cvs: php4 / acinclude.m4

[email protected] ("Sascha Schumann")
Newsgroups php.version4
Message-ID <cvssas959123593@cvsserver>
sas		Wed May 24 01:13:13 2000 EDT

  Modified files:
    /php4	acinclude.m4 
  Log:
  A couple of cleanups and shared-libadd additions
  
  
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.87 php4/acinclude.m4:1.88
--- php4/acinclude.m4:1.87	Tue May 23 17:43:29 2000
+++ php4/acinclude.m4	Wed May 24 01:13:13 2000
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.87 2000/05/23 15:43:29 sas Exp $
+dnl $Id: acinclude.m4,v 1.88 2000/05/23 23:13:13 sas Exp $
 dnl
 dnl This file contains local autoconf functions.
 
@@ -416,18 +416,22 @@
 ])
 
 dnl
-dnl AC_ADD_LIBPATH(path)
+dnl AC_ADD_LIBPATH(path[, shared-libadd])
 dnl
 dnl add a library to linkpath/runpath
 dnl
 AC_DEFUN(AC_ADD_LIBPATH,[
   if test "$1" != "/usr/lib"; then
     AC_EXPAND_PATH($1, ai_p)
-    AC_PHP_ONCE(LIBPATH, $ai_p, [
-      test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
-      LDFLAGS="$LDFLAGS -L$ai_p"
-      PHP_RPATHS="$PHP_RPATHS $ai_p"
-    ])
+    if test "$ext_shared" = "yes" && test -n "$2"; then
+      $2="-R$1 -L$1 [$]$2"
+    else
+      AC_PHP_ONCE(LIBPATH, $ai_p, [
+        test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$ai_p"
+        LDFLAGS="$LDFLAGS -L$ai_p"
+        PHP_RPATHS="$PHP_RPATHS $ai_p"
+      ])
+    fi
   fi
 ])
 
@@ -462,17 +466,29 @@
   fi
 ])
 
+AC_DEFUN(PHP_X_ADD_LIBRARY,[
+  ifelse($2,,$3="-l$1 [$]$3", $3="[$]$3 -l$1")
+])
+
 dnl
-dnl AC_ADD_LIBRARY(library[, append])
+dnl AC_ADD_LIBRARY(library[, append[, shared-libadd]])
 dnl
 dnl add a library to the link line
 dnl
 AC_DEFUN(AC_ADD_LIBRARY,[
-  AC_PHP_ONCE(LIBRARY, $1, [
-    if test "$1" != "c"; then
-      ifelse($#, 1, LIBS="-l$1 $LIBS", LIBS="$LIBS -l$1")
-    fi
-  ])
+ if test "$1" != "c"; then
+ifelse($3,,[
+   AC_PHP_ONCE(LIBRARY, $1, [
+     PHP_X_ADD_LIBRARY($1,$2,LIBS)
+   ])
+],[
+   if test "$ext_shared" = "yes"; then
+     PHP_X_ADD_LIBRARY($1,$2,$3)
+   else
+     AC_ADD_LIBRARY($1,$2)
+   fi
+])
+  fi
 ])
 
 dnl
@@ -500,17 +516,13 @@
   AC_ADD_LIBRARY($1)
 ],[
   if test "$ext_shared" = "yes"; then
+    $3="-l$1 [$]$3"
     if test -n "$2"; then
-      $3="-R$2 -L$2 -l$1 [$]$3"
-	else
-      $3="-l$1 [$]$3"
+      AC_ADD_LIBPATH($2,$3)
     fi
   else
-    if test -n "$2"; then
-      AC_ADD_LIBPATH($2)
-	fi
-    AC_ADD_LIBRARY($1)
- fi
+    AC_ADD_LIBRARY_WITH_PATH($1,$2)
+  fi
 ])
 ])
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.