[xslt] win32 build (mingw-cross compilation)
- From: Roumen Petrov <bugtrack roumenpetrov info>
- To: xslt gnome org
- Subject: [xslt] win32 build (mingw-cross compilation)
- Date: Fri, 24 Aug 2007 00:57:19 +0300
Hello list members,
Before more than one month I post a patch (bug#454392 libxslt bug track
system).
Daniel is not convinced that patch is correct and think that patch will
affect other builds.
I attach patch "libxslt-1.1.20.patch-0" as is.
Notes:
- Without changes in makefiles mingw build don't create shared libraries(dlls):
WIN32_EXTRA_LDFLAGS += -no-undefined : for details see libtool documentation.
configure set this flag but don't use in makefiles.
- Changes in ./configure.in:
remove unused winsock. AC_DEFINE([_WINSOCKAPI_]... seems to me as cut and paste from libxml.
WIN32_EXTRA_LDFLAGS += -avoid-version (new - only for mingw): create dll with name libXXX.dll instead of
libXXX[versufix].dll, where [versufix] is in format "-N" where N is a number computed from version info.
As result created by cross compilation libraries match names from native builds.
- Modification in extensions.c is to suppress warning.
- Now I'm sure that AC_LIBTOOL_WIN32_DLL is not necessary.
I attach a new more general patch ("libxslt-1.1.20.patch").
This patch remove completely winsock from libxslt and affect now native builds.
Note about changes in xsltutils.c:
- In mingw HAVE_GETTIMEOFDAY should be defined.
After patch mingw compile fine in case if XSLT_WIN32_PERFORMANCE_COUNTER is defined too.
- for winsock2.h library is ws2_32 but for wsock32 - winsock.h (included be default from windows.h if winsock2.h is not included before I think
).
Please comment on it (I don't have native build environment).
Roumen
--- ./libxslt/Makefile.am.ORIG 2007-01-03 17:11:57.000000000 +0200
+++ ./libxslt/Makefile.am 2007-07-04 03:07:14.000000000 +0300
@@ -50,8 +50,8 @@
xsltwin32config.h.in \
libxslt.h
-libxslt_la_LIBADD = $(EXTRA_LIBS)
-libxslt_la_LDFLAGS = -version-info @LIBXSLT_VERSION_INFO@
+libxslt_la_LIBADD = $(EXTRA_LIBS) $(WIN32_EXTRA_LIBADD)
+libxslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBXSLT_VERSION_INFO)
man_MANS = libxslt.3
--- ./libxslt/extensions.c.ORIG 2007-01-15 14:54:32.000000000 +0200
+++ ./libxslt/extensions.c 2007-06-26 17:12:46.000000000 +0300
@@ -34,8 +34,10 @@
#ifdef _WIN32
#include <stdlib.h> /* for _MAX_PATH */
+#ifndef PATH_MAX
#define PATH_MAX _MAX_PATH
#endif
+#endif
#ifdef WITH_XSLT_DEBUG
#define WITH_XSLT_DEBUG_EXTENSIONS
--- ./configure.in.ORIG 2007-01-17 16:37:13.000000000 +0200
+++ ./configure.in 2007-07-04 03:08:09.000000000 +0300
@@ -103,6 +103,7 @@
AC_PATH_PROG(TAR, tar, /bin/tar)
AC_STDC_HEADERS
+AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
dnl
@@ -511,9 +512,7 @@
WIN32_EXTRA_LDFLAGS=
case "$host" in
*-*-mingw*)
- WIN32_EXTRA_LIBADD="-lwsock32"
- WIN32_EXTRA_LDFLAGS="-no-undefined"
- AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
+ WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version"
AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
;;
--- ./libexslt/Makefile.am.ORIG 2007-01-03 17:11:57.000000000 +0200
+++ ./libexslt/Makefile.am 2007-07-04 02:05:09.000000000 +0300
@@ -28,8 +28,8 @@
libexslt.h \
dynamic.c
-libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS)
-libexslt_la_LDFLAGS = -version-info @LIBEXSLT_VERSION_INFO@ $(LIBGCRYPT_LIBS)
+libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS) $(WIN32_EXTRA_LIBADD)
+libexslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBEXSLT_VERSION_INFO) $(LIBGCRYPT_LIBS)
man_MANS = libexslt.3
--- ./win32/Makefile.mingw.ORIG 2007-01-03 17:11:57.000000000 +0200
+++ ./win32/Makefile.mingw 2007-08-23 23:38:32.000000000 +0300
@@ -55,7 +55,7 @@
# The linker and its options.
LD = gcc.exe
LDFLAGS += -Wl,-L,$(BINDIR) -Wl,-L,$(LIBPREFIX)
-LIBS = -lwsock32
+LIBS =
# The archiver and its options.
AR = ar.exe
--- ./win32/Makefile.msvc.ORIG 2007-01-03 17:11:57.000000000 +0200
+++ ./win32/Makefile.msvc 2007-08-23 23:38:38.000000000 +0300
@@ -58,7 +58,7 @@
LD = link.exe
LDFLAGS = /nologo
LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
-LIBS = wsock32.lib
+LIBS =
# The archiver and its options.
AR = lib.exe
--- ./libxslt/Makefile.am.ORIG 2007-01-03 17:11:57.000000000 +0200
+++ ./libxslt/Makefile.am 2007-07-04 03:07:14.000000000 +0300
@@ -50,8 +50,8 @@
xsltwin32config.h.in \
libxslt.h
-libxslt_la_LIBADD = $(EXTRA_LIBS)
-libxslt_la_LDFLAGS = -version-info @LIBXSLT_VERSION_INFO@
+libxslt_la_LIBADD = $(EXTRA_LIBS) $(WIN32_EXTRA_LIBADD)
+libxslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBXSLT_VERSION_INFO)
man_MANS = libxslt.3
--- ./libxslt/xsltutils.c.ORIG 2007-01-15 14:54:32.000000000 +0200
+++ ./libxslt/xsltutils.c 2007-08-23 23:17:46.000000000 +0300
@@ -36,16 +36,12 @@
#include "imports.h"
#include "transform.h"
-/* gettimeofday on Windows ??? */
-#if defined(WIN32) && !defined(__CYGWIN__)
+#ifndef HAVE_GETTIMEOFDAY
#ifdef _MSC_VER
-#include <winsock2.h>
-#pragma comment(lib, "ws2_32.lib")
-#define gettimeofday(p1,p2)
-#define HAVE_GETTIMEOFDAY
+#include <windows.h>
#define XSLT_WIN32_PERFORMANCE_COUNTER
#endif /* _MS_VER */
-#endif /* WIN32 */
+#endif /* HAVE_GETTIMEOFDAY*/
#ifdef XSLT_NEED_TRIO
#include "trio.h"
--- ./libxslt/extensions.c.ORIG 2007-01-15 14:54:32.000000000 +0200
+++ ./libxslt/extensions.c 2007-06-26 17:12:46.000000000 +0300
@@ -34,8 +34,10 @@
#ifdef _WIN32
#include <stdlib.h> /* for _MAX_PATH */
+#ifndef PATH_MAX
#define PATH_MAX _MAX_PATH
#endif
+#endif
#ifdef WITH_XSLT_DEBUG
#define WITH_XSLT_DEBUG_EXTENSIONS
--- ./configure.in.ORIG 2007-01-17 16:37:13.000000000 +0200
+++ ./configure.in 2007-08-23 23:32:51.000000000 +0300
@@ -511,9 +511,7 @@
WIN32_EXTRA_LDFLAGS=
case "$host" in
*-*-mingw*)
- WIN32_EXTRA_LIBADD="-lwsock32"
- WIN32_EXTRA_LDFLAGS="-no-undefined"
- AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
+ WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version"
AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
;;
--- ./xsltproc/xsltproc.c.ORIG 2007-01-15 14:54:32.000000000 +0200
+++ ./xsltproc/xsltproc.c 2007-08-23 23:05:21.000000000 +0300
@@ -54,8 +54,7 @@
#include <libexslt/exsltconfig.h>
#if defined(WIN32) && !defined (__CYGWIN__)
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#include <winsock2.h>
+#if defined(_MSC_VER)
#define gettimeofday(p1,p2)
#define snprintf _snprintf
#endif /* _MS_VER */
--- ./libexslt/Makefile.am.ORIG 2007-01-03 17:11:57.000000000 +0200
+++ ./libexslt/Makefile.am 2007-07-04 02:05:09.000000000 +0300
@@ -28,8 +28,8 @@
libexslt.h \
dynamic.c
-libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS)
-libexslt_la_LDFLAGS = -version-info @LIBEXSLT_VERSION_INFO@ $(LIBGCRYPT_LIBS)
+libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS) $(WIN32_EXTRA_LIBADD)
+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]