summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2011-01-26 22:18:45 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2011-01-26 23:22:32 +0100
commit12d2ea9ae79f0a13989a37ee5af5ee9062c8efe7 (patch)
tree5b0a37ceeee72f61bc4eb193a713396000252a20
parent5bd96726f37f56d66f82538a7cd470a920bfba18 (diff)
downloadbuildroot-novena-12d2ea9ae79f0a13989a37ee5af5ee9062c8efe7.tar.gz
buildroot-novena-12d2ea9ae79f0a13989a37ee5af5ee9062c8efe7.zip
cdrkit: convert to CMAKETARGETS infrastructure
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
-rw-r--r--package/cdrkit/cdrkit.mk66
1 files changed, 9 insertions, 57 deletions
diff --git a/package/cdrkit/cdrkit.mk b/package/cdrkit/cdrkit.mk
index 7d6899a3c..ea7f65e35 100644
--- a/package/cdrkit/cdrkit.mk
+++ b/package/cdrkit/cdrkit.mk
@@ -11,62 +11,14 @@ 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)
+CDRKIT_CONF_OPT += $(CMAKE_ENDIAN_OPT)
-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))
+## cdrkit isn't completely re-rooted by CMAKE_FIND_ROOT_PATH, so add
+## some extra flags so it finds needed libs and headers.
+CDRKIT_CONF_OPT += -DCMAKE_C_FLAGS="-I$(STAGING_DIR)/usr/include"
+CDRKIT_CONF_OPT += -DCMAKE_EXE_LINKER_FLAGS="$(TARGET_LDFLAGS)"
+HOST_CDRKIT_CONF_OPT += -DCMAKE_C_FLAGS="-I$(HOST_DIR)/usr/include"
+HOST_CDRKIT_CONF_OPT += -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)"
+$(eval $(call CMAKETARGETS,package,cdrkit))
+$(eval $(call CMAKETARGETS,package,cdrkit,host))