]> granicus.if.org Git - php/commitdiff
modified the configure scripts to make shared extension.
authorRui Hirokawa <hirokawa@php.net>
Wed, 18 Oct 2000 22:17:41 +0000 (22:17 +0000)
committerRui Hirokawa <hirokawa@php.net>
Wed, 18 Oct 2000 22:17:41 +0000 (22:17 +0000)
ext/domxml/Makefile.in
ext/domxml/config.m4

index 97906ad6660e9afce00e0422b2e03fb1a8a93443..3b4b4c44a2d7bfb87c5ef2bd12eae05809432054 100644 (file)
@@ -1,5 +1,8 @@
+# $Id$
 
-LTLIBRARY_NAME    = libdomxml.la
-LTLIBRARY_SOURCES = php_domxml.c
+LTLIBRARY_NAME        = libdomxml.la
+LTLIBRARY_SOURCES     = php_domxml.c
+LTLIBRARY_SHARED_NAME = domxml.la
+LTLIBRARY_SHARED_LIBADD  = $(DOMXML_SHARED_LIBADD)
 
 include $(top_srcdir)/build/dynlib.mk
index 0ba23fd834b23acc78c9813009c53b45a4d9d198..44d965798f96dcaec9c12c082ad194d2fdcf17fa 100644 (file)
@@ -1,65 +1,61 @@
 dnl $Id$
+dnl config.m4 for extension domxml
 
-AC_MSG_CHECKING(whether to include DOM support)
-AC_ARG_WITH(dom,
-[  --with-dom[=DIR]        Include DOM support (requires libxml >= 2.0).
+PHP_ARG_WITH(dom, for DOM support,
+Make sure that the comment is aligned:
+[  --with-dom[=DIR]       Include DOM support (requires libxml >= 2.0).
                           DIR is the libxml install directory,
-                          defaults to /usr.],
-[
-  case "$withval" in
-    no)
-      AC_MSG_RESULT(no) ;;
-    yes)
-      AC_MSG_RESULT(yes)
-      PHP_EXTENSION(domxml)
-      old_LIBS=$LIBS
-      LIBS="$LIBS -lz"
-      AC_CHECK_LIB(xml, xmlFreeURI, [AC_DEFINE(HAVE_DOMXML,1,[ ])],
-        [AC_MSG_ERROR(DOM module requires libxml >= 2.0)])
-      LIBS=$old_LIBS
-      AC_ADD_LIBRARY(z)
-      AC_ADD_LIBRARY(xml)
-      AC_ADD_INCLUDE(/usr/local/include)
-      ;;
-    *)
-      test -f $withval/include/libxml/tree.h && DOMXML_INCLUDE="$withval/include"
-      if test -n "$DOMXML_INCLUDE" ; then
-        AC_MSG_RESULT(yes)
-        PHP_EXTENSION(domxml)
-        old_LIBS=$LIBS
-        LIBS="$LIBS -L$withval/lib"
+                          defaults to /usr.])
 
-        if test $HAVE_ZLIB; then
-          old_withval=$withval
-          AC_MSG_CHECKING([for zlib (needed by DOM support)])
-          AC_ARG_WITH(zlib-dir,
-          [  --with-zlib-dir[=DIR]   zlib dir for libxml or include zlib support],[
-            AC_MSG_RESULT( )
-            if test -z $withval; then
-              withval="/usr/local"
-            fi
-            LIBS="$LIBS -L$withval/lib -lz"
-            AC_CHECK_LIB(z,deflate, ,[AC_MSG_RESULT(no)],)
-            AC_ADD_LIBRARY_WITH_PATH(z, $withval/lib)
-          ],[
-            AC_MSG_RESULT(no)
-            AC_MSG_WARN(If configure fails try --with-zlib=<DIR>)
-          ])
-          withval=$old_withval
-        else
-          echo "checking for libz needed by pdflib 3.0... already zlib support"
-          LIBS="$LIBS -L$withval/lib -lz"
-        fi
+if test "$PHP_DOMXML" != "no"; then
 
-        AC_CHECK_LIB(xml, xmlFreeURI, [AC_DEFINE(HAVE_DOMXML,1,[ ])],
-          [AC_MSG_ERROR(DOM module requires libxml >= 2.0.)])
-        LIBS=$old_LIBS
-        AC_ADD_LIBRARY_WITH_PATH(xml, $withval/lib)
-        AC_ADD_INCLUDE($DOMXML_INCLUDE)
-      else
-        AC_MSG_RESULT(no)
-      fi ;;
-  esac
-],[
-  AC_MSG_RESULT(no)
-])
+  if test -r $PHP_DOMXML/include/libxml/tree.h; then
+    DOMXML_DIR=$PHP_DOMXML
+  else
+    AC_MSG_CHECKING(for DOM in default path)
+    for i in /usr/local /usr; do
+      if test -r $i/include/libxml/tree.h; then
+        DOMXML_DIR=$i
+        AC_MSG_RESULT(found in $i)
+      fi
+    done
+  fi
+
+  if test -z "$DOMXML_DIR"; then
+    AC_MSG_RESULT(not found)
+    AC_MSG_ERROR(Please reinstall the libxml >= 2.0 distribution)
+  fi
+
+  AC_ADD_INCLUDE($DOMXML_DIR/include)
+
+  PHP_SUBST(DOMXML_SHARED_LIBADD)
+  AC_ADD_LIBRARY_WITH_PATH(xml, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
+
+  if test $HAVE_ZLIB; then
+    old_withval=$withval
+    AC_MSG_CHECKING([for zlib (needed by DOM support)])
+    AC_ARG_WITH(zlib-dir,
+    [  --with-zlib-dir[=DIR]   zlib dir for libxml or include zlib support],[
+     AC_MSG_RESULT( )
+     if test -z $withval; then
+       withval="/usr/local"
+     fi
+     LIBS="$LIBS -L$withval/lib -lz"
+     AC_CHECK_LIB(z,deflate, ,[AC_MSG_RESULT(no)],)
+     AC_ADD_LIBRARY_WITH_PATH(z, $withval/lib)
+    ],[
+     AC_MSG_RESULT(no)
+     AC_MSG_WARN(If configure fails try --with-zlib=<DIR>)
+    ])
+    withval=$old_withval
+  else
+    echo "checking for libz needed by pdflib 3.0... already zlib support"
+    LIBS="$LIBS -L$withval/lib -lz"
+  fi
+
+  AC_CHECK_LIB(xml, xmlFreeURI, [AC_DEFINE(HAVE_DOMXML,1,[ ])],
+    [AC_MSG_ERROR(DOM module requires libxml >= 2.0)])
+  AC_ADD_LIBRARY(z)
+
+  PHP_EXTENSION(domxml, $ext_shared)
+fi