Re: [xml] [PATCH] Build shared library on Win32



Richard W.M. Jones wrote:
On Mon, Nov 03, 2008 at 09:38:03PM +0200, Roumen Petrov wrote:
- configure.in: macro AC_LIBTOOL_WIN32_DLL is no more required. It is for about 7 years old GNU compiler(gcc version about 2.9x) where we has to use dlltool to create shared libraries. I could not found reason to include it (year is 2008 and gcc(mingw version) is 3.5x).

I'm very sorry but this information is plain wrong.
AC_LIBTOOL_WIN32_DLL is required otherwise libtool will assume that
the package library cannot build a DLL and won't build one.  I have
just now verified this is the case with our toolchain (gcc 4.3.2,
libtool 1.5.26).

Ahh. Yes. I forgot an another requirement - objdump tool is required to check type of external dependent libraries. Macro AC_LIBTOOL_WIN32_DLL add check for this tool too. Due problems with many projects my build environment always prepends path to non-prefixed (by <ARCH>-<VENDOR>-) mingw binutils. Of course after one,two years I forgot this issue :) .


- LDFLAGS: for mingw host configure script is set and substitute variable WIN32_EXTRA_LDFLAGS with flag "-no-undefined". Why the patch don't use it ? Also why the patch don't set it in libexslt/Makefile.am and python/Makefile.am ?

We didn't build libexslt or python bindings, but that part of the
patch looks good.

Index: configure.in
===================================================================
[SNIP]
-AC_LIBTOOL_WIN32_DLL
 AC_GNU_SOURCE

You need to revert this bit.

Yes agree - it is required so attached revisited patch "libxslt-trunk-20081106.patch" : libtool macros just grouped together (do not forget if one day project switch to libtool 2.2+ ) and the rest is as previous one.


Even if AC_LIBTOOL_WIN32_DLL isn't
required in some future version of libtool, it does no harm to have
this, and it's required by our cross-compiler.

Libtool 1.5.26 is the last one from 1.x series. Next stable version (2.2+) use another macro: LT_INIT([win32-dll ...]) and I'm now sure that backward compatible macros work well.


Rich.


Roumen
Index: python/Makefile.am
===================================================================
--- python/Makefile.am  (revision 1492)
+++ python/Makefile.am  (working copy)
@@ -24,7 +24,7 @@
        libxslt-python-api.xml  \
        $(DOCS)
 
-libxsltmod_la_LDFLAGS = -module -avoid-version
+libxsltmod_la_LDFLAGS =  $(WIN32_EXTRA_LDFLAGS) -module -avoid-version
 
 if WITH_PYTHON
 mylibs = \
Index: libxslt/xsltwin32config.h
===================================================================
--- libxslt/xsltwin32config.h   (revision 1492)
+++ libxslt/xsltwin32config.h   (working copy)
@@ -62,7 +62,7 @@
  *
  * Whether module support is configured into libxslt
  */
-#if 0
+#if 1
 #ifndef WITH_MODULES
 #define WITH_MODULES
 #endif
Index: libxslt/Makefile.am
===================================================================
--- libxslt/Makefile.am (revision 1492)
+++ libxslt/Makefile.am (working copy)
@@ -53,7 +53,7 @@
        libxslt.h
 
 libxslt_la_LIBADD = $(EXTRA_LIBS)
-libxslt_la_LDFLAGS = -version-info @LIBXSLT_VERSION_INFO@ -no-undefined
+libxslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info @LIBXSLT_VERSION_INFO@
 
 man_MANS = libxslt.3
 
Index: configure.in
===================================================================
--- configure.in        (revision 1492)
+++ configure.in        (working copy)
@@ -3,7 +3,6 @@
 AC_INIT(libxslt/xslt.c)
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_HOST
-AC_LIBTOOL_WIN32_DLL
 AC_GNU_SOURCE
 
 dnl
@@ -105,6 +104,8 @@
 AC_PATH_PROG(TAR, tar, /bin/tar)
 
 AC_STDC_HEADERS
+
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 
 
@@ -588,6 +589,9 @@
 WIN32_EXTRA_LIBADD=
 WIN32_EXTRA_LDFLAGS=
 case "$host" in
+ *-*-cygwin*)
+ WIN32_EXTRA_LDFLAGS="-no-undefined"
+ ;;
  *-*-mingw*)
  WIN32_EXTRA_LIBADD="-lwsock32"
  WIN32_EXTRA_LDFLAGS="-no-undefined"
Index: libexslt/Makefile.am
===================================================================
--- libexslt/Makefile.am        (revision 1492)
+++ libexslt/Makefile.am        (working copy)
@@ -29,7 +29,7 @@
        dynamic.c
 
 libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS)
-libexslt_la_LDFLAGS = -version-info @LIBEXSLT_VERSION_INFO@ $(LIBGCRYPT_LIBS)
+libexslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info @LIBEXSLT_VERSION_INFO@ $(LIBGCRYPT_LIBS)
 
 man_MANS = libexslt.3
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]