[Issues] [mod_gnutls 0000099]: mod_gnutls build fails to produce shared library under CygWin

Mantis Bug Tracker issues at outoforder.cc
Sat Jul 4 11:52:30 EDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://issues.outoforder.cc/view.php?id=99 
====================================================================== 
Reported By:                TimeHorse
Assigned To:                
====================================================================== 
Project:                    mod_gnutls
Issue ID:                   99
Category:                   Compile or Build
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Apache Version:             Apache 2.2.6 CYGWIN 
====================================================================== 
Date Submitted:             2009-05-31 14:15 EDT
Last Modified:              2009-07-04 11:52 EDT
====================================================================== 
Summary:                    mod_gnutls build fails to produce shared library
under CygWin
Description: 
When trying to build mod_gnutls for the current release of CYGWIN, the
build produces the static libraries but fails to produce the required
shared library (*.so).  I have back-verified this fails also in version
0.2.0 and 0.4.3 of the mod_gnutls software.

The system I am using has the following versions:
Apache 2.2.6
GnuTLS 2.4.1
CygWin DLL 1.2.25-15
APR 1.3.3-3
APR-Utils 1.3.4-1
ap_memcache 0.7.0
====================================================================== 

---------------------------------------------------------------------- 
 (0000148) TimeHorse (reporter) - 2009-06-14 11:50
 http://issues.outoforder.cc/view.php?id=99#c148 
---------------------------------------------------------------------- 
Build still does not produce .so file as of version 0.5.5.  Statically
linked files are built, but the .so file, critical for use with Apache, is
silently ignored and never generated.

Now, this make command:

make all LDFLAGS="-W1 -shared -avoid-version -no-undefined -R/usr/bin
-L/usr/bin -L/usr/lib -ldl -shrext=.so --enable-auto-import
/usr/lib/libapr-1.la /usr/lib/libhttpd2core.la" libdir=/usr/lib/apache2
LIBTOOL=/usr/share/apr/build-1/libtool

Does make a seemingly valid shared library by the name cygmod_gnutls.dll
with headers in libmod_gnutls.dll.a but as you can see this is a massive
make line which forces me to link my module statically with the latest APR
library and the Apache 2 core.  This strikes me as inelegant for a module,
not to mention that I had to hardcode the path to the libtool since you
were not using the libtool appropriate for the Apache Portable Runtime,
had to turn on warnings, force the target to sharded, turn off versions
for no undefined symbols to make sure the build doesn't silently build the
statically linked file and neglect the critical shared library build, had
to add /usr/bin to the run-time, shared library path, /usr/bin and
/usr/lib to the link-time library search path, add dl or the dynamic
loading library to the list of linked modules and force auto import of
modules.  You can see that I tried to force the extension of the shared
library to '.so' but this actually has no effect.  I also had to force the
libdir to be the apache library directory.

Anyway, the install just needs to copy src/.libs/cygmod_gnutls.dll to
/usr/lib/apache2/mod_gnutls.so as well as src/.libs/libmod_gnutls.dll.a to
/usr/lib/apache2/mod_gnutls.dll.a and src/.libs/libmod_gnutls.la to
/usr/lib/apache2/mod_gnutls.la.

Anyone who needs to compile mod_gnutls for CYGWIN can follow these
complicated build instructions to get the software compiled. 
Specifically, the counter-intuitive make command above and the three
manual copy instructions as described below:

$ ./configure --with-apxs=/usr/sbin/apxs2

...

$ make all LDFLAGS="-W1 -shared -avoid-version -no-undefined -R/usr/bin
-L/usr/bin -L/usr/lib -ldl -shrext=.so --enable-auto-import
/usr/lib/libapr-1.la /usr/lib/libhttpd2core.la" libdir=/usr/lib/apache2
LIBTOOL=/usr/share/apr/build-1/libtool

...

$ cp -f src/.libs/cygmod_gnutls.dll /usr/lib/apache2/mod_gnutls.so
$ cp -f src/.libs/libmod_gnutls.dll.a /usr/lib/apache2/mod_gnutls.dll.a
$ cp -f src/.libs/libmod_gnutls.la /usr/lib/apache2/mod_gnutls.la

Good luck for those who use these instructions and if you need any further
help integrating these instructions into a common build, I'll be happy to
work with you further. 

---------------------------------------------------------------------- 
 (0000155) nmav (manager) - 2009-06-30 14:05
 http://issues.outoforder.cc/view.php?id=99#c155 
---------------------------------------------------------------------- 
The shared library is generated with libtool thus I wasn't much involved in
the generation of it. However if you know any other apache module that
could make a shared library at windows, we could check what it is doing at
configure time. 

---------------------------------------------------------------------- 
 (0000164) TimeHorse (reporter) - 2009-07-04 11:52
 http://issues.outoforder.cc/view.php?id=99#c164 
---------------------------------------------------------------------- 
Well, of the various apache mods I've tried to compile, the one that went
the smoothest under CYGWIN was mod_wsgi
(http://code.google.com/p/modwsgi/).  This is also a VERY small library
with one 1 source file though it does expect Python to be installed.  It
built the .so file perfectly using the apxs2 binary for the link step.  As
I suggested, it's probably best to use the libtool associated with the APR
rather than the generic system-wide libtool since the APR is meant to be
platform independent and built in this case specifically for CYGWIN. 
Since the mod_wsgi package is just the 1 source file, the compilation of
it combines build with link so it's maybe not the best answer but the
apxs2 can handle linking and understands Apache so generally it's the best
way to create modules in my experience.  Hope that helps and thanks again
for looking into this!

Line used to build and link mod_wsgi:

$(APXS) -c $(CPPFLAGS) $(CFLAGS) mod_wsgi.c $(LDFLAGS) $(LDLIBS)

Where APXS is apxs2 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-31 14:15 TimeHorse      New Issue                                    
2009-05-31 14:15 TimeHorse      File Added: config.log                       
2009-05-31 14:15 TimeHorse      Apache Version            => Apache 2.2.6 CYGWIN
2009-05-31 14:16 TimeHorse      File Added: build.log                        
2009-05-31 14:16 TimeHorse      File Added: build2.log                       
2009-06-14 11:50 TimeHorse      Note Added: 0000148                          
2009-06-30 14:05 nmav           Note Added: 0000155                          
2009-06-30 14:14 nmav           Issue Monitored: nmav                        
2009-07-04 11:52 TimeHorse      Note Added: 0000164                          
======================================================================




More information about the Issues mailing list