mirror of
https://github.com/Fishwaldo/meta-riscv.git
synced 2025-03-15 11:31:43 +00:00
libsf-codaj12: Package SF's JPEG coding library
Make upstream library build with horribly patched symlink and Makefile fork combination. Need to be refactored to a decent build system.
This commit is contained in:
parent
f77d7fae36
commit
6824cc8154
3 changed files with 206 additions and 0 deletions
57
recipes-multimedia/vpu/libsf-codaj12.bb
Normal file
57
recipes-multimedia/vpu/libsf-codaj12.bb
Normal file
|
@ -0,0 +1,57 @@
|
|||
SUMMARY = "CODAJ12 is a standalone JPEG Codec (JPU)"
|
||||
DESCRIPTION = "CODAJ12 performs the JPEG baseline/extended sequential and M-JPEG decoding and encoding"
|
||||
|
||||
LICENSE = "ChipsMedia_VisionFive2"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=16bead7cc56b053f5da0061ce0637ad2"
|
||||
|
||||
COMPATIBLE_MACHINE = "visionfive2"
|
||||
|
||||
require recipes-bsp/common/visionfive2-firmware.inc
|
||||
inherit autotools
|
||||
|
||||
SOLIBS = ".so"
|
||||
FILES_SOLIBSDEV = ""
|
||||
|
||||
SRC_URI += " \
|
||||
file://codaj12_yocto.mak;subdir=git/codaj12 \
|
||||
file://20_jpu.rules \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git/codaj12"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake -C ${S} -f codaj12_yocto.mak
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}/usr/include/codaj12
|
||||
install -D -m 0644 ${S}/jpuapi/jpuapi.h ${D}/usr/include/codaj12/jpuapi/jpuapi.h
|
||||
install -D -m 0644 ${S}/jpuapi/jpuapifunc.h ${D}/usr/include/codaj12/jpuapi/jpuapifunc.h
|
||||
install -D -m 0644 ${S}/jpuapi/regdefine.h ${D}/usr/include/codaj12/jpuapi/regdefine.h
|
||||
install -D -m 0644 ${S}/jpuapi/jpuconfig.h ${D}/usr/include/codaj12/jpuapi/jpuconfig.h
|
||||
install -D -m 0644 ${S}/jpuapi/jputypes.h ${D}/usr/include/codaj12/jpuapi/jputypes.h
|
||||
install -D -m 0644 ${S}/jpuapi/jputable.h ${D}/usr/include/codaj12/jpuapi/jputable.h
|
||||
install -D -m 0644 ${S}/sample/helper/cnm_fpga.h ${D}/usr/include/codaj12/sample/helper/cnm_fpga.h
|
||||
install -D -m 0644 ${S}/sample/helper/platform.h ${D}/usr/include/codaj12/sample/helper/platform.h
|
||||
install -D -m 0644 ${S}/sample/helper/yuv_feeder.h ${D}/usr/include/codaj12/sample/helper/yuv_feeder.h
|
||||
install -D -m 0644 ${S}/sample/helper/datastructure.h ${D}/usr/include/codaj12/sample/helper/datastructure.h
|
||||
install -D -m 0644 ${S}/sample/helper/jpulog.h ${D}/usr/include/codaj12/sample/helper/jpulog.h
|
||||
install -D -m 0644 ${S}/sample/main_helper.h ${D}/usr/include/codaj12/sample/main_helper.h
|
||||
install -D -m 0644 ${S}/jdi/linux/driver/jpu.h ${D}/usr/include/codaj12/jdi/linux/driver/jpu.h
|
||||
install -D -m 0644 ${S}/jdi/linux/driver/jmm.h ${D}/usr/include/codaj12/jdi/linux/driver/jmm.h
|
||||
install -D -m 0644 ${S}/jdi/jdi.h ${D}/usr/include/codaj12/jdi/jdi.h
|
||||
install -D -m 0644 ${S}/jdi/mm.h ${D}/usr/include/codaj12/jdi/mm.h
|
||||
install -D -m 0644 ${S}/config.h ${D}/usr/include/codaj12/
|
||||
|
||||
install -d ${D}/usr/lib
|
||||
install -m 0644 ${S}/libcodadec.so ${D}/usr/lib/
|
||||
|
||||
|
||||
install -d ${D}/${base_libdir}/udev/rules.d/
|
||||
install -m 0644 ${WORKDIR}/20_jpu.rules ${D}/${base_libdir}/udev/rules.d/
|
||||
}
|
||||
|
||||
FILES:${PN} += " \
|
||||
${base_libdir}/* \
|
||||
${libdir}/* \
|
||||
"
|
1
recipes-multimedia/vpu/libsf-codaj12/20_jpu.rules
Normal file
1
recipes-multimedia/vpu/libsf-codaj12/20_jpu.rules
Normal file
|
@ -0,0 +1 @@
|
|||
SUBSYSTEM=="jpu", MODE="0666"
|
148
recipes-multimedia/vpu/libsf-codaj12/codaj12_yocto.mak
Normal file
148
recipes-multimedia/vpu/libsf-codaj12/codaj12_yocto.mak
Normal file
|
@ -0,0 +1,148 @@
|
|||
# ----------------------------------------------------------------------
|
||||
#
|
||||
# codaj12
|
||||
#
|
||||
# ----------------------------------------------------------------------
|
||||
.PHONY: CREATE_DIR
|
||||
BUILD_CONFIGURATION := EmbeddedRiscvLinux
|
||||
PRODUCT := CODAJ12
|
||||
PRODUCT := CODDAJ12C
|
||||
|
||||
USE_PTHREAD = yes
|
||||
USE_RTL_SIM = no
|
||||
LINT_HOME = etc/lint
|
||||
|
||||
UNAME = $(shell uname -a)
|
||||
ifneq (,$(findstring i386, $(UNAME)))
|
||||
USE_32BIT = yes
|
||||
endif
|
||||
|
||||
ifeq ($(RTL_SIM), 1)
|
||||
USE_RTL_SIM = yes
|
||||
endif
|
||||
|
||||
REFC := 0
|
||||
|
||||
ifeq ($(USE_32BIT), yes)
|
||||
PLATFORM = nativelinux
|
||||
else
|
||||
PLATFORM = nativelinux_64bit
|
||||
endif
|
||||
|
||||
CROSS_CC_PREFIX =
|
||||
JDI_C = jdi/linux/jdi.c
|
||||
VDI_OSAL_C =
|
||||
MM_C =
|
||||
PLATFORM_FLAGS =
|
||||
JDI_VPATH = jdi/linux
|
||||
ifeq ("$(BUILD_CONFIGURATION)", "NonOS")
|
||||
CROSS_CC_PREFIX = arm-none-eabi-
|
||||
JDI_C = jdi/nonos/jdi.c
|
||||
VDI_OSAL_C =
|
||||
MM_C = jdi/mm.c
|
||||
USE_PTHREAD = no
|
||||
PLATFORM = none
|
||||
DEFINES = -DLIB_C_STUB
|
||||
PLATFORM_FLAGS =
|
||||
JDI_VPATH = jdi/nonos
|
||||
NONOS_RULE = options_nonos.lnt
|
||||
endif
|
||||
ifeq ("$(BUILD_CONFIGURATION)", "EmbeddedLinux")
|
||||
CROSS_CC_PREFIX = arm-none-linux-gnueabi-
|
||||
PLATFORM = armlinux
|
||||
endif
|
||||
|
||||
ifeq ("$(BUILD_CONFIGURATION)", "EmbeddedRiscvLinux")
|
||||
CROSS_CC_PREFIX = riscv64-buildroot-linux-gnu-
|
||||
PLATFORM = riscvlinux
|
||||
endif
|
||||
#CC = $(CROSS_CC_PREFIX)gcc
|
||||
#CXX = $(CROSS_CC_PREFIX)g++
|
||||
LINKER=$(CC)
|
||||
AR = $(CROSS_CC_PREFIX)ar
|
||||
|
||||
INCLUDES = -I./jpuapi -I./ffmpeg/include -I./sample/helper -I./sample -I./jdi -I../
|
||||
ifeq ($(USE_RTL_SIM), yes)
|
||||
DEFINES += -DCNM_SIM_PLATFORM -DCNM_SIM_DPI_INTERFACE -DSUPPORT_DECODER
|
||||
DEFINES += -D$(PRODUCT) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
||||
else
|
||||
DEFINES += -D$(PRODUCT) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
||||
endif # USE_SIM_PLATFORM
|
||||
DEFINES += -DUSE_FEEDING_METHOD_BUFFER
|
||||
|
||||
CFLAGS += -g -I. -Wno-format-truncation -Wl,--fatal-warning $(INCLUDES) $(DEFINES) $(PLATFORM_FLAGS)
|
||||
ifeq ($(USE_RTL_SIM), yes)
|
||||
ifeq ($(IUS), 1)
|
||||
CFLAGS += -fPIC # ncverilog is 64bit version
|
||||
endif
|
||||
endif
|
||||
ARFLAGS += cru
|
||||
|
||||
#LDFLAGS = $(PLATFORM_FLAGS)
|
||||
|
||||
ifeq ($(USE_PTHREAD), yes)
|
||||
LDLIBS += -lpthread
|
||||
endif
|
||||
LDLIBS += -lm
|
||||
|
||||
BUILDLIST=DECTEST
|
||||
MAKEFILE=codaj12_buildroot.mak
|
||||
DECTEST=libcodadec.so
|
||||
|
||||
OBJDIR=obj
|
||||
ALLOBJS=*.o
|
||||
ALLDEPS=*.dep
|
||||
ALLLIBS=*.a
|
||||
RM=rm -f
|
||||
MKDIR=mkdir -p
|
||||
|
||||
SOURCES_COMMON = jpuapi.c jpuapifunc.c jpuhelper.c jpulog.c cnm_fpga.c main_jpg_dec_test.c \
|
||||
platform.c datastructure.c bitstreamfeeder.c bsfeeder_fixedsize_impl.c bsfeeder_buffer_impl.c\
|
||||
$(JDI_C) \
|
||||
$(VDI_OSAL_C) \
|
||||
$(MM_C)
|
||||
|
||||
VPATH = jdi:
|
||||
VPATH += sample:
|
||||
VPATH += sample/helper:
|
||||
VPATH += $(JDI_VPATH):jpuapi
|
||||
|
||||
VPATH2=$(patsubst %,-I%,$(subst :, ,$(VPATH)))
|
||||
|
||||
OBJECTNAMES_COMMON=$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES_COMMON)))
|
||||
OBJECTPATHS_COMMON=$(addprefix $(OBJDIR)/,$(notdir $(OBJECTNAMES_COMMON)))
|
||||
|
||||
SOURCES_DECTEST = sample/main_jpg_dec_test.c
|
||||
ifeq ($(USE_RTL_SIM), yes)
|
||||
SOURCES_DECTEST += sample/main_sim.c
|
||||
endif
|
||||
|
||||
OBJECTNAMES_DECTEST=$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES_DECTEST)))
|
||||
OBJECTPATHS_DECTEST=$(addprefix $(OBJDIR)/,$(notdir $(OBJECTNAMES_DECTEST))) $(OBJECTPATHS_COMMON)
|
||||
|
||||
all: $(BUILDLIST)
|
||||
|
||||
ifeq ($(USE_RTL_SIM), yes)
|
||||
DECTEST: CREATE_DIR $(OBJECTPATHS_COMMON)
|
||||
else
|
||||
DECTEST: CREATE_DIR $(OBJECTPATHS_COMMON)
|
||||
$(LINKER) -g -fPIC -shared -o $(DECTEST) $(LDFLAGS) -Wl,-gc-section -Wl,--start-group $(OBJECTPATHS_COMMON) $(LDLIBS) -Wl,--end-group
|
||||
endif
|
||||
|
||||
|
||||
-include $(OBJECTPATHS:.o=.dep)
|
||||
|
||||
clean:
|
||||
$(RM) $(DECTEST)
|
||||
$(RM) $(OBJDIR)/$(ALLOBJS)
|
||||
$(RM) $(OBJDIR)/$(ALLDEPS)
|
||||
|
||||
CREATE_DIR:
|
||||
-mkdir -p $(OBJDIR)
|
||||
|
||||
obj/%.o: %.c $(MAKEFILE)
|
||||
$(CC) -fPIC -shared $(CFLAGS) -Wall -Wno-error -Wno-error=format-security -c $< -o $@ -MD -MF $(@:.o=.dep)
|
||||
|
||||
lint:
|
||||
"$(LINT_HOME)/flint" -i"$(LINT_HOME)" $(DEFINES) $(INCLUDES) $(VPATH2) linux_std.lnt $(HAPS_RULE) $(NONOS_RULE) $(SOURCES_COMMON)
|
||||
|
Loading…
Add table
Reference in a new issue