summaryrefslogtreecommitdiff
path: root/nt/configure.bat
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2012-04-07 16:57:36 +0300
committerEli Zaretskii <eliz@gnu.org>2012-04-07 16:57:36 +0300
commit9078ead6ce0237eb566a2779016560c85fff5768 (patch)
tree965a35cb3e4e5f7b83edfd65712ce40105dc1fd5 /nt/configure.bat
parente4ecc6a217dfe759fdb7859b38079e66368944d2 (diff)
downloademacs-9078ead6ce0237eb566a2779016560c85fff5768.tar.gz
Support building on MS-Windows with libxml2.
src/makefile.w32-in (OBJ2): Add xml.$(O). (GLOBAL_SOURCES): Add xml.c. ($(BLD)/xml.$(O)): New dependency list. src/xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros. (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement) (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion) [!WINDOWSNT]: New macros. (init_libxml2_functions, libxml2_loaded_p): New functions. (parse_region): Call fn_xmlCheckVersion instead of using the macro LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros. (xml_cleanup_parser): New function, export for fn_xmlCleanupParser. Calls xmlCleanupParser only if libxml2 was loaded (or statically linked in). (Flibxml_parse_html_region, Flibxml_parse_xml_region): Call init_libxml2_functions before calling libxml2 functions. (syms_of_xml) <Qlibxml2_dll>: DEFSYM it. src/emacs.c: Don't include libxml/parser.h. (shut_down_emacs): Call xml_cleanup_parser, instead of calling xmlCleanupParser directly. src/ lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser. nt/configure.bat: Support building with libxml2. nt/INSTALL: nt/README.W32: Add information about libxml2. lisp/term/w32-win.el (dynamic-library-alist): Add libxml2 DLLs. lib-src/makefile.w32-in (obj): Add xml.o.
Diffstat (limited to 'nt/configure.bat')
-rwxr-xr-xnt/configure.bat34
1 files changed, 34 insertions, 0 deletions
diff --git a/nt/configure.bat b/nt/configure.bat
index e0362c5c278..db587b02997 100755
--- a/nt/configure.bat
+++ b/nt/configure.bat
@@ -131,6 +131,7 @@ if "%1" == "--without-jpeg" goto withoutjpeg
if "%1" == "--without-gif" goto withoutgif
if "%1" == "--without-tiff" goto withouttiff
if "%1" == "--without-gnutls" goto withoutgnutls
+if "%1" == "--without-libxml2" goto withoutlibxml2
if "%1" == "--without-xpm" goto withoutxpm
if "%1" == "--with-svg" goto withsvg
if "%1" == "--distfiles" goto distfiles
@@ -156,6 +157,7 @@ echo. --without-gif do not use GIF library even if it is installed
echo. --without-tiff do not use TIFF library even if it is installed
echo. --without-xpm do not use XPM library even if it is installed
echo. --without-gnutls do not use GnuTLS library even if it is installed
+echo. --without-libxml2 do not use libxml2 library even if it is installed
echo. --with-svg use the RSVG library (experimental)
echo. --distfiles path to files for make dist, e.g. libXpm.dll
if "%use_extensions%" == "0" goto end
@@ -317,6 +319,14 @@ goto again
rem ----------------------------------------------------------------------
+:withoutlibxml2
+set libxml2support=N
+set HAVE_LIBXML2=
+shift
+goto again
+
+rem ----------------------------------------------------------------------
+
:withouttiff
set tiffsupport=N
set HAVE_TIFF=
@@ -569,6 +579,28 @@ set HAVE_GNUTLS=1
:tlsDone
rm -f junk.c junk.obj
+if (%libxml2support%) == (N) goto xml2Done
+
+echo Checking for libxml2....
+echo #include "libxml/HTMLparser.h" >junk.c
+echo main(){} >>junk.c
+echo %COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >>config.log
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>>config.log
+if exist junk.obj goto havelibxml2
+
+echo ...libxml/HTMLparser.h not found, building without libxml2 support
+echo The failed program was: >>config.log
+type junk.c >>config.log
+set HAVE_LIBXML2=
+goto xml2Done
+
+:havelibxml2
+echo ...libxml2 header available, building with libxml2 support
+set HAVE_LIBXML2=1
+
+:xml2Done
+rm -f junk.c junk.obj
+
if (%jpegsupport%) == (N) goto jpegDone
echo Checking for jpeg-6b...
@@ -757,6 +789,7 @@ if (%doldflags%) == (Y) echo #define USER_LDFLAGS " %escuserldflags%">>config.tm
if (%profile%) == (Y) echo #define PROFILING 1 >>config.tmp
if not "(%HAVE_PNG%)" == "()" echo #define HAVE_PNG 1 >>config.tmp
if not "(%HAVE_GNUTLS%)" == "()" echo #define HAVE_GNUTLS 1 >>config.tmp
+if not "(%HAVE_LIBXML2%)" == "()" echo #define HAVE_LIBXML2 1 >>config.tmp
if not "(%HAVE_JPEG%)" == "()" echo #define HAVE_JPEG 1 >>config.tmp
if not "(%HAVE_GIF%)" == "()" echo #define HAVE_GIF 1 >>config.tmp
if not "(%HAVE_TIFF%)" == "()" echo #define HAVE_TIFF 1 >>config.tmp
@@ -896,6 +929,7 @@ set HAVE_DISTFILES=
set distFilesOk=
set pngsupport=
set tlssupport=
+set libxml2support=
set jpegsupport=
set gifsupport=
set tiffsupport=