summaryrefslogtreecommitdiffstats
path: root/package/cdrkit/cdrkit.mk
blob: 7d6899a3c4efc72f0ae795af4cf26c55080f9985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
CDRKIT_VERSION=1.1.10
CDRKIT_SOURCE=cdrkit-$(CDRKIT_VERSION).tar.gz
CDRKIT_SITE=http://www.cdrkit.org/releases/

CDRKIT_DEPENDENCIES=libcap bzip2 host-cmake zlib
HOST_CDRKIT_DEPENDENCIES=host-libcap host-cmake host-bzip2 host-zlib

ifeq ($(BR2_ENDIAN),"BIG")
CMAKE_ENDIAN_OPT=-DBITFIELDS_HTOL=1
else
CMAKE_ENDIAN_OPT=-DBITFIELDS_HTOL=0
endif

# CMake doesn't support having the --sysroot option directly in the
# compiler path, so move this option to the CFLAGS/CXXFLAGS variables.
# It also gets confused by ccache, so don't use ccache here.
CDRKIT_TARGET_CC = $(filter-out --sysroot=%,$(TARGET_CC_NOCCACHE))
CDRKIT_TARGET_CXX = $(filter-out --sysroot=%,$(TARGET_CXX_NOCCACHE))
CDRKIT_TARGET_CFLAGS = $(filter --sysroot=%,$(TARGET_CC)) $(TARGET_CFLAGS)
CDRKIT_TARGET_CXXFLAGS = $(filter --sysroot=%,$(TARGET_CXX)) $(TARGET_CXXFLAGS)

define CDRKIT_CONFIGURE_CMDS
 -mkdir $(@D)/build
 (cd $(@D)/build ; \
	$(HOST_DIR)/usr/bin/cmake .. \
		-Wno-dev \
		-DCMAKE_SYSTEM_NAME:STRING="Linux" \
		-DCMAKE_C_COMPILER:FILEPATH="$(CDRKIT_TARGET_CC)" \
		-DCMAKE_CXX_COMPILER:FILEPATH="$(CDRKIT_TARGET_CXX)" \
		-DCMAKE_C_FLAGS:STRING="$(CDRKIT_TARGET_CFLAGS)" \
		-DCMAKE_CXX_FLAGS:STRING="$(CDRKIT_TARGET_CXXFLAGS)" \
		-DCMAKE_EXE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
		-DCMAKE_MODULE_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
		-DCMAKE_SHARED_LINKER_FLAGS:STRING="$(TARGET_LDFLAGS)" \
		-DCMAKE_FIND_ROOT_PATH:PATH="$(STAGING_DIR)" \
		-DCMAKE_INSTALL_PREFIX:PATH="$(TARGET_DIR)/usr" \
		$(CMAKE_ENDIAN_OPT) \
 )
endef

define CDRKIT_BUILD_CMDS
 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build
endef

define CDRKIT_INSTALL_TARGET_CMDS
 $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build install
endef

define HOST_CDRKIT_CONFIGURE_CMDS
 -mkdir $(@D)/build
 (cd $(@D)/build ; \
	$(HOST_DIR)/usr/bin/cmake .. \
		-Wno-dev \
		-DCMAKE_C_FLAGS="$(HOST_CFLAGS)" \
		-DCMAKE_EXE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
		-DCMAKE_MODULE_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
		-DCMAKE_SHARED_LINKER_FLAGS:STRING="$(HOST_LDFLAGS)" \
		-DCMAKE_INSTALL_PREFIX:STRING="$(HOST_DIR)/usr" \
 )
endef

define HOST_CDRKIT_BUILD_CMDS
 $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/build
endef

define HOST_CDRKIT_INSTALL_CMDS
 $(HOST_MAKE_ENV) $(MAKE) -C $(@D)/build  install
endef

$(eval $(call GENTARGETS,package,cdrkit))
$(eval $(call GENTARGETS,package,cdrkit,host))