2002-11-14 17:43:24 +00:00
# Makefile for libxml2, specific for Windows, GCC (mingw) and GNU make.
#
# Take a look at the beginning and modify the variables to suit your
# environment. Having done that, you can do a
#
# nmake [all] to build the libxml and the accompanying utilities.
# nmake clean to remove all compiler output files and return to a
# clean state.
# nmake rebuild to rebuild everything from scratch. This basically does
# a 'nmake clean' and then a 'nmake all'.
# nmake install to install the library and its header files.
#
2002-12-18 14:53:54 +00:00
# November 2002, Igor Zlatkovic <igor@zlatkovic.com>
2002-11-14 17:43:24 +00:00
# There should never be a need to modify anything below this line.
# ----------------------------------------------------------------
2003-11-27 18:39:01 +00:00
AUTOCONF = .\c onfig.mingw
i n c l u d e $( AUTOCONF )
2002-11-14 17:43:24 +00:00
# Names of various input and output components.
XML_NAME = xml2
XML_BASENAME = lib$( XML_NAME)
XML_SO = $( XML_BASENAME) .dll
XML_IMP = $( XML_BASENAME) .lib
XML_A = $( XML_BASENAME) .a
2003-11-27 18:39:01 +00:00
# Place where we let the compiler put its output.
BINDIR = bin.mingw
XML_INTDIR = int.mingw
XML_INTDIR_A = int.a.mingw
UTILS_INTDIR = int.utils.mingw
2002-11-14 17:43:24 +00:00
# The preprocessor and its options.
CPP = gcc.exe -E
2010-03-19 06:31:55 -04:00
CPPFLAGS += -I$( XML_SRCDIR) /include -DNOLIBTOOL
2002-11-14 17:43:24 +00:00
i f e q ( $( WITH_THREADS ) , 1 )
CPPFLAGS += -D_REENTRANT
e n d i f
# The compiler and its options.
CC = gcc.exe
2010-03-19 06:31:55 -04:00
CFLAGS += -DWIN32 -D_WINDOWS -D_MBCS -DNOLIBTOOL
2011-09-14 16:00:28 +08:00
CFLAGS += -I$( XML_SRCDIR) -I$( XML_SRCDIR) /include -I$( INCPREFIX) $( INCLUDE)
2002-11-14 17:43:24 +00:00
i f n e q ( $( WITH_THREADS ) , n o )
CFLAGS += -D_REENTRANT
e n d i f
i f e q ( $( WITH_THREADS ) , y e s )
CFLAGS += -DHAVE_WIN32_THREADS -DHAVE_COMPILER_TLS
e n d i f
i f e q ( $( WITH_THREADS ) , c t l s )
CFLAGS += -DHAVE_WIN32_THREADS -DHAVE_COMPILER_TLS
e n d i f
i f e q ( $( WITH_THREADS ) , n a t i v e )
CFLAGS += -DHAVE_WIN32_THREADS
e n d i f
i f e q ( $( WITH_THREADS ) , p o s i x )
CFLAGS += -DHAVE_PTHREAD_H
e n d i f
i f e q ( $( WITH_ZLIB ) , 1 )
CFLAGS += -DHAVE_ZLIB_H
e n d i f
Various "make distcheck" and portability fixups
Makefile.am:
* Don't use @VAR@, use $(VAR). Autoconf's AC_SUBST provides us the Make
variable, it allows overriding the value at the command line, and
(notably) it avoids a Make parse error in the libxml2_la_LDFLAGS
assignment when @MODULE_PLATFORM_LIBS@ is empty
* Changed how the THREADS_W32 mechanism switches the build between
testThreads.c and testThreadsWin32.c as appropriate; using AM_CONDITIONAL
allows this to work cleanly and plays well with dependencies
* testapi.c should be specified as BUILT_SOURCES
* Create symlinks to the test/ and result/ subdirs so that the runtests
target is usable in out-of-source-tree builds
* Don't do MAKEFLAGS+=--silent as this is not portable to non-GNU Makes
* Fixed incorrect find(1) syntax in the "cleanup" rule, and doing "rm -f"
instead of just "rm" is good form
* (DIST)CLEANFILES needed a bit more coverage to allow "make distcheck" to
pass
configure.in:
* Need AC_PROG_LN_S to create test/ and result/ symlinks in Makefile.am
* AC_LIBTOOL_WIN32_DLL and AM_PROG_LIBTOOL are obsolete; these have been
superceded by LT_INIT
* Don't rebuild docs by default, as this requires GNU Make (as
implemented)
* Check for uint32_t as some platforms don't provide it
* Check for some more functions, and undefine HAVE_MMAP if we don't also
HAVE_MUNMAP (one system I tested on actually needed this)
* Changed THREADS_W32 from a filename insert into an Automake conditional
* The "Copyright" file will not be in the current directory if builddir !=
srcdir
doc/Makefile.am:
* EXTRA_DIST cannot use wildcards when they refer to generated files; this
breaks dependencies. What I did was define EXTRA_DIST_wc, which uses GNU
Make $(wildcard) directives to build up a list of files, and EXTRA_DIST,
as a literal expansion of EXTRA_DIST_wc. I also added a new rule,
"check-extra-dist", to simplify checking that the two variables are
equivalent. (Note that this works only when builddir == srcdir)
(I can implement this differently if desired; this is just one way of
doing it)
* Don't define an "all" target; this steps on Automake's toes
* Fixed up the "libxml2-api.xml ..." rule by using $(wildcard) for
dependencies (as Make doesn't process the wildcards otherwise) and
qualifying appropriate files with $(srcdir)
(Note that $(srcdir) is not needed in the dependencies, thanks to VPATH,
which we can count on as this is GNU-Make-only code anyway)
doc/devhelp/Makefile.am:
* Qualified appropriate files with $(srcdir)
* Added an "uninstall-local" rule so that "make distcheck" passes
doc/examples/Makefile.am:
* Rather than use a wildcard that doesn't work, use a substitution that
most Make programs can handle
doc/examples/index.py:
* Do the same here
include/libxml/nanoftp.h:
* Some platforms (e.g. MSVC 6) already #define INVALID_SOCKET:
user@host:/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/\
Include$ grep -R INVALID_SOCKET .
./WINSOCK.H:#define INVALID_SOCKET (SOCKET)(~0)
./WINSOCK2.H:#define INVALID_SOCKET (SOCKET)(~0)
include/libxml/xmlversion.h.in:
* Support ancient GCCs (I was actually able to build the library with 2.5
but for this bit)
python/Makefile.am:
* Expanded CLEANFILES to allow "make distcheck" to pass
python/tests/Makefile.am:
* Define CLEANFILES instead of a "clean" rule, and added tmp.xml to allow
"make distcheck" to pass
testRelax.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H (as some
systems have the header but not the function)
testSchemas.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H
testapi.c:
* Don't use putenv() if it's not available
threads.c:
* This fixes the following build error on Solaris 8:
libtool: compile: cc -DHAVE_CONFIG_H -I. -I./include -I./include \
-D_REENTRANT -D__EXTENSIONS__ -D_REENTRANT -Dsparc -Xa -mt -v \
-xarch=v9 -xcrossfile -xO5 -c threads.c -KPIC -DPIC -o threads.o
"threads.c", line 442: controlling expressions must have scalar type
"threads.c", line 512: controlling expressions must have scalar type
cc: acomp failed for threads.c
*** Error code 1
trio.c:
* Define isascii() if the system doesn't provide it
trio.h:
* The trio library's HAVE_CONFIG_H header is not the same as LibXML2's
HAVE_CONFIG_H header; this change is needed to avoid a double-inclusion
win32/configure.js:
* Added support for the LZMA compression option
win32/Makefile.{bcb,mingw,msvc}:
* Added appropriate bits to support WITH_LZMA=1
* Install the header files under $(INCPREFIX)\libxml2\libxml instead of
$(INCPREFIX)\libxml, to mirror the install location on Unix+Autotools
xml2-config.in:
* @MODULE_PLATFORM_LIBS@ (usually "-ldl") needs to be in there in order for
`xml2-config --libs` to provide a complete set of dependencies
xmllint.c:
* Use HAVE_MMAP instead of the less-explicit HAVE_SYS_MMAN_H
2012-08-06 11:32:54 +08:00
i f e q ( $( WITH_LZMA ) , 1 )
CFLAGS += -DHAVE_LZMA_H
e n d i f
2002-11-14 17:43:24 +00:00
# The linker and its options.
LD = gcc.exe
LDFLAGS += -Wl,--major-image-version,$( LIBXML_MAJOR_VERSION)
LDFLAGS += -Wl,--minor-image-version,$( LIBXML_MINOR_VERSION)
LDFLAGS += -Wl,-L,$( BINDIR) -Wl,-L,$( LIBPREFIX)
2011-09-14 16:00:28 +08:00
LIBS =
2002-11-14 17:43:24 +00:00
i f e q ( $( WITH_FTP ) , 1 )
CFLAGS += -D_WINSOCKAPI_
2011-09-14 16:00:28 +08:00
LIBS += -lwsock32 -lws2_32
2002-11-14 17:43:24 +00:00
e n d i f
i f e q ( $( WITH_HTTP ) , 1 )
CFLAGS += -D_WINSOCKAPI_
2011-09-14 16:00:28 +08:00
LIBS += -lwsock32 -lws2_32
2002-11-14 17:43:24 +00:00
e n d i f
i f e q ( $( WITH_ICONV ) , 1 )
LIBS += -liconv
e n d i f
i f e q ( $( WITH_ZLIB ) , 1 )
2011-09-14 16:00:28 +08:00
# Could be named differently
# LIBS += -lzdll
LIBS += -lz
2002-11-14 17:43:24 +00:00
e n d i f
Various "make distcheck" and portability fixups
Makefile.am:
* Don't use @VAR@, use $(VAR). Autoconf's AC_SUBST provides us the Make
variable, it allows overriding the value at the command line, and
(notably) it avoids a Make parse error in the libxml2_la_LDFLAGS
assignment when @MODULE_PLATFORM_LIBS@ is empty
* Changed how the THREADS_W32 mechanism switches the build between
testThreads.c and testThreadsWin32.c as appropriate; using AM_CONDITIONAL
allows this to work cleanly and plays well with dependencies
* testapi.c should be specified as BUILT_SOURCES
* Create symlinks to the test/ and result/ subdirs so that the runtests
target is usable in out-of-source-tree builds
* Don't do MAKEFLAGS+=--silent as this is not portable to non-GNU Makes
* Fixed incorrect find(1) syntax in the "cleanup" rule, and doing "rm -f"
instead of just "rm" is good form
* (DIST)CLEANFILES needed a bit more coverage to allow "make distcheck" to
pass
configure.in:
* Need AC_PROG_LN_S to create test/ and result/ symlinks in Makefile.am
* AC_LIBTOOL_WIN32_DLL and AM_PROG_LIBTOOL are obsolete; these have been
superceded by LT_INIT
* Don't rebuild docs by default, as this requires GNU Make (as
implemented)
* Check for uint32_t as some platforms don't provide it
* Check for some more functions, and undefine HAVE_MMAP if we don't also
HAVE_MUNMAP (one system I tested on actually needed this)
* Changed THREADS_W32 from a filename insert into an Automake conditional
* The "Copyright" file will not be in the current directory if builddir !=
srcdir
doc/Makefile.am:
* EXTRA_DIST cannot use wildcards when they refer to generated files; this
breaks dependencies. What I did was define EXTRA_DIST_wc, which uses GNU
Make $(wildcard) directives to build up a list of files, and EXTRA_DIST,
as a literal expansion of EXTRA_DIST_wc. I also added a new rule,
"check-extra-dist", to simplify checking that the two variables are
equivalent. (Note that this works only when builddir == srcdir)
(I can implement this differently if desired; this is just one way of
doing it)
* Don't define an "all" target; this steps on Automake's toes
* Fixed up the "libxml2-api.xml ..." rule by using $(wildcard) for
dependencies (as Make doesn't process the wildcards otherwise) and
qualifying appropriate files with $(srcdir)
(Note that $(srcdir) is not needed in the dependencies, thanks to VPATH,
which we can count on as this is GNU-Make-only code anyway)
doc/devhelp/Makefile.am:
* Qualified appropriate files with $(srcdir)
* Added an "uninstall-local" rule so that "make distcheck" passes
doc/examples/Makefile.am:
* Rather than use a wildcard that doesn't work, use a substitution that
most Make programs can handle
doc/examples/index.py:
* Do the same here
include/libxml/nanoftp.h:
* Some platforms (e.g. MSVC 6) already #define INVALID_SOCKET:
user@host:/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/\
Include$ grep -R INVALID_SOCKET .
./WINSOCK.H:#define INVALID_SOCKET (SOCKET)(~0)
./WINSOCK2.H:#define INVALID_SOCKET (SOCKET)(~0)
include/libxml/xmlversion.h.in:
* Support ancient GCCs (I was actually able to build the library with 2.5
but for this bit)
python/Makefile.am:
* Expanded CLEANFILES to allow "make distcheck" to pass
python/tests/Makefile.am:
* Define CLEANFILES instead of a "clean" rule, and added tmp.xml to allow
"make distcheck" to pass
testRelax.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H (as some
systems have the header but not the function)
testSchemas.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H
testapi.c:
* Don't use putenv() if it's not available
threads.c:
* This fixes the following build error on Solaris 8:
libtool: compile: cc -DHAVE_CONFIG_H -I. -I./include -I./include \
-D_REENTRANT -D__EXTENSIONS__ -D_REENTRANT -Dsparc -Xa -mt -v \
-xarch=v9 -xcrossfile -xO5 -c threads.c -KPIC -DPIC -o threads.o
"threads.c", line 442: controlling expressions must have scalar type
"threads.c", line 512: controlling expressions must have scalar type
cc: acomp failed for threads.c
*** Error code 1
trio.c:
* Define isascii() if the system doesn't provide it
trio.h:
* The trio library's HAVE_CONFIG_H header is not the same as LibXML2's
HAVE_CONFIG_H header; this change is needed to avoid a double-inclusion
win32/configure.js:
* Added support for the LZMA compression option
win32/Makefile.{bcb,mingw,msvc}:
* Added appropriate bits to support WITH_LZMA=1
* Install the header files under $(INCPREFIX)\libxml2\libxml instead of
$(INCPREFIX)\libxml, to mirror the install location on Unix+Autotools
xml2-config.in:
* @MODULE_PLATFORM_LIBS@ (usually "-ldl") needs to be in there in order for
`xml2-config --libs` to provide a complete set of dependencies
xmllint.c:
* Use HAVE_MMAP instead of the less-explicit HAVE_SYS_MMAN_H
2012-08-06 11:32:54 +08:00
i f e q ( $( WITH_LZMA ) , 1 )
LIBS += -llzma
e n d i f
2002-11-14 17:43:24 +00:00
i f e q ( $( WITH_THREADS ) , p o s i x )
LIBS += -lpthreadGC
e n d i f
2005-01-04 15:10:22 +00:00
i f e q ( $( WITH_MODULES ) , 1 )
LIBS += -lkernel32
e n d i f
2002-11-14 17:43:24 +00:00
2011-09-14 16:00:28 +08:00
LIBS += $( LIB)
2002-11-14 17:43:24 +00:00
# The archiver and its options.
AR = ar.exe
ARFLAGS = -r
# Optimisation and debug symbols.
i f e q ( $( DEBUG ) , 1 )
CFLAGS += -D_DEBUG -g
LDFLAGS +=
e l s e
CFLAGS += -DNDEBUG -O2
LDFLAGS +=
e n d i f
# Libxml object files.
2012-08-15 13:52:09 +08:00
XML_OBJS = $( XML_INTDIR) /buf.o\
$( XML_INTDIR) /c14n.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /catalog.o\
2003-10-21 19:15:44 +00:00
$( XML_INTDIR) /chvalid.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /debugXML.o\
2003-08-28 10:24:40 +00:00
$( XML_INTDIR) /dict.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /DOCBparser.o\
$( XML_INTDIR) /encoding.o\
$( XML_INTDIR) /entities.o\
$( XML_INTDIR) /error.o\
$( XML_INTDIR) /globals.o\
$( XML_INTDIR) /hash.o\
$( XML_INTDIR) /HTMLparser.o\
$( XML_INTDIR) /HTMLtree.o\
2003-10-06 08:47:56 +00:00
$( XML_INTDIR) /legacy.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /list.o\
$( XML_INTDIR) /nanoftp.o\
$( XML_INTDIR) /nanohttp.o\
$( XML_INTDIR) /parser.o\
$( XML_INTDIR) /parserInternals.o\
2003-12-11 13:56:54 +00:00
$( XML_INTDIR) /pattern.o\
2003-02-08 17:53:46 +00:00
$( XML_INTDIR) /relaxng.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /SAX.o\
2003-08-28 10:24:40 +00:00
$( XML_INTDIR) /SAX2.o\
2005-11-01 10:55:24 +00:00
$( XML_INTDIR) /schematron.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /threads.o\
$( XML_INTDIR) /tree.o\
$( XML_INTDIR) /uri.o\
$( XML_INTDIR) /valid.o\
$( XML_INTDIR) /xinclude.o\
$( XML_INTDIR) /xlink.o\
$( XML_INTDIR) /xmlIO.o\
$( XML_INTDIR) /xmlmemory.o\
2002-12-16 18:45:29 +00:00
$( XML_INTDIR) /xmlreader.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /xmlregexp.o\
2005-04-06 20:42:35 +00:00
$( XML_INTDIR) /xmlmodule.o\
2004-03-09 10:53:42 +00:00
$( XML_INTDIR) /xmlsave.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /xmlschemas.o\
$( XML_INTDIR) /xmlschemastypes.o\
$( XML_INTDIR) /xmlunicode.o\
2003-11-27 18:39:01 +00:00
$( XML_INTDIR) /xmlwriter.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR) /xpath.o\
2004-01-07 23:38:02 +00:00
$( XML_INTDIR) /xpointer.o\
$( XML_INTDIR) /xmlstring.o
2002-11-14 17:43:24 +00:00
XML_SRCS = $( subst .o,.c,$( subst $( XML_INTDIR) /,$( XML_SRCDIR) /,$( XML_OBJS) ) )
# Static libxml object files.
2012-08-15 13:52:09 +08:00
XML_OBJS_A = $( XML_INTDIR_A) /buf.o\
$( XML_INTDIR_A) /c14n.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /catalog.o\
2003-10-21 19:15:44 +00:00
$( XML_INTDIR_A) /chvalid.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /debugXML.o\
2003-08-28 10:24:40 +00:00
$( XML_INTDIR_A) /dict.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /DOCBparser.o\
$( XML_INTDIR_A) /encoding.o\
$( XML_INTDIR_A) /entities.o\
$( XML_INTDIR_A) /error.o\
$( XML_INTDIR_A) /globals.o\
$( XML_INTDIR_A) /hash.o\
$( XML_INTDIR_A) /HTMLparser.o\
$( XML_INTDIR_A) /HTMLtree.o\
2003-10-06 08:47:56 +00:00
$( XML_INTDIR_A) /legacy.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /list.o\
$( XML_INTDIR_A) /nanoftp.o\
$( XML_INTDIR_A) /nanohttp.o\
$( XML_INTDIR_A) /parser.o\
$( XML_INTDIR_A) /parserInternals.o\
2003-12-11 13:56:54 +00:00
$( XML_INTDIR_A) /pattern.o\
2003-02-08 17:53:46 +00:00
$( XML_INTDIR_A) /relaxng.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /SAX.o\
2003-08-28 10:24:40 +00:00
$( XML_INTDIR_A) /SAX2.o\
2005-11-01 10:55:24 +00:00
$( XML_INTDIR_A) /schematron.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /threads.o\
$( XML_INTDIR_A) /tree.o\
$( XML_INTDIR_A) /uri.o\
$( XML_INTDIR_A) /valid.o\
$( XML_INTDIR_A) /xinclude.o\
$( XML_INTDIR_A) /xlink.o\
$( XML_INTDIR_A) /xmlIO.o\
$( XML_INTDIR_A) /xmlmemory.o\
2002-12-16 18:45:29 +00:00
$( XML_INTDIR_A) /xmlreader.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /xmlregexp.o\
2005-04-06 20:42:35 +00:00
$( XML_INTDIR_A) /xmlmodule.o\
2004-03-09 10:53:42 +00:00
$( XML_INTDIR_A) /xmlsave.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /xmlschemas.o\
$( XML_INTDIR_A) /xmlschemastypes.o\
$( XML_INTDIR_A) /xmlunicode.o\
2003-11-27 18:39:01 +00:00
$( XML_INTDIR_A) /xmlwriter.o\
2002-11-14 17:43:24 +00:00
$( XML_INTDIR_A) /xpath.o\
2004-01-07 23:38:02 +00:00
$( XML_INTDIR_A) /xpointer.o\
$( XML_INTDIR_A) /xmlstring.o
2002-11-14 17:43:24 +00:00
XML_SRCS_A = $( subst .o,.c,$( subst $( XML_INTDIR_A) /,$( XML_SRCDIR) /,$( XML_OBJS_A) ) )
# Xmllint and friends executables.
UTILS = $( BINDIR) /xmllint.exe\
$( BINDIR) /xmlcatalog.exe\
$( BINDIR) /testAutomata.exe\
$( BINDIR) /testC14N.exe\
$( BINDIR) /testDocbook.exe\
$( BINDIR) /testHTML.exe\
2002-12-16 18:45:29 +00:00
$( BINDIR) /testReader.exe\
2002-11-14 17:43:24 +00:00
$( BINDIR) /testRegexp.exe\
2005-01-04 15:10:22 +00:00
$( BINDIR) /testModule.exe\
2003-02-08 17:53:46 +00:00
$( BINDIR) /testRelax.exe\
2002-11-14 17:43:24 +00:00
$( BINDIR) /testSAX.exe\
$( BINDIR) /testSchemas.exe\
$( BINDIR) /testURI.exe\
2005-07-05 10:40:52 +00:00
$( BINDIR) /testXPath.exe\
2005-11-01 10:55:24 +00:00
$( BINDIR) /runtest.exe\
2006-02-01 11:28:14 +00:00
$( BINDIR) /runsuite.exe\
2012-08-15 13:52:09 +08:00
$( BINDIR) /testapi.exe\
$( BINDIR) /testlimits.exe
2006-02-01 11:28:14 +00:00
2002-11-14 17:43:24 +00:00
i f e q ( $( WITH_THREADS ) , y e s )
UTILS += $( BINDIR) /testThreadsWin32.exe
e n d i f
i f e q ( $( WITH_THREADS ) , c t l s )
UTILS += $( BINDIR) /testThreadsWin32.exe
e n d i f
i f e q ( $( WITH_THREADS ) , n a t i v e )
UTILS += $( BINDIR) /testThreadsWin32.exe
e n d i f
i f e q ( $( WITH_THREADS ) , p o s i x )
UTILS += $( BINDIR) /testThreads.exe
e n d i f
all : dep libxml libxmla utils
libxml : $( BINDIR ) /$( XML_SO )
libxmla : $( BINDIR ) /$( XML_A )
utils : $( UTILS )
clean :
2007-08-14 09:41:21 +00:00
cmd.exe /C " if exist $( XML_INTDIR) rmdir /S /Q $( XML_INTDIR) "
cmd.exe /C " if exist $( XML_INTDIR_A) rmdir /S /Q $( XML_INTDIR_A) "
cmd.exe /C " if exist $( UTILS_INTDIR) rmdir /S /Q $( UTILS_INTDIR) "
cmd.exe /C " if exist $( BINDIR) rmdir /S /Q $( BINDIR) "
cmd.exe /C "if exist depends.mingw del depends.mingw"
2002-11-14 17:43:24 +00:00
distclean : clean
2007-08-14 09:41:21 +00:00
cmd.exe /C "if exist config.* del config.*"
cmd.exe /C "if exist Makefile del Makefile"
2002-11-14 17:43:24 +00:00
rebuild : clean all
2005-04-06 21:14:06 +00:00
install-libs : all
Various "make distcheck" and portability fixups
Makefile.am:
* Don't use @VAR@, use $(VAR). Autoconf's AC_SUBST provides us the Make
variable, it allows overriding the value at the command line, and
(notably) it avoids a Make parse error in the libxml2_la_LDFLAGS
assignment when @MODULE_PLATFORM_LIBS@ is empty
* Changed how the THREADS_W32 mechanism switches the build between
testThreads.c and testThreadsWin32.c as appropriate; using AM_CONDITIONAL
allows this to work cleanly and plays well with dependencies
* testapi.c should be specified as BUILT_SOURCES
* Create symlinks to the test/ and result/ subdirs so that the runtests
target is usable in out-of-source-tree builds
* Don't do MAKEFLAGS+=--silent as this is not portable to non-GNU Makes
* Fixed incorrect find(1) syntax in the "cleanup" rule, and doing "rm -f"
instead of just "rm" is good form
* (DIST)CLEANFILES needed a bit more coverage to allow "make distcheck" to
pass
configure.in:
* Need AC_PROG_LN_S to create test/ and result/ symlinks in Makefile.am
* AC_LIBTOOL_WIN32_DLL and AM_PROG_LIBTOOL are obsolete; these have been
superceded by LT_INIT
* Don't rebuild docs by default, as this requires GNU Make (as
implemented)
* Check for uint32_t as some platforms don't provide it
* Check for some more functions, and undefine HAVE_MMAP if we don't also
HAVE_MUNMAP (one system I tested on actually needed this)
* Changed THREADS_W32 from a filename insert into an Automake conditional
* The "Copyright" file will not be in the current directory if builddir !=
srcdir
doc/Makefile.am:
* EXTRA_DIST cannot use wildcards when they refer to generated files; this
breaks dependencies. What I did was define EXTRA_DIST_wc, which uses GNU
Make $(wildcard) directives to build up a list of files, and EXTRA_DIST,
as a literal expansion of EXTRA_DIST_wc. I also added a new rule,
"check-extra-dist", to simplify checking that the two variables are
equivalent. (Note that this works only when builddir == srcdir)
(I can implement this differently if desired; this is just one way of
doing it)
* Don't define an "all" target; this steps on Automake's toes
* Fixed up the "libxml2-api.xml ..." rule by using $(wildcard) for
dependencies (as Make doesn't process the wildcards otherwise) and
qualifying appropriate files with $(srcdir)
(Note that $(srcdir) is not needed in the dependencies, thanks to VPATH,
which we can count on as this is GNU-Make-only code anyway)
doc/devhelp/Makefile.am:
* Qualified appropriate files with $(srcdir)
* Added an "uninstall-local" rule so that "make distcheck" passes
doc/examples/Makefile.am:
* Rather than use a wildcard that doesn't work, use a substitution that
most Make programs can handle
doc/examples/index.py:
* Do the same here
include/libxml/nanoftp.h:
* Some platforms (e.g. MSVC 6) already #define INVALID_SOCKET:
user@host:/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/\
Include$ grep -R INVALID_SOCKET .
./WINSOCK.H:#define INVALID_SOCKET (SOCKET)(~0)
./WINSOCK2.H:#define INVALID_SOCKET (SOCKET)(~0)
include/libxml/xmlversion.h.in:
* Support ancient GCCs (I was actually able to build the library with 2.5
but for this bit)
python/Makefile.am:
* Expanded CLEANFILES to allow "make distcheck" to pass
python/tests/Makefile.am:
* Define CLEANFILES instead of a "clean" rule, and added tmp.xml to allow
"make distcheck" to pass
testRelax.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H (as some
systems have the header but not the function)
testSchemas.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H
testapi.c:
* Don't use putenv() if it's not available
threads.c:
* This fixes the following build error on Solaris 8:
libtool: compile: cc -DHAVE_CONFIG_H -I. -I./include -I./include \
-D_REENTRANT -D__EXTENSIONS__ -D_REENTRANT -Dsparc -Xa -mt -v \
-xarch=v9 -xcrossfile -xO5 -c threads.c -KPIC -DPIC -o threads.o
"threads.c", line 442: controlling expressions must have scalar type
"threads.c", line 512: controlling expressions must have scalar type
cc: acomp failed for threads.c
*** Error code 1
trio.c:
* Define isascii() if the system doesn't provide it
trio.h:
* The trio library's HAVE_CONFIG_H header is not the same as LibXML2's
HAVE_CONFIG_H header; this change is needed to avoid a double-inclusion
win32/configure.js:
* Added support for the LZMA compression option
win32/Makefile.{bcb,mingw,msvc}:
* Added appropriate bits to support WITH_LZMA=1
* Install the header files under $(INCPREFIX)\libxml2\libxml instead of
$(INCPREFIX)\libxml, to mirror the install location on Unix+Autotools
xml2-config.in:
* @MODULE_PLATFORM_LIBS@ (usually "-ldl") needs to be in there in order for
`xml2-config --libs` to provide a complete set of dependencies
xmllint.c:
* Use HAVE_MMAP instead of the less-explicit HAVE_SYS_MMAN_H
2012-08-06 11:32:54 +08:00
cmd.exe /C " if not exist $( INCPREFIX) \libxml2 mkdir $( INCPREFIX) \libxml2 "
cmd.exe /C " if not exist $( INCPREFIX) \libxml2\libxml mkdir $( INCPREFIX) \libxml2\libxml "
2007-08-14 09:41:21 +00:00
cmd.exe /C " if not exist $( BINPREFIX) mkdir $( BINPREFIX) "
cmd.exe /C " if not exist $( LIBPREFIX) mkdir $( LIBPREFIX) "
Various "make distcheck" and portability fixups
Makefile.am:
* Don't use @VAR@, use $(VAR). Autoconf's AC_SUBST provides us the Make
variable, it allows overriding the value at the command line, and
(notably) it avoids a Make parse error in the libxml2_la_LDFLAGS
assignment when @MODULE_PLATFORM_LIBS@ is empty
* Changed how the THREADS_W32 mechanism switches the build between
testThreads.c and testThreadsWin32.c as appropriate; using AM_CONDITIONAL
allows this to work cleanly and plays well with dependencies
* testapi.c should be specified as BUILT_SOURCES
* Create symlinks to the test/ and result/ subdirs so that the runtests
target is usable in out-of-source-tree builds
* Don't do MAKEFLAGS+=--silent as this is not portable to non-GNU Makes
* Fixed incorrect find(1) syntax in the "cleanup" rule, and doing "rm -f"
instead of just "rm" is good form
* (DIST)CLEANFILES needed a bit more coverage to allow "make distcheck" to
pass
configure.in:
* Need AC_PROG_LN_S to create test/ and result/ symlinks in Makefile.am
* AC_LIBTOOL_WIN32_DLL and AM_PROG_LIBTOOL are obsolete; these have been
superceded by LT_INIT
* Don't rebuild docs by default, as this requires GNU Make (as
implemented)
* Check for uint32_t as some platforms don't provide it
* Check for some more functions, and undefine HAVE_MMAP if we don't also
HAVE_MUNMAP (one system I tested on actually needed this)
* Changed THREADS_W32 from a filename insert into an Automake conditional
* The "Copyright" file will not be in the current directory if builddir !=
srcdir
doc/Makefile.am:
* EXTRA_DIST cannot use wildcards when they refer to generated files; this
breaks dependencies. What I did was define EXTRA_DIST_wc, which uses GNU
Make $(wildcard) directives to build up a list of files, and EXTRA_DIST,
as a literal expansion of EXTRA_DIST_wc. I also added a new rule,
"check-extra-dist", to simplify checking that the two variables are
equivalent. (Note that this works only when builddir == srcdir)
(I can implement this differently if desired; this is just one way of
doing it)
* Don't define an "all" target; this steps on Automake's toes
* Fixed up the "libxml2-api.xml ..." rule by using $(wildcard) for
dependencies (as Make doesn't process the wildcards otherwise) and
qualifying appropriate files with $(srcdir)
(Note that $(srcdir) is not needed in the dependencies, thanks to VPATH,
which we can count on as this is GNU-Make-only code anyway)
doc/devhelp/Makefile.am:
* Qualified appropriate files with $(srcdir)
* Added an "uninstall-local" rule so that "make distcheck" passes
doc/examples/Makefile.am:
* Rather than use a wildcard that doesn't work, use a substitution that
most Make programs can handle
doc/examples/index.py:
* Do the same here
include/libxml/nanoftp.h:
* Some platforms (e.g. MSVC 6) already #define INVALID_SOCKET:
user@host:/cygdrive/c/Program Files/Microsoft Visual Studio/VC98/\
Include$ grep -R INVALID_SOCKET .
./WINSOCK.H:#define INVALID_SOCKET (SOCKET)(~0)
./WINSOCK2.H:#define INVALID_SOCKET (SOCKET)(~0)
include/libxml/xmlversion.h.in:
* Support ancient GCCs (I was actually able to build the library with 2.5
but for this bit)
python/Makefile.am:
* Expanded CLEANFILES to allow "make distcheck" to pass
python/tests/Makefile.am:
* Define CLEANFILES instead of a "clean" rule, and added tmp.xml to allow
"make distcheck" to pass
testRelax.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H (as some
systems have the header but not the function)
testSchemas.c:
* Use HAVE_MMAP instead of the less explicit HAVE_SYS_MMAN_H
testapi.c:
* Don't use putenv() if it's not available
threads.c:
* This fixes the following build error on Solaris 8:
libtool: compile: cc -DHAVE_CONFIG_H -I. -I./include -I./include \
-D_REENTRANT -D__EXTENSIONS__ -D_REENTRANT -Dsparc -Xa -mt -v \
-xarch=v9 -xcrossfile -xO5 -c threads.c -KPIC -DPIC -o threads.o
"threads.c", line 442: controlling expressions must have scalar type
"threads.c", line 512: controlling expressions must have scalar type
cc: acomp failed for threads.c
*** Error code 1
trio.c:
* Define isascii() if the system doesn't provide it
trio.h:
* The trio library's HAVE_CONFIG_H header is not the same as LibXML2's
HAVE_CONFIG_H header; this change is needed to avoid a double-inclusion
win32/configure.js:
* Added support for the LZMA compression option
win32/Makefile.{bcb,mingw,msvc}:
* Added appropriate bits to support WITH_LZMA=1
* Install the header files under $(INCPREFIX)\libxml2\libxml instead of
$(INCPREFIX)\libxml, to mirror the install location on Unix+Autotools
xml2-config.in:
* @MODULE_PLATFORM_LIBS@ (usually "-ldl") needs to be in there in order for
`xml2-config --libs` to provide a complete set of dependencies
xmllint.c:
* Use HAVE_MMAP instead of the less-explicit HAVE_SYS_MMAN_H
2012-08-06 11:32:54 +08:00
cmd.exe /C " copy $( XML_SRCDIR) \include\libxml\*.h $( INCPREFIX) \libxml2\libxml "
2007-08-14 09:41:21 +00:00
cmd.exe /C " copy $( BINDIR) \$(XML_SO) $( SOPREFIX) "
cmd.exe /C " copy $( BINDIR) \$(XML_A) $( LIBPREFIX) "
cmd.exe /C " copy $( BINDIR) \$(XML_IMP) $( LIBPREFIX) "
cmd.exe /C " copy $( BINDIR) \xml*.exe $( BINPREFIX) "
2005-04-06 21:14:06 +00:00
install : install -libs
2007-08-14 09:41:21 +00:00
cmd.exe /C " copy $( BINDIR) \*.exe $( BINPREFIX) "
2002-11-14 17:43:24 +00:00
2005-04-06 21:14:06 +00:00
install-dist : install -libs
2007-08-14 09:41:21 +00:00
cmd.exe /C " copy $( BINDIR) \xml*.exe $( BINPREFIX) "
2004-06-09 14:32:47 +00:00
2002-11-14 17:43:24 +00:00
# This is a target for me, to make a binary distribution. Not for the public use,
# keep your hands off :-)
BDVERSION = $( LIBXML_MAJOR_VERSION) .$( LIBXML_MINOR_VERSION) .$( LIBXML_MICRO_VERSION)
BDPREFIX = $( XML_BASENAME) -$( BDVERSION) .win32
bindist : all
2005-04-06 21:14:06 +00:00
$( MAKE) PREFIX = $( BDPREFIX) SOPREFIX = $( BDPREFIX) /bin install-dist
2002-11-14 17:43:24 +00:00
cscript //NoLogo configure.js genreadme $( XML_BASENAME) $( BDVERSION) $( BDPREFIX) \r eadme.txt
# Creates the dependency file
dep :
$( CC) $( CFLAGS) -M $( XML_SRCS) > depends.mingw
# Makes the output directory.
$(BINDIR) :
2003-08-28 10:24:40 +00:00
cmd.exe /C if not exist $( BINDIR) mkdir $( BINDIR)
2002-11-14 17:43:24 +00:00
# Makes the libxml intermediate directory.
$(XML_INTDIR) :
2003-08-28 10:24:40 +00:00
cmd.exe /C if not exist $( XML_INTDIR) mkdir $( XML_INTDIR)
2002-11-14 17:43:24 +00:00
# Makes the static libxml intermediate directory.
$(XML_INTDIR_A) :
2003-08-28 10:24:40 +00:00
cmd.exe /C if not exist $( XML_INTDIR_A) mkdir $( XML_INTDIR_A)
2002-11-14 17:43:24 +00:00
# An implicit rule for libxml compilation.
$(XML_INTDIR)/%.o : $( XML_SRCDIR ) /%.c
$( CC) $( CFLAGS) -o $@ -c $<
# An implicit rule for static libxml compilation.
$(XML_INTDIR_A)/%.o : $( XML_SRCDIR ) /%.c
$( CC) $( CFLAGS) -DLIBXML_STATIC -o $@ -c $<
# Compiles libxml source. Uses the implicit rule for commands.
$(XML_OBJS) : $( XML_INTDIR )
# Compiles static libxml source. Uses the implicit rule for commands.
$(XML_OBJS_A) : $( XML_INTDIR_A )
# Creates the libxml shared object.
XMLSO_LDFLAGS = $( LDFLAGS) -shared -Wl,--dll -Wl,--out-implib,$( BINDIR) /$( XML_IMP)
$(BINDIR)/$(XML_SO) : $( BINDIR ) $( XML_OBJS )
$( LD) $( XMLSO_LDFLAGS) -o $( BINDIR) /$( XML_SO) $( XML_OBJS) $( LIBS)
# Creates the libxml archive.
$(BINDIR)/$(XML_A) : $( BINDIR ) $( XML_OBJS_A )
$( AR) $( ARFLAGS) $( BINDIR) \$ ( XML_A) $( XML_OBJS_A)
# Makes the utils intermediate directory.
$(UTILS_INTDIR) :
2003-08-28 10:24:40 +00:00
cmd.exe /C if not exist $( UTILS_INTDIR) mkdir $( UTILS_INTDIR)
2002-11-14 17:43:24 +00:00
# An implicit rule for xmllint and friends.
i f e q ( $( STATIC ) , 1 )
$(BINDIR)/%.exe : $( UTILS_SRCDIR ) /%.c
$( CC) -DLIBXML_STATIC $( CFLAGS) -o $( subst .c,.o,$( UTILS_INTDIR) /$( <F) ) -c $<
2002-11-22 18:07:37 +00:00
$( LD) $( LDFLAGS) -o $@ $( subst .c,.o,$( UTILS_INTDIR) /$( <F) ) -l$( XML_BASENAME) $( LIBS)
2002-11-14 17:43:24 +00:00
e l s e
$(BINDIR)/%.exe : $( UTILS_SRCDIR ) /%.c
$( CC) $( CFLAGS) -o $( subst .c,.o,$( UTILS_INTDIR) /$( <F) ) -c $<
2002-11-22 18:07:37 +00:00
$( LD) $( LDFLAGS) -o $@ $( subst .c,.o,$( UTILS_INTDIR) /$( <F) ) -l$( XML_BASENAME) $( LIBS)
2002-11-14 17:43:24 +00:00
e n d i f
# Builds xmllint and friends. Uses the implicit rule for commands.
$(UTILS) : $( UTILS_INTDIR ) $( BINDIR ) libxml libxmla
# Source dependencies
#-include depends.mingw