finally really fixes IRIX build:

- determine the name of the standard libraries directory (lib, lib32, lib64
   or lib/64) and use it to find other standard libraries
 - look in default libraries locations after checking the other ones, not
   before


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-09-18 00:44:06 +00:00
parent 404914c6f6
commit e7272c0856
2 changed files with 74 additions and 42 deletions

View File

@@ -60,21 +60,30 @@ AC_DEFUN([WX_PATH_FIND_LIBRARIES_IN_PATH],
]) ])
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl call WX_PATH_FIND_LIBRARIES(search path, header name), sets ac_find_libraries dnl return list of standard library paths
dnl to the full name of the file that was found or leaves it empty if not found
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
AC_DEFUN([WX_PATH_FIND_LIBRARIES], dnl return all default locations:
[
dnl check in default locations first:
dnl - /usr/lib: standard dnl - /usr/lib: standard
dnl - /usr/lib32: n32 ABI on IRIX dnl - /usr/lib32: n32 ABI on IRIX
dnl - /usr/lib64: n64 ABI on IRIX dnl - /usr/lib64: n64 ABI on IRIX
dnl - /usr/lib/64: 64 bit ABI on Solaris and Linux x86-64 dnl - /usr/lib/64: 64 bit ABI on Solaris and Linux x86-64
WX_PATH_FIND_LIBRARIES_IN_PATH([/usr/lib /usr/lib32 /usr/lib/64 /usr/lib64], $2) dnl
if test "$ac_find_libraries" != "" ; then dnl NB: if any of directories in the list is not a subdir of /usr, code setting
ac_find_libraries="default location" dnl wx_cv_std_libpath needs to be updated
else AC_DEFUN([WX_STD_LIBPATH], [/usr/lib /usr/lib32 /usr/lib/64 /usr/lib64])
dnl ---------------------------------------------------------------------------
dnl call WX_PATH_FIND_LIBRARIES(search path, lib name), sets ac_find_libraries
dnl to the full name of the file that was found or leaves it empty if not found
dnl ---------------------------------------------------------------------------
AC_DEFUN([WX_PATH_FIND_LIBRARIES],
[
WX_PATH_FIND_LIBRARIES_IN_PATH($1, $2) WX_PATH_FIND_LIBRARIES_IN_PATH($1, $2)
if test "x$ac_find_libraries" = "x" ; then
WX_PATH_FIND_LIBRARIES_IN_PATH(WX_STD_LIBPATH(), $2)
if test "x$ac_find_libraries" != "x" ; then
ac_find_libraries="default location"
fi
fi fi
]) ])

View File

@@ -2152,9 +2152,32 @@ SEARCH_INCLUDE="\
\ \
/usr/openwin/share/include" /usr/openwin/share/include"
dnl add 64 bit X11 libs for Linux on AMD, they must come before the usual dnl try to find out the standard lib locations
dnl locations or 64 bit compilation failed AC_CACHE_CHECK([for libraries directory],
SEARCH_LIB="/usr/X11R6/lib64 `echo "$SEARCH_INCLUDE" | sed s/include/lib/g`" wx_cv_std_libpath,
[
for d in WX_STD_LIBPATH(); do
for e in a so sl dylib dll.a; do
libc="$d/libc.$e"
if test -f $libc; then
save_LIBS="$LIBS"
LIBS="$libc"
AC_LINK_IFELSE([int main() { return 0; }],
wx_cv_std_libpath=`echo $d | sed s@/usr/@@`)
LIBS="$save_LIBS"
if test "x$wx_cv_std_libpath" != "x"; then
break 2
fi
fi
done
done
if test "x$wx_cv_std_libpath" = "x"; then
wx_cv_std_libpath="lib"
fi
]
)
SEARCH_LIB=`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g`
dnl Cross compiling with gcc? dnl Cross compiling with gcc?
if test "$build" != "$host" -a "$GCC" = yes; then if test "$build" != "$host" -a "$GCC" = yes; then
@@ -3082,22 +3105,23 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
fi fi
if test "$COMPILED_X_PROGRAM" = 0; then
AC_MSG_CHECKING(for Motif/Lesstif library) AC_MSG_CHECKING(for Motif/Lesstif library)
WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
if test "$ac_find_libraries" != "" ; then
if test "x$ac_find_libraries" != "x" ; then
AC_MSG_RESULT(found in $ac_find_libraries) AC_MSG_RESULT(found in $ac_find_libraries)
WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
else else
dnl it might happen that we found headers in one of the dnl it might happen that we found headers in one of the standard
dnl standard paths but the libs are elsewhere - we do need to dnl paths but the libs are elsewhere but still in default (linker)
dnl try to compile a sample program then here dnl path -- try to compile a test program to check for this
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" CFLAGS="$CFLAGS $TOOLKIT_INCLUDE"
AC_TRY_COMPILE( AC_TRY_LINK(
[ [
#include <Xm/Xm.h> #include <Xm/Xm.h>
], ],
@@ -3117,7 +3141,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
fi fi
fi
AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE]) AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE])
libp_link="" libp_link=""