[xml] Compilation of libxml2 for Win32 using Borland's BCB6



Hi,

I've been tinkering a bit to make it possible to build libxml2 for
Win32 platforms using Borland's C++ Builder 6. Toward this end, I'd
like to submit a few patches to make this work. The first is a set 
of minor changes to win32\configure.js to provide a "compiler=bcb" 
option. The second is a change to include\win32config.h and the 
third modifies include\libxml\xmlversion.h.in. The latter two add 
__BORLANDC__ to conditionals which currently use only _MSC_VER.

Index: win32/configure.js
===================================================================
RCS file: /cvs/gnome/gnome-xml/win32/configure.js,v
retrieving revision 1.14
diff -u -r1.14 configure.js
--- win32/configure.js  17 May 2003 11:30:54 -0000      1.14
+++ win32/configure.js  12 Jun 2003 03:53:26 -0000
@@ -112,7 +112,7 @@
        txt += "  schemas:    Enable XML Schema support (" + (withSchemas?
"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] (" + compiler
+ ")\n";
+       txt += "  compiler:   Compiler to be used [msvc|mingw|bcb] (" +
compiler + ")\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";
@@ -143,6 +143,8 @@
                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 + ".");
@@ -196,6 +198,9 @@
        } else if (compiler == "mingw") {
                vf.WriteLine("INCLUDE+=;" + buildInclude);
                vf.WriteLine("LIB+=;" + buildLib);
+       } else if (compiler == "bcb") {
+               vf.WriteLine("INCLUDE=" + buildInclude);
+               vf.WriteLine("LIB=" + buildLib);
        }
        vf.Close();
 }


Index: include/win32config.h
===================================================================
RCS file: /cvs/gnome/gnome-xml/include/win32config.h,v
retrieving revision 1.21
diff -u -r1.21 win32config.h
--- include/win32config.h       11 Dec 2002 17:00:40 -0000      1.21
+++ include/win32config.h       12 Jun 2003 03:59:07 -0000
@@ -30,11 +30,11 @@
 #define HAVE_ISINF
 #define HAVE_ISNAN
 #include <math.h>
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__BORLANDC__)
 /* MS C-runtime has functions which can be used in order to determine if
-   a given floating-point variable contains NaN, (+-)INF. These are 
+   a given floating-point variable contains NaN, (+-)INF. These are
    preferred, because floating-point technology is considered propriatary
-   by MS and we can assume that their functions know more about their 
+   by MS and we can assume that their functions know more about their
    oddities than we do. */
 #include <float.h>
 /* Bjorn Reese figured a quite nice construct for isinf() using the
_fpclass


Index: include/libxml/xmlversion.h.in
===================================================================
RCS file: /cvs/gnome/gnome-xml/include/libxml/xmlversion.h.in,v
retrieving revision 1.34
diff -u -r1.34 xmlversion.h.in
--- include/libxml/xmlversion.h.in      19 Sep 2002 19:56:43 -0000      1.34
+++ include/libxml/xmlversion.h.in      12 Jun 2003 04:05:05 -0000
@@ -76,7 +76,7 @@
  * Whether the thread support is configured in
  */
 #if @WITH_THREADS@
-#if defined(_REENTRANT) || (_POSIX_C_SOURCE - 0 >= 199506L)
+#if defined(_REENTRANT) || defined(__MT__) || (_POSIX_C_SOURCE - 0 >=
199506L)
 #define LIBXML_THREAD_ENABLED
 #endif
 #endif
@@ -241,7 +241,7 @@
  * code which links against libxml statically. 
  */
 #ifndef LIBXML_DLL_IMPORT
-#if (defined(_MSC_VER) || defined(__CYGWIN__)) && !defined(IN_LIBXML) &&
!defined(LIBXML_STATIC)
+#if (defined(_MSC_VER) || defined(__BORLANDC__) || defined(__CYGWIN__)) &&
!defined(IN_LIBXML) && !defined(LIBXML_STATIC)
 #define LIBXML_DLL_IMPORT __declspec(dllimport)
 #else
 #define LIBXML_DLL_IMPORT





Eric Zurcher
CSIRO Livestock Industries
Canberra, Australia
Eric Zurcher csiro au



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