From 6829b110f6483ad8d6f5855d5709dae2bba3b399 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Wed, 23 Mar 2022 15:52:07 +0800 Subject: neon.mak: Support building against libxml2 too Allow the build to support building against libxml2 too, if one explicitly requests for it and not request Expat. This means that if both are requested, Expat is preferred over libxml2. Drop the parts where we try to integrate the build with the Expat sources since it seems that the it is no longer bundled and the Visual Studio build files and layout has changed quite a bit as it switched to CMake. Update entries in the NMake Makefile to support both types of XML support. --- neon.mak | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/neon.mak b/neon.mak index 6fadb43..a5654a6 100644 --- a/neon.mak +++ b/neon.mak @@ -33,34 +33,29 @@ CFLAGS = $(CFLAGS) /D HAVE_SSPI !ENDIF ######## -# Support for Expat integration +# Support for Expat or libxml2 integration # -# If EXPAT_SRC or EXPAT_INC are set, then assume compiling against a -# pre-built binary Expat 1.95.X. You can use either EXPAT_SRC -# to specify the top-level Expat directory, or EXPAT_INC to directly -# specify the Expat include directory. (If both are set, EXPAT_SRC -# is ignored). -# -# If EXPAT_SRC and EXPAT_INC are not set, then the user can -# still set EXPAT_FLAGS to specify very specific compile behavior. -# -# If none of EXPAT_SRC, EXPAT_INC and EXPAT_FLAGS are set, disable -# WebDAV support. +# If USE_EXPAT or USE_LIBXML are set, then assume compiling against a +# pre-built binary Expat or libxml2. Note that if both are set, USE_EXPAT is +# assumed and USE_LIBXML is ignored. If neither of USE_EXPAT or USE_LIBXML are +# set, disable WebDAV support. -!IF "$(EXPAT_INC)" == "" -!IF "$(EXPAT_SRC)" != "" -EXPAT_INC = $(EXPAT_SRC)\Source\Lib -!ENDIF +!IF DEFINED (USE_EXPAT) && DEFINED (USE_LIBXML) +!MESSAGE Expat is preferred over LibXML2 !ENDIF -BUILD_EXPAT = 1 -!IF "$(EXPAT_INC)" == "" -!IFNDEF EXPAT_FLAGS -EXPAT_FLAGS = -BUILD_EXPAT = +!IFDEF USE_EXPAT +BUILD_XML_SUPPORT = 1 +NE_XML_FLAGS = /D HAVE_EXPAT /D NE_HAVE_DAV +EXPAT_LIBS = libexpat.lib +NE_DEP_LIBS = $(NE_DEP_LIBS) $(EXPAT_LIBS) !ENDIF -!ELSE -EXPAT_FLAGS = /I "$(EXPAT_INC)" /D HAVE_EXPAT /D HAVE_EXPAT_H /D NE_HAVE_DAV + +!IF DEFINED(USE_LIBXML) && !DEFINED(USE_EXPAT) +BUILD_XML_SUPPORT = 1 +NE_XML_FLAGS = /D HAVE_LIBXML /D NE_HAVE_DAV +LIBXML_LIBS = libxml2.lib +NE_DEP_LIBS = $(NE_DEP_LIBS) $(LIBXML_LIBS) !ENDIF ######## @@ -134,7 +129,7 @@ IPV6_FLAGS = /D USE_GETADDRINFO WIN32_DEFS = /D WIN32_LEAN_AND_MEAN /D NOUSER /D NOGDI /D NONLS /D NOCRYPT CPP=cl.exe -CPP_PROJ = /c /nologo $(CFLAGS) $(WIN32_DEFS) $(EXPAT_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) $(IPV6_FLAGS) /D "HAVE_CONFIG_H" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" +CPP_PROJ = /c /nologo $(CFLAGS) $(WIN32_DEFS) $(NE_XML_FLAGS) $(OPENSSL_FLAGS) $(ZLIB_FLAGS) $(IPV6_FLAGS) /D "HAVE_CONFIG_H" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" LIB32=link.exe -lib LIB32_FLAGS=/nologo /out:"$(TARGET)" @@ -157,7 +152,7 @@ LIB32_OBJS= \ "$(INTDIR)\ne_uri.obj" \ "$(INTDIR)\ne_utils.obj" -!IF "$(BUILD_EXPAT)" != "" +!IF "$(BUILD_XML_SUPPORT)" != "" LIB32_OBJS= \ $(LIB32_OBJS) \ "$(INTDIR)\ne_207.obj" \ -- cgit v1.2.1