Permalink
Browse files

Fix TestBigEndian configure error

It turns out that when MacPort (and possibly HomeBrew) are installed
on a MacOSX system, the "intl" library
is first found in a non standard location:

  HAVE_LIBINTL:FILEPATH=/opt/local/lib/libintl.dylib

Compared to, for example, libraries "m" and "util" which are found
in "/usr/lib":

  HAVE_LIBM:FILEPATH=/usr/lib/libm.dylib
  HAVE_LIBUTIL:FILEPATH=/usr/lib/libutil.dylib

Since CMAKE_REQUIRED_LIBRARIES variable used for the different configure
tests was updated with the name of the library instead of the full path
to the library, the first compile test was failing complaining that
it couldn't be linked against the "intl" library:

"/Applications/CMake 2.8-10.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/cmTryCompileExec1536614598.dir/link.txt --verbose=1
/usr/bin/cc      -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/cmTryCompileExec1536614598.dir/CMAKE_SIZEOF_UNSIGNED_LONG.c.o  -o cmTryCompileExec1536614598  -lm -lintl -lutil
ld: library not found for -lintl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [cmTryCompileExec1536614598] Error 1
make: *** [cmTryCompileExec1536614598/fast] Error 2
  • Loading branch information...
1 parent 8e32c5c commit 6043a5df86420c3ee8e4f4b23f436b1219e89f02 @jcfr jcfr committed Apr 2, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 cmake/ConfigureChecks.cmake
View
2 cmake/ConfigureChecks.cmake
@@ -385,8 +385,8 @@ endif()
set(CMAKE_EXTRA_INCLUDE_FILES stdio.h)
add_cond(CMAKE_REQUIRED_LIBRARIES HAVE_LIBM m)
-add_cond(CMAKE_REQUIRED_LIBRARIES HAVE_LIBINTL intl)
add_cond(CMAKE_REQUIRED_LIBRARIES HAVE_LIBUTIL util)
+add_cond(CMAKE_REQUIRED_LIBRARIES HAVE_LIBINTL ${HAVE_LIBINTL})
add_cond(CMAKE_EXTRA_INCLUDE_FILES HAVE_WCHAR_H wchar.h)
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)

0 comments on commit 6043a5d

Please sign in to comment.