From 7fee680be802877ac483e22ee68e3c1957663d0b Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 19 Mar 2000 14:47:13 +0000 Subject: [PATCH] Some VC++ makefile fixes; minor comment mods to setup0.h git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6857 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/msw.rsp | 4 ++-- distrib/msw/tmake/vc.t | 21 +++++++++++++++------ docs/msw/install.txt | 23 ++++++++++++++++++----- include/wx/msw/setup0.h | 9 +-------- samples/minimal/makefile.vc | 6 ++++++ src/makeprog.vc | 4 ++-- src/msw/app.cpp | 2 +- src/msw/dummy.cpp | 2 +- src/msw/font.cpp | 6 +----- src/msw/makefile.vc | 10 ++++------ src/png/makefile.vc | 4 ++-- src/zlib/makefile.vc | 2 +- 12 files changed, 54 insertions(+), 39 deletions(-) diff --git a/distrib/msw/msw.rsp b/distrib/msw/msw.rsp index 7676207376..97d6d40d5f 100644 --- a/distrib/msw/msw.rsp +++ b/distrib/msw/msw.rsp @@ -1,5 +1,7 @@ Mingw32-gcc295.patches +lib/dummy +lib/wx*.def lib/watcom/*.txt lib/watcom/*.lib lib/watcom/*.bat @@ -85,8 +87,6 @@ include/wx/msw/*.cur include/wx/msw/*.ico include/wx/msw/*.bmp -lib/dummy - samples/ownerdrw/*.cpp samples/ownerdrw/*.h samples/ownerdrw/makefile.* diff --git a/distrib/msw/tmake/vc.t b/distrib/msw/tmake/vc.t index 3f0cb99c90..97f19d896b 100644 --- a/distrib/msw/tmake/vc.t +++ b/distrib/msw/tmake/vc.t @@ -160,9 +160,6 @@ all: dirs $(DUMMYOBJ) $(OBJECTS) $(PERIPH_TARGET) png zlib xpm jpeg tiff $(LI dirs: $(MSWDIR)\$D $(COMMDIR)\$D $(GENDIR)\$D $(OLEDIR)\$D $(HTMLDIR)\$D -test: $(MSWDIR)\$D\wave.obj -test2: ..\common\Debug\config.obj - $D: mkdir $D @@ -221,7 +218,7 @@ $(WXDIR)\lib\$(WXLIBNAME).lib: $D\dummy.obj $(OBJECTS) $(PERIPH_LIBS) $(implib) @<< -out:$@ -machine:$(CPU) -$(OBJECTS) $(PERIPH_LIBS) +$(OBJECTS) $D\dummy.obj $(PERIPH_LIBS) << !else @@ -263,7 +260,8 @@ $(CPPFLAGS) $(MAKEPRECOMP) /Fo$D\dummydll.obj /c /Tp dummydll.cpp << # Compile certain files with no optimization (some files cause a -# compiler crash for buggy versions of VC++, e.g. 4.0) +# compiler crash for buggy versions of VC++, e.g. 4.0). +# Don't forget to put FINAL=1 on the command line. noopt: cl @<< $(CPPFLAGS2) /Od /Fo$(COMMDIR)\$D\datetime.obj /c /Tp $(COMMDIR)\datetime.cpp @@ -431,7 +429,7 @@ clean: $(PERIPH_CLEAN_TARGET) -erase $(COMMDIR)\$D\*.obj -erase $(COMMDIR)\$D\*.pdb -erase $(COMMDIR)\$D\*.sbr - -erase $(COMMDIR)\\y_tab.c + -erase $(COMMDIR)\y_tab.c -erase $(COMMDIR)\lex_yy.c -erase $(MSWDIR)\$D\*.obj -erase $(MSWDIR)\$D\*.sbr @@ -615,6 +613,17 @@ $(WXDIR)\docs\ps\referenc.ps: $(WXDIR)\docs\latex\wx\referenc.dvi move referenc.ps $(WXDIR)\docs\ps\referenc.ps cd $(THISDIR) +# An htb file is a zip file containing the .htm, .gif, .hhp, .hhc and .hhk +# files, renamed to htb. +# This can then be used with e.g. helpview. +# Optionally, a cached version of the .hhp file can be generated with hhp2cached. +htb: + cd $(WXDIR)\docs\html\wx + -erase /Y wx.zip wx.htb + zip32 wx.zip *.htm *.gif *.hhp *.hhc *.hhk + ren wx.zip wx.htb + cd $(THISDIR) + # In order to force document reprocessing touchmanual: -touch $(WXDIR)\docs\latex\wx\manual.tex diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 04311b7ad8..50fd12e2c2 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -112,8 +112,9 @@ Using makefiles: 'nmake -f makefile.vc' to make the wxWindows core library with debug information - (wx\lib\wx_d.lib), or + (wx\lib\wxd.lib), then + 'nmake -f makefile.vc cleanall FINAL=1' 'nmake -f makefile.vc FINAL=1' to make the wxWindows core library without debug information @@ -123,17 +124,22 @@ Using makefiles: Makefile notes: - Use the 'clean' target to clean all objects, libraries and + Use the 'cleanall' target to clean all objects, libraries and executables. To build the release version using makefiles, add FINAL=1 to your nmake invocation, both when building the library and for samples. + You MUST use the 'cleanall' target (with FINAL=1 or FINAL=0) + before making a different configuration, because otherwise + object files used to build the previous configuration may be + used accidentally for the current configuation. You might see + this manifested in unexpected link errors or warnings. This problem + doesn't occur when using project files to build wxWindows. Note that the wxWindows core library allows you to have debug and release libraries available simultaneously, by compiling the objects in different subdirectories, whereas samples must be - cleaned and re-made to build a different configuration. This - may be changed in later versions of wxWindows. + cleaned and re-made to build a different configuration. To build the DLL version using makefiles: @@ -179,7 +185,10 @@ trying build a release version of the library. Or, type: nmake -f makefile.vc noopt FINAL=1 and then resume compilation in the normal way. This will build -troublesome files with no optimization. +troublesome files with no optimization. However, there now seems to be +an internal linker error using VC++ 4, in addition to internal +compiler errors for most of the samples, so this version of the compiler +cannot be recommended! Note (4): some crash problems can be due to inconsistent compiler options. If strange/weird/impossible things start to happen please @@ -255,6 +264,10 @@ LINK=ilink32 in src\makeb32.env. You may also need to disable wxUSE_LIBJPEG because there is a conflict in the BC++ headers (actually this problem seems to have gone away with 5.5 and SP1). +Note (7): If you wish debug messages to be sent to the console in +debug mode, edit src\makeb32.env and change /aa to /Tpe in +LINK_FLAGS. + Compiling using the IDE files: 1. Load src\bc32.ide (Release settings) diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index a9d81afe45..d2b150d449 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -576,14 +576,11 @@ // support instead. #define wxUSE_BITMAP_MESSAGE 1 // Define 1 to use bitmap messages. -#define wxUSE_PORTABLE_FONTS_IN_MSW 0 - // Define 1 to use new portable font scheme in Windows - // (used by default under X) #define wxFONT_SIZE_COMPATIBILITY 0 // Define 1 for font size to be backward compatible // to 1.63 and earlier. 1.64 and later define point // sizes to be compatible with Windows. -#define wxUSE_PENWINDOWS 0 +#define wxUSE_PENWINDOWS 0 // Set to 1 to use PenWindows #define wxUSE_OWNER_DRAWN 1 @@ -618,10 +615,6 @@ #undef wxUSE_DEBUG_NEW_ALWAYS #define wxUSE_DEBUG_NEW_ALWAYS 0 - -#ifndef _MBCS -// #define _MBCS -#endif #endif // wxUSE_MFC #if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) diff --git a/samples/minimal/makefile.vc b/samples/minimal/makefile.vc index 35aefc474c..d4dc595b73 100644 --- a/samples/minimal/makefile.vc +++ b/samples/minimal/makefile.vc @@ -16,3 +16,9 @@ OBJECTS = $(PROGRAM).obj !include $(WXDIR)\src\makeprog.vc +# For broken VC++ 4 +noopt: + cl @<< +$(CPPFLAGS2) /Od /c /Tp $(PROGRAM).cpp +<< + diff --git a/src/makeprog.vc b/src/makeprog.vc index a2f9cd52dc..1db976b6d5 100644 --- a/src/makeprog.vc +++ b/src/makeprog.vc @@ -29,11 +29,11 @@ wxclean: nmake -f makefile.vc clean # cd $(THISDIR) -$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res +$(PROGRAM).exe: $(WXLIB) $(OBJECTS) $(PROGRAM).res $(link) @<< -out:$(PROGRAM).exe $(LINKFLAGS) -$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res +$(OBJECTS) $(DUMMYOBJ) $(PROGRAM).res $(LIBS) << diff --git a/src/msw/app.cpp b/src/msw/app.cpp index a564b6033f..7d642fc7e2 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -266,7 +266,7 @@ bool wxApp::Initialize() // This is to foil optimizations in Visual C++ that throw out dummy.obj. // PLEASE DO NOT ALTER THIS. -#if defined(__VISUALC__) && !defined(WXMAKINGDLL) +#if defined(__VISUALC__) && defined(__WIN16__) && !defined(WXMAKINGDLL) extern char wxDummyChar; if (wxDummyChar) wxDummyChar++; #endif diff --git a/src/msw/dummy.cpp b/src/msw/dummy.cpp index ae232c15c7..4829376c7c 100644 --- a/src/msw/dummy.cpp +++ b/src/msw/dummy.cpp @@ -30,7 +30,7 @@ // Foils optimizations in Visual C++ (see also app.cpp). Without it, // dummy.obj isn't linked and we get a linker error. -#if defined(__VISUALC__) +#if defined(__VISUALC__) && defined(__WIN16__) char wxDummyChar = 0; #endif diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 54ef9aced8..e02b116efa 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -39,11 +39,7 @@ #include "wx/msw/private.h" - IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) - - #if wxUSE_PORTABLE_FONTS_IN_MSW - IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject) - #endif +IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) // ---------------------------------------------------------------------------- // wxFontRefData - the internal description of the font diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index 4267138743..6eadac6176 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -365,9 +365,6 @@ all: dirs $(DUMMYOBJ) $(OBJECTS) $(PERIPH_TARGET) png zlib xpm jpeg tiff $(LI dirs: $(MSWDIR)\$D $(COMMDIR)\$D $(GENDIR)\$D $(OLEDIR)\$D $(HTMLDIR)\$D -test: $(MSWDIR)\$D\wave.obj -test2: ..\common\Debug\config.obj - $D: mkdir $D @@ -426,7 +423,7 @@ $(WXDIR)\lib\$(WXLIBNAME).lib: $D\dummy.obj $(OBJECTS) $(PERIPH_LIBS) $(implib) @<< -out:$@ -machine:$(CPU) -$(OBJECTS) $(PERIPH_LIBS) +$(OBJECTS) $D\dummy.obj $(PERIPH_LIBS) << !else @@ -469,6 +466,7 @@ $(CPPFLAGS) $(MAKEPRECOMP) /Fo$D\dummydll.obj /c /Tp dummydll.cpp # Compile certain files with no optimization (some files cause a # compiler crash for buggy versions of VC++, e.g. 4.0) +# Don't forget to put FINAL=1 on the command line. noopt: cl @<< $(CPPFLAGS2) /Od /Fo$(COMMDIR)\$D\datetime.obj /c /Tp $(COMMDIR)\datetime.cpp @@ -616,7 +614,7 @@ rcparser: nmake -f makefile.vc FINAL=$(FINAL) cd $(WXDIR)\src\msw -cleanall: clean_png clean_zlib clean_xpm clean_jpeg clean_tiff +cleanall: clean clean_png clean_zlib clean_xpm clean_jpeg clean_tiff -erase ..\..\lib\wx$(WXVERSION)$(LIBEXT).dll -erase ..\..\lib\wx$(WXVERSION)$(LIBEXT).lib -erase ..\..\lib\wx$(WXVERSION)$(LIBEXT).exp @@ -636,7 +634,7 @@ clean: $(PERIPH_CLEAN_TARGET) -erase $(COMMDIR)\$D\*.obj -erase $(COMMDIR)\$D\*.pdb -erase $(COMMDIR)\$D\*.sbr - -erase $(COMMDIR)\\y_tab.c + -erase $(COMMDIR)\y_tab.c -erase $(COMMDIR)\lex_yy.c -erase $(MSWDIR)\$D\*.obj -erase $(MSWDIR)\$D\*.sbr diff --git a/src/png/makefile.vc b/src/png/makefile.vc index 94244472b8..61b7be06a5 100644 --- a/src/png/makefile.vc +++ b/src/png/makefile.vc @@ -59,7 +59,7 @@ OBJECTS = png.obj pngread.obj pngrtran.obj pngrutil.obj \ all: $(WINPNGLIB) $(WINPNGLIB): $(OBJECTS) - -del $(WINPNGLIB) + -erase $(WINPNGLIB) lib @<< -out:$(WINPNGLIB) $(OBJECTS) @@ -71,6 +71,6 @@ $(OBJECTS) clean: -erase *.obj -erase *.exe - -erase *.lib + -erase $(WINPNGLIB) cleanall: clean diff --git a/src/zlib/makefile.vc b/src/zlib/makefile.vc index 5c195c82b4..fdcbbb97c7 100644 --- a/src/zlib/makefile.vc +++ b/src/zlib/makefile.vc @@ -95,7 +95,7 @@ zutil.obj: zutil.c zutil.h zlib.h zconf.h LIBOBJECTS = $(OBJ1) $(OBJ2) $(LIBTARGET): $(LIBOBJECTS) - -del $(LIBTARGET) + -erase $(LIBTARGET) lib @<< -out:$(LIBTARGET) $(LIBOBJECTS) -- 2.47.2