Created
August 24, 2012 17:09
-
-
Save auroraeosrose/3452993 to your computer and use it in GitHub Desktop.
support libxml PHP extension shared and against shared dll on windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $Id$ | |
// vim:ft=javascript | |
ARG_WITH("libxml", "LibXML support", "yes"); | |
ARG_WITH("libxmlshared", "LibXML support", "no"); | |
if (PHP_LIBXMLSHARED == "yes") { | |
PHP_LIBXML = PHP_LIBXMLSHARED; | |
PHP_LIBXML_SHARED = PHP_LIBXMLSHARED_SHARED; | |
if (CHECK_LIB("libxml2.lib", "libxml") && | |
CHECK_LIB("libiconv.lib;iconv.lib", "libxml") && | |
CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML") && | |
ADD_EXTENSION_DEP('libxml', 'iconv')) { | |
EXTENSION("libxml", "libxml.c", PHP_LIBXML_SHARED); | |
AC_DEFINE("HAVE_LIBXML", 1, "LibXML support"); | |
ADD_FLAG("CFLAGS_LIBXML", "/D HAVE_WIN32_THREADS "); | |
PHP_INSTALL_HEADERS("ext/libxml/", "php_libxml.h"); | |
} else { | |
WARNING("libxml support can't be enabled, iconv or libxml are missing") | |
PHP_LIBXML = "no" | |
} | |
} else if (PHP_LIBXML == "yes") { | |
if (CHECK_LIB("libxml2_a_dll.lib;libxml2_a.lib", "libxml") && | |
CHECK_LIB("libiconv_a.lib;iconv_a.lib;libiconv.lib;iconv.lib", "libxml") && | |
CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML") && | |
ADD_EXTENSION_DEP('libxml', 'iconv')) { | |
EXTENSION("libxml", "libxml.c", false /* never shared */); | |
AC_DEFINE("HAVE_LIBXML", 1, "LibXML support"); | |
ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC /D LIBXML_STATIC_FOR_DLL /D HAVE_WIN32_THREADS "); | |
if (!PHP_LIBXML_SHARED) { | |
ADD_DEF_FILE("ext\\libxml\\php_libxml2.def"); | |
} | |
PHP_INSTALL_HEADERS("ext/libxml/", "php_libxml.h"); | |
} else { | |
WARNING("libxml support can't be enabled, iconv or libxml are missing") | |
PHP_LIBXML = "no" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @auroraeosrose
Thx for this patch!
Actually on PHP8.1 I'm facing this error with
--with-libxmlshared
andlibxml2.lib
(all works with--with-libxml
andlibxml2_a_dll.lib
)Have you encounter this issue?
What I tried to fix it without success:
libxml/parser.h
tolibxml/threads.h
libxml/threads.h
XMLPUBFUN
forxmlDllMain
__declspec(dllexport)
for__imp_xmlDllMain
LIBXML_STATIC_FOR_DLL
dumpbin /EXPORTS
thatxmlDllMain
is well exposed onlibxml2.lib
/libxml2.dll
win32/dllmain.c
code...Here are: