]> granicus.if.org Git - php/commitdiff
Make yaz compilable as shared module.
authorSascha Schumann <sas@php.net>
Sat, 10 Jun 2000 03:35:57 +0000 (03:35 +0000)
committerSascha Schumann <sas@php.net>
Sat, 10 Jun 2000 03:35:57 +0000 (03:35 +0000)
ext/yaz/Makefile.in
ext/yaz/config.m4
ext/yaz/php_yaz.c

index 6425dee5e8858730957a33eae1ab9c1f96db99cf..0df612ffa23683f7637e19b4dee4c30a1ae3a489 100644 (file)
@@ -1,5 +1,7 @@
 LTLIBRARY_NAME    = libyaz.la
 LTLIBRARY_SOURCES = php_yaz.c
+LTLIBRARY_SHARED_NAME = yaz.la
+LTLIBRARY_SHARED_LIBADD = $(YAZ_SHARED_LIBADD)
 
 include $(top_srcdir)/build/dynlib.mk
 
index 7d006e039601aa957748e231c0e49652ae983109..75c6ffa0dc1e21885a0d198619eeac21779eb4ee 100644 (file)
@@ -1,51 +1,46 @@
 dnl $Id$
 
-AC_ARG_WITH(yaz,
+PHP_ARG_WITH(yaz,for YAZ support,
 [  --with-yaz[=DIR]        Include YAZ support (ANSI/NISO Z39.50). DIR is
-                          the YAZ bin install directory],
-[
-       yazconfig=NONE
-       if test "$withval" != "no"; then
-               if test "$withval" = "yes"; then
-                       AC_PATH_PROG(yazconfig, yaz-config, NONE)
-               else
-                       if test -r ${withval}/yaz-config; then
-                               yazconfig=${withval}/yaz-config
-                       else
-                               yazconfig=${withval}/bin/yaz-config
-                       fi
-               fi
-       fi
-       AC_MSG_CHECKING(for YAZ support)
-       if test -f $yazconfig; then
-               AC_DEFINE(HAVE_YAZ,1,[Whether you have YAZ])
-               . $yazconfig
-               for i in $YAZLIB; do
-                       case $i in
-                       -l*)
-                               ii=`echo $i|cut -c 3-`
-                               AC_ADD_LIBRARY($ii)
-                               ;;
-                       -L*)
-                               ii=`echo $i|cut -c 3-`
-                               AC_ADD_LIBPATH($ii)
-                               ;;
-                       esac
-               done
-               for i in $YAZINC; do
-                       case $i in
-                       -I*)
-                               ii=`echo $i|cut -c 3-`
-                               AC_ADD_INCLUDE($ii)
-                               ;;
-                       esac
-               done
-               AC_MSG_RESULT(yes)
-               PHP_EXTENSION(yaz)
-       else
-               AC_MSG_RESULT(no)
-       fi
-],[
-       AC_MSG_CHECKING(for YAZ support)
-       AC_MSG_RESULT(no)
-])
+                          the YAZ bin install directory])
+
+
+if test "$PHP_YAZ" != "no"; then
+  yazconfig=NONE
+  if test "$PHP_YAZ" = "yes"; then
+    AC_PATH_PROG(yazconfig, yaz-config, NONE)
+  else
+    if test -r ${PHP_YAZ}/yaz-config; then
+      yazconfig=${PHP_YAZ}/yaz-config
+    else
+      yazconfig=${PHP_YAZ}/bin/yaz-config
+    fi
+  fi
+
+  if test -f $yazconfig; then
+    AC_DEFINE(HAVE_YAZ,1,[Whether you have YAZ])
+    . $yazconfig
+    for i in $YAZLIB; do
+      case $i in
+      -l*)
+        ii=`echo $i|cut -c 3-`
+        AC_ADD_LIBRARY($ii, YAZ_SHARED_LIBADD)
+        ;;
+      -L*)
+        ii=`echo $i|cut -c 3-`
+        AC_ADD_LIBPATH($ii,, YAZ_SHARED_LIBADD)
+        ;;
+      esac
+    done
+    for i in $YAZINC; do
+      case $i in
+      -I*)
+        ii=`echo $i|cut -c 3-`
+        AC_ADD_INCLUDE($ii)
+        ;;
+      esac
+    done
+    PHP_SUBST(YAZ_SHARED_LIBADD)
+    PHP_EXTENSION(yaz, $ext_shared)
+  fi
+fi
index e56a6d825180b0c33305ff95a6f71c2217a93a2c..045dff67d1bc470626fab22ad5d93e67cd00b466 100644 (file)
@@ -1584,8 +1584,8 @@ zend_module_entry yaz_module_entry = {
        STANDARD_MODULE_PROPERTIES
 };
 
-#if COMPILE_DL
-DLEXPORT zend_module_entry *get_module(void) { return &yaz_module_entry; }
+#ifdef COMPILE_DL_YAZ
+ZEND_GET_MODULE(yaz)
 #endif