Re: [xml] Building libxml2 as a DLL under MinGW MSYS



On Tue, Sep 24, 2002 at 04:21:13PM +0000, 
jhheider attbi com wrote:
When I build libxml as a DLL using the
win32/Makefile.mingw, I get errors indicating that 
the 
code I'm using can't find _imp__xmlFree. A co-worker 
and
I are using libxml with Peter Jones's xmlwrapp C++
wrapper (http://pmade.org/pjones/software/xmlwrapp/)
and we came up with a way to build the system with 
only
minor changes to source files. I'm not as familar as 
I'd
like to be with the autotools for configuration, so 
this
can probably be improved, but these changes do allow 
us
to build a dll that works with xmlwrapp. These 
changes
are against the 2.4.24 source using the MSYS 
environment
from the MinGW folks 
(http://www.mingw.org/msys.shtml).
Hope this helps.

Please let me know if I can be of further assistance
getting these changes integrated.

   What do they do ? A patch without explanation of 
what it's
supposed to do has little chances to get in. Give 
details please !

Daniel


Of course. By file:

include/libxml/entities.h
include/libxml/parser.h
  - Added 'LIBXML_DLL_IMPORT' to all function definitions
    for replacement with __declspec(dllimport) or 
    __declspec(dllexport) as needed.

include/libxml/tree.h
  - Same as above
  - Replaced
#if defined(WIN32) && (defined(_MSC_VER) || defined
(__BORLANDC__))
    with
#if defined(__WIN32__)
    since MinGW compiler doesn't define either of these.

include/libxml/xmlversion.h
  - disabled libiconv

include/win32config.h
  - changed an 
#ifdef _MSC_VER
    to
#if defined(_MSC_VER) || defined(__MINGW32__)
  - expanded 'LIBXML_DLL_IMPORT' logic to set both
    __declspec(dllimport) and __declspec(dllexport)
    as appropriate.

configure
  - added a block to set NEED_TRIO, LDFLAGS, and CPPFLAGS
    appropriately for MINGW32. Also added an 
    ADDIITIONAL_DLL_COMMANDS replacement to insert dll
    commands in the makefile.

trio.h
  - modified this block
#if defined(WIN32) && !defined(isascii)
# define isascii ((unsigned)(x) < 0x80)
#endif
    by inserting '0 &&' after '#if'. It looks like 'x'
    should be a macro arguement, and gcc seems to have no
    problem without this.

Makefile.in
  - Added '@ADDITIONAL_DLL_COMMANDS@' for insertion of
    additional calls.

I realize that not all of the changes may require
modification so as to not change any already existing
functionality, but as they stand, they comprise a 
sufficient set to allow one to build libxml under MSYS.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]