summaryrefslogtreecommitdiff
path: root/config.bat
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2010-09-18 15:57:06 +0200
committerEli Zaretskii <eliz@gnu.org>2010-09-18 15:57:06 +0200
commit1ff11b21a8d1f4aaf02325e8cba2e83e99a2f110 (patch)
tree9acee5b47109afefb9911a033e14509a3139153e /config.bat
parent25b88a3dc4308d952e2fbc036501867aa9e828aa (diff)
downloademacs-1ff11b21a8d1f4aaf02325e8cba2e83e99a2f110.tar.gz
Support building with libxml2, if it is installed.
config.bat: Detect that libxml2 is installed and if so, build with it.
Diffstat (limited to 'config.bat')
-rw-r--r--config.bat26
1 files changed, 26 insertions, 0 deletions
diff --git a/config.bat b/config.bat
index 802cacc8897..63f9c5d5865 100644
--- a/config.bat
+++ b/config.bat
@@ -38,6 +38,7 @@ set X11=
set nodebug=
set djgpp_ver=
set sys_malloc=
+set libxml=
if "%1" == "" goto usage
rem ----------------------------------------------------------------------
rem See if their environment is large enough. We need 28 bytes.
@@ -175,6 +176,24 @@ rem The following line disables DECL_ALIGN which in turn disables USE_LSB_TAG
rem For details see lisp.h where it defines USE_LSB_TAG
echo #define NO_DECL_ALIGN >>config.h2
:alignOk
+Rem See if they have libxml2 later than v2.2.0 installed
+Echo Checking whether libxml2 v2.2.1 or later is installed ...
+rm -f junk.c junk.o junk junk.exe
+rem Use djecho here because we need to quote brackets
+djecho "#include <libxml/xmlversion.h>" >junk.c
+djecho "int main()" >>junk.c
+djecho "{return (LIBXML_VERSION > 20200 ? 0 : 1);}" >>junk.c
+redir -o Nul -eo gcc -I/dev/env/DJDIR/include/libxml2 -o junk junk.c
+if not exist junk Goto xmlDone
+if not exist junk.exe coff2exe junk
+junk
+If ErrorLevel 1 Goto xmlDone
+Echo Configuring with libxml2 ...
+sed -e "/#undef HAVE_LIBXML2/s/^.*$/#define HAVE_LIBXML2 1/" <config.h2 >config.h3
+mv config.h3 config.h2
+set libxml=1
+:xmlDone
+rm -f junk.c junk junk.exe
Rem See if they requested a SYSTEM_MALLOC build
if "%sys_malloc%" == "" Goto cfgDone
rm -f config.tmp
@@ -213,6 +232,12 @@ sed -e "/^CFLAGS *=/s/ *-gcoff//" <Makefile >makefile.tmp
sed -e "/^LDFLAGS *=/s/=/=-s/" <makefile.tmp >Makefile
rm -f makefile.tmp
:src6
+
+if "%libxml%" == "" goto src7
+sed -e "/^LIBXML2_LIBS *=/s/=/= -lxml2 -lz -liconv/" <Makefile >makefile.tmp
+sed -e "/^LIBXML2_CFLAGS *=/s|=|= -I/dev/env/DJDIR/include/libxml2|" <makefile.tmp >Makefile
+rm -f makefile.tmp
+:src7
cd ..
rem ----------------------------------------------------------------------
Echo Configuring the library source directory...
@@ -289,6 +314,7 @@ set X11=
set nodebug=
set djgpp_ver=
set sys_malloc=
+set libxml=
goto skipArchTag
arch-tag: 2d2fed23-4dc6-4006-a2e4-49daf0031f33