httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject cvs commit: apache-1.3/src/os/cygwin os.h
Date Thu, 27 Sep 2001 18:12:04 GMT
martin      01/09/27 11:12:04

  Modified:    .        configure
               htdocs/manual cygwin.html
               src      CHANGES Configure Makefile.tmpl
               src/main http_main.c
               src/os/cygwin os.h
  Log:
  * configure: added case for Cygwin to translate shared module
  extensions from .so to .dll. Almost the same as for OS2.
  
  * htdocs/manual/cywin.html: added related changes to the configure
  and build process for shared module DLLs.
  
  * src/Configure: cleaned up Cygwin case for OS specific variable
  declaration. Removed no longer need $DLL_IMPORT_DEF and
  $DLL_IMPORT_LIB variables.
  
  * src/Makefile.tmpl: removed no longer needed $DLL_IMPORT_LIB
  variable.
  
  * src/main/http_main.c: added dllexport declaration for int REALMAIN
  for SHARED_CORE support.
  
  * src/modules/standard/Makefile.Cygwin: added this new file to
  reflect the extra rules needed to link the shared module DLLs. Very
  similar to src/modules/standard/Makefile.OS2.
  
  * src/os/cygwin/os.h: added explicit dllimport and dllexport
  declarations for API_VAR_EXPORT and API_EXPORT(type).
  
  Submitted by:	Stipe Tolj <tolj@wapme-systems.de>
  
  Revision  Changes    Path
  1.133     +4 -0      apache-1.3/configure
  
  Index: configure
  ===================================================================
  RCS file: /home/cvs/apache-1.3/configure,v
  retrieving revision 1.132
  retrieving revision 1.133
  diff -u -r1.132 -r1.133
  --- configure	2001/08/29 13:32:07	1.132
  +++ configure	2001/09/27 18:12:03	1.133
  @@ -1537,6 +1537,10 @@
           echo $SEO "s%/mod_\\(.\\{1,8\\}\\).*\\.so%/\\1\\.dll%" >>$sedsubst
           echo $SEO "s%/\\(lib.*\\)\\.so$%/\\1.dll%" >>$sedsubst
           ;;
  +    *cygwin* ) 
  +        echo $SEO "s%/\\(mod_.*\\)\\.so$%/\\1.dll%" >>$sedsubst
  +        echo $SEO "s%/\\(lib.*\\)\\.so$%/\\1.dll%" >>$sedsubst
  +        ;;
   esac
   
   #   split sedsubst into chunks of 50 commands
  
  
  
  1.7       +31 -25    httpd-docs-1.3/htdocs/manual/cygwin.html
  
  Index: cygwin.html
  ===================================================================
  RCS file: /home/cvs/httpd-docs-1.3/htdocs/manual/cygwin.html,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- cygwin.html	2001/09/24 14:22:45	1.6
  +++ cygwin.html	2001/09/27 18:12:03	1.7
  @@ -38,7 +38,7 @@
      operating systems.  While it is considered release quality, it is slower
      and less thoroughly tested than the Unix ports.  The Cygwin alternative
      uses the well tested Unix code by using the Cygwin portability layer for
  -   Unix emulation.  The Cygwin port may suffer from gaps in security or
  +   POSIX.1 emulation.  The Cygwin port may suffer from gaps in security or
      reliability due to the interaction of the Cygwin compatibility layer with
      the native Windows API.</p>
   
  @@ -188,6 +188,7 @@
   
   <ul>
   
  +
   <li><strong>Static linked version</strong>
   <p>To build a static linked version of <code>httpd</code> including
      additional modules, use the following commands in the shell:</p>
  @@ -199,6 +200,7 @@
   <p>This will produce the required extra libraries or object files for
      <i>module</i> and link everything to <code>src/httpd.exe</code>.</p>
   
  +
   <li><strong>Shared core, DLL linked version ('one-for-all' version)</strong>
   <p>To build a DLL version of <code>httpd</code> including additional
      modules, use the following commands:</p>
  @@ -223,11 +225,18 @@
   <pre>
     $ mv /usr/local/apache/libexec/libhttpd.dll /usr/local/apache/bin
   </pre>
  +  The core DLL module <code>libhttpd.dll</code> is the <i>only</i>
file that
  +  should reside in <code>/usr/local/apache/bin</code> directory. All other
shared DLL
  +  modules <code>mod_foo.dll</code> should be located in 
  +  <code>/usr/local/apache/libexec</code>.
  +<p>
  +
   
   <li><strong>Shared DLL modules linked version</strong>
   <p>This method is currently <strong>ONLY</strong> supported using
  -   a patched version of <code>ld.exe</code>. Please see the
  -   <a href="#req">requirements</a> section for where to get that version.
  +   a patched version of <code>ld.exe</code> which support the 
  +	<code>--auto-import</code> option. Please see the 
  +	<a href="#req">requirements</a> section for where to get that version.
   
   <p>To build a dynamic loadable DLL version of <code>httpd</code> which
can
      load DLL modules on the fly (at runtime), proceed as follows:</p>
  @@ -241,46 +250,43 @@
          [--enable-module=<i>module</i>|--add-module=<i>/path/to/module</i>]
\
          [--enable-shared=<i>module</i>]
     $ make
  -  $ make install
   </pre>
  -<p>Now the <code>make</code> process will break when trying to compile
the
  -  shared module defined using <code>--enable-shared</code>. You will have
  -  to use a work-around, due to the fact that currently there is no
  -  <code>src/libhttpd.dll</code> (required to link against by the
  -  shared module build process).</p>
  +<p>You will notice that there is a warning message shown which lets you
  +	know that the shared core DLL library <code>src/libhttpd.dll</code>
  +	is missing while trying to link the shared DLL modules 
  +	<code>mod_foo.dll</code>.
  +
  +<p>Unfortunatly while Apache's build process the shared modules are linked
  +	before the shared core import library <code>src/libhttpd.dll</code> has
  +	been made. The shared modules depend on this import library, so they
  +	can not link for the first time you run <code>make</code>.</p>
   
  -<li>Create an empty file to satisfy <code>make</code> and
  -  restart the <code>make</code> process again:
  +<li>Re-run <code>make</code> to build the shared module DLLs and install
the
  +    whole package to the installation directory:
   <pre>
  -  $ touch <i>/path/to/module.so</i>
     $ make
     $ make install
   </pre>
  -<p>This will build the core dynamic library <code>libhttpd.dll</code>
as
  -  described in the previous scenario.</p>
  +<p>All shared modules are placed into <code>libexec</code>, including
the 
  +	shared core DLL <code>libhttpd.dll</code>. When Apache's <code>/bin/httpd</code>

  +	is started it has to dynamicly link <code>libhttpd.dll</code> while runtime.

  +	That is why you have to place the shared core DLL <code>libhttpd.dll</code>
to 
  +	the same direcotry where <code>httpd.exe</code> resides, i.e. 
  +	<code>/usr/local/apache/bin</code>.</p>
   
  -<li>Now we have to link the shared module against that library:
  -<pre>
  -  $ cd <i>/path/to/module</i>
  -  $ gcc --shared -o <i>module</i>.dll <i>module</i>.lo <i>/path/to/libhttpd.dll</i>
  -</pre>
  -<p>The shared DLL module has to be placed in Apache's
  -  <code>bin</code> directory, where <code>libhttpd.dll</code> also
resides.</p>
   
   <li>Add configuration directives to <code>conf/httpd.conf</code> to load
   and activate shared DLL modules at runtime:
   <pre>
     # httpd.conf
     [...]
  -  LoadModule foo_module   bin/mod_foo.dll
  +  LoadModule foo_module   libexec/mod_foo.dll
     AddModule mod_foo.c
     [...]
   </pre>
   
   </ul>
   
  -<p>The above steps have to be repeated for each shared DLL module you want
  -   to build.</p>
   
   <li><strong>Using apxs to create shared DLL modules</strong>
   <p>To make the extending <code>httpd</code> with shared DLL modules
  @@ -318,7 +324,7 @@
   <pre>
     $ apxs -c mod_foo.c -o mod_foo.dll
   </pre>
  -   Place the resulting DLL in Apache's <code>bin</code> directory, so
  +   Place the resulting DLL in Apache's <code>libexec</code> directory, so
      the <code>dlopen()</code> function within the compiled in <code>mod_so.c</code>
      module can find and load it at runtime.
   
  
  
  
  1.1714    +3 -2      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1713
  retrieving revision 1.1714
  diff -u -r1.1713 -r1.1714
  --- CHANGES	2001/09/26 14:47:15	1.1713
  +++ CHANGES	2001/09/27 18:12:03	1.1714
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.21
   
  +  *) PORT: Some Cygwin changes, esp. improvements for dynamic loading,
  +     and cleanups. [Stipe Tolj <tolj@wapme-systems.de>]
  +
     *) Win32 SECURITY: The default installation could lead to mod_negotiation
        and mod_dir/mod_autoindex displaying a directory listing instead of
        the index.html.* files, if a very long path was created artificially
  @@ -23,8 +26,6 @@
   
     *) mod_proxy - close origin server connection when client aborts
        [Alexey Panchenko <panchenko@liwest.ru>] PR#8067,7383,6585
  -
  -  *) PORT: Some Cygwin changes. [Stipe Tolj <tolj@wapme-systems.de>]
   
     *) ErrorDocument 404 pointing to a parsed html file with a
        <!--#include virtual="file" --> with a request URI containing
  
  
  
  1.431     +0 -6      apache-1.3/src/Configure
  
  Index: Configure
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.430
  retrieving revision 1.431
  diff -u -r1.430 -r1.431
  --- Configure	2001/09/24 14:14:21	1.430
  +++ Configure	2001/09/27 18:12:04	1.431
  @@ -1924,12 +1924,6 @@
       if [ "x$TCFLAGS_SHLIB" = "x" ]; then
   	echo "CFLAGS_SHLIB=$CFLAGS_SHLIB -DSHARED_MODULE" >> Makefile.config
       fi
  -    if [ "x$TDLL_IMPORT_DEF" = "x" ]; then
  -	echo "DLL_IMPORT_DEF=$DLL_IMPORT_DEF" >> Makefile.config
  -    fi
  -    if [ "x$TDLL_IMPORT_LIB" = "x" ]; then
  -	echo "DLL_IMPORT_LIB=$DLL_IMPORT_LIB" >> Makefile.config
  -    fi
       if [ "x$TLD_SHLIB" = "x" ]; then
   	echo "LD_SHLIB=$LD_SHLIB" >> Makefile.config
       fi
  
  
  
  1.118     +1 -1      apache-1.3/src/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/Makefile.tmpl,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- Makefile.tmpl	2001/04/02 09:22:05	1.117
  +++ Makefile.tmpl	2001/09/27 18:12:04	1.118
  @@ -41,7 +41,7 @@
   target_shared: $(SHCORE_IMPLIB) $(SHARED_CORE_EP) lib$(TARGET).$(SHLIB_SUFFIX_NAME)
   	$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
   	      -o $(TARGET) -DSHARED_CORE_BOOTSTRAP main/http_main.c \
  -	      ap/libap.a $(LIBS) $(SHCORE_IMPLIB) $(DLL_IMPORT_LIB)
  +	      ap/libap.a $(LIBS) $(SHCORE_IMPLIB)
   
   lib$(TARGET).ep: lib$(TARGET).$(SHLIB_SUFFIX_NAME)
   	$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
  
  
  
  1.551     +10 -0     apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.550
  retrieving revision 1.551
  diff -u -r1.550 -r1.551
  --- http_main.c	2001/09/10 14:47:19	1.550
  +++ http_main.c	2001/09/27 18:12:04	1.551
  @@ -5137,6 +5137,15 @@
   extern char *optarg;
   extern int optind;
   
  +/* Cygwin 1.x SHARED_CORE support needs REALMAIN to be declared as dllexport,
  + * so we can later while SHARED_CORE_BOOTSTRAP is compiled and linked see the 
  + * dllimport for it. -- Stipe Tolj <tolj@wapme-systems.de>
  + */
  +
  +#if defined(CYGWIN)
  +__declspec(dllexport)  
  +#endif
  +
   int REALMAIN(int argc, char *argv[])
   {
       int c;
  @@ -7467,6 +7476,7 @@
   #if defined(CYGWIN)
   __declspec(dllimport) 
   #endif
  +
   
   int ap_main(int argc, char *argv[]); /* Load time linked from libhttpd.dll */
   
  
  
  
  1.3       +8 -1      apache-1.3/src/os/cygwin/os.h
  
  Index: os.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/os/cygwin/os.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- os.h	2001/04/02 18:56:39	1.2
  +++ os.h	2001/09/27 18:12:04	1.3
  @@ -68,7 +68,14 @@
   
   #ifndef API_EXPORT
   #ifdef SHARED_CORE
  -# define API_EXPORT(type)    __declspec(dllexport) type
  +# ifdef SHARED_MODULE
  +#  define API_VAR_EXPORT      __declspec(dllimport)
  +#  define API_EXPORT(type)    __declspec(dllimport) type
  +#  define MODULE_VAR_EXPORT   __declspec(dllexport)
  +# else
  +#  define API_VAR_EXPORT      __declspec(dllexport)
  +#  define API_EXPORT(type)    __declspec(dllexport) type
  +# endif /* def SHARED_MODULE */
   #endif /* def SHARED_CORE */ 
   #endif /* ndef API_EXPORT */
   
  
  
  

Mime
View raw message