From: Markus S. <msv...@ae...> - 2010-07-20 15:33:06
|
Hello all, > * Is there some way I can get the Makefile.am to auto-detect > whether or not we are building for desktop Linux, or > cross-compiling for Gumstix? This way it could automatically add > the "-mt" if building for Gumstix. > I just wanted to inform the mailing list that I found a working solution. In my configure.ac autoconf file, I added the following line before the AC_OUTPUT at the end: AM_CONDITIONAL(BUILDING_FOR_GUMSTIX, test "$enable_build_for_gumstix" = yes) Next, in the Makefile.am automake file for the program, I added the following before the LDADD flags: if BUILDING_FOR_GUMSTIX BOOST_LIB_SUFFIX=-mt else BOOST_LIB_SUFFIX= endif program_LDADD = -lpthread -lasound -lboost_serialization${BOOST_LIB_SUFFIX} Finally, in the .bb file, before the "inherit autotools" I added: EXTRA_OECONF = " \ --enable-build-for-gumstix=yes \ " This way, the "-mt" suffix is automatically added when building the software via Bitbake, but there is no suffix when building on my desktop Linux machine. I'm still curious why boost would name its libraries with "-mt" in the filename on Gumstix, but not on my desktop machine. Multi-threading is enabled on both, except on the desktop the MT libraries are placed in a separate folder, and on Gumstix the files get "-mt" added to the filename. Either way, hope this helps someone! All the best, Markus. |