]> git.saurik.com Git - wxWidgets.git/commitdiff
check default library directories in WX_PATH_FIND_LIBRARIES; do *not* add default...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Sep 2005 22:10:33 +0000 (22:10 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Sep 2005 22:10:33 +0000 (22:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

acinclude.m4

index 676aeb70b8dc532870aaf7716273bdfe424836a4..817275d7f40124da49806e53cb03836133e42020 100644 (file)
@@ -43,13 +43,12 @@ for ac_dir in $1 /usr/include;
 ])
 
 dnl ---------------------------------------------------------------------------
 ])
 
 dnl ---------------------------------------------------------------------------
-dnl call WX_PATH_FIND_LIBRARIES(search path, header name), sets ac_find_libraries
-dnl to the full name of the file that was found or leaves it empty if not found
+dnl WX_PATH_FIND_LIBRARIES helper
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
-AC_DEFUN([WX_PATH_FIND_LIBRARIES],
+AC_DEFUN([WX_PATH_FIND_LIBRARIES_IN_PATH],
 [
 [
-ac_find_libraries=
-for ac_dir in $1 /usr/lib;
+  ac_find_libraries=
+  for ac_dir in $1;
   do
     for ac_extension in a so sl dylib dll.a; do
       if test -f "$ac_dir/lib$2.$ac_extension"; then
   do
     for ac_extension in a so sl dylib dll.a; do
       if test -f "$ac_dir/lib$2.$ac_extension"; then
@@ -60,6 +59,25 @@ for ac_dir in $1 /usr/lib;
   done
 ])
 
   done
 ])
 
+dnl ---------------------------------------------------------------------------
+dnl call WX_PATH_FIND_LIBRARIES(search path, header 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],
+[
+  dnl check in default locations first:
+  dnl   - /usr/lib: standard
+  dnl   - /usr/lib32: n32 ABI on IRIX
+  dnl   - /usr/lib64: n64 ABI on IRIX
+  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)
+  if test "$ac_find_libraries" != "" ; then
+    ac_find_libraries="default location"
+  else
+    WX_PATH_FIND_LIBRARIES_IN_PATH($1, $2)
+  fi
+])
+
 dnl ---------------------------------------------------------------------------
 dnl Path to include, already defined
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
 dnl Path to include, already defined
 dnl ---------------------------------------------------------------------------
@@ -80,16 +98,25 @@ AC_DEFUN([WX_INCLUDE_PATH_EXIST],
 ])
 
 dnl ---------------------------------------------------------------------------
 ])
 
 dnl ---------------------------------------------------------------------------
-dnl Path to link, already defined
+dnl Usage: WX_LINK_PATH_EXIST(path, libpath)
+dnl
+dnl Set ac_path_to_link to nothing if path is already in libpath of to -Lpath
+dnl if it is not, so that libpath can be set to "$libpath$ac_path_to_link"
+dnl after calling this function
 dnl ---------------------------------------------------------------------------
 AC_DEFUN([WX_LINK_PATH_EXIST],
 [
 dnl ---------------------------------------------------------------------------
 AC_DEFUN([WX_LINK_PATH_EXIST],
 [
-  echo "$2" | grep "\-L$1" > /dev/null
-  result=$?
-  if test $result = 0; then
+  dnl never add -L/usr/libXXX explicitely to libpath
+  if test "$1" = "default location"; then
     ac_path_to_link=""
   else
     ac_path_to_link=""
   else
-    ac_path_to_link=" -L$1"
+    echo "$2" | grep "\-L$1" > /dev/null
+    result=$?
+    if test $result = 0; then
+      ac_path_to_link=""
+    else
+      ac_path_to_link=" -L$1"
+    fi
   fi
 ])
 
   fi
 ])