modified for compiler coexistence, added xmlwriter, added cruntime option
diff --git a/win32/Makefile.bcb b/win32/Makefile.bcb
index 2d60d14..f621194 100644
--- a/win32/Makefile.bcb
+++ b/win32/Makefile.bcb
@@ -15,52 +15,16 @@
# March 2002, Igor Zlatkovic <igor@zlatkovic.com>
#
-AUTOCONF = .\config.bcb
-
# Extra setting to control whether to use dynamic or static Borland runtime.
# Set to "1" to use static RTL, anything else to use dynamic RTL
STATIC_RTL = 0
-# If you cannot run the configuration script, which would take the burden of
-# editing this file from your back, then remove the following line...
-!include $(AUTOCONF)
-# ...and enable the following lines and adapt them to your environment.
-#XML_SRCDIR = ..
-#UTILS_SRCDIR = ..
-#BINDIR = binaries
-#LIBXML_MAJOR_VERSION = 0 # set this to the right value.
-#LIBXML_MINOR_VERSION = 0 # set this to the right value.
-#LIBXML_MICRO_VERSION = 0 # set this to the right value.
-#WITH_TRIO = 0
-#WITH_THREADS = 0
-#WITH_FTP = 1
-#WITH_HTTP = 1
-#WITH_HTML = 1
-#WITH_C14N = 1
-#WITH_CATALOG = 1
-#WITH_DOCB = 1
-#WITH_XPATH = 1
-#WITH_XPTR = 1
-#WITH_XINCLUDE = 1
-#WITH_ICONV = 1
-#WITH_ZLIB = 0
-#WITH_DEBUG = 1
-#WITH_MEM_DEBUG = 0
-#WITH_SCHEMAS = 1
-#DEBUG = 0
-#STATIC = 0
-#PREFIX = . # set this to the right value.
-#BINPREFIX = $(PREFIX)\bin
-#INCPREFIX = $(PREFIX)\include
-#LIBPREFIX = $(PREFIX)\lib
-#SOPREFIX = $(PREFIX)\lib
-#INCLUDE = $(INCLUDE);$(INCPREFIX)
-#LIB = $(LIB);$(LIBPREFIX)
-
-
# There should never be a need to modify anything below this line.
# ----------------------------------------------------------------
+AUTOCONF = .\config.bcb
+!include $(AUTOCONF)
+
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
@@ -76,9 +40,10 @@
DUMMY = dir.exists
# Place where we let the compiler put its intermediate trash.
-XML_INTDIR = $(XML_BASENAME).int
-XML_INTDIR_A = $(XML_BASENAME)_a.int
-UTILS_INTDIR = utils.int
+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- -DWIN32
@@ -184,6 +149,7 @@
$(XML_INTDIR)\xmlschemas.obj\
$(XML_INTDIR)\xmlschemastypes.obj\
$(XML_INTDIR)\xmlunicode.obj\
+ $(XML_INTDIR)\xmlwriter.obj\
$(XML_INTDIR)\xpath.obj\
$(XML_INTDIR)\xpointer.obj
@@ -223,6 +189,7 @@
$(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
diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw
index 5edaae5..c6a167f 100644
--- a/win32/Makefile.mingw
+++ b/win32/Makefile.mingw
@@ -12,48 +12,11 @@
#
# November 2002, Igor Zlatkovic <igor@zlatkovic.com>
-AUTOCONF = .\config.mingw
-
-# If you cannot run the configuration script, which would take the burden of
-# editing this file from your back, then remove the following line...
-include $(AUTOCONF)
-# ...and enable the following lines and adapt them to your environment.
-#XML_SRCDIR = ..
-#UTILS_SRCDIR = ..
-#BINDIR = binaries
-#LIBXML_MAJOR_VERSION = 0 # set this to the right value.
-#LIBXML_MINOR_VERSION = 0 # set this to the right value.
-#LIBXML_MICRO_VERSION = 0 # set this to the right value.
-#WITH_TRIO = 0
-#WITH_THREADS = 0
-#WITH_FTP = 1
-#WITH_HTTP = 1
-#WITH_HTML = 1
-#WITH_C14N = 1
-#WITH_CATALOG = 1
-#WITH_DOCB = 1
-#WITH_XPATH = 1
-#WITH_XPTR = 1
-#WITH_XINCLUDE = 1
-#WITH_ICONV = 1
-#WITH_ZLIB = 0
-#WITH_DEBUG = 1
-#WITH_MEM_DEBUG = 0
-#WITH_SCHEMAS = 1
-#DEBUG = 0
-#STATIC = 0
-#PREFIX = . # set this to the right value.
-#BINPREFIX = $(PREFIX)\bin
-#INCPREFIX = $(PREFIX)\include
-#LIBPREFIX = $(PREFIX)\lib
-#SOPREFIX = $(PREFIX)\lib
-#INCLUDE += ;$(INCPREFIX)
-#LIB += ;$(LIBPREFIX)
-
-
# 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
@@ -62,10 +25,11 @@
XML_IMP = $(XML_BASENAME).lib
XML_A = $(XML_BASENAME).a
-# Place where we let the compiler put its intermediate trash.
-XML_INTDIR = $(XML_BASENAME).int
-XML_INTDIR_A = $(XML_BASENAME)_a.int
-UTILS_INTDIR = utils.int
+# 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
@@ -171,6 +135,7 @@
$(XML_INTDIR)/xmlschemas.o\
$(XML_INTDIR)/xmlschemastypes.o\
$(XML_INTDIR)/xmlunicode.o\
+ $(XML_INTDIR)/xmlwriter.o\
$(XML_INTDIR)/xpath.o\
$(XML_INTDIR)/xpointer.o
@@ -212,6 +177,7 @@
$(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
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 1fd3d86..08c3491 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -12,48 +12,11 @@
#
# March 2002, Igor Zlatkovic <igor@zlatkovic.com>
-AUTOCONF = .\config.msvc
-
-# If you cannot run the configuration script, which would take the burden of
-# editing this file from your back, then remove the following line...
-!include $(AUTOCONF)
-# ...and enable the following lines and adapt them to your environment.
-#XML_SRCDIR = ..
-#UTILS_SRCDIR = ..
-#BINDIR = binaries
-#LIBXML_MAJOR_VERSION = 0 # set this to the right value.
-#LIBXML_MINOR_VERSION = 0 # set this to the right value.
-#LIBXML_MICRO_VERSION = 0 # set this to the right value.
-#WITH_TRIO = 0
-#WITH_THREADS = 0
-#WITH_FTP = 1
-#WITH_HTTP = 1
-#WITH_HTML = 1
-#WITH_C14N = 1
-#WITH_CATALOG = 1
-#WITH_DOCB = 1
-#WITH_XPATH = 1
-#WITH_XPTR = 1
-#WITH_XINCLUDE = 1
-#WITH_ICONV = 1
-#WITH_ZLIB = 0
-#WITH_DEBUG = 1
-#WITH_MEM_DEBUG = 0
-#WITH_SCHEMAS = 1
-#DEBUG = 0
-#STATIC = 0
-#PREFIX = . # set this to the right value.
-#BINPREFIX = $(PREFIX)\bin
-#INCPREFIX = $(PREFIX)\include
-#LIBPREFIX = $(PREFIX)\lib
-#SOPREFIX = $(PREFIX)\lib
-#INCLUDE = $(INCLUDE);$(INCPREFIX)
-#LIB = $(LIB);$(LIBPREFIX)
-
-
# 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
@@ -63,10 +26,11 @@
XML_DEF = $(XML_BASENAME).def
XML_A = $(XML_BASENAME)_a.lib
-# Place where we let the compiler put its intermediate trash.
-XML_INTDIR = $(XML_BASENAME).int
-XML_INTDIR_A = $(XML_BASENAME)_a.int
-UTILS_INTDIR = utils.int
+# Place where we let the compiler put its output.
+BINDIR = bin.msvc
+XML_INTDIR = int.msvc
+XML_INTDIR_A = int.a.msvc
+UTILS_INTDIR = int.utils.msvc
# The preprocessor and its options.
CPP = cl.exe /EP
@@ -77,7 +41,7 @@
# The compiler and its options.
CC = cl.exe
-CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W1 /MD
+CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W1 $(CRUNTIME)
CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
!if "$(WITH_THREADS)" != "no"
CFLAGS = $(CFLAGS) /D "_REENTRANT"
@@ -160,6 +124,7 @@
$(XML_INTDIR)\xmlschemas.obj\
$(XML_INTDIR)\xmlschemastypes.obj\
$(XML_INTDIR)\xmlunicode.obj\
+ $(XML_INTDIR)\xmlwriter.obj\
$(XML_INTDIR)\xpath.obj\
$(XML_INTDIR)\xpointer.obj
@@ -199,6 +164,7 @@
$(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
diff --git a/win32/Readme.txt b/win32/Readme.txt
index 022dac8..6b3eddd 100644
--- a/win32/Readme.txt
+++ b/win32/Readme.txt
@@ -79,13 +79,13 @@
Once you have decided which options suit you, run the script with that
options. Here is an example:
- cscript configure.js prefix=c:\opt include=c:\opt\include
- lib=c:\opt\lib debug=yes
+ 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 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.
+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
@@ -106,19 +106,29 @@
you configured it to build with GNU C compiler, mingw edition, you
would use the GNU make. Assuming you use MSVC, type
- nmake
+ 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\binaries directory.
-
+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
+configure script during the configure stage by typing (with MSVC in
+this example)
- nmake install
+ nmake /f Makefile.msvc install
That would be it, enjoy.
@@ -134,8 +144,9 @@
--------------------------
If you use the compiler which comes with Visual Studio .NET, note that
-it will link to its own C-runtime named msvcr70.dll. This file is not
-available on any machine which doesn't have .NET installed.
+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
@@ -143,8 +154,8 @@
When specifying paths to configure.js, please use slashes instead of
backslashes for directory separation. Sometimes Mingw needs this. If
-this is the case, then 'make install' won't work correctly and you'll
-have to install manually.
+this is the case, and you specify backslashes, then the compiler will
+complain about not finding necessary header files.
2.2 Borland C++ Builder
@@ -204,7 +215,8 @@
2.2.3 Other caveats
-I have tested this only with BCB6, Professional Edition.
+We have tested this only with BCB6, Professional Edition, and BCB 5.5 free
+command-line tools.
diff --git a/win32/configure.js b/win32/configure.js
index 4612879..eaaf3fd 100644
--- a/win32/configure.js
+++ b/win32/configure.js
@@ -10,8 +10,6 @@
/* The source directory, relative to the one where this file resides. */
var srcDirXml = "..";
var srcDirUtils = "..";
-/* The directory where we put the binaries after compilation. */
-var binDir = "binaries";
/* Base name of what we are building. */
var baseName = "libxml2";
/* Configure file which contains the version and the output file where
@@ -59,6 +57,7 @@
/* Win32 build options. */
var dirSep = "\\";
var compiler = "msvc";
+var cruntime = "/MD";
var buildDebug = 0;
var buildStatic = 0;
var buildPrefix = ".";
@@ -135,6 +134,7 @@
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 += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n";
txt += " static: Link xmllint statically to libxml2 (" + (buildStatic? "yes" : "no") + ")\n";
txt += " prefix: Base directory for the installation (" + buildPrefix + ")\n";
@@ -191,7 +191,6 @@
cf.Close();
vf.WriteLine("XML_SRCDIR=" + srcDirXml);
vf.WriteLine("UTILS_SRCDIR=" + srcDirUtils);
- vf.WriteLine("BINDIR=" + binDir);
vf.WriteLine("WITH_TRIO=" + (withTrio? "1" : "0"));
vf.WriteLine("WITH_THREADS=" + withThreads);
vf.WriteLine("WITH_FTP=" + (withFtp? "1" : "0"));
@@ -230,6 +229,7 @@
if (compiler == "msvc") {
vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
vf.WriteLine("LIB=$(LIB);" + buildLib);
+ vf.WriteLine("CRUNTIME=" + cruntime);
} else if (compiler == "mingw") {
vf.WriteLine("INCLUDE+=;" + buildInclude);
vf.WriteLine("LIB+=;" + buildLib);
@@ -468,6 +468,8 @@
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 == "debug")
buildDebug = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "static")
@@ -605,6 +607,8 @@
txtOut += "Win32 build configuration\n";
txtOut += "-------------------------\n";
txtOut += " Compiler: " + compiler + "\n";
+if (compiler == "msvc")
+ txtOut += " C-Runtime option: " + cruntime + "\n";
txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n";
txtOut += " Static xmllint: " + boolToStr(buildStatic) + "\n";
txtOut += " Install prefix: " + buildPrefix + "\n";