summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-05-02 04:00:14 +0000
committerSascha Schumann <sas@php.net>2000-05-02 04:00:14 +0000
commit0b516602fd274d477850095b0edea52f09b01e82 (patch)
tree0dd41273c4324f627d32731a8f709624faa80af7 /acinclude.m4
parentc3d4066b48425921c171bcdac18ea36347f1efae (diff)
downloadphp-git-0b516602fd274d477850095b0edea52f09b01e82.tar.gz
Add shared-libadd option to AC_ADD_LIBRARY_WITH_PATH.
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)
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m418
1 files changed, 16 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index f14c07d2ca..d5ac7d73f1 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -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