[greenstone-devel] Re: Why support VC++ 4.0

From Michael Dewsnip
DateWed, 15 Feb 2006 15:24:27 +1300
Subject [greenstone-devel] Re: Why support VC++ 4.0
In-Reply-To (004401c63142$93d54cf0$2801a8c0-ITPROVISION-COM)
Dear Emanuel,

Thanks very much for your good ideas; here's what I've done to the
win32.mak files:

- Added "-nologo" to all cl and lib calls (this also works with Visual
C++ 4)
- Added "-D_CRT_SECURE_NO_DEPRECATE" to all DEFS (this does not affect
Visual C++ 4)
- Replaced all "-o" options with "-Fe" when linking (this works with all
versions)
- Added a "GSDL_VC4" option as you suggested. Since in the end there was
only one option that was different between VC4 and VC6+ ("-GX" vs
"-EHsc"), I decided not to create a base file (for now), and just put
the option straight into the files:

GSDL_VC4=0
!IF $(GSDL_VC4)
CPPFLAGS = -GX
!ELSE
CPPFLAGS = -EHsc
!ENDIF

- Removed the USE_STLPORT option -- this is now incorporated into GSDL_VC4.

Hopefully you will now have a lot fewer warnings when using Visual
Studio 2005.

Thanks for your fixes to the crashing problem with Visual Studio 2005 --
I'm hoping to do these next.

All the best,

Michael

Emanuel Dejanu wrote:

>The best way will be to use an intermediate layer like:
>- Scon (http://www.scons.org/) - Python script
>- Bakefile (http://bakefile.sf.net/)
>- and others
>
>This will generate the needed files for selected
>platform/compiler.
>But this requires to learn the new tool and
>depends on a new programming tool (Python).
>
>Back to your question. I think that will be better
>to have 2 global files in gsdl that will be included
>by win32.mak on each project directory.
>
>So we will have the following structure:
>
>gsdl
>---base_vc4.mak (for vc4)
>---base.mak (for vc6+)
>---src
>------txt2db
>---------win32.mak
>
>This win32.mak file will include the selected base file
>based on an enviroment variabile (like GSDL_VC4)
>
>GSDL_VC4=0
>!IF $(GSDL_VC4)
>!INCLUDE $(GSDL_HOME)/base_vc4.mak
>!ELSE
>!INCLUDE $(GSDL_HOME)/base.mak
>!ENDIF
>
>In this way we have a global space to define
>options, targets and defines and a single make
>file per project.
>
>So if you run in the command prompt:
>set GSDL_VC4=1
>nmake win32.mak
>
>You will build using VC4 options and defines.
>Also what I will like also to do with this
>Change is to be posible to build compile in the same
>time the release/debug version without making clean
>first.
>
>Regards,
>
>Emanuel
>
>-----Original Message-----
>From: Michael Dewsnip [mailto:mdewsnip@cs.waikato.ac.nz]
>Sent: Tuesday, February 14, 2006 12:46 AM
>To: Emanuel Dejanu
>Cc: greenstone-devel@list.scms.waikato.ac.nz
>Subject: Re: Why support VC++ 4.0
>
>Dear Emanuel,
>
>Yes, we keep Greenstone compiling with VC++ 4 so the executables will run on
>Windows 3.1. We hope to drop Windows 3.1 support soon, however -- although
>so far it hasn't required much work to keep Greenstone compiling with VC++
>4.
>
>Perhaps a good solution is to have two versions of the win32.mak files
>-- one for VC++ 4, and one for VC++ 6/VS 2005. What do you think?
>
>Regards,
>
>Michael
>
>
>
>Emanuel Dejanu wrote:
>
>
>
>>Hi,
>>
>>Why greenstone is keeping support for VC++ 4.0?
>>If is for Windows 3.1 is there any statistics on how many Greenstone
>>users are using Windows 3.1?
>>
>>
>>Regards,
>>
>>Emanuel
>>
>>
>>-----Original Message-----
>>From: Michael Dewsnip [mailto:mdewsnip@cs.waikato.ac.nz]
>>Sent: Friday, February 03, 2006 1:17 AM
>>To: Emanuel Dejanu
>>Cc: greenstone-devel@list.scms.waikato.ac.nz
>>Subject: Re: Greenstone and Visual Studio 8
>>
>>Dear Emanuel,
>>
>>I have tried compiling Greenstone with Visual Studio 2005 and committed
>>a few changes necessary to get it to compile. I haven't committed your
>>changes to the makefiles and the source code to prevent all the
>>warnings, as we want to keep Greenstone compiling with Visual C++ 4 (at
>>
>>
>this stage, anyway).
>
>
>>However when I run the compiled library.exe or server.exe it crashes
>>with an exception -- did you experience this problem?
>>
>>Thanks,
>>
>>Michael
>>
>>
>>
>>Emanuel Dejanu wrote:
>>
>>
>>
>>
>>
>>>Hi,
>>>
>>>I am trying to compile the greenstone 2 (CVS) using Visual Studio 2005
>>>Professional on Windows XP SP2.
>>>If you do not have Visual Studio 2005 you can get Visual Studio C++
>>>2005 Express edition for free from msdn.microsoft.com (you must
>>>register it before 7 nov 2006)
>>>
>>>I send you a patch to fix the compilation problemes.
>>>The patch was done using the command (in D:CVSROOTgsdl):
>>>cvs -q diff -bu2 > d:mg_patch
>>>
>>>I have tested also with Visual Studio 6.0 and is working also.
>>>
>>>
>>>Best regards,
>>>
>>>Emanuel Dejanu
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
>
>