diff --git a/ChangeLog b/ChangeLog index dd044772..f7821333 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 30 20:01:21 CET 2005 Daniel Veillard + + * tests/plugins/testplugin.c win32/Makefile.msvc win32/configure.js: + applied plugin patch for Windows by Joel Reed + Fri Jan 28 01:00:56 CET 2005 Daniel Veillard * win32/configure.js: Makefile fixes for Widows from Joel Reed diff --git a/tests/plugins/testplugin.c b/tests/plugins/testplugin.c index eba609fc..68ffa980 100644 --- a/tests/plugins/testplugin.c +++ b/tests/plugins/testplugin.c @@ -9,7 +9,6 @@ * daniel@veillard.com */ -#define IN_LIBXSLT #include #ifdef WITH_MODULES @@ -33,6 +32,14 @@ #define XSLT_TESTPLUGIN_URL "http://xmlsoft.org/xslt/testplugin" +/* make sure init function is exported on win32 */ +#if defined(_WIN32) + #define PLUGINPUBFUN __declspec(dllexport) +#else + #define PLUGINPUBFUN +#endif + + /************************************************************************ * * * Test plugin module http://xmlsoft.org/xslt/testplugin * @@ -311,7 +318,7 @@ xsltExtStyleShutdownTest(xsltStylesheetPtr style ATTRIBUTE_UNUSED, */ void -XSLTPUBFUN xmlsoft_org_xslt_testplugin_init(void) +PLUGINPUBFUN xmlsoft_org_xslt_testplugin_init(void) { xsltRegisterExtModuleFull((const xmlChar *) XSLT_TESTPLUGIN_URL, xsltExtInitTest, xsltExtShutdownTest, diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc index cf40a8b3..1ea64f0b 100644 --- a/win32/Makefile.msvc +++ b/win32/Makefile.msvc @@ -329,6 +329,38 @@ APPLIBS = $(LIBS) libxml2.lib # Builds xsltproc and friends. Uses the implicit rule for commands. $(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxslt libxslta libexslt libexslta +# plugins only work with non-static builds currently. +!if "$(STATIC)" == "0" + +TESTPLUGIN_SRCDIR = $(BASEDIR)\tests\plugins +TESTPLUGIN_DIR = $(TESTPLUGIN_SRCDIR)\plugin +TESTPLUGIN_SO = xmlsoft_org_xslt_testplugin.dll +TESTPLUGIN_OBJS = $(TESTPLUGIN_DIR)\testplugin.obj + +testplugin: + if exist $(TESTPLUGIN_DIR) rmdir /S /Q $(TESTPLUGIN_DIR) + $(MAKE) $(TESTPLUGIN_DIR)\$(TESTPLUGIN_SO) + +$(TESTPLUGIN_DIR) : + if not exist $(TESTPLUGIN_DIR) mkdir $(TESTPLUGIN_DIR) + +{$(TESTPLUGIN_SRCDIR)}.c{$(TESTPLUGIN_DIR)}.obj:: + $(CC) $(CFLAGS) /Fo$(TESTPLUGIN_DIR)\ /c $< + +# Creates the testplugin archive. +$(TESTPLUGIN_DIR)\$(TESTPLUGIN_SO) : $(TESTPLUGIN_DIR) $(TESTPLUGIN_OBJS) libxslt + $(LD) $(LDFLAGS) /DLL $(XSLT_IMP) $(APPLIBS) $(LIBS)\ + /OUT:$(TESTPLUGIN_DIR)\$(TESTPLUGIN_SO) \ + $(TESTPLUGIN_OBJS) + +!else + +testplugin: + @echo "plugins are disabled with static=yes" + +!endif + + # Source dependences should be autogenerated somehow here, but how to # do it? I have no clue. diff --git a/win32/configure.js b/win32/configure.js index 5e95a603..9671e18c 100644 --- a/win32/configure.js +++ b/win32/configure.js @@ -396,6 +396,15 @@ if (cruntime == "/MT" || cruntime == "/MTd" || buildStatic = 1; } +if (buildStatic == 1 && withModules == 1) { + WScript.Echo("Warning: Disabling plugin support."); + WScript.Echo(""); + WScript.Echo("Modules cannot be enabled when a statically linked cruntime has"); + WScript.Echo("been selected, or when xsltproc.exe is linked statically to libxslt."); + WScript.Echo(""); + withModules=0; +} + dirSep = "\\"; //if (compiler == "mingw") // dirSep = "/";