From c61a46c305c2d88e924cf1403b23798930741787 Mon Sep 17 00:00:00 2001 From: Karl Waclawek Date: Mon, 21 Oct 2002 21:19:41 +0000 Subject: [PATCH] * Applied patch #620822 - Windows Dll build with DEF file * Changed macro for static linking from _STATIC to XML_STATIC and modified expat.h accordingly * Added ReadMe file to Win32 subdirectory documenting Windows builds * Changed static build settings to create libraries with names different from the Dll stub library libexpat(w).lib --- expat/examples/elements.dsp | 8 ++--- expat/lib/expat.dsp | 4 +++ expat/lib/expat.h | 2 +- expat/lib/expat_static.dsp | 4 +-- expat/lib/expatw.dsp | 4 +++ expat/lib/expatw_static.dsp | 8 ++--- expat/lib/libexpat.def | 61 +++++++++++++++++++++++++++++++++++++ expat/lib/libexpatw.def | 61 +++++++++++++++++++++++++++++++++++++ expat/lib/xmlparse.c | 6 +--- expat/win32/README.txt | 44 ++++++++++++++++++++++++++ 10 files changed, 186 insertions(+), 16 deletions(-) create mode 100644 expat/lib/libexpat.def create mode 100644 expat/lib/libexpatw.def create mode 100644 expat/win32/README.txt diff --git a/expat/examples/elements.dsp b/expat/examples/elements.dsp index e2eaa578..8caa2798 100644 --- a/expat/examples/elements.dsp +++ b/expat/examples/elements.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\lib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_STATIC" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\lib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "XML_STATIC" /FD /c # SUBTRACT CPP /X /YX # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 odbccp32.lib libexpat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib /nologo /subsystem:console /pdb:none /machine:I386 /libpath:"..\lib\Release_static" +# ADD LINK32 odbccp32.lib libexpatMT.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib /nologo /subsystem:console /pdb:none /machine:I386 /libpath:"..\lib\Release_static" !ELSEIF "$(CFG)" == "elements - Win32 Debug" @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm- /GX /ZI /Od /I "..\lib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_STATIC" /FR /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /I "..\lib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "XML_STATIC" /FR /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe @@ -75,7 +75,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 odbccp32.lib libexpat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /libpath:"..\lib\Debug_static" +# ADD LINK32 odbccp32.lib libexpatMT.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /libpath:"..\lib\Debug_static" !ENDIF diff --git a/expat/lib/expat.dsp b/expat/lib/expat.dsp index c0d445ef..441c69b5 100644 --- a/expat/lib/expat.dsp +++ b/expat/lib/expat.dsp @@ -92,6 +92,10 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File +SOURCE=.\libexpat.def +# End Source File +# Begin Source File + SOURCE=.\xmlparse.c !IF "$(CFG)" == "expat - Win32 Release" diff --git a/expat/lib/expat.h b/expat/lib/expat.h index ccd52b0b..958a9261 100644 --- a/expat/lib/expat.h +++ b/expat/lib/expat.h @@ -18,7 +18,7 @@ #ifndef XMLPARSEAPI #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) -#ifdef _STATIC +#ifdef XML_STATIC #define XMLPARSEAPI(type) type __cdecl #else #define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl diff --git a/expat/lib/expat_static.dsp b/expat/lib/expat_static.dsp index d2435765..62e5530c 100644 --- a/expat/lib/expat_static.dsp +++ b/expat/lib/expat_static.dsp @@ -50,7 +50,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Release_static\libexpat.lib" +# ADD LIB32 /nologo /out:"Release_static\libexpatMT.lib" !ELSEIF "$(CFG)" == "expat_static - Win32 Debug" @@ -74,7 +74,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Debug_static\libexpat.lib" +# ADD LIB32 /nologo /out:"Debug_static\libexpatMT.lib" !ENDIF diff --git a/expat/lib/expatw.dsp b/expat/lib/expatw.dsp index 62ed94ce..944edb56 100644 --- a/expat/lib/expatw.dsp +++ b/expat/lib/expatw.dsp @@ -93,6 +93,10 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File +SOURCE=.\libexpatw.def +# End Source File +# Begin Source File + SOURCE=.\xmlparse.c !IF "$(CFG)" == "expatw - Win32 Release" diff --git a/expat/lib/expatw_static.dsp b/expat/lib/expatw_static.dsp index a1b912dc..c3660480 100644 --- a/expat/lib/expatw_static.dsp +++ b/expat/lib/expatw_static.dsp @@ -50,7 +50,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Release-w_static\libexpatw.lib" +# ADD LIB32 /nologo /out:"Release-w_static\libexpatwMT.lib" !ELSEIF "$(CFG)" == "expatw_static - Win32 Debug" @@ -64,8 +64,8 @@ LIB32=link.exe -lib # PROP Output_Dir "Debug-w_static" # PROP Intermediate_Dir "Debug-w_static" # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm- /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "COMPILED_FROM_DSP" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "COMPILED_FROM_DSP" /D "_MBCS" /D "_LIB" /FR /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x1009 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" @@ -74,7 +74,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"Debug-w_static\libexpat.lib" +# ADD LIB32 /nologo /out:"Debug-w_static\libexpatwMT.lib" !ENDIF diff --git a/expat/lib/libexpat.def b/expat/lib/libexpat.def new file mode 100644 index 00000000..59805079 --- /dev/null +++ b/expat/lib/libexpat.def @@ -0,0 +1,61 @@ +LIBRARY LIBEXPAT +DESCRIPTION "Implements an XML parser." +EXPORTS + XML_DefaultCurrent @1 + XML_ErrorString @2 + XML_ExpatVersion @3 + XML_ExpatVersionInfo @4 + XML_ExternalEntityParserCreate @5 + XML_GetBase @6 + XML_GetBuffer @7 + XML_GetCurrentByteCount @8 + XML_GetCurrentByteIndex @9 + XML_GetCurrentColumnNumber @10 + XML_GetCurrentLineNumber @11 + XML_GetErrorCode @12 + XML_GetIdAttributeIndex @13 + XML_GetInputContext @14 + XML_GetSpecifiedAttributeCount @15 + XML_Parse @16 + XML_ParseBuffer @17 + XML_ParserCreate @18 + XML_ParserCreateNS @19 + XML_ParserCreate_MM @20 + XML_ParserFree @21 + XML_SetAttlistDeclHandler @22 + XML_SetBase @23 + XML_SetCdataSectionHandler @24 + XML_SetCharacterDataHandler @25 + XML_SetCommentHandler @26 + XML_SetDefaultHandler @27 + XML_SetDefaultHandlerExpand @28 + XML_SetDoctypeDeclHandler @29 + XML_SetElementDeclHandler @30 + XML_SetElementHandler @31 + XML_SetEncoding @32 + XML_SetEndCdataSectionHandler @33 + XML_SetEndDoctypeDeclHandler @34 + XML_SetEndElementHandler @35 + XML_SetEndNamespaceDeclHandler @36 + XML_SetEntityDeclHandler @37 + XML_SetExternalEntityRefHandler @38 + XML_SetExternalEntityRefHandlerArg @39 + XML_SetNamespaceDeclHandler @40 + XML_SetNotStandaloneHandler @41 + XML_SetNotationDeclHandler @42 + XML_SetParamEntityParsing @43 + XML_SetProcessingInstructionHandler @44 + XML_SetReturnNSTriplet @45 + XML_SetStartCdataSectionHandler @46 + XML_SetStartDoctypeDeclHandler @47 + XML_SetStartElementHandler @48 + XML_SetStartNamespaceDeclHandler @49 + XML_SetUnknownEncodingHandler @50 + XML_SetUnparsedEntityDeclHandler @51 + XML_SetUserData @52 + XML_SetXmlDeclHandler @53 + XML_UseParserAsHandlerArg @54 + XML_ParserReset @55 + XML_SetSkippedEntityHandler @56 + XML_GetFeatureList @57 + XML_UseForeignDTD @58@ diff --git a/expat/lib/libexpatw.def b/expat/lib/libexpatw.def new file mode 100644 index 00000000..5477a521 --- /dev/null +++ b/expat/lib/libexpatw.def @@ -0,0 +1,61 @@ +LIBRARY LIBEXPATW +DESCRIPTION "Implements an XML parser." +EXPORTS + XML_DefaultCurrent @1 + XML_ErrorString @2 + XML_ExpatVersion @3 + XML_ExpatVersionInfo @4 + XML_ExternalEntityParserCreate @5 + XML_GetBase @6 + XML_GetBuffer @7 + XML_GetCurrentByteCount @8 + XML_GetCurrentByteIndex @9 + XML_GetCurrentColumnNumber @10 + XML_GetCurrentLineNumber @11 + XML_GetErrorCode @12 + XML_GetIdAttributeIndex @13 + XML_GetInputContext @14 + XML_GetSpecifiedAttributeCount @15 + XML_Parse @16 + XML_ParseBuffer @17 + XML_ParserCreate @18 + XML_ParserCreateNS @19 + XML_ParserCreate_MM @20 + XML_ParserFree @21 + XML_SetAttlistDeclHandler @22 + XML_SetBase @23 + XML_SetCdataSectionHandler @24 + XML_SetCharacterDataHandler @25 + XML_SetCommentHandler @26 + XML_SetDefaultHandler @27 + XML_SetDefaultHandlerExpand @28 + XML_SetDoctypeDeclHandler @29 + XML_SetElementDeclHandler @30 + XML_SetElementHandler @31 + XML_SetEncoding @32 + XML_SetEndCdataSectionHandler @33 + XML_SetEndDoctypeDeclHandler @34 + XML_SetEndElementHandler @35 + XML_SetEndNamespaceDeclHandler @36 + XML_SetEntityDeclHandler @37 + XML_SetExternalEntityRefHandler @38 + XML_SetExternalEntityRefHandlerArg @39 + XML_SetNamespaceDeclHandler @40 + XML_SetNotStandaloneHandler @41 + XML_SetNotationDeclHandler @42 + XML_SetParamEntityParsing @43 + XML_SetProcessingInstructionHandler @44 + XML_SetReturnNSTriplet @45 + XML_SetStartCdataSectionHandler @46 + XML_SetStartDoctypeDeclHandler @47 + XML_SetStartElementHandler @48 + XML_SetStartNamespaceDeclHandler @49 + XML_SetUnknownEncodingHandler @50 + XML_SetUnparsedEntityDeclHandler @51 + XML_SetUserData @52 + XML_SetXmlDeclHandler @53 + XML_UseParserAsHandlerArg @54 + XML_ParserReset @55 + XML_SetSkippedEntityHandler @56 + XML_GetFeatureList @57 + XML_UseForeignDTD @58@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 0dcf61df..fff5b481 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -8,11 +8,7 @@ #ifdef COMPILED_FROM_DSP #include "winconfig.h" -#ifdef _LIB #define XMLPARSEAPI(type) type __cdecl -#else -#define XMLPARSEAPI(type) __declspec(dllexport) type __cdecl -#endif #include "expat.h" #undef XMLPARSEAPI @@ -26,7 +22,7 @@ #include #ifdef __declspec -#define XMLPARSEAPI(type) __declspec(dllexport) type __cdecl +#define XMLPARSEAPI(type) type __cdecl #endif #include "expat.h" diff --git a/expat/win32/README.txt b/expat/win32/README.txt new file mode 100644 index 00000000..63c49bd5 --- /dev/null +++ b/expat/win32/README.txt @@ -0,0 +1,44 @@ + +Expat can be built on Windows in three ways: + using MS Visual C++ 6, Borland C++ Builder 5 or Cygwin. + +* Cygwin: + This follows the Unix build procedures. + +* C++ Builder 5: + Possible with make files in the BCB5 subdirectory. + Details can be found in the ReadMe file located there. + +* MS Visual C++ 6: + Based on workspace (.dsw) and project files (.dsp) + located in the lib subdirectory. + +* Special note about building static libraries under MS VC++: + + There are three possible configurations: using the + single threaded or multithreaded run-time library, + or using the multi-threaded run-time Dll. That is, + one can build three different Expat libraries depending + on the needs of the application. + + The libraries should be named like this: + Single-theaded: libexpatML.lib + Multi-threaded: libexpatMT.lib + Multi-threaded Dll: libexpatMD.lib + The suffixes conform to the compiler switch settings + /ML, /MT and /MD for MS VC++. + + By default, the expat-static and expatw-static projects + are set up to link against the multithreaded run-time library, + so they will build libexpatMT.lib or libexpatwMT.lib files. + + To build the other versions of the static library, + go to Project - Settings: + - specify a different RTL linkage on the C/C++ tab + under the category Code Generation. + - then, on the Library tab, change the output file name + accordingly, as described above + + An application linking to the static libraries must + have the global macro XML_STATIC defined. + @ -- 2.40.0