]> granicus.if.org Git - php/commitdiff
Make recode extension buildable as shared module.
authorSascha Schumann <sas@php.net>
Tue, 23 May 2000 23:30:38 +0000 (23:30 +0000)
committerSascha Schumann <sas@php.net>
Tue, 23 May 2000 23:30:38 +0000 (23:30 +0000)
ext/recode/Makefile.in
ext/recode/config.m4
ext/recode/recode.c

index 1e02abb3d94795d410de28c555e2e403e199c570..fcf63e9e2aefe521500c0a53d13f4b5d6e894804 100644 (file)
@@ -1,5 +1,7 @@
 
 LTLIBRARY_NAME    = librecode.la
 LTLIBRARY_SOURCES = recode.c
+LTLIBRARY_SHARED_NAME = recode.la
+LTLIBRARY_SHARED_LIBADD = $(RECODE_SHARED_LIBADD)
 
 include $(top_srcdir)/build/dynlib.mk
index 41741a426ce650e3919db54899757d4ebaff1f2f..80ba17f86880a4ff7ecce396b0fdb4623df14c68 100644 (file)
@@ -3,13 +3,12 @@ dnl config.m4 for extension recode
 dnl don't forget to call PHP_EXTENSION(recode)
 
 
-AC_MSG_CHECKING(for recode support)
-AC_ARG_WITH(recode,
+PHP_ARG_WITH(recode,for recode support,
 [  --with-recode[=DIR]     Include recode support. DIR is the recode install
-                          directory.],
-[
-       if test "$withval" != "no"; then
-               RECODE_LIST="$withval /usr /usr/local /opt"
+                          directory.])
+
+       if test "$PHP_RECODE" != "no"; then
+               RECODE_LIST="$PHP_RECODE /usr /usr/local /opt"
 
                for i in $RECODE_LIST; do
                        if test -f $i/include/recode.h; then
@@ -51,15 +50,13 @@ recode_format_table();
                fi
 
                AC_ADD_INCLUDE($RECODE_DIR/$RECODE_INC)
-               AC_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB)
-
-               AC_MSG_RESULT(yes)
+               if test "$ext_shared" = "yes"; then
+                       AC_ADD_LIBRARY_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB, RECODE_SHARED_LIBADD)
+                       PHP_SUBST(RECODE_SHARED_LIBADD)
+               else
+                       AC_ADD_LIBRARY_DEFER_WITH_PATH(recode, $RECODE_DIR/$RECODE_LIB)
+               fi
 
                AC_DEFINE(HAVE_LIBRECODE, 1, [Whether we have librecode 3.5 or higher])
-               PHP_EXTENSION(recode)
-       else
-               AC_MSG_RESULT(no)
+               PHP_EXTENSION(recode,$ext_shared)
        fi
-],[
-       AC_MSG_RESULT(no)
-])
index f83583067163ae51b6ecbf303359d6591ff15315..b57b5395e67f80dfe2839e2956dda14a237cee1e 100644 (file)
@@ -64,6 +64,10 @@ zend_module_entry recode_module_entry = {
 extern void timeout(int sig);
 #endif
 
+#ifdef COMPILE_DL_RECODE
+ZEND_GET_MODULE(recode)
+#endif
+
 PHP_MINIT_FUNCTION(recode)
 {
        ReSLS_FETCH();