First stepps to make it possible to build libsmi as a .dll

Hi, Included patches to split makefile Into config.nmake and makefile add add a smi.def file needed when building a .dll If this is acceptable I will try to make a common makefile for both options (.exe vs .dll).
Regards Anders
Index: config.nmake =================================================================== --- config.nmake (revision 0) +++ config.nmake (revision 0) @@ -0,0 +1,50 @@ +# $Id$ +# +# +# + +## +## Project directories -- these may need to be customized for your site +## +## ROOT -- top of the source tree. +## TMPDIR -- location for .obj files. +## TOOLS32 -- location of VC++ compiler installation. +## +ROOT = ... +TMPDIR = . +#TOOLS32 = C:\MSDEV +TOOLS32 = C:\PROGRA~1\MICROS~2\VC98 + +## +## Installation paths: +## +## MIBROOT -- definition for default search path (unix-style) +## MIBDIR -- same in windows style +## PIBDIR -- same in windows style +## BINDIR -- destination for the binaries (smidump.exe, ...) +## LIBDIR -- destination for the library (smi.lib) +## +MIBROOT = c:/smi/mibs +PIBROOT = c:/smi/pibs +INSTROOT = c:\smi +MIBDIR = $(INSTROOT)\mibs +PIBDIR = $(INSTROOT)\pibs +BINDIR = $(INSTROOT)\bin +LIBDIR = $(INSTROOT)\lib + +## +## Visual C++ tools +## +PATH=$(TOOLS32)\bin;$(PATH) + +cc32 = cl +CP = copy +RM = del +MKDIR = md + +## +## Definitions: +## +# DEBUG = -W3 -Zi -Od /Yd +INCLUDES = -I$(ROOT)\lib -I$(ROOT)\win -I$(TOOLS32)\include +DEFINES = $(DEBUG) -D_CRT_SECURE_NO_DEPRECATE=1 Index: smi.def =================================================================== --- smi.def (revision 0) +++ smi.def (revision 0) @@ -0,0 +1,102 @@ +EXPORTS +optParseOptions +smiInit +smiExit +smiSetErrorLevel +smiGetFlags +smiSetFlags +smiGetPath +smiSetPath +smiSetSeverity +smiReadConfig +smiLoadModule +smiIsLoaded +smiSetErrorHandler +smiGetModule +smiGetFirstModule +smiGetNextModule +smiGetModuleIdentityNode +smiGetFirstImport +smiGetNextImport +smiIsImported +smiGetFirstRevision +smiGetNextRevision +smiGetRevisionLine +smiGetType +smiGetFirstType +smiGetNextType +smiGetParentType +smiGetTypeModule +smiGetTypeLine +smiGetFirstRange +smiGetNextRange +smiGetFirstNamedNumber +smiGetNextNamedNumber +smiGetMacro +smiGetFirstMacro +smiGetNextMacro +smiGetMacroModule +smiGetNode +smiGetNodeByOID +smiGetFirstNode +smiGetNextNode +smiGetParentNode +smiGetRelatedNode +smiGetFirstChildNode +smiGetNextChildNode +smiGetNodeModule +smiGetNodeType +smiGetNodeLine +smiGetFirstElement +smiGetNextElement +smiGetElementNode +smiGetFirstOption +smiGetNextOption +smiGetOptionNode +smiGetOptionLine +smiGetFirstRefinement +smiGetNextRefinement +smiGetRefinementNode +smiGetRefinementType +smiGetRefinementWriteType +smiGetRefinementLine +smiGetFirstUniquenessElement +smiRenderOID +smiRenderValue +smiRenderNode +smiRenderType +smiAsprintf +smiVasprintf +smiGetErrorDescription +smiGetErrorMsg +smiGetErrorTag +smiGetErrorSeverity +smiGetParentIdentity +smiGetNextIdentity +smiGetFirstIdentity +smiGetParentClass +smiGetNextClass +smiGetFirstClass +smiGetNextUniqueAttribute +smiGetFirstUniqueAttribute +smiIsClassScalar +smiGetAttributeParentType +smiGetAttributeParentClass +smiGetNextAttribute +smiGetFirstAttribute +smiGetAttributeNextRange +smiGetAttributeFirstRange +smiGetAttributeNextNamedNumber +smiGetAttributeFirstNamedNumber +smiGetNextEvent +smiGetFirstEvent +smiGetMinSize +smiGetMinSize +smiGetMinSize +smiGetMinSize +smiGetMaxSize +smiGetMaxSize +smiGetMaxSize +smiGetMaxSize +smiGetMinMaxRange +smiGetMinMaxRange Index: makefile =================================================================== --- makefile (revision 8059) +++ makefile (working copy) @@ -13,52 +13,7 @@ # # @(#) $Id$
-## -## Project directories -- these may need to be customized for your site -## -## ROOT -- top of the source tree. -## TMPDIR -- location for .obj files. -## TOOLS32 -- location of VC++ compiler installation. -## -ROOT = ... -TMPDIR = . -#TOOLS32 = C:\MSDEV -TOOLS32 = C:\PROGRA~1\MICROS~2\VC98 - -## -## Installation paths: -## -## MIBROOT -- definition for default search path (unix-style) -## MIBDIR -- same in windows style -## PIBDIR -- same in windows style -## BINDIR -- destination for the binaries (smidump.exe, ...) -## LIBDIR -- destination for the library (smi.lib) -## -MIBROOT = c:/smi/mibs -PIBROOT = c:/smi/pibs -INSTROOT = c:\smi -MIBDIR = $(INSTROOT)\mibs -PIBDIR = $(INSTROOT)\pibs -BINDIR = $(INSTROOT)\bin -LIBDIR = $(INSTROOT)\lib - -## -## Visual C++ tools -## -PATH=$(TOOLS32)\bin;$(PATH) - -cc32 = cl -CP = copy -RM = del -MKDIR = md - -## -## Definitions: -## -# DEBUG = -W3 -Zi -Od /Yd -INCLUDES = -I$(ROOT)\lib -I$(ROOT)\win -I$(TOOLS32)\include -DEFINES = $(DEBUG) -D_CRT_SECURE_NO_DEPRECATE=1 - +!include "config.nmake" !include <win32.mak>
## @@ -150,11 +105,13 @@ # (flex-src avoids missing unistd.h if _Win32 defined) # $(TMPDIR)\scanner-smi.obj : $(ROOT)\lib\scanner-smi.c - $(cc32) $(cdebug) $(cflags) -D_Win32 -D__STDC__ $(INCLUDES) \ + $(cc32) $(cdebug) $(cflags) -D_Win32 -D__STDC__ $(INCLUDES) \ + -DYY_NEVER_INTERACTIVE \ $(DEFINES) -Fo$(TMPDIR)\ $?
$(TMPDIR)\scanner-sming.obj : $(ROOT)\lib\scanner-sming.c - $(cc32) $(cdebug) $(cflags) -D_Win32 -D__STDC__ $(INCLUDES) \ + $(cc32) $(cdebug) $(cflags) -D_Win32 -D__STDC__ $(INCLUDES) \ + -DYY_NEVER_INTERACTIVE \ $(DEFINES) -Fo$(TMPDIR)\ $?
@@ -182,12 +139,12 @@ /osmixlate.exe $(SMIXLATEOBJS) $(SMILIB)
clean: - del *.lib - del *.obj - del *.exe - del *.ilk - del *.pdb - del *.mdp + rm -f *.lib + rm -f *.obj + rm -f *.exe + rm -f *.ilk + rm -f *.pdb + rm -f *.mdp
install: all install-doc install-bin install-lib install-mibs install-pibs

On Wed, Apr 16, 2008 at 11:07:56AM +0200, Anders Broman wrote:
Included patches to split makefile Into config.nmake and makefile add add a smi.def file needed when building a .dll If this is acceptable I will try to make a common makefile for both options (.exe vs .dll).
Sounds good to me. I am happy to check in any solution that makes builds on Windows easier and to which people can agree. My only stake in the win directory is Makefile.mingw which I have occasionally used to cross-compile things.
/js

Hi, With the following files I think it works. Regards Anders
-----Original Message----- From: Juergen Schoenwaelder [mailto:j.schoenwaelder@jacobs-university.de] Sent: den 16 april 2008 11:20 To: Anders Broman Cc: libsmi@ibr.cs.tu-bs.de Subject: Re: [libsmi] First stepps to make it possible to build libsmi as a.dll
On Wed, Apr 16, 2008 at 11:07:56AM +0200, Anders Broman wrote:
Included patches to split makefile Into config.nmake and makefile add add a smi.def file needed when building a .dll If this is acceptable I will try to make a common makefile for both options (.exe vs .dll).
Sounds good to me. I am happy to check in any solution that makes builds on Windows easier and to which people can agree. My only stake in the win directory is Makefile.mingw which I have occasionally used to cross-compile things.
/js

On Wed, Apr 16, 2008 at 03:34:04PM +0200, Anders Broman wrote:
With the following files I think it works.
Can someone here confirm?
If there are no objections, I will copy the new files into the repository.
/js
participants (2)
-
Anders Broman
-
Juergen Schoenwaelder