]> granicus.if.org Git - php/commitdiff
Add shared-libadd option to AC_ADD_LIBRARY_WITH_PATH.
authorSascha Schumann <sas@php.net>
Tue, 2 May 2000 04:00:14 +0000 (04:00 +0000)
committerSascha Schumann <sas@php.net>
Tue, 2 May 2000 04:00:14 +0000 (04:00 +0000)
This lets you replace

  if test "$ext_shared" = "yes"; then
    FOO_SHARED_LIBADD="-R$LIBDIR -L$LIBDIR -l$LIB"
  else
    AC_ADD_LIBRARY_WITH_PATH($LIB, $LIBDIR)
  fi

with

  AC_ADD_LIBRARY_WITH_PATH($LIB, $LIBDIR, FOO_SHARED_LIBADD)

acinclude.m4

index f14c07d2ca3dbe2a62671200b59b0ee9762ff055..d5ac7d73f1430dd70b118e5f31ae4248ff72cfa6 100644 (file)
@@ -375,13 +375,27 @@ AC_DEFUN(AC_ADD_LIBRARY_DEFER,[
 ])
 
 dnl
-dnl AC_ADD_LIBRARY_WITH_PATH(library, path)
+dnl AC_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
 dnl
-dnl add a library to the link line and path to linkpath/runpath
+dnl add a library to the link line and path to linkpath/runpath.
+dnl if shared-libadd is not empty and $ext_shared is yes,
+dnl shared-libadd will be assigned the library information
 dnl
 AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH,[
+ifelse($3,,[
   AC_ADD_LIBPATH($2)
   AC_ADD_LIBRARY($1)
+],[
+  if test "$ext_shared" = "yes"; then
+    if test -n "$2"; then
+      $3="[$]$3 -R$2 -L$2"
+    fi
+    $3="[$]$3 -l$1"
+  else
+   AC_ADD_LIBPATH($2)
+   AC_ADD_LIBRARY($1)
+ fi
+])
 ])
 
 dnl