Re: [xml] autotool based vs. plain make builds

Roumen Petrov wrote:
Rob Richards wrote:
Roumen Petrov wrote:
I will hijack mail thread as change subject and I will exclude
Matthias Jung as hijacked post is for Solaris.

The original issue start here

Rob Richards wrote:
Daniel Veillard wrote:
On Fri, Oct 23, 2009 at 12:09:19AM +0300, Roumen Petrov wrote:
Daniel Veillard wrote:
On Thu, Oct 22, 2009 at 12:26:27AM +0300, Roumen Petrov wrote:
Matthias Jung wrote:

A piece of the patch from this appears to break at least the native
windows build by forcing LIBXML_STATIC to always be defined.
The change in question is here:

which is part of this collection of changes:

If this is only for mingw then the following would be more
appropriate imo:

Technically no . It is for all libtool based builds.

It is my mistake as I don't provide complete patch in above mentioned
mail thread ( ).

Why is not mingw specific. The one of the libtool branches is for
support of MSVC compiler. No idea when this branch will be merger
mainstream. After merge usres that will try to use autotool(with
libtool) based build will enter into same issue.

So I would like to propose to add flag -DNOLIBTOOL to plain make file
- win32/Makefile.bcb
replace CPPFLAGS = -I"$(XML_SRCDIR)\include" with

- win32/Makefile.mingw
replace CPPFLAGS += -I$(XML_SRCDIR)/include with

- win32/Makefile.msvc
replace CPPFLAGS = /nologo /I$(XML_SRCDIR)\include with
CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL"

- ???
No idea. May be is better to be removed from sources.

and finally change in libxml.h :
#ifndef PIC
#if !defined(PIC) && defined(__MINGW32__)

Currently #define LIBXML_STATIC from libxml.h impact only windows
platform (cf. threads.c ). This could change in future if new code is
added under #ifdef LIBXML_STATIC statement.

That works for the win32 build (at least msvc). I ended up using the
following block of code though:

#ifdef IN_LIBXML
#ifdef __GNUC__
#ifdef PIC
#ifdef linux
#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
#include "elfgcchack.h"
#elif !defined(NOLIBTOOL)
#endif /* ! __XML_LIBXML_H__ */


No above  is not correct as it is not for GNU compiler .
GNU libtool define C preprocessor directive -DPIC for shared builds and appropriate flag for compiler. This mean that case has to be outside #ifdef __GNUC__ and -DPIC is opposite to -DLIBXML_STATIC.


Ok, I attached a patch for this which works for msvc currently. libxml.h now just checks for ! defined(PIC) and ! defined(NOLIBTOL) to determine if it should explicitly define LIBXML_STATIC. Also, the NOLIBTOOL defines needed to be moved to the "compiler and its options" section though I also did leave it for the preprocessor section too. I assume this will work for mingwin and borland too though dont have a test environment to try them.

diff --git a/libxml.h b/libxml.h
index 1656ac2..dfc6c64 100644
--- a/libxml.h
+++ b/libxml.h
@@ -90,7 +90,7 @@ void __xmlGlobalInitMutexDestroy(void);
-#ifndef PIC
+#if !defined(PIC) && !defined(NOLIBTOOL)
 #  define LIBXML_STATIC
 #endif /* ! __XML_LIBXML_H__ */
diff --git a/win32/Makefile.bcb b/win32/Makefile.bcb
index 0bc4dbb..d612e2d 100644
--- a/win32/Makefile.bcb
+++ b/win32/Makefile.bcb
@@ -43,14 +43,14 @@ UTILS_INTDIR = int.utils.bcb
 # The preprocessor and its options.
 CPP = cpp32.exe -P- -DWIN32
-CPPFLAGS = -I"$(XML_SRCDIR)\include"
 !if "$(WITH_THREADS)" != "no"
 # The compiler and its options.
 CC = bcc32.exe
 !if "$(WITH_THREADS)" != "no"
diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw
index e79970e..a689f31 100644
--- a/win32/Makefile.mingw
+++ b/win32/Makefile.mingw
@@ -33,14 +33,14 @@ UTILS_INTDIR = int.utils.mingw
 # The preprocessor and its options.
 CPP = gcc.exe -E
-CPPFLAGS += -I$(XML_SRCDIR)/include
 ifeq ($(WITH_THREADS),1)
 # The compiler and its options.
 CC = gcc.exe
 ifneq ($(WITH_THREADS),no)
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 2409905..908c088 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -36,14 +36,14 @@ UTILS_INTDIR = int.utils.msvc
 # The preprocessor and its options.
 CPP = cl.exe /EP
-CPPFLAGS = /nologo /I$(XML_SRCDIR)\include
+CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL" 
 !if "$(WITH_THREADS)" != "no"
 # The compiler and its options.
 CC = cl.exe
-CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W1 $(CRUNTIME)
+CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS"  /D "NOLIBTOOL" /W1 $(CRUNTIME)
 !if "$(WITH_THREADS)" != "no"

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