diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2010-07-29 10:10:35 +0200 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2010-07-29 16:04:38 +0200 |
commit | 0eae20b7be89bc76225a15c7238ff0c809259ac3 (patch) | |
tree | 9f27703598adfc8ae1ced34c1c741214a69c2c54 | |
parent | d2e5763e529e4ed387e30854f80e801273ecdbaf (diff) |
cdrkit: fix TARGET_CC/TARGET_CFLAGS for CMake
Since the reorganization of the variables in package/Makefile.in,
TARGET_CC and TARGET_CXX now directly contain the --sysroot= option in
addition to the compiler path. This is due to some ./configure scripts
using just $(TARGET_CC) for some tests instead of $(TARGET_CC)
$(TARGET_CFLAGS).
However, in the case of CMake, this fails as CMake really only wants
the path of the compiler in its CMAKE_C_COMPILER and
CMAKE_CXX_COMPILER variables. So here, we recompute proper values for
CMake by removing the --sysroot option from the compiler variables and
re-adding it to the flags variables.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r-- | package/cdrkit/cdrkit.mk | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/package/cdrkit/cdrkit.mk b/package/cdrkit/cdrkit.mk index f7e21b033..a0ce9cb56 100644 --- a/package/cdrkit/cdrkit.mk +++ b/package/cdrkit/cdrkit.mk @@ -11,15 +11,23 @@ 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. +CDRKIT_TARGET_CC = $(filter-out --sysroot=%,$(TARGET_CC)) +CDRKIT_TARGET_CXX = $(filter-out --sysroot=%,$(TARGET_CXX)) +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="$(TARGET_CC)" \ - -DCMAKE_CXX_COMPILER:FILEPATH="$(TARGET_CXX)" \ - -DCMAKE_C_FLAGS:STRING="$(TARGET_CFLAGS)" \ + -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)" \ |