summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/Makefile.am3
-rw-r--r--ext/xml/Makefile.am12
-rw-r--r--ext/xml/config.m428
-rw-r--r--ext/xml/xml.c6
4 files changed, 41 insertions, 8 deletions
diff --git a/ext/Makefile.am b/ext/Makefile.am
index 0903c2c82b..12f02bafc4 100644
--- a/ext/Makefile.am
+++ b/ext/Makefile.am
@@ -1,9 +1,10 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = @EXT_SUBDIRS@
+EXT_STATIC = @EXT_STATIC@
noinst_LIBRARIES=libphpext.a
libphpext.a: @EXT_LIBS@
- top_srcdir=$(top_srcdir) $(top_builddir)/scripts/mkextlib $@ $(SUBDIRS)
+ top_srcdir=$(top_srcdir) $(top_builddir)/scripts/mkextlib $@ $(EXT_STATIC)
-@test "`uname -s`" = "Rhapsody" && $(RANLIB) $@
diff --git a/ext/xml/Makefile.am b/ext/xml/Makefile.am
index c4f9f526f3..9b6e9cdec4 100644
--- a/ext/xml/Makefile.am
+++ b/ext/xml/Makefile.am
@@ -1,6 +1,12 @@
# $Id$
-INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
-noinst_LIBRARIES=libphpext_xml.a
-libphpext_xml_a_SOURCES=xml.c
+phplibdir=$(libdir)/php
+SRC=xml.c
+INCLUDES=@INCLUDES@ @XML_INCLUDE@ -I@top_srcdir@ -I@top_srcdir@/libzend
+noinst_LIBRARIES=libphpext_xml.a
+phplib_LTLIBRARIES=libphpext_xml.la
+libphpext_xml_a_SOURCES=$(SRC)
+libphpext_xml_la_SOURCES=$(SRC)
+libphpext_xml_la_LIBADD=@XML_LIBS@
+EXTRA_LIBS=
diff --git a/ext/xml/config.m4 b/ext/xml/config.m4
index b70082a547..787ee3465d 100644
--- a/ext/xml/config.m4
+++ b/ext/xml/config.m4
@@ -4,7 +4,25 @@
AC_MSG_CHECKING(for XML support)
AC_ARG_WITH(xml,
[ --with-xml Include XML support],[
+ case $withval in
+ shared)
+ shared=yes
+ withval=yes
+ ;;
+ shared,*)
+ shared=yes
+ withval=`echo $withval | sed -e 's/^shared,//'`
+ ;;
+ *)
+ shared=no
+ ;;
+ esac
if test "$withval" != "no"; then
+ if test "$shared" = "yes"; then
+ AC_MSG_RESULT([yes (shared)])
+ else
+ AC_MSG_RESULT([yes (static)])
+ fi
if test "$withval" = "yes"; then
test -d /usr/include/xmltok && XML_INCLUDE="-I/usr/include/xmltok"
test -d /usr/include/xml && XML_INCLUDE="-I/usr/include/xml"
@@ -19,13 +37,15 @@ AC_ARG_WITH(xml,
fi
fi
AC_DEFINE(HAVE_LIBEXPAT, 1)
- AC_MSG_RESULT(yes)
- PHP_EXTENSION(xml)
- EXTRA_LIBS="$EXTRA_LIBS $XML_LIBS"
- INCLUDES="$INCLUDES $XML_INCLUDE"
+ PHP_EXTENSION(xml, $shared)
+ if test "$shared" != "yes"; then
+ EXTRA_LIBS="$EXTRA_LIBS $XML_LIBS"
+ fi
else
AC_MSG_RESULT(no)
fi
],[
AC_MSG_RESULT(no)
])
+AC_SUBST(XML_LIBS)
+AC_SUBST(XML_INCLUDE)
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 66ea4a043d..b270adc1ea 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -18,6 +18,12 @@
/* $Id$ */
#define IS_EXT_MODULE
+
+/* boldly assume that if PIC is defined, we are being compiled dynamically */
+#ifdef PIC
+# define COMPILE_DL 1
+#endif
+
#if COMPILE_DL
# if PHP_31
# include "../phpdl.h"