1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

Remove legacy win32 build system

This commit is contained in:
Nick Wellnhofer
2025-09-10 18:04:57 +02:00
parent 347147b555
commit b9943bcaa3
7 changed files with 2 additions and 1904 deletions

3
NEWS
View File

@@ -28,6 +28,8 @@ More internal functions and struct members were deprecated.
The built-in HTTP client and support for LZMA compression were removed.
The custom Windows build system in `win32` was removed in favor of CMake.
### Planned removals
The Python bindings and support for Schematron validation are planned to
@@ -37,7 +39,6 @@ The following features are considered for removal:
- Modules API (xmlmodule.h)
- Support for zlib compressed file I/O
- Legacy Windows build system in win32
RELAX NG support is still in a bad state and a long-term removal
candidate.

View File

@@ -1,306 +0,0 @@
# Makefile for libxml2, specific for Windows, BCB6 and Borland make.
#
# Take a look at the beginning and modify the variables to suit your
# environment. Having done that, you can do a
#
# make [all] to build the libxml and the accompanying utilities.
# make clean to remove all compiler output files and return to a
# clean state.
# make rebuild to rebuild everything from scratch. This basically does
# a 'nmake clean' and then a 'nmake all'.
# make install to install the library and its header files.
#
# August 2003, Eric Zurcher <Eric.Zurcher@csiro.au>
# based on the MSVC version of
# March 2002, Igor Zlatkovic <igor@zlatkovic.com>
#
# There should never be a need to modify anything below this line.
# ----------------------------------------------------------------
AUTOCONF = .\config.bcb
!include $(AUTOCONF)
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
.autodepend
# 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.lib
DUMMY = dir.exists
# Place where we let the compiler put its intermediate trash.
BINDIR = bin.bcb
XML_INTDIR = int.bcb
XML_INTDIR_A = int.a.bcb
UTILS_INTDIR = int.utils.bcb
# The preprocessor and its options.
CPP = cpp32.exe -P-
CPPFLAGS = -I"$(XML_SRCDIR)\include" -DNOLIBTOOL
!if "$(WITH_THREADS)" != "no"
CPPFLAGS = $(CPPFLAGS) -D__MT__
!endif
# The compiler and its options.
CC = bcc32.exe
CFLAGS = -q -D_NO_VCL -D_WINDOWS -D_MBCS -DEILSEQ=2 -DNOLIBTOOL -w-
CFLAGS = $(CFLAGS) -I"$(XML_SRCDIR)" -I"$(XML_SRCDIR)\include" -I"$(INCPREFIX)" -I"$(INCLUDE)"
!if "$(WITH_THREADS)" != "no"
CFLAGS = $(CFLAGS) -tWM
!endif
!if "$(DYNRUNTIME)" == "1"
CFLAGS = $(CFLAGS) -tWR
!endif
!if "$(WITH_THREADS)" == "ctls"
CFLAGS = $(CFLAGS) "-DXML_THREAD_LOCAL=__declspec(thread)"
!endif
# The linker and its options.
LD = ilink32.exe
LDFLAGS = -q -U$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
LDFLAGS = $(LDFLAGS) -L"$(BINDIR);$(LIBPREFIX);$(LIB);$(BCB)\lib;$(BCB)\lib\PSdk"
LIBS = import32.lib
!if "$(WITH_THREADS)" != "no" && "$(DYNRUNTIME)" == "1"
LIBS = $(LIBS) cw32mti.lib
!elif "$(WITH_THREADS)" != "no"
LIBS = $(LIBS) cw32mt.lib
!elif "$(DYNRUNTIME)" == "1"
LIBS = $(LIBS) cw32i.lib
!else
LIBS = $(LIBS) cw32.lib
!endif
!if "$(WITH_ICONV)" == "1"
LIBS = $(LIBS) iconvomf.lib
!endif
!if "$(WITH_ZLIB)" == "1"
LIBS = $(LIBS) zlibomf.lib
!endif
!if "$(WITH_THREADS)" == "posix"
LIBS = $(LIBS) pthreadVC.lib
!endif
!if "$(WITH_MODULES)" == "1"
LIBS = $(LIBS) kernel32.lib
!endif
# The archiver and its options.
AR = tlib.exe
ARFLAGS = /P64 /0
# Optimisation and debug symbols.
!if "$(DEBUG)" == "1"
CFLAGS = $(CFLAGS) -D_DEBUG -Od -v
LDFLAGS = $(LDFLAGS) -v
!else
CFLAGS = $(CFLAGS) -DNDEBUG -O2
LDFLAGS = $(LDFLAGS)
!endif
# Libxml object files.
XML_OBJS = $(XML_INTDIR)\buf.obj\
$(XML_INTDIR)\c14n.obj\
$(XML_INTDIR)\catalog.obj\
$(XML_INTDIR)\chvalid.obj\
$(XML_INTDIR)\debugXML.obj\
$(XML_INTDIR)\dict.obj\
$(XML_INTDIR)\encoding.obj\
$(XML_INTDIR)\entities.obj\
$(XML_INTDIR)\error.obj\
$(XML_INTDIR)\globals.obj\
$(XML_INTDIR)\hash.obj\
$(XML_INTDIR)\HTMLparser.obj\
$(XML_INTDIR)\HTMLtree.obj\
$(XML_INTDIR)\list.obj\
$(XML_INTDIR)\nanohttp.obj\
$(XML_INTDIR)\parser.obj\
$(XML_INTDIR)\parserInternals.obj\
$(XML_INTDIR)\pattern.obj\
$(XML_INTDIR)\relaxng.obj\
$(XML_INTDIR)\SAX2.obj\
$(XML_INTDIR)\schematron.obj\
$(XML_INTDIR)\threads.obj\
$(XML_INTDIR)\tree.obj\
$(XML_INTDIR)\uri.obj\
$(XML_INTDIR)\valid.obj\
$(XML_INTDIR)\xinclude.obj\
$(XML_INTDIR)\xlink.obj\
$(XML_INTDIR)\xmlIO.obj\
$(XML_INTDIR)\xmlmemory.obj\
$(XML_INTDIR)\xmlreader.obj\
$(XML_INTDIR)\xmlregexp.obj\
$(XML_INTDIR)\xmlmodule.obj\
$(XML_INTDIR)\xmlsave.obj\
$(XML_INTDIR)\xmlschemas.obj\
$(XML_INTDIR)\xmlschemastypes.obj\
$(XML_INTDIR)\xmlunicode.obj\
$(XML_INTDIR)\xmlwriter.obj\
$(XML_INTDIR)\xpath.obj\
$(XML_INTDIR)\xpointer.obj\
$(XML_INTDIR)\xmlstring.obj
# Static libxml object files.
XML_OBJS_A = $(XML_INTDIR_A)\buf.obj\
$(XML_INTDIR_A)\c14n.obj\
$(XML_INTDIR_A)\catalog.obj\
$(XML_INTDIR_A)\chvalid.obj\
$(XML_INTDIR_A)\debugXML.obj\
$(XML_INTDIR_A)\dict.obj\
$(XML_INTDIR_A)\encoding.obj\
$(XML_INTDIR_A)\entities.obj\
$(XML_INTDIR_A)\error.obj\
$(XML_INTDIR_A)\globals.obj\
$(XML_INTDIR_A)\hash.obj\
$(XML_INTDIR_A)\HTMLparser.obj\
$(XML_INTDIR_A)\HTMLtree.obj\
$(XML_INTDIR_A)\list.obj\
$(XML_INTDIR_A)\nanohttp.obj\
$(XML_INTDIR_A)\parser.obj\
$(XML_INTDIR_A)\parserInternals.obj\
$(XML_INTDIR_A)\pattern.obj\
$(XML_INTDIR_A)\relaxng.obj\
$(XML_INTDIR_A)\SAX2.obj\
$(XML_INTDIR_A)\schematron.obj\
$(XML_INTDIR_A)\threads.obj\
$(XML_INTDIR_A)\tree.obj\
$(XML_INTDIR_A)\uri.obj\
$(XML_INTDIR_A)\valid.obj\
$(XML_INTDIR_A)\xinclude.obj\
$(XML_INTDIR_A)\xlink.obj\
$(XML_INTDIR_A)\xmlIO.obj\
$(XML_INTDIR_A)\xmlmemory.obj\
$(XML_INTDIR_A)\xmlreader.obj\
$(XML_INTDIR_A)\xmlregexp.obj\
$(XML_INTDIR_A)\xmlmodule.obj\
$(XML_INTDIR_A)\xmlsave.obj\
$(XML_INTDIR_A)\xmlschemas.obj\
$(XML_INTDIR_A)\xmlschemastypes.obj\
$(XML_INTDIR_A)\xmlunicode.obj\
$(XML_INTDIR_A)\xmlwriter.obj\
$(XML_INTDIR_A)\xpath.obj\
$(XML_INTDIR_A)\xpointer.obj\
$(XML_INTDIR_A)\xmlstring.obj
# Xmllint and friends executables.
UTILS = $(BINDIR)\xmllint.exe\
$(BINDIR)\xmlcatalog.exe\
$(BINDIR)\testModule.exe\
$(BINDIR)\runtest.exe\
$(BINDIR)\runsuite.exe\
$(BINDIR)\testapi.exe\
$(BINDIR)\testlimits.exe
all : libxml libxmla utils
libxml : $(BINDIR)\$(XML_SO)
libxmla : $(BINDIR)\$(XML_A)
utils : $(UTILS)
clean :
if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
if exist $(BINDIR) rmdir /S /Q $(BINDIR)
distclean : clean
if exist config.* del config.*
if exist Makefile del Makefile
rebuild : clean all
install-libs : all
if not exist "$(INCPREFIX)\libxml2" mkdir "$(INCPREFIX)\libxml2"
if not exist "$(INCPREFIX)\libxml2\libxml" mkdir "$(INCPREFIX)\libxml2\libxml"
if not exist "$(BINPREFIX)" mkdir "$(BINPREFIX)"
if not exist "$(LIBPREFIX)" mkdir "$(LIBPREFIX)"
copy $(XML_SRCDIR)\include\libxml\*.h "$(INCPREFIX)\libxml2\libxml"
copy $(BINDIR)\$(XML_SO) "$(SOPREFIX)"
copy $(BINDIR)\$(XML_A) "$(LIBPREFIX)"
copy $(BINDIR)\$(XML_IMP) "$(LIBPREFIX)"
copy $(BINDIR)\*.exe "$(BINPREFIX)"
install : install-libs
copy $(BINDIR)\*.exe "$(BINPREFIX)"
install-dist : install-libs
copy $(BINDIR)\xml*.exe "$(BINPREFIX)"
# 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
$(MAKE) /nologo PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)\bin install-dist
cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
# Makes the output directory.
$(BINDIR)\$(DUMMY) :
if not exist $(BINDIR) mkdir $(BINDIR)
touch $(BINDIR)\$(DUMMY)
# Makes the libxml intermediate directory.
$(XML_INTDIR)\$(DUMMY) :
if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
touch $(XML_INTDIR)\$(DUMMY)
# Makes the static libxml intermediate directory.
$(XML_INTDIR_A)\$(DUMMY) :
if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
touch $(XML_INTDIR_A)\$(DUMMY)
# An implicit rule for libxml compilation.
{$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj:
$(CC) $(CFLAGS) -n$(XML_INTDIR) -c $<
# An implicit rule for static libxml compilation.
{$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj:
$(CC) $(CFLAGS) -DLIBXML_STATIC -n$(XML_INTDIR_A)\ -c $<
# Compiles libxml source. Uses the implicit rule for commands.
$(XML_OBJS) : $(XML_INTDIR)\$(DUMMY)
# Compiles static libxml source. Uses the implicit rule for commands.
$(XML_OBJS_A) : $(XML_INTDIR_A)\$(DUMMY)
#def4bcb.exe : def4bcb.c
# Creates the libxml shared object.
$(BINDIR)\$(XML_SO) : $(BINDIR)\$(DUMMY) $(XML_OBJS)
$(LD) $(LDFLAGS) -Tpd -Gi c0d32.obj $(XML_OBJS),$(BINDIR)\$(XML_SO),,$(LIBS)
#$(BINDIR)\$(XML_SO) : $(BINDIR)\$(DUMMY) $(XML_OBJS)
# $(LD) $(LDFLAGS) -Tpd -Gi c0d32.obj $(XML_OBJS),$(BINDIR)\$(XML_SO),,$(LIBS)
# Creates the libxml archive.
$(BINDIR)\$(XML_A) : $(BINDIR)\$(DUMMY) $(XML_OBJS_A)
$(AR) $(BINDIR)\$(XML_A) $(ARFLAGS) /u $(XML_OBJS_A)
# Makes the utils intermediate directory.
$(UTILS_INTDIR)\$(DUMMY) :
if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
touch $(UTILS_INTDIR)\$(DUMMY)
# An implicit rule for xmllint and friends.
!if "$(STATIC)" == "1"
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) -DLIBXML_STATIC -w -tWC $(CFLAGS) -o$(UTILS_INTDIR)\$&.obj -c $<
$(LD) $(LDFLAGS) c0x32.obj $(UTILS_INTDIR)\$&.obj,$@,,$(LIBS) $(XML_A)
!else
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) $(CFLAGS) -tWC -o$(UTILS_INTDIR)\$&.obj -c $<
$(LD) $(LDFLAGS) c0x32.obj $(UTILS_INTDIR)\$&.obj $(XML_IMP),$@,,$(LIBS)
!endif
# Builds xmllint and friends. Uses the implicit rule for commands.
$(UTILS) : $(UTILS_INTDIR)\$(DUMMY) $(BINDIR)\$(DUMMY) $(BINDIR)\$(XML_SO) $(BINDIR)\$(XML_A)
# Source dependences should be autogenerated somehow here, but how to
# do it? I have no clue.

View File

@@ -1,294 +0,0 @@
# 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.
#
# November 2002, Igor Zlatkovic <igor@zlatkovic.com>
# There should never be a need to modify anything below this line.
# ----------------------------------------------------------------
AUTOCONF = .\config.mingw
include $(AUTOCONF)
# 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
# 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
# The preprocessor and its options.
CPP = gcc.exe -E
CPPFLAGS += -I$(XML_SRCDIR)/include -DNOLIBTOOL
# The compiler and its options.
CC = gcc.exe
CFLAGS += -D_WINDOWS -D_MBCS -DNOLIBTOOL
CFLAGS += -I$(XML_SRCDIR) -I$(XML_SRCDIR)/include -I$(INCPREFIX) $(INCLUDE)
ifeq ($(WITH_THREADS),ctls)
CFLAGS += "-DXML_THREAD_LOCAL=__declspec(thread)"
endif
# 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)
LIBS =
ifeq ($(WITH_ICONV),1)
LIBS += -liconv
endif
ifeq ($(WITH_ZLIB),1)
# Could be named differently
# LIBS += -lzdll
LIBS += -lz
endif
ifeq ($(WITH_THREADS),posix)
LIBS += -lpthreadGC
endif
ifeq ($(WITH_MODULES),1)
LIBS += -lkernel32
endif
LIBS += $(LIB)
# The archiver and its options.
AR = ar.exe
ARFLAGS = -r
# Optimisation and debug symbols.
ifeq ($(DEBUG),1)
CFLAGS += -D_DEBUG -g
LDFLAGS +=
else
CFLAGS += -DNDEBUG -O2
LDFLAGS +=
endif
# Libxml object files.
XML_OBJS = $(XML_INTDIR)/buf.o\
$(XML_INTDIR)/c14n.o\
$(XML_INTDIR)/catalog.o\
$(XML_INTDIR)/chvalid.o\
$(XML_INTDIR)/debugXML.o\
$(XML_INTDIR)/dict.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\
$(XML_INTDIR)/legacy.o\
$(XML_INTDIR)/list.o\
$(XML_INTDIR)/nanohttp.o\
$(XML_INTDIR)/parser.o\
$(XML_INTDIR)/parserInternals.o\
$(XML_INTDIR)/pattern.o\
$(XML_INTDIR)/relaxng.o\
$(XML_INTDIR)/SAX.o\
$(XML_INTDIR)/SAX2.o\
$(XML_INTDIR)/schematron.o\
$(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\
$(XML_INTDIR)/xmlreader.o\
$(XML_INTDIR)/xmlregexp.o\
$(XML_INTDIR)/xmlmodule.o\
$(XML_INTDIR)/xmlsave.o\
$(XML_INTDIR)/xmlschemas.o\
$(XML_INTDIR)/xmlschemastypes.o\
$(XML_INTDIR)/xmlunicode.o\
$(XML_INTDIR)/xmlwriter.o\
$(XML_INTDIR)/xpath.o\
$(XML_INTDIR)/xpointer.o\
$(XML_INTDIR)/xmlstring.o
XML_SRCS = $(subst .o,.c,$(subst $(XML_INTDIR)/,$(XML_SRCDIR)/,$(XML_OBJS)))
# Static libxml object files.
XML_OBJS_A = $(XML_INTDIR_A)/buf.o\
$(XML_INTDIR_A)/c14n.o\
$(XML_INTDIR_A)/catalog.o\
$(XML_INTDIR_A)/chvalid.o\
$(XML_INTDIR_A)/debugXML.o\
$(XML_INTDIR_A)/dict.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\
$(XML_INTDIR_A)/legacy.o\
$(XML_INTDIR_A)/list.o\
$(XML_INTDIR_A)/nanohttp.o\
$(XML_INTDIR_A)/parser.o\
$(XML_INTDIR_A)/parserInternals.o\
$(XML_INTDIR_A)/pattern.o\
$(XML_INTDIR_A)/relaxng.o\
$(XML_INTDIR_A)/SAX.o\
$(XML_INTDIR_A)/SAX2.o\
$(XML_INTDIR_A)/schematron.o\
$(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\
$(XML_INTDIR_A)/xmlreader.o\
$(XML_INTDIR_A)/xmlregexp.o\
$(XML_INTDIR_A)/xmlmodule.o\
$(XML_INTDIR_A)/xmlsave.o\
$(XML_INTDIR_A)/xmlschemas.o\
$(XML_INTDIR_A)/xmlschemastypes.o\
$(XML_INTDIR_A)/xmlunicode.o\
$(XML_INTDIR_A)/xmlwriter.o\
$(XML_INTDIR_A)/xpath.o\
$(XML_INTDIR_A)/xpointer.o\
$(XML_INTDIR_A)/xmlstring.o
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)/testModule.exe\
$(BINDIR)/runtest.exe\
$(BINDIR)/runsuite.exe\
$(BINDIR)/testapi.exe\
$(BINDIR)/testlimits.exe
all : dep libxml libxmla utils
libxml : $(BINDIR)/$(XML_SO)
libxmla : $(BINDIR)/$(XML_A)
utils : $(UTILS)
clean :
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"
distclean : clean
cmd.exe /C "if exist config.* del config.*"
cmd.exe /C "if exist Makefile del Makefile"
rebuild : clean all
install-libs : all
cmd.exe /C "if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2"
cmd.exe /C "if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml"
cmd.exe /C "if not exist $(BINPREFIX) mkdir $(BINPREFIX)"
cmd.exe /C "if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)"
cmd.exe /C "copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml"
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)"
install : install-libs
cmd.exe /C "copy $(BINDIR)\*.exe $(BINPREFIX)"
install-dist : install-libs
cmd.exe /C "copy $(BINDIR)\xml*.exe $(BINPREFIX)"
# 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
$(MAKE) PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)/bin install-dist
cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
# Creates the dependency file
dep :
$(CC) $(CFLAGS) -M $(XML_SRCS) > depends.mingw
# Makes the output directory.
$(BINDIR) :
cmd.exe /C if not exist $(BINDIR) mkdir $(BINDIR)
# Makes the libxml intermediate directory.
$(XML_INTDIR) :
cmd.exe /C if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
# Makes the static libxml intermediate directory.
$(XML_INTDIR_A) :
cmd.exe /C if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
# 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) :
cmd.exe /C if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
# An implicit rule for xmllint and friends.
ifeq ($(STATIC),1)
$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
$(CC) -DLIBXML_STATIC $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
$(LD) $(LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -l$(XML_BASENAME) $(LIBS)
else
$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
$(LD) $(LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -l$(XML_BASENAME) $(LIBS)
endif
# Builds xmllint and friends. Uses the implicit rule for commands.
$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla
# Source dependencies
#-include depends.mingw

View File

@@ -1,386 +0,0 @@
# Makefile for libxml2, specific for Windows, MSVC and NMAKE.
#
# 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.
#
# March 2002, Igor Zlatkovic <igor@zlatkovic.com>
# There should never be a need to modify anything below this line.
# ----------------------------------------------------------------
AUTOCONF = .\config.msvc
!include $(AUTOCONF)
# Names of various input and output components.
XML_NAME = xml2
XML_BASENAME = lib$(XML_NAME)
XML_SO = $(XML_BASENAME).dll
XML_RES = $(XML_BASENAME).res
XML_IMP = $(XML_BASENAME).lib
XML_A = $(XML_BASENAME)_a.lib
XML_A_DLL = $(XML_BASENAME)_a_dll.lib
# Place where we let the compiler put its output.
BINDIR = bin.msvc
XML_INTDIR = int.msvc
XML_INTDIR_A = int.a.msvc
XML_INTDIR_A_DLL = int.a.dll.msvc
UTILS_INTDIR = int.utils.msvc
# The preprocessor and its options.
CPP = cl.exe /EP
CPPFLAGS = /nologo /I$(XML_SRCDIR)\include /D "NOLIBTOOL"
# The compiler and its options.
CC = cl.exe
CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(CRUNTIME)
CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
!if "$(WITH_THREADS)" == "ctls"
CFLAGS = $(CFLAGS) /D "XML_THREAD_LOCAL=__declspec(thread)"
!endif
CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
# The linker and its options.
LD = link.exe
LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
LIBS =
!if "$(WITH_ICONV)" == "1"
LIBS = $(LIBS) iconv.lib
!endif
!if "$(WITH_ICU)" == "1"
!if "$(STATIC)" == "1"
LIBS = $(LIBS) advapi32.lib sicuuc.lib sicuin.lib sicudt.lib
!else
LIBS = $(LIBS) icuuc.lib icuin.lib icudt.lib
!endif
!endif
!if "$(WITH_ZLIB)" == "1"
# could be named differently zdll or zlib
# LIBS = $(LIBS) zdll.lib
LIBS = $(LIBS) zlib.lib
!endif
!if "$(WITH_THREADS)" == "posix"
LIBS = $(LIBS) pthreadVC.lib
!endif
!if "$(WITH_MODULES)" == "1"
LIBS = $(LIBS) kernel32.lib
!endif
LIBS = $(LIBS) Bcrypt.lib
# The archiver and its options.
AR = lib.exe
ARFLAGS = /nologo
# Optimisation and debug symbols.
!if "$(DEBUG)" == "1"
CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
LDFLAGS = $(LDFLAGS) /DEBUG
!else
CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
# commented out as this break VC10 c.f. 634846
# LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
LDFLAGS = $(LDFLAGS)
!endif
# append CFLAGS etc. passed on command line
CPPFLAGS = $(CPPFLAGS) $(EXTRA_CPPFLAGS)
CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
LDFLAGS = $(LDFLAGS) $(EXTRA_LDFLAGS)
# Libxml object files.
XML_OBJS = $(XML_INTDIR)\buf.obj\
$(XML_INTDIR)\c14n.obj\
$(XML_INTDIR)\catalog.obj\
$(XML_INTDIR)\chvalid.obj\
$(XML_INTDIR)\debugXML.obj\
$(XML_INTDIR)\dict.obj\
$(XML_INTDIR)\encoding.obj\
$(XML_INTDIR)\entities.obj\
$(XML_INTDIR)\error.obj\
$(XML_INTDIR)\globals.obj\
$(XML_INTDIR)\hash.obj\
$(XML_INTDIR)\HTMLparser.obj\
$(XML_INTDIR)\HTMLtree.obj\
$(XML_INTDIR)\list.obj\
$(XML_INTDIR)\nanohttp.obj\
$(XML_INTDIR)\parser.obj\
$(XML_INTDIR)\parserInternals.obj\
$(XML_INTDIR)\pattern.obj\
$(XML_INTDIR)\relaxng.obj\
$(XML_INTDIR)\SAX2.obj\
$(XML_INTDIR)\schematron.obj\
$(XML_INTDIR)\threads.obj\
$(XML_INTDIR)\tree.obj\
$(XML_INTDIR)\uri.obj\
$(XML_INTDIR)\valid.obj\
$(XML_INTDIR)\xinclude.obj\
$(XML_INTDIR)\xlink.obj\
$(XML_INTDIR)\xmlIO.obj\
$(XML_INTDIR)\xmlmemory.obj\
$(XML_INTDIR)\xmlreader.obj\
$(XML_INTDIR)\xmlregexp.obj\
$(XML_INTDIR)\xmlmodule.obj\
$(XML_INTDIR)\xmlsave.obj\
$(XML_INTDIR)\xmlschemas.obj\
$(XML_INTDIR)\xmlschemastypes.obj\
$(XML_INTDIR)\xmlunicode.obj\
$(XML_INTDIR)\xmlwriter.obj\
$(XML_INTDIR)\xpath.obj\
$(XML_INTDIR)\xpointer.obj\
$(XML_INTDIR)\xmlstring.obj
# Static libxml object files.
XML_OBJS_A = $(XML_INTDIR_A)\buf.obj\
$(XML_INTDIR_A)\c14n.obj\
$(XML_INTDIR_A)\catalog.obj\
$(XML_INTDIR_A)\chvalid.obj\
$(XML_INTDIR_A)\debugXML.obj\
$(XML_INTDIR_A)\dict.obj\
$(XML_INTDIR_A)\encoding.obj\
$(XML_INTDIR_A)\entities.obj\
$(XML_INTDIR_A)\error.obj\
$(XML_INTDIR_A)\globals.obj\
$(XML_INTDIR_A)\hash.obj\
$(XML_INTDIR_A)\HTMLparser.obj\
$(XML_INTDIR_A)\HTMLtree.obj\
$(XML_INTDIR_A)\list.obj\
$(XML_INTDIR_A)\nanohttp.obj\
$(XML_INTDIR_A)\parser.obj\
$(XML_INTDIR_A)\parserInternals.obj\
$(XML_INTDIR_A)\pattern.obj\
$(XML_INTDIR_A)\relaxng.obj\
$(XML_INTDIR_A)\SAX2.obj\
$(XML_INTDIR_A)\schematron.obj\
$(XML_INTDIR_A)\threads.obj\
$(XML_INTDIR_A)\tree.obj\
$(XML_INTDIR_A)\uri.obj\
$(XML_INTDIR_A)\valid.obj\
$(XML_INTDIR_A)\xinclude.obj\
$(XML_INTDIR_A)\xlink.obj\
$(XML_INTDIR_A)\xmlIO.obj\
$(XML_INTDIR_A)\xmlmemory.obj\
$(XML_INTDIR_A)\xmlreader.obj\
$(XML_INTDIR_A)\xmlregexp.obj\
$(XML_INTDIR_A)\xmlmodule.obj\
$(XML_INTDIR_A)\xmlsave.obj\
$(XML_INTDIR_A)\xmlschemas.obj\
$(XML_INTDIR_A)\xmlschemastypes.obj\
$(XML_INTDIR_A)\xmlunicode.obj\
$(XML_INTDIR_A)\xmlwriter.obj\
$(XML_INTDIR_A)\xpath.obj\
$(XML_INTDIR_A)\xpointer.obj\
$(XML_INTDIR_A)\xmlstring.obj
# Static libxml object files.
XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\buf.obj\
$(XML_INTDIR_A_DLL)\c14n.obj\
$(XML_INTDIR_A_DLL)\catalog.obj\
$(XML_INTDIR_A_DLL)\chvalid.obj\
$(XML_INTDIR_A_DLL)\debugXML.obj\
$(XML_INTDIR_A_DLL)\dict.obj\
$(XML_INTDIR_A_DLL)\encoding.obj\
$(XML_INTDIR_A_DLL)\entities.obj\
$(XML_INTDIR_A_DLL)\error.obj\
$(XML_INTDIR_A_DLL)\globals.obj\
$(XML_INTDIR_A_DLL)\hash.obj\
$(XML_INTDIR_A_DLL)\HTMLparser.obj\
$(XML_INTDIR_A_DLL)\HTMLtree.obj\
$(XML_INTDIR_A_DLL)\list.obj\
$(XML_INTDIR_A_DLL)\nanohttp.obj\
$(XML_INTDIR_A_DLL)\parser.obj\
$(XML_INTDIR_A_DLL)\parserInternals.obj\
$(XML_INTDIR_A_DLL)\pattern.obj\
$(XML_INTDIR_A_DLL)\relaxng.obj\
$(XML_INTDIR_A_DLL)\SAX2.obj\
$(XML_INTDIR_A_DLL)\schematron.obj\
$(XML_INTDIR_A_DLL)\threads.obj\
$(XML_INTDIR_A_DLL)\tree.obj\
$(XML_INTDIR_A_DLL)\uri.obj\
$(XML_INTDIR_A_DLL)\valid.obj\
$(XML_INTDIR_A_DLL)\xinclude.obj\
$(XML_INTDIR_A_DLL)\xlink.obj\
$(XML_INTDIR_A_DLL)\xmlIO.obj\
$(XML_INTDIR_A_DLL)\xmlmemory.obj\
$(XML_INTDIR_A_DLL)\xmlreader.obj\
$(XML_INTDIR_A_DLL)\xmlregexp.obj\
$(XML_INTDIR_A_DLL)\xmlmodule.obj\
$(XML_INTDIR_A_DLL)\xmlsave.obj\
$(XML_INTDIR_A_DLL)\xmlschemas.obj\
$(XML_INTDIR_A_DLL)\xmlschemastypes.obj\
$(XML_INTDIR_A_DLL)\xmlunicode.obj\
$(XML_INTDIR_A_DLL)\xmlwriter.obj\
$(XML_INTDIR_A_DLL)\xpath.obj\
$(XML_INTDIR_A_DLL)\xpointer.obj\
$(XML_INTDIR_A_DLL)\xmlstring.obj
# Xmllint and friends executables.
UTILS = $(BINDIR)\xmllint.exe\
$(BINDIR)\xmlcatalog.exe\
$(BINDIR)\testModule.exe\
$(BINDIR)\runtest.exe\
$(BINDIR)\runsuite.exe\
$(BINDIR)\runxmlconf.exe\
$(BINDIR)\testapi.exe\
$(BINDIR)\testchar.exe\
$(BINDIR)\testdict.exe\
$(BINDIR)\testlimits.exe\
$(BINDIR)\testrecurse.exe
!if "$(VCMANIFEST)" == "1"
_VC_MANIFEST_EMBED_EXE= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
_VC_MANIFEST_EMBED_DLL= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
!else
_VC_MANIFEST_EMBED_EXE=
_VC_MANIFEST_EMBED_DLL=
!endif
all : libxml libxmla libxmladll utils
libxml : $(BINDIR)\$(XML_SO)
libxmla : $(BINDIR)\$(XML_A)
libxmladll : $(BINDIR)\$(XML_A_DLL)
utils : $(UTILS)
clean :
if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
if exist $(XML_INTDIR_A_DLL) rmdir /S /Q $(XML_INTDIR_A_DLL)
if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
if exist $(BINDIR) rmdir /S /Q $(BINDIR)
distclean : clean
if exist config.* del config.*
if exist Makefile del Makefile
rebuild : clean all
install-libs : all
if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2
if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml
if not exist $(BINPREFIX) mkdir $(BINPREFIX)
if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)
if not exist $(SOPREFIX) mkdir $(SOPREFIX)
copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml
copy $(BINDIR)\$(XML_SO) $(SOPREFIX)
copy $(BINDIR)\$(XML_A) $(LIBPREFIX)
copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX)
copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)
install : install-libs
copy $(BINDIR)\*.exe $(BINPREFIX)
-copy $(BINDIR)\*.pdb $(BINPREFIX)
install-dist : install-libs
copy $(BINDIR)\xml*.exe $(BINPREFIX)
-copy $(BINDIR)\xml*.pdb $(BINPREFIX)
# 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
$(MAKE) /nologo PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)\bin install-dist
cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
# Makes the output directory.
$(BINDIR) :
if not exist $(BINDIR) mkdir $(BINDIR)
# Makes the libxml intermediate directory.
$(XML_INTDIR) :
if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
# Makes the static libxml intermediate directory.
$(XML_INTDIR_A) :
if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
# Makes the static for dll libxml intermediate directory.
$(XML_INTDIR_A_DLL) :
if not exist $(XML_INTDIR_A_DLL) mkdir $(XML_INTDIR_A_DLL)
# An implicit rule for libxml compilation.
{$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj::
$(CC) $(CFLAGS) /Fo$(XML_INTDIR)\ /c $<
# An implicit rule for static libxml compilation.
{$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj::
$(CC) $(CFLAGS) /D "LIBXML_STATIC" /Fo$(XML_INTDIR_A)\ /c $<
# An implicit rule for static for dll libxml compilation.
{$(XML_SRCDIR)}.c{$(XML_INTDIR_A_DLL)}.obj::
$(CC) $(CFLAGS) /D "LIBXML_STATIC" /D "LIBXML_STATIC_FOR_DLL" /Fo$(XML_INTDIR_A_DLL)\ /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)
# Compiles static for dll libxml source. Uses the implicit rule for commands.
$(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL)
$(XML_INTDIR)\$(XML_RES) : $(XML_INTDIR) libxml2.rc
rc -Fo $(XML_INTDIR)\$(XML_RES) libxml2.rc
# Creates the libxml shared object.
$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_RES)
$(LD) $(LDFLAGS) /DLL \
/IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(XML_INTDIR)\$(XML_RES) $(LIBS)
@$(_VC_MANIFEST_EMBED_DLL)
# Creates the libxml archive.
$(BINDIR)\$(XML_A) : $(BINDIR) $(XML_OBJS_A)
$(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A) $(XML_OBJS_A)
# Creates the libxml static for dll archive.
$(BINDIR)\$(XML_A_DLL) : $(BINDIR) $(XML_OBJS_A_DLL)
$(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A_DLL) $(XML_OBJS_A_DLL)
# Makes the utils intermediate directory.
$(UTILS_INTDIR) :
if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
# An implicit rule for xmllint and friends.
!if "$(STATIC)" == "1"
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) /D "LIBXML_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
$(LD) $(LDFLAGS) /OUT:$@ $(XML_A) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
@$(_VC_MANIFEST_EMBED_EXE)
!else
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
$(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
@$(_VC_MANIFEST_EMBED_EXE)
!endif
# Builds xmllint and friends. Uses the implicit rule for commands.
$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll
# Source dependences should be autogenerated somehow here, but how to
# do it? I have no clue.
# TESTS
tests : checktests XPathtests
checktests : $(UTILS)
cd .. && win32\$(BINDIR)\runtest.exe
cd .. && win32\$(BINDIR)\testrecurse.exe
cd .. && win32\$(BINDIR)\testapi.exe
cd .. && win32\$(BINDIR)\testchar.exe
cd .. && win32\$(BINDIR)\testdict.exe
cd .. && win32\$(BINDIR)\runxmlconf.exe

View File

@@ -1,229 +0,0 @@
Windows port
============
DEPRECATION WARNING: The build system in the win32 directory is deprecated
and will be removed in a future release. Please switch to CMake.
This directory contains the files required to build this software on the
native Windows platform. This is not a place to look for help if you are
using a POSIX emulator, such as Cygwin. Check the Unix instructions for
that.
CONTENTS
========
1. General
1.1 Building From the Command-Line
1.2 Configuring The Source
1.3 Compiling
1.4 Installing
2. Compiler Specifics
2.1 Microsoft Visual C/C++
2.1 GNU C/C++, Mingw Edition
2.2 Borland C++ Builder
2.2.1 Building with iconv support
2.2.2 Compatibility problems with MSVC (and probably CYGWIN)
2.2.3 Other caveats
1. General
==========
1.1 Building From The Command-Line
----------------------------------
This is the easiest, preferred and currently supported method. It can
be that a subdirectory of the directory where this file resides
contains project files for some IDE. If you want to use that, please
refer to the readme file within that subdirectory.
In order to build from the command-line you need to make sure that
your compiler works from the command line. This is not always the
case, often the required environment variables are missing. If you are
not sure, test if this works first. If it doesn't, you will first have
to configure your compiler suite to run from the command-line - please
refer to your compiler's documentation regarding that.
The first thing you want to do is configure the source. You can have
the configuration script do this automatically for you. The
configuration script is written in JScript, a Microsoft's
implementation of the ECMA scripting language. Almost every Windows
machine can execute this through the Windows Scripting Host. If your
system lacks the ability to execute JScript for some reason, you must
perform the configuration manually and you are on your own with that.
The second step is compiling the source and, optionally, installing it
to the location of your choosing.
1.2 Configuring The Source
--------------------------
The configuration script accepts numerous options. Some of these
affect features which will be available in the compiled software,
others affect the way the software is built and installed. To see a
full list of options supported by the configuration script, run
cscript configure.js help
from the win32 subdirectory. The configuration script will present you
the options it accepts and give a biref explanation of these. In every
case you will have two sets of options. The first set is specific to
the software you are building and the second one is specific to the
Windows port.
Once you have decided which options suit you, run the script with that
options. Here is an example:
cscript configure.js compiler=msvc prefix=c:\opt
include=c:\opt\include lib=c:\opt\lib debug=yes
The previous example will configure the process to use the Microsoft's
compiler, install the library in c:\opt, use c:\opt\include and
c:\opt\lib as additional search paths for the compiler and the linker
and build executables with debug symbols.
Note: Please do not use path names which contain spaces. This will
fail. Allowing this would require me to put almost everything in the
Makefile in quotas and that looks quite ugly with my
syntax-highlighting engine. If you absolutely must use spaces in paths
send me an email and tell me why. If there are enough of you out there
who need this, or if a single one has a very good reason, I will
modify the Makefile to allow spaces in paths.
1.3 Compiling
-------------
After the configuration stage has been completed, you want to build
the software. You will have to use the make tool which comes with
your compiler. If you, for example, configured the source to build
with Microsoft's MSVC compiler, you would use the NMAKE utility. If
you configured it to build with GNU C compiler, mingw edition, you
would use the GNU make. Assuming you use MSVC, type
nmake /f Makefile.msvc
and if you use MinGW, you would type
make -f Makefile.mingw
and if you use Borland's compiler, you would type
bmake -f Makefile.bcb
in the win32 subdirectory. When the building completes, you will find
the executable files in win32\bin.* directory, where * stands for the
name of the compiler you have used.
1.4 Installing
--------------
You can install the software into the directory you specified to the
configure script during the configure stage by typing (with MSVC in
this example)
nmake /f Makefile.msvc install
That would be it, enjoy.
2. Compiler Specifics
=====================
2.1 Microsoft Visual C/C++
--------------------------
If you use the compiler which comes with Visual Studio .NET, note that
it will link to its own C-runtime named msvcr70.dll or msvcr71.dll. This
file is not available on any machine which doesn't have Visual Studio
.NET installed.
2.2 GNU C/C++, Mingw edition
----------------------------
When specifying paths to configure.js, please use slashes instead of
backslashes for directory separation. Sometimes Mingw needs this. If
this is the case, and you specify backslashes, then the compiler will
complain about not finding necessary header files.
2.2 Borland C++ Builder
-----------------------
To compile libxml2 with the BCB6 compiler and associated tools, just follow
the basic instructions found in this file file. Be sure to specify
the "compiler=bcb" option when running the configure script. To compile the
library and test programs, just type
make -fMakefile.bcb
That should be all that's required. But there are a few other things to note:
2.2.1 Building with iconv support
If you configure libxml2 to include iconv support, you will obviously need to
obtain the iconv library and include files. To get them, just follow the links
at http://www.gnu.org/software/libiconv/ - there are pre-compiled Win32
versions available, but note that these where built with MSVC. Hence the
supplied import library is in COFF format rather than OMF format. You can
convert this library by using Borland's COFF2OMF utility, or use IMPLIB to
build a new import library from the DLL. Alternatively, it is possible to
obtain the iconv source, and build the DLL using the Borland compiler.
There is a minor problem with the header files for iconv - they expect a
macro named "EILSEQ" in errno.h, but this is not defined in the Borland
headers, and its absence can cause problems. To circumvent this problem, I
define EILSEQ=2 in Makefile.bcb. The value "2" is the value for ENOFILE (file
not found). This should not have any disastrous side effects beyond possibly
displaying a misleading error message in certain situations.
2.2.2 Compatibility problems with MSVC (and probably CYGWIN)
A libxml2 DLL generated by BCB is callable from MSVC programs, but there is a
minor problem with the names of the symbols exported from the library. The
Borland compiler, by default, prepends an underscore character to global
identifiers (functions and global variables) when generating object files.
Hence the function "xmlAddChild" is added to the DLL with the name
"_xmlAddChild". The MSVC compiler does not have this behaviour, and looks for
the unadorned name. I currently circumvent this problem by writing a .def file
which causes BOTH the adorned and unadorned names to be exported from the DLL.
This behaviour may not be supported in the future.
An even worse problem is that of generating an import library for the DLL. The
Borland-generated DLL is in OMF format. MSVC expects libraries in COFF format,
but they don't provide a "OMF2COFF" utility, or even the equivalent of
Borland's IMPLIB utility. But it is possible to create an import lib from the
.def file, using the command:
LIB /DEF:libxml2.def
If you don't have the .def file, it's possible to create one manually. Use
DUMPBIN /EXPORTS /OUT:libxml2.tmp libxml2.dll to get a list of the exported
names, and edit this into .def file format.
A similar problem is likely with Cygwin.
2.2.3 Other caveats
We have tested this only with BCB6, Professional Edition, and BCB 5.5 free
command-line tools.
Authors: Igor Zlatkovic <igor@zlatkovic.com>
Eric Zurcher <Eric.Zurcher@csiro.au>

View File

@@ -1,668 +0,0 @@
/* Configure script for libxml, specific for Windows with Scripting Host.
*
* This script will configure the libxml build process and create necessary files.
* Run it with an 'help', or an invalid option and it will tell you what options
* it accepts.
*
* March 2002, Igor Zlatkovic <igor@zlatkovic.com>
*/
/* The source directory, relative to the one where this file resides. */
var srcDirXml = "..";
var srcDirUtils = "..";
/* Base name of what we are building. */
var baseName = "libxml2";
/* Configure file which contains the version and the output file where
we can store our build configuration. */
var libxmlVersionFile = srcDirXml + "\\VERSION";
var versionFile = ".\\config.msvc";
/* Input and output files regarding the libxml features. */
var optsFileIn = srcDirXml + "\\include\\libxml\\xmlversion.h.in";
var optsFile = srcDirXml + "\\include\\libxml\\xmlversion.h";
/* Version strings for the binary distribution. Will be filled later
in the code. */
var verMajor;
var verMinor;
var verMicro;
var verMicroSuffix;
var verCvs;
var useCvsVer = true;
/* Libxml features. */
var withThreads = "native";
var withHttp = true;
var withHtml = true;
var withC14n = true;
var withCatalog = true;
var withXpath = true;
var withXptr = true;
var withXinclude = true;
var withIconv = true;
var withIcu = false;
var withIso8859x = false;
var withZlib = false;
var withDebug = true;
var withSchemas = true;
var withSchematron = true;
var withRegExps = true;
var withRelaxNg = true;
var withModules = true;
var withTree = true;
var withReader = true;
var withWriter = true;
var withWalker = true;
var withPattern = true;
var withPush = true;
var withValid = true;
var withSax1 = true;
var withLegacy = true;
var withOutput = true;
var withPython = false;
/* Win32 build options. */
var dirSep = "\\";
var compiler = "msvc";
var cruntime = "/MD";
var dynruntime = true;
var vcmanifest = false;
var buildDebug = 0;
var buildStatic = 0;
var buildPrefix = ".";
var buildBinPrefix = "";
var buildIncPrefix = "";
var buildLibPrefix = "";
var buildSoPrefix = "";
var buildInclude = ".";
var buildLib = ".";
/* Local stuff */
var error = 0;
/* Helper function, transforms the option variable into the 'Enabled'
or 'Disabled' string. */
function boolToStr(opt)
{
if (opt == false)
return "no";
else if (opt == true)
return "yes";
error = 1;
return "*** undefined ***";
}
/* Helper function, transforms the argument string into a boolean
value. */
function strToBool(opt)
{
if (opt == 0 || opt == "no")
return false;
else if (opt == 1 || opt == "yes")
return true;
error = 1;
return false;
}
/* Displays the details about how to use this script. */
function usage()
{
var txt;
txt = "Usage:\n";
txt += " cscript " + WScript.ScriptName + " <options>\n";
txt += " cscript " + WScript.ScriptName + " help\n\n";
txt += "Options can be specified in the form <option>=<value>, where the value is\n";
txt += "either 'yes' or 'no', if not stated otherwise.\n\n";
txt += "\nXML processor options, default value given in parentheses:\n\n";
txt += " threads: Enable thread safety [no|ctls|native|posix] (" + (withThreads) + ") \n";
txt += " http: Enable HTTP client (" + (withHttp? "yes" : "no") + ")\n";
txt += " html: Enable HTML processor (" + (withHtml? "yes" : "no") + ")\n";
txt += " c14n: Enable C14N support (" + (withC14n? "yes" : "no") + ")\n";
txt += " catalog: Enable catalog support (" + (withCatalog? "yes" : "no") + ")\n";
txt += " xpath: Enable XPath support (" + (withXpath? "yes" : "no") + ")\n";
txt += " xptr: Enable XPointer support (" + (withXptr? "yes" : "no") + ")\n";
txt += " xinclude: Enable XInclude support (" + (withXinclude? "yes" : "no") + ")\n";
txt += " iconv: Enable iconv support (" + (withIconv? "yes" : "no") + ")\n";
txt += " icu: Enable icu support (" + (withIcu? "yes" : "no") + ")\n";
txt += " iso8859x: Enable ISO8859X support (" + (withIso8859x? "yes" : "no") + ")\n";
txt += " zlib: Enable zlib support (" + (withZlib? "yes" : "no") + ")\n";
txt += " xml_debug: Enable XML debbugging module (" + (withDebug? "yes" : "no") + ")\n";
txt += " regexps: Enable regular expressions (" + (withRegExps? "yes" : "no") + ")\n";
txt += " relaxng: Enable RELAX NG support (" + (withRelaxNg ? "yes" : "no") + ")\n";
txt += " modules: Enable module support (" + (withModules? "yes" : "no") + ")\n";
txt += " tree: Enable tree api (" + (withTree? "yes" : "no") + ")\n";
txt += " reader: Enable xmlReader api (" + (withReader? "yes" : "no") + ")\n";
txt += " writer: Enable xmlWriter api (" + (withWriter? "yes" : "no") + ")\n";
txt += " walker: Enable xmlDocWalker api (" + (withWalker? "yes" : "no") + ")\n";
txt += " pattern: Enable xmlPattern api (" + (withPattern? "yes" : "no") + ")\n";
txt += " push: Enable push api (" + (withPush? "yes" : "no") + ")\n";
txt += " valid: Enable DTD validation support (" + (withValid? "yes" : "no") + ")\n";
txt += " sax1: Enable SAX1 api (" + (withSax1? "yes" : "no") + ")\n";
txt += " legacy: Enable Deprecated api's (" + (withLegacy? "yes" : "no") + ")\n";
txt += " output: Enable serialization support (" + (withOutput? "yes" : "no") + ")\n";
txt += " schemas: Enable XML Schema support (" + (withSchemas? "yes" : "no") + ")\n";
txt += " schematron: Enable Schematron support (" + (withSchematron? "yes" : "no") + ")\n";
txt += " python: Build Python bindings (" + (withPython? "yes" : "no") + ")\n";
txt += "\nWin32 build options, default value given in parentheses:\n\n";
txt += " compiler: Compiler to be used [msvc|mingw|bcb] (" + compiler + ")\n";
txt += " cruntime: C-runtime compiler option (only msvc) (" + cruntime + ")\n";
txt += " dynruntime: Use the dynamic RTL (only bcb) (" + dynruntime + ")\n";
txt += " vcmanifest: Embed VC manifest (only msvc) (" + (vcmanifest? "yes" : "no") + ")\n";
txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n";
txt += " static: Link xmllint statically to libxml2 (" + (buildStatic? "yes" : "no") + ")\n";
txt += " Note: automatically enabled if cruntime is not /MD or /MDd\n";
txt += " prefix: Base directory for the installation (" + buildPrefix + ")\n";
txt += " bindir: Directory where xmllint and friends should be installed\n";
txt += " (" + buildBinPrefix + ")\n";
txt += " incdir: Directory where headers should be installed\n";
txt += " (" + buildIncPrefix + ")\n";
txt += " libdir: Directory where static and import libraries should be\n";
txt += " installed (" + buildLibPrefix + ")\n";
txt += " sodir: Directory where shared libraries should be installed\n";
txt += " (" + buildSoPrefix + ")\n";
txt += " include: Additional search path for the compiler, particularly\n";
txt += " where iconv headers can be found (" + buildInclude + ")\n";
txt += " lib: Additional search path for the linker, particularly\n";
txt += " where iconv library can be found (" + buildLib + ")\n";
WScript.Echo(txt);
}
/* Discovers the version we are working with by reading the appropriate
configuration file. Despite its name, this also writes the configuration
file included by our makefile. */
function discoverVersion()
{
var fso, cf, vf, ln, s, iDot, iSlash;
fso = new ActiveXObject("Scripting.FileSystemObject");
verCvs = "";
cf = fso.OpenTextFile(libxmlVersionFile, 1);
if (compiler == "msvc")
versionFile = ".\\config.msvc";
else if (compiler == "mingw")
versionFile = ".\\config.mingw";
else if (compiler == "bcb")
versionFile = ".\\config.bcb";
vf = fso.CreateTextFile(versionFile, true);
vf.WriteLine("# " + versionFile);
vf.WriteLine("# This file is generated automatically by " + WScript.ScriptName + ".");
vf.WriteBlankLines(1);
while (cf.AtEndOfStream != true) {
ln = cf.ReadLine();
s = new String(ln);
versionSplit = s.split(".");
verMajor = versionSplit[0];
vf.WriteLine("LIBXML_MAJOR_VERSION=" + verMajor);
verMinor = versionSplit[1];
vf.WriteLine("LIBXML_MINOR_VERSION=" + verMinor);
verMicro = versionSplit[2];
vf.WriteLine("LIBXML_MICRO_VERSION=" + verMicro);
}
cf.Close();
vf.WriteLine("XML_SRCDIR=" + srcDirXml);
vf.WriteLine("UTILS_SRCDIR=" + srcDirUtils);
vf.WriteLine("WITH_THREADS=" + withThreads);
vf.WriteLine("WITH_HTTP=" + (withHttp? "1" : "0"));
vf.WriteLine("WITH_HTML=" + (withHtml? "1" : "0"));
vf.WriteLine("WITH_C14N=" + (withC14n? "1" : "0"));
vf.WriteLine("WITH_CATALOG=" + (withCatalog? "1" : "0"));
vf.WriteLine("WITH_XPATH=" + (withXpath? "1" : "0"));
vf.WriteLine("WITH_XPTR=" + (withXptr? "1" : "0"));
vf.WriteLine("WITH_XINCLUDE=" + (withXinclude? "1" : "0"));
vf.WriteLine("WITH_ICONV=" + (withIconv? "1" : "0"));
vf.WriteLine("WITH_ICU=" + (withIcu? "1" : "0"));
vf.WriteLine("WITH_ISO8859X=" + (withIso8859x? "1" : "0"));
vf.WriteLine("WITH_ZLIB=" + (withZlib? "1" : "0"));
vf.WriteLine("WITH_DEBUG=" + (withDebug? "1" : "0"));
vf.WriteLine("WITH_SCHEMAS=" + (withSchemas? "1" : "0"));
vf.WriteLine("WITH_SCHEMATRON=" + (withSchematron? "1" : "0"));
vf.WriteLine("WITH_REGEXPS=" + (withRegExps? "1" : "0"));
vf.WriteLine("WITH_RELAXNG=" + (withRelaxNg ? "1" : "0"));
vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0"));
vf.WriteLine("WITH_TREE=" + (withTree? "1" : "0"));
vf.WriteLine("WITH_READER=" + (withReader? "1" : "0"));
vf.WriteLine("WITH_WRITER=" + (withWriter? "1" : "0"));
vf.WriteLine("WITH_WALKER=" + (withWalker? "1" : "0"));
vf.WriteLine("WITH_PATTERN=" + (withPattern? "1" : "0"));
vf.WriteLine("WITH_PUSH=" + (withPush? "1" : "0"));
vf.WriteLine("WITH_VALID=" + (withValid? "1" : "0"));
vf.WriteLine("WITH_SAX1=" + (withSax1? "1" : "0"));
vf.WriteLine("WITH_LEGACY=" + (withLegacy? "1" : "0"));
vf.WriteLine("WITH_OUTPUT=" + (withOutput? "1" : "0"));
vf.WriteLine("WITH_PYTHON=" + (withPython? "1" : "0"));
vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0"));
vf.WriteLine("STATIC=" + (buildStatic? "1" : "0"));
vf.WriteLine("PREFIX=" + buildPrefix);
vf.WriteLine("BINPREFIX=" + buildBinPrefix);
vf.WriteLine("INCPREFIX=" + buildIncPrefix);
vf.WriteLine("LIBPREFIX=" + buildLibPrefix);
vf.WriteLine("SOPREFIX=" + buildSoPrefix);
if (compiler == "msvc") {
vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
vf.WriteLine("LIB=$(LIB);" + buildLib);
vf.WriteLine("CRUNTIME=" + cruntime);
vf.WriteLine("VCMANIFEST=" + (vcmanifest? "1" : "0"));
} else if (compiler == "mingw") {
vf.WriteLine("INCLUDE+= -I" + buildInclude);
vf.WriteLine("LIB+= -L" + buildLib);
} else if (compiler == "bcb") {
vf.WriteLine("INCLUDE=" + buildInclude);
vf.WriteLine("LIB=" + buildLib);
vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
}
vf.Close();
versionFile = "rcVersion.h";
vf = fso.CreateTextFile(versionFile, true);
vf.WriteLine("/*");
vf.WriteLine(" " + versionFile);
vf.WriteLine(" This file is generated automatically by " + WScript.ScriptName + ".");
vf.WriteLine("*/");
vf.WriteBlankLines(1);
vf.WriteLine("#define LIBXML_MAJOR_VERSION " + verMajor);
vf.WriteLine("#define LIBXML_MINOR_VERSION " + verMinor);
vf.WriteLine("#define LIBXML_MICRO_VERSION " + verMicro);
vf.WriteLine("#define LIBXML_DOTTED_VERSION " + "\"" + verMajor + "." + verMinor + "." + verMicro + "\"");
vf.Close();
}
/* Configures libxml. This one will generate xmlversion.h from xmlversion.h.in
taking what the user passed on the command line into account. */
function configureLibxml()
{
var fso, ofi, of, ln, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
ofi = fso.OpenTextFile(optsFileIn, 1);
of = fso.CreateTextFile(optsFile, true);
while (ofi.AtEndOfStream != true) {
ln = ofi.ReadLine();
s = new String(ln);
if (s.search(/\@VERSION\@/) != -1) {
of.WriteLine(s.replace(/\@VERSION\@/,
verMajor + "." + verMinor + "." + verMicro + verMicroSuffix));
} else if (s.search(/\@LIBXML_VERSION_NUMBER\@/) != -1) {
of.WriteLine(s.replace(/\@LIBXML_VERSION_NUMBER\@/,
verMajor*10000 + verMinor*100 + verMicro*1));
} else if (s.search(/\@LIBXML_VERSION_EXTRA\@/) != -1) {
of.WriteLine(s.replace(/\@LIBXML_VERSION_EXTRA\@/, verCvs));
} else if (s.search(/\@WITH_THREADS\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_THREADS\@/, withThreads == "no"? "0" : "1"));
} else if (s.search(/\@WITH_THREAD_ALLOC\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_THREAD_ALLOC\@/, "0"));
} else if (s.search(/\@WITH_HTTP\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_HTTP\@/, withHttp? "1" : "0"));
} else if (s.search(/\@WITH_HTML\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_HTML\@/, withHtml? "1" : "0"));
} else if (s.search(/\@WITH_C14N\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_C14N\@/, withC14n? "1" : "0"));
} else if (s.search(/\@WITH_CATALOG\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_CATALOG\@/, withCatalog? "1" : "0"));
} else if (s.search(/\@WITH_XPATH\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_XPATH\@/, withXpath? "1" : "0"));
} else if (s.search(/\@WITH_XPTR\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_XPTR\@/, withXptr? "1" : "0"));
} else if (s.search(/\@WITH_XINCLUDE\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_XINCLUDE\@/, withXinclude? "1" : "0"));
} else if (s.search(/\@WITH_ICONV\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_ICONV\@/, withIconv? "1" : "0"));
} else if (s.search(/\@WITH_ICU\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_ICU\@/, withIcu? "1" : "0"));
} else if (s.search(/\@WITH_ISO8859X\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_ISO8859X\@/, withIso8859x? "1" : "0"));
} else if (s.search(/\@WITH_ZLIB\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_ZLIB\@/, withZlib? "1" : "0"));
} else if (s.search(/\@WITH_DEBUG\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_DEBUG\@/, withDebug? "1" : "0"));
} else if (s.search(/\@WITH_SCHEMAS\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_SCHEMAS\@/, withSchemas? "1" : "0"));
} else if (s.search(/\@WITH_SCHEMATRON\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_SCHEMATRON\@/, withSchematron? "1" : "0"));
} else if (s.search(/\@WITH_REGEXPS\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_REGEXPS\@/, withRegExps? "1" : "0"));
} else if (s.search(/\@WITH_RELAXNG\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_RELAXNG\@/, withRelaxNg? "1" : "0"));
} else if (s.search(/\@WITH_MODULES\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0"));
} else if (s.search(/\@MODULE_EXTENSION\@/) != -1) {
of.WriteLine(s.replace(/\@MODULE_EXTENSION\@/, ".dll"));
} else if (s.search(/\@WITH_TREE\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_TREE\@/, withTree? "1" : "0"));
} else if (s.search(/\@WITH_READER\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_READER\@/, withReader? "1" : "0"));
} else if (s.search(/\@WITH_WRITER\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_WRITER\@/, withWriter? "1" : "0"));
} else if (s.search(/\@WITH_WALKER\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_WALKER\@/, withWalker? "1" : "0"));
} else if (s.search(/\@WITH_PATTERN\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_PATTERN\@/, withPattern? "1" : "0"));
} else if (s.search(/\@WITH_PUSH\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_PUSH\@/, withPush? "1" : "0"));
} else if (s.search(/\@WITH_VALID\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_VALID\@/, withValid? "1" : "0"));
} else if (s.search(/\@WITH_SAX1\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_SAX1\@/, withSax1? "1" : "0"));
} else if (s.search(/\@WITH_LEGACY\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_LEGACY\@/, withLegacy? "1" : "0"));
} else if (s.search(/\@WITH_OUTPUT\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_OUTPUT\@/, withOutput? "1" : "0"));
} else
of.WriteLine(ln);
}
ofi.Close();
of.Close();
}
/* Configures Python bindings. Otherwise identical to the above */
function configureLibxmlPy()
{
var pyOptsFileIn = srcDirXml + "\\python\\setup.py.in";
var pyOptsFile = srcDirXml + "\\python\\setup.py";
var fso, ofi, of, ln, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
ofi = fso.OpenTextFile(pyOptsFileIn, 1);
of = fso.CreateTextFile(pyOptsFile, true);
while (ofi.AtEndOfStream != true) {
ln = ofi.ReadLine();
s = new String(ln);
if (s.search(/\@LIBXML_VERSION\@/) != -1) {
of.WriteLine(s.replace(/\@LIBXML_VERSION\@/,
verMajor + "." + verMinor + "." + verMicro));
} else if (s.search(/\@prefix\@/) != -1) {
of.WriteLine(s.replace(/\@prefix\@/, buildPrefix));
} else if (s.search(/\@WITH_THREADS\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_THREADS\@/, withThreads == "no"? "0" : "1"));
} else if (s.search(/\@WITH_ZLIB\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_ZLIB\@/, withZlib? "1" : "0"));
} else if (s.search(/\@WITH_ICONV\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_ICONV\@/, withIconv? "1" : "0"));
} else if (s.search(/\@WITH_ICU\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_ICU\@/, withIcu? "1" : "0"));
} else
of.WriteLine(ln);
}
ofi.Close();
of.Close();
}
/* Creates the readme file for the binary distribution of 'bname', for the
version 'ver' in the file 'file'. This one is called from the Makefile when
generating a binary distribution. The parameters are passed by make. */
function genReadme(bname, ver, file)
{
var fso, f;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.CreateTextFile(file, true);
f.WriteLine(" " + bname + " " + ver);
f.WriteLine(" --------------");
f.WriteBlankLines(1);
f.WriteLine(" This is " + bname + ", version " + ver + ", binary package for the native Win32/IA32");
f.WriteLine("platform.");
f.WriteBlankLines(1);
f.WriteLine(" The files in this package do not require any special installation");
f.WriteLine("steps. Extract the contents of the archive wherever you wish and");
f.WriteLine("make sure that your tools which use " + bname + " can find it.");
f.WriteBlankLines(1);
f.WriteLine(" For example, if you want to run the supplied utilities from the command");
f.WriteLine("line, you can, if you wish, add the 'bin' subdirectory to the PATH");
f.WriteLine("environment variable.");
f.WriteLine(" If you want to make programmes in C which use " + bname + ", you'll");
f.WriteLine("likely know how to use the contents of this package. If you don't, please");
f.WriteLine("refer to your compiler's documentation.");
f.WriteBlankLines(1);
f.WriteLine(" If there is something you cannot keep for yourself, such as a problem,");
f.WriteLine("a cheer of joy, a comment or a suggestion, feel free to contact me using");
f.WriteLine("the address below.");
f.WriteBlankLines(1);
f.WriteLine(" Igor Zlatkovic (igor@zlatkovic.com)");
f.Close();
}
/*
* main(),
* Execution begins here.
*/
// Parse the command-line arguments.
for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
var arg, opt;
arg = WScript.Arguments(i);
opt = arg.substring(0, arg.indexOf("="));
if (opt.length == 0)
opt = arg.substring(0, arg.indexOf(":"));
if (opt.length > 0) {
if (opt == "threads")
withThreads = arg.substring(opt.length + 1, arg.length);
else if (opt == "http")
withHttp = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "html")
withHtml = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "c14n")
withC14n = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "catalog")
withCatalog = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "xpath")
withXpath = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "xptr")
withXptr = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "xinclude")
withXinclude = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "iconv")
withIconv = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "icu")
withIcu = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "iso8859x")
withIso8859x = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "zlib")
withZlib = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "xml_debug")
withDebug = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "schemas")
withSchemas = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "schematron")
withSchematron = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "regexps")
withRegExps = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "relaxng")
withRelaxNg = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "modules")
withModules = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "tree")
withTree = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "reader")
withReader = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "writer")
withWriter = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "walker")
withWalker = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "pattern")
withPattern = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "push")
withPush = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "valid")
withValid = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "sax1")
withSax1 = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "legacy")
withLegacy = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "output")
withOutput = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "python")
withPython = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "compiler")
compiler = arg.substring(opt.length + 1, arg.length);
else if (opt == "cruntime")
cruntime = arg.substring(opt.length + 1, arg.length);
else if (opt == "dynruntime")
dynruntime = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "vcmanifest")
vcmanifest = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "debug")
buildDebug = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "static")
buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "prefix")
buildPrefix = arg.substring(opt.length + 1, arg.length);
else if (opt == "bindir")
buildBinPrefix = arg.substring(opt.length + 1, arg.length);
else if (opt == "libdir")
buildLibPrefix = arg.substring(opt.length + 1, arg.length);
else if (opt == "sodir")
buildSoPrefix = arg.substring(opt.length + 1, arg.length);
else if (opt == "incdir")
buildIncPrefix = arg.substring(opt.length + 1, arg.length);
else if (opt == "include")
buildInclude = arg.substring(opt.length + 1, arg.length);
else if (opt == "lib")
buildLib = arg.substring(opt.length + 1, arg.length);
else if (opt == "release")
useCvsVer = false;
else
error = 1;
} else if (i == 0) {
if (arg == "genreadme") {
// This command comes from the Makefile and will not be checked
// for errors, because Makefile will always supply right the parameters.
genReadme(WScript.Arguments(1), WScript.Arguments(2), WScript.Arguments(3));
WScript.Quit(0);
} else if (arg == "help") {
usage();
WScript.Quit(0);
}
} else {
error = 1;
}
}
// If we fail here, it is because the user supplied an unrecognised argument.
if (error != 0) {
usage();
WScript.Quit(error);
}
// if user choses to link the c-runtime library statically into libxml2
// with /MT and friends, then we need to enable static linking for xmllint
if (cruntime == "/MT" || cruntime == "/MTd" ||
cruntime == "/ML" || cruntime == "/MLd") {
buildStatic = 1;
}
dirSep = "\\";
if (buildBinPrefix == "")
buildBinPrefix = "$(PREFIX)" + dirSep + "bin";
if (buildIncPrefix == "")
buildIncPrefix = "$(PREFIX)" + dirSep + "include";
if (buildLibPrefix == "")
buildLibPrefix = "$(PREFIX)" + dirSep + "lib";
if (buildSoPrefix == "")
buildSoPrefix = "$(PREFIX)" + dirSep + "bin";
// Discover the version.
discoverVersion();
if (error != 0) {
WScript.Echo("Version discovery failed, aborting.");
WScript.Quit(error);
}
var outVerString = baseName + " version: " + verMajor + "." + verMinor + "." + verMicro;
if (verMicroSuffix && verMicroSuffix != "")
outVerString += "-" + verMicroSuffix;
if (verCvs && verCvs != "")
outVerString += "-" + verCvs;
WScript.Echo(outVerString);
// Configure libxml.
configureLibxml();
if (error != 0) {
WScript.Echo("Configuration failed, aborting.");
WScript.Quit(error);
}
if (withPython == true) {
configureLibxmlPy();
if (error != 0) {
WScript.Echo("Configuration failed, aborting.");
WScript.Quit(error);
}
}
// Create the makefile.
var fso = new ActiveXObject("Scripting.FileSystemObject");
var makefile = ".\\Makefile.msvc";
if (compiler == "mingw")
makefile = ".\\Makefile.mingw";
else if (compiler == "bcb")
makefile = ".\\Makefile.bcb";
var new_makefile = ".\\Makefile";
var f = fso.FileExists(new_makefile);
if (f) {
var t = fso.GetFile(new_makefile);
t.Attributes =0;
}
fso.CopyFile(makefile, new_makefile, true);
WScript.Echo("Created Makefile.");
// Create the config.h.
var confighsrc = "win32config.h";
var configh = "..\\config.h";
var f = fso.FileExists(configh);
if (f) {
var t = fso.GetFile(configh);
t.Attributes =0;
}
fso.CopyFile(confighsrc, configh, true);
WScript.Echo("Created config.h.");
// Display the final configuration.
var txtOut = "\nXML processor configuration\n";
txtOut += "---------------------------\n";
txtOut += " Thread safety: " + withThreads + "\n";
txtOut += " HTTP client: " + boolToStr(withHttp) + "\n";
txtOut += " HTML processor: " + boolToStr(withHtml) + "\n";
txtOut += " C14N support: " + boolToStr(withC14n) + "\n";
txtOut += " Catalog support: " + boolToStr(withCatalog) + "\n";
txtOut += " XPath support: " + boolToStr(withXpath) + "\n";
txtOut += " XPointer support: " + boolToStr(withXptr) + "\n";
txtOut += " XInclude support: " + boolToStr(withXinclude) + "\n";
txtOut += " iconv support: " + boolToStr(withIconv) + "\n";
txtOut += " icu support: " + boolToStr(withIcu) + "\n";
txtOut += " iso8859x support: " + boolToStr(withIso8859x) + "\n";
txtOut += " zlib support: " + boolToStr(withZlib) + "\n";
txtOut += " Debugging module: " + boolToStr(withDebug) + "\n";
txtOut += " Regexp support: " + boolToStr(withRegExps) + "\n";
txtOut += " Relax NG support: " + boolToStr(withRelaxNg) + "\n";
txtOut += " Module support: " + boolToStr(withModules) + "\n";
txtOut += " Tree support: " + boolToStr(withTree) + "\n";
txtOut += " Reader support: " + boolToStr(withReader) + "\n";
txtOut += " Writer support: " + boolToStr(withWriter) + "\n";
txtOut += " Walker support: " + boolToStr(withWalker) + "\n";
txtOut += " Pattern support: " + boolToStr(withPattern) + "\n";
txtOut += " Push support: " + boolToStr(withPush) + "\n";
txtOut += "Validation support: " + boolToStr(withValid) + "\n";
txtOut += " SAX1 support: " + boolToStr(withSax1) + "\n";
txtOut += " Legacy support: " + boolToStr(withLegacy) + "\n";
txtOut += " Output support: " + boolToStr(withOutput) + "\n";
txtOut += "XML Schema support: " + boolToStr(withSchemas) + "\n";
txtOut += "Schematron support: " + boolToStr(withSchematron) + "\n";
txtOut += " Python bindings: " + boolToStr(withPython) + "\n";
txtOut += "\n";
txtOut += "Win32 build configuration\n";
txtOut += "-------------------------\n";
txtOut += " Compiler: " + compiler + "\n";
if (compiler == "msvc") {
txtOut += " C-Runtime option: " + cruntime + "\n";
txtOut += " Embed Manifest: " + boolToStr(vcmanifest) + "\n";
} else if (compiler == "bcb")
txtOut += " Use dynamic RTL: " + dynruntime + "\n";
txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n";
txtOut += " Static xmllint: " + boolToStr(buildStatic) + "\n";
txtOut += " Install prefix: " + buildPrefix + "\n";
txtOut += " Put tools in: " + buildBinPrefix + "\n";
txtOut += " Put headers in: " + buildIncPrefix + "\n";
txtOut += "Put static libs in: " + buildLibPrefix + "\n";
txtOut += "Put shared libs in: " + buildSoPrefix + "\n";
txtOut += " Include path: " + buildInclude + "\n";
txtOut += " Lib path: " + buildLib + "\n";
txtOut += "\n";
txtOut += "DEPRECATION WARNING: The build system in the win32 directory is\n";
txtOut += "deprecated and will be removed in a future release. Please switch\n";
txtOut += "to CMake.\n";
WScript.Echo(txtOut);
//

View File

@@ -1,20 +0,0 @@
#ifndef __LIBXML_WIN32_CONFIG__
#define __LIBXML_WIN32_CONFIG__
#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1600)
#define HAVE_STDINT_H
#endif
#if defined(_MSC_VER)
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#if _MSC_VER < 1500
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
#endif
#endif
#define XML_SYSCONFDIR "/etc"
#endif /* __LIBXML_WIN32_CONFIG__ */