[Gdal-dev] Re: build gdal for mingw32 on cygwin

Frank Warmerdam warmerdam at pobox.com
Mon May 12 11:02:32 EDT 2003


Martin Daly wrote:
> Frank,
> 
> 
>>Of course, it would be more appropriate for me to actually 
>>test if the compiler is VC++, but offhand I am not sure how 
>>to do that.
> 
> 
> "#ifdef _MSC_VER" could be a suitable test.
> 
> The VC++ 6.0 on-line helps says "Defines the compiler version. Defined
> as 1200 for Microsoft Visual C++ 6.0. Always defined."  VC++ .NET is
> 
>>=1300.


Folks,

Thanks Martin ... I have tentatively modified cpl_port.h to make a few decisions
on this basis.  So the practice now is:

  o WIN32 is defined if access to the win32 API is OK.  Specifically disabled
    in Cygwin builds as we want to treat this case as "almost" unix.  However it
    *is* defined for MingW builds and builds for other Win32 based compilers.

  o CPL_DLL is only defined to be non-empty if _MSC_VER is defined.  So it is
    disabled in MingW, Cygwin and other builds.

The three configurations on windows I would like to work "out of the box"
are windows are MS Visual C++, Cygwin and Mingw GCC.  The Cygwin and Mingw GCC
would use the GNUmakefile based build mechanism and VC++ uses the NMAKE files
(ie. makefile.vc).

I would be interested in supporting other windows compilers (eg. Borland and
WATCOM) but I am not willing to support additional sets of build (make) files.
Two sets is already one too many to do well.  What might be interesting is
trying to extend the existing GNUmake based build to support non-unix like
environments.  In this case we would have to dispense with running configure,
and instead have more "canned" GNUmake.opt files or something similar.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list