]> granicus.if.org Git - php/commitdiff
Core changes to support multi-ABI platforms with libraries in
authorJoe Orton <jorton@php.net>
Wed, 3 Nov 2004 14:07:09 +0000 (14:07 +0000)
committerJoe Orton <jorton@php.net>
Wed, 3 Nov 2004 14:07:09 +0000 (14:07 +0000)
/usr/lib64 rather than /usr/lib.

* configure.in: Add --with-libdir flag; define PHP_LIBDIR.

* acinclude.m4 (PHP_REMOVE_USR_LIB, PHP_RUNPATH_SWITCH,
PHP_ADD_LIBPATH): Check for /usr/$PHP_LIBDIR rather than /usr/lib.
(PHP_SETUP_OPENSSL, PHP_SETUP_ICONV): Use /path/to/$PHP_LIBDIR in
place of /path/to/lib.

acinclude.m4
configure.in

index 8f1b7f5c47d9f27e669982480a90b8470d4fd026..8fce0aa14852c44f6599e48c1dac0eecfe340060 100644 (file)
@@ -176,7 +176,7 @@ AC_DEFUN([PHP_REMOVE_USR_LIB],[
   unset ac_new_flags
   for i in [$]$1; do
     case [$]i in
-    -L/usr/lib|-L/usr/lib/[)] ;;
+    -L/usr/$PHP_LIBDIR|-L/usr/$PHP_LIBDIR/[)] ;;
     *[)] ac_new_flags="[$]ac_new_flags [$]i" ;;
     esac
   done
@@ -638,7 +638,7 @@ dnl check for -R, etc. switch
 AC_MSG_CHECKING([if compiler supports -R])
 AC_CACHE_VAL(php_cv_cc_dashr,[
        SAVE_LIBS=$LIBS
-       LIBS="-R /usr/lib $LIBS"
+       LIBS="-R /usr/$PHP_LIBDIR $LIBS"
        AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
        LIBS=$SAVE_LIBS])
 AC_MSG_RESULT([$php_cv_cc_dashr])
@@ -648,7 +648,7 @@ else
        AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
        AC_CACHE_VAL(php_cv_cc_rpath,[
                SAVE_LIBS=$LIBS
-               LIBS="-Wl,-rpath,/usr/lib $LIBS"
+               LIBS="-Wl,-rpath,/usr/$PHP_LIBDIR $LIBS"
                AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
                LIBS=$SAVE_LIBS])
        AC_MSG_RESULT([$php_cv_cc_rpath])
@@ -832,7 +832,7 @@ dnl
 dnl add a library to linkpath/runpath
 dnl
 AC_DEFUN([PHP_ADD_LIBPATH],[
-  if test "$1" != "/usr/lib"; then
+  if test "$1" != "/usr/$PHP_LIBDIR"; then
     PHP_EXPAND_PATH($1, ai_p)
     ifelse([$2],,[
       _PHP_ADD_LIBPATH_GLOBAL([$ai_p])
@@ -1622,8 +1622,8 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
       if test -r $i/include/openssl/evp.h; then
         OPENSSL_INCDIR=$i/include
       fi
-      if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
-        OPENSSL_LIBDIR=$i/lib
+      if test -r $i/$PHP_LIBDIR/libssl.a -o -r $i/$PHP_LIBDIR/libssl.$SHLIB_SUFFIX_NAME; then
+        OPENSSL_LIBDIR=$i/$PHP_LIBDIR
       fi
       test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
     done
@@ -1732,8 +1732,8 @@ AC_DEFUN([PHP_SETUP_ICONV], [
       AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=<DIR>])
     fi
   
-    if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a ||
-       test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
+    if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a ||
+       test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
     then
       PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
         found_iconv=yes
@@ -1743,10 +1743,10 @@ AC_DEFUN([PHP_SETUP_ICONV], [
           found_iconv=yes
           PHP_DEFINE(HAVE_ICONV)
         ], [], [
-          -L$ICONV_DIR/lib
+          -L$ICONV_DIR/$PHP_LIBDIR
         ])
       ], [
-        -L$ICONV_DIR/lib
+        -L$ICONV_DIR/$PHP_LIBDIR
       ])
     fi
   fi
@@ -1754,7 +1754,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
   if test "$found_iconv" = "yes"; then
     if test -n "$ICONV_DIR"; then
       AC_DEFINE(HAVE_ICONV, 1, [ ])
-      PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1)
+      PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/$PHP_LIBDIR, $1)
       PHP_ADD_INCLUDE($ICONV_DIR/include)
     fi
     $2
index ba541bc05fb4ed7f33619b361134af694b44b19a..f472a44fa0b3706a0078069b89588d671e7b12ae 100644 (file)
@@ -1,4 +1,4 @@
-dnl ## $Id$ -*- sh -*-
+dnl ## $Id$ -*- autoconf -*-
 dnl ## Process this file with autoconf to produce a configure script.
 
 divert(1)
@@ -124,6 +124,11 @@ AC_AIX
 dnl AC_PROG_CXX
 dnl AC_PROG_CXXCPP
 
+dnl Support systems with system libraries in e.g. /usr/lib64
+AC_ARG_WITH(libdir,
+[  --with-libdir=NAME     Look for libraries in .../NAME rather than .../lib],
+[PHP_LIBDIR=$withval], [PHP_LIBDIR=lib])
+
 dnl check for -R, etc. switch
 PHP_RUNPATH_SWITCH