Skip to content

Commit

Permalink
Fix build with mingw
Browse files Browse the repository at this point in the history
- include/libxml/xmlexports.h: restore export decoration otherwise
  xsltproc and xmlsec crash
- libxml.h: define LIBXML_STATIC for static build
- configure.in: enable modules support for mingw* builds
- Makefile.am: flags for testdso if modules support enabled
  • Loading branch information
petrovr authored and veillard committed Mar 10, 2010
1 parent 3157e51 commit 120a269
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ testModule_LDADD= $(LDADDS)

noinst_LTLIBRARIES = testdso.la
testdso_la_SOURCES = testdso.c
testdso_la_LDFLAGS = -module -rpath $(libdir)
testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir)

# that one forces the rebuild when "make rebuild" is run on doc/
rebuild_testapi:
Expand Down
4 changes: 4 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,10 @@ if test "$with_modules" != "no" ; then
AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
])
;;
*-*-mingw*)
MODULE_EXTENSION=".dll"
WITH_MODULES=1
;;
*)
AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
AC_CHECK_LIB(dld, shl_load, [
Expand Down
2 changes: 1 addition & 1 deletion include/libxml/xmlexports.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
* _imp__xmlFree listed as missing. Try to workaround the problem
* by also making that declaration when compiling client code.
*/
#if !defined(LIBXML_STATIC)
#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
#define XMLPUBFUN __declspec(dllexport)
#define XMLPUBVAR __declspec(dllexport)
#else
Expand Down
3 changes: 3 additions & 0 deletions libxml.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,7 @@ void __xmlGlobalInitMutexDestroy(void);
#endif
#endif
#endif
#ifndef PIC
# define LIBXML_STATIC
#endif
#endif /* ! __XML_LIBXML_H__ */

0 comments on commit 120a269

Please sign in to comment.