Source: trackballs Version: 1.3.2-1 Tags: patch upstream User: debian-cr...@lists.debian.org Usertags: ftcbfs X-Debbugs-Cc: Nilesh Patra <nil...@debian.org>
trackballs fails to cross build from source, because it uses the build architecture preprocessor during guile-snarf invocations. As a consequence, it fails locating gmp, which is only requested for the host architecture. The issue is manifested in the CMakeLists.txt, where it says CPP=cpp. Beyond the issue of what is being passed here, it also uses an unportable form of environment passing. Please use ${CMAKE_COMMAND} -E env instead. Figuring the right preprocessor is not entirely trivial. CMake does not seem to know about it by itself. The closest we can get likely is passing -E to the relevant compiler. I'm attaching a patch that makes trackballs cross buildable for your convenience. Helmut
--- trackballs-1.3.2.orig/CMakeLists.txt +++ trackballs-1.3.2/CMakeLists.txt @@ -70,7 +70,7 @@ # cpp is the c++ preprocessor add_custom_command(OUTPUT guile.cc.x - COMMAND CPP=cpp; ${GUILE_SNARF} -o guile.cc.x ${PROJECT_SOURCE_DIR}/src/guile.cc ${defstr} ${incstr} -D_GNU_SOURCE=1 -D_REENTRANT + COMMAND ${CMAKE_COMMAND} -E env "CPP=${CMAKE_CXX_COMPILER} -E" ${GUILE_SNARF} -o guile.cc.x ${PROJECT_SOURCE_DIR}/src/guile.cc ${defstr} ${incstr} -D_GNU_SOURCE=1 -D_REENTRANT DEPENDS src/guile.cc WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})