cvs: php4 / README.SELF-CONTAINED-EXTENSIONS

[email protected] ("Sascha Schumann")
Newsgroups php.version4
Message-ID <cvssas959034831@cvsserver>
sas		Tue May 23 00:33:51 2000 EDT

  Modified files:
    /php4	README.SELF-CONTAINED-EXTENSIONS 
  Log:
  Add section about adding shared module support to an existing module.
  
  
Index: php4/README.SELF-CONTAINED-EXTENSIONS
diff -u php4/README.SELF-CONTAINED-EXTENSIONS:1.2 php4/README.SELF-CONTAINED-EXTENSIONS:1.3
--- php4/README.SELF-CONTAINED-EXTENSIONS:1.2	Tue May  2 23:51:48 2000
+++ php4/README.SELF-CONTAINED-EXTENSIONS	Tue May 23 00:33:51 2000
@@ -1,4 +1,4 @@
-$Id: README.SELF-CONTAINED-EXTENSIONS,v 1.2 2000/05/02 21:51:48 sas Exp $
+$Id: README.SELF-CONTAINED-EXTENSIONS,v 1.3 2000/05/22 22:33:51 sas Exp $
 =============================================================================
 
 HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
@@ -126,4 +126,26 @@
      $ ./configure \
             [--with-php-config=/path/to/php-config]
      $ make install
-  
+
+ADDING SHARED MODULE SUPPORT TO A MODULE
+
+  In order to be useful, a self-contained extension must be loadable
+  as a shared module. I will explain now how you can shared module support
+  to an existing module called foo.
+
+  1. In config.m4, use PHP_ARG_WITH/PHP_ARG_ENABLE. Then you will
+     automatically be able to use --with-foo=shared or
+     --enable-foo=shared.
+
+  2. In config.m4, use PHP_EXTENSION(foo, $ext_shared) to enable
+     building the extension.
+
+  3. Add the following line to Makefile.in:
+
+        LTLIBRARY_SHARED_NAME = foo.la
+
+  4. Add the following lines to your C source file:
+
+        #if defined(COMPILE_DL) || defined(COMPILE_DL_FOO)
+        ZEND_GET_MODULE(foo)
+        #endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.