win32 MapServer builds

Valik Solórzano Barboza valik.solorzano.barboza at GEODAN.NL
Wed Nov 24 07:51:25 EST 2004


Frank,

I would think that adding some flag when building which tells whether it's 
a release or debug version would be very handy. I made some changes to 
makefile.vc and nmake.opt see the below (changes made based on the head 
version from CVS).

makefile.vc

#MY CHANGES

!IFDEF BUILD_DEBUG
OPTFLAGS =      /nologo /Od /MTd /Zi /Fdmapserv.pdb $(WARNING_LEVEL) $(DEBUG)
BASE_CFLAGS =   $(OPTFLAGS) -DWIN32 -D_WIN32
LDFLAGS =       $(LDEBUG) /NODEFAULTLIB:libcmtd /pdb:"mapserv.pdb"
!ELSE
OPTFLAGS =      /nologo /MT $(WARNING_LEVEL) $(DEBUG)
BASE_CFLAGS =   $(OPTFLAGS) -DWIN32 -D_WIN32
LDFLAGS =       $(LDEBUG)
!ENDIF

$(MS_LIB):      $(MS_OBJS)
         if exist $(GDAL_DIR)\gdal.pdb copy $(GDAL_DIR)\gdal.pdb .
         lib /out:$(MS_LIB) $(MS_OBJS)
         link /dll $(LDEBUG) \
                 $(MS_OBJS) $(EXTERNAL_LIBS) /def:mapserver.def \
                  /out:$(MS_DLL) /implib:$(MS_LIB_DLL)

#ORIGINAL

OPTFLAGS =      /nologo /Zi $(WARNING_LEVEL) $(DEBUG)
BASE_CFLAGS =   $(OPTFLAGS) -DWIN32 -D_WIN32
LDFLAGS =       /NODEFAULTLIB:msvcrt /NODEFAULTLIB:libcd /DEBUG

$(MS_LIB):      $(MS_OBJS)
         if exist $(GDAL_DIR)\gdal.pdb copy $(GDAL_DIR)\gdal.pdb .
         lib /out:$(MS_LIB) $(MS_OBJS)
         link /dll /debug \
                 $(MS_OBJS) $(EXTERNAL_LIBS) /def:mapserver.def \
                  /out:$(MS_DLL) /implib:$(MS_LIB_DLL)


and in

nmake.opt

#MY CHANGES

########################################################################
# Section III: Debug flags
########################################################################
# Should not need to be updated.
########################################################################
!IFDEF BUILD_DEBUG
# DEBUG Build flags
# Set the DEBUG flag if you wish to make a debug build
DEBUG=/DDEBUG
# Set the Warning level for the compiler (defaults to W1)
WARNING_LEVEL=/W3
# Set the linker debug option
LDEBUG=/debug
!ELSE
# DEBUG Build flags
# Set the DEBUG flag if you wish to make a debug build
DEBUG=
# Set the Warning level for the compiler (defaults to W1)
WARNING_LEVEL=/W3
# Set the linker debug option
LDEBUG=
!ENDIF


#ORIGINAL

########################################################################
# Section III: Debug flags
########################################################################
# Should not need to be updated.
########################################################################

# DEBUG Build flags
# Set the DEBUG flag if you wish to make a debug build
DEBUG=/DDEBUG
# Set the Warning level for the compiler (defaults to W1)
WARNING_LEVEL=/W3
# Set the linker debug option
LDEBUG=/debug


But for the above changes to be usefull I had to change other makefiles and 
nmake.opt (if you are interested I can send you the files I had to change):

- freetype
- gd
- gdal
- jpeg
- libpng
- proj

I would actually advise to use /MT (static linkage of the runtime 
libraries). My experience with the runtime libraries (MSVCT**.DLL) are not 
very nice. And offcourse this also could be made configurable trough 
commandline flags for the NMAKE command.

Cheers,

Valik

At 18:17 23/11/2004, Frank Warmerdam wrote:
>Assefa,
>
>I am intrested in reworking the default configuration of the mapserver
>win32 builds somewhat with the following in mind:
>
>  o Default to assuming folks are building against the bgd GD DLLs with 
> all the
>    stuff they include.
>  o Disable (comment out) all the optional packages (ming, pdf, gdal, 
> curl, etc)
>    by default.
>  o Move OPTFLAGS and LDFLAGS from makefile.vc to nmake.opt since they
>    frequently need to be changed.
>  o Use /MD by default, since many support libraries like GDAL and PROJ.4 are
>    built that way by default.  Statically linking proj.lib in (that was built
>    with /MD) with a non-/MD mapserver is bad karma.
>
>In general, I would like to make building a simple MapServer build alot 
>easier,
>and then let people add stuff to that rather than starting with lots of stuff
>broken.
>
>Also, using the pre-built GD makes *alot* of stuff easier.
>
>What do you think?  Mind if I "do a number" on makefile.vc and nmake.opt?
>
>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

Drs. Valik Solórzano Barboza
Geodan SDT b.v.
President Kennedylaan 1
1079 MB Amsterdam (NL)
-------------------------------------
Tel: +31 (0)20 - 5711 311
Fax: +31 (0)20 - 5711 333
-------------------------------------
E-mail: valik.solorzano.barboza at geodan.nl
Website: www.geodan.nl
Disclaimer: www.geodan.nl/disclaimer
-------------------------------------  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20041124/1dab7ef5/attachment.html


More information about the mapserver-dev mailing list