From 413098d06c1dfe9c3d7a379c8dac74ca57b00e4b Mon Sep 17 00:00:00 2001 From: David Webster Date: Thu, 9 Mar 2000 21:12:50 +0000 Subject: [PATCH] Update for building jpeg as an os2 dll git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6568 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/jpeg/MAKEFILE.VA | 39 +++++++++++++++++++++++++++++++++++++-- src/jpeg/jmorecfg.h | 12 +++++++++++- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/jpeg/MAKEFILE.VA b/src/jpeg/MAKEFILE.VA index 2b4a76bec2..7548d0a8d5 100644 --- a/src/jpeg/MAKEFILE.VA +++ b/src/jpeg/MAKEFILE.VA @@ -13,17 +13,26 @@ OBJSUFF=obj SRCSUFF=cpp -OS2FLAGS=/c /W2 /DOS232 /D__VISAGECPP__ /D__WXPM__ /DJPEGLOCAL /Ss /Q /N100 +OS2FLAGS=/c /W2 /DOS232 /D__VISAGECPP__ /D__WXPM__ /DJPEGLOCAL /Ss /Q /N100 /Tdc OS2LINKFLAGS=/BASE:0x00010000 /PMTYPE:PM /NOE /NOD /ALIGN:16 OS2LIBFLAGS=/NOL /NOE OS2LIBS=CPPOM30.lib CPPOOC3.LIB OS2386.LIB +!if "$(WXMAKINGDLL)" != "0" +EXTRADLLFLAGS=/DWXMAKINGDLL=1 /Ge- /D__OS2DLL__ +EXTRALNKFLAGS=/DLL +!endif + # Change WXDIR or WXWIN to wherever wxWindows is found WXDIR = $(WXWIN) OS2JPEGDIR=$(WXDIR)\src\jpeg OS2JPEGINC=$(WINJPEGDIR) +!if "$(WXMAKINGDLL)" != "1" OS2JPEGLIB=$(WXDIR)\lib\os2jpeg.lib +!else +OS2JPEGLIB=$(WXDIR)\lib\os2jpeg.dll +!endif TEMP1TGT=$(WXDIR)\lib\os2jpeg1.lib TEMP2TGT=$(WXDIR)\lib\os2jpeg2.lib @@ -44,7 +53,12 @@ MAKEPRECOMP=/Fi$(PCH) !endif !if "$(FINAL)" == "0" +!if "$(WXMAKINGDLL)" == "1" +D=DebugOS2DLL +!else D=DebugOS2 +!endif + OPT = DEBUG_FLAGS= /Ti /D__WXDEBUG__ #/Fb LINK_DEBUG_FLAGS=/DEBUG @@ -52,7 +66,11 @@ CRTFLAG=/Gm /Gd !else # /O1 - smallest code # /O2 - fastest code +!if "$(WXMAKINGDLL)" == "1" +D=RelseOS2DLL +!else D=RelseOS2 +!endif OPT = /O+ /Oc /G5 DEBUG_FLAGS= LINK_DEBUG_FLAGS=/RELEASE @@ -62,7 +80,8 @@ CRTFLAG=/Gm /Gd !if [md $(OS2JPEGDIR)\$D] !endif -CPPFLAGS=$(OS2FLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(INC) $(OPT) $(CRTFLAG) +CPPFLAGS=$(OS2FLAGS) $(EXTRADLLFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(INC) $(OPT) $(CRTFLAG) +LINKFKAGS=$(OS2LINKFLAGS) $(EXTRALNKFLAGS) {..\jpeg}.c{..\jpeg\$D}.obj: @echo $< @@ -263,6 +282,8 @@ $(DLIBLIBOBJS): copy ..\jpeg\$D\jquant2.obj copy ..\jpeg\$D\jdmerge.obj +!if "$(WXMAKINGDLL)" != "1" + $(WXDIR)\lib\os2jpeg1.lib: \ $(COMLIBOBJS) \ $(CLIBLIBOBJS) @@ -291,6 +312,20 @@ $(WXDIR)\lib\os2jpeg.lib: \ del $(TEMP1TGT) del $(TEMP2TGT) +!else + +# Update the dynamic link library +$(WXDIR)\lib\os2jpeg.dll: $(OBJECTS) + icc @<< + /B" $(LINKFLAGS)" /Fe$@ + $(LIBS) + $(OBJECTS) + $(WXDIR)\lib\os2jpeg.def +<< + implib $(WXDIR)\lib\os2jpegd.lib $(WXDIR)\lib\os2jpeg.def + +!endif + clean: del $(OS2JPEGLIB) erase /N $(OS2JPEGDIR)\$D diff --git a/src/jpeg/jmorecfg.h b/src/jpeg/jmorecfg.h index 2733047bac..fc34aab470 100644 --- a/src/jpeg/jmorecfg.h +++ b/src/jpeg/jmorecfg.h @@ -186,7 +186,7 @@ typedef unsigned int JDIMENSION; * or code profilers that require it. */ -#if defined(__VISAGECPP__) && !defined(JPEGLOCAL) /* need this for /common/imagjpeg.obj but not loclly */ +#if defined(__VISAGECPP__) /* need this for /common/imagjpeg.obj but not loclly */ /* a function called through method pointers: */ #define METHODDEF(type) static type _Optlink /* a function used only in its module: */ @@ -212,12 +212,22 @@ typedef unsigned int JDIMENSION; * Again, you can customize this if you need special linkage keywords. */ +#if defined(__VISAGECPP__) /* need this for /common/imagjpeg.obj but not loclly */ +#ifdef HAVE_PROTOTYPES +#define JMETHOD(type,methodname,arglist) type (_Optlink *methodname) arglist +#else +#define JMETHOD(type,methodname,arglist) type (_Optlink *methodname) () +#endif + +#else + #ifdef HAVE_PROTOTYPES #define JMETHOD(type,methodname,arglist) type (*methodname) arglist #else #define JMETHOD(type,methodname,arglist) type (*methodname) () #endif +#endif /* Here is the pseudo-keyword for declaring pointers that must be "far" * on 80x86 machines. Most of the specialized coding for 80x86 is handled -- 2.45.2