1
2########################################################################
3# nmake.opt - Tinyows configuration for MSVC++
4########################################################################
5
6########################################################################
7# Section I: Tinyows Compilation Options
8########################################################################
9
10#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11# Uncomment the following if you are building for 64-bit windows
12# (x64). You'll need to have PATH, INCLUDE and LIB set up for 64-bit
13# compiles.
14#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15#WIN64=YES
16
17#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18# Check compiler version given in command line
19# nmake -f makefile.vc MSVC_VER=xxxx
20# 1310 = 7.1 (2003)   1400 = 8.0 (2005)
21#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22!IFNDEF MSVC_VER
23#assume msvc 7.1
24MSVC_VER=1310
25!ENDIF
26
27#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28# File locations and where to install things
29# ----------------------------------------------------------------------
30# If you are using the MapServer Build Kit, almost everything should be
31# relative to this directory throughout this option file.
32#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
34# Set the following to point to the directory adjacent to the dependent libs.
35!IFNDEF TINY_BASE
36TINY_BASE =  C:\build\release-1400-dev\tinyows-svn
37#TINY_BASE =  .
38!ENDIF
39
40# Set the following to point to the current (tinyows) directory.
41!IFNDEF TINY_CURRENT
42TINY_CURRENT = $(TINY_BASE)
43!ENDIF
44
45!IFNDEF BINDIR
46BINDIR = $(TINY_BASE)\..\bin
47!ENDIF
48
49#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50# Optmization, debug, and related compile flags.
51#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52
53!IF $(MSVC_VER) == 1400
54# Optimized, with using MSVCRT.
55OPTFLAGS =	/nologo /Ox /MD $(WARNING_LEVEL) $(DEBUG) /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
56# Debug with MSVCRT
57#OPTFLAGS = /nologo /Zi /MD $(WARNING_LEVEL) $(DEBUG) /EHsc /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
58#LDFLAGS =  /NODEFAULTLIB:msvcrt /NODEFAULTLIB:libcd /DEBUG
59!ELSE
60# Optimized, with using MSVCRT.
61OPTFLAGS =	/nologo /Ox /MD $(WARNING_LEVEL) $(DEBUG) /EHsc
62# Debug with MSVCRT
63#OPTFLAGS = /nologo /Zi /MDd $(WARNING_LEVEL) $(DEBUG) /EHsc
64#LDFLAGS =  /NODEFAULTLIB:msvcrt /NODEFAULTLIB:libcd /DEBUG
65!ENDIF
66
67# Set the Warning level for the compiler (defaults to W1)
68WARNING_LEVEL=/W3
69
70#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71# Debugging Options
72# ----------------------------------------------------------------------
73#NEED_NONBLOCKING_STDERR=-DNEED_NONBLOCKING_STDERR
74ENABLE_STDERR_DEBUG=-DENABLE_STDERR_DEBUG
75
76# Set the linker debug option
77LDEBUG=/debug
78
79# DEBUG Build flags
80# Set the DEBUG flag if you wish to make a debug build
81DEBUG=/DDEBUG
82
83
84#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85# String methods
86# ----------------------------------------------------------------------
87# Apparently these aren't as commonplace. Edit the
88# following line to reflect the missing functions on your platform.
89#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90#STRINGS=-DNEED_STRCASECMP -DNEED_STRNCASECMP -DNEED_STRDUP
91STRINGS=-DNEED_STRCASECMP -DNEED_STRNCASECMP -DNEED_STRLCAT -DNEED_STRRSTR
92
93#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94# Direct connectivity to Postgresql PostGIS.
95# ----------------------------------------------------------------------
96# To turn on direct connectivity to Postgresql PostGIS uncomment the following
97# flag and set the full path name to the project directory for the
98# Postgresql native Win32 client library.
99# See http://www.postgresql.org for support library.
100#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101POSTGIS =-DUSE_POSTGIS
102POSTGIS_DIR =$(TINY_BASE)\..\release-1400\postgresql-8.3.3
103
104
105#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106# LIBXML: utility library to write xml.
107# http://xmlsoft.org/index.html
108# WFS, WCS and SOS all need this flag to be activated
109# NOTE: ICONV is required when libxml2 is activated
110# ----------------------------------------------------------------------
111XML2_ENABLED=-DUSE_LIBXML2
112LIBXML_DIR=$(TINY_BASE)\..\release-1400
113
114
115########################################################################
116# Section II: Mapserver Rendering Configuration
117########################################################################
118#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119# ICONV
120# ----------------------------------------------------------------------
121#libiconv support is used for to support double bytes (see bug 911).
122#uncomment the following to build with libiconv support.
123#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124ICONV=-DUSE_ICONV
125ICONV_DIR=$(TINY_BASE)\..\release-1400
126
127########################################################################
128# Section VI: Support Libraries.
129########################################################################
130#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131# REGEX Libary
132# ----------------------------------------------------------------------
133# VC++ does not include the REGEX library... so we must provide our one.
134# The following definitions will try to build GNU regex-0.12 located in the
135# regex-0.12 sub-directory.
136# If it was not included in the source distribution, then you can get it from:
137#    ftp://ftp.gnu.org/pub/gnu/regex/regex-0.12.tar.gz
138# Provide the full path to the REGEX project directory
139# You do not need this library if you are compiling for PHP mapscript.
140# In that case the PHP regex library will be used instead
141#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142!IFNDEF PHP_REGEX
143REGEX_DIR=$(TINY_BASE)\..\regex-0.12
144!ENDIF
145
146
147########################################################################
148# Section VII: Variable Setup
149########################################################################
150# Should not need to be updated.
151########################################################################
152TINY_LIB =    tiny.lib
153
154#libiconv support
155!IFDEF ICONV
156ICONV_LIB=$(ICONV_DIR)\lib\iconv.lib
157ICONV_INC= -I$(ICONV_DIR)\include
158!ENDIF
159
160# LIBXML include and library
161!IFDEF XML2_ENABLED
162LIBXML_INC = -I$(LIBXML_DIR)/include/libxml
163LIBXML_LIB = $(LIBXML_DIR)/lib/libxml2.lib
164!ENDIF
165
166# Setup REGEX object and includes
167!IFNDEF PHP_REGEX
168REGEX_OBJ=$(REGEX_DIR)\regex.obj
169REGEX_INC=-I$(REGEX_DIR)
170!ELSE
171REGEX_OBJ=$(PHP_HOME)\regex\regcomp.obj $(PHP_HOME)\regex\regerror.obj \
172          $(PHP_HOME)\regex\regexec.obj $(PHP_HOME)\regex\regfree.obj
173REGEX_INC=-I$(PHP_HOME)/regex -DPHP_NO_ALIASES
174!ENDIF
175
176# REGEX needs some special flags... here they are for VC++ 6.0
177REGEX_OPT=-DHAVE_STRING_H -DREGEX_MALLOC
178
179# Setup Postgesql PostGIS includes and libs
180!IFDEF POSTGIS
181!IFNDEF PHP_BUILD_CALL
182# If we're building PHP MapScript, there is a macro conflict
183POSTGIS_INC=-I$(POSTGIS_DIR)/src/interfaces/libpq -I$(POSTGIS_DIR)/src/include
184!ENDIF
185POSTGIS_LIB=$(POSTGIS_DIR)/src/interfaces/libpq/release/libpqdll.lib
186!ENDIF
187
188#######################################################################
189# Section IX: Collect compiler flags
190########################################################################
191# Should not need to be updated.
192########################################################################
193
194!IFNDEF EXTERNAL_LIBS
195EXTERNAL_LIBS=$(POSTGIS_LIB) $(ERR_LIB) $(ICONV_LIB) $(LIBXML_LIB)
196!ENDIF
197
198LIBS=$(TINY_LIB) $(EXTERNAL_LIBS)
199
200!IFNDEF INCLUDES
201INCLUDES=$(REGEX_INC) $(POSTGIS_INC) $(ICONV_INC) $(LIBXML_INC)
202!ENDIF
203
204
205TINY_DEFS =$(REGEX_OPT) $(STRINGS) $(POSTGIS) $(NEED_NONBLOCKING_STDERR) \
206          $(ENABLE_STDERR_DEBUG) $(ICONV) $(XML2_ENABLED)
207
208
209
210!IFDEF WIN64
211TINY_CFLAGS=$(INCLUDES) $(TINY_DEFS) -DWIN32 -D_WIN32 -DUSE_GENERIC_MS_NINT
212!ELSE
213TINY_CFLAGS=$(INCLUDES) $(TINY_DEFS) -DWIN32 -D_WIN32
214!ENDIF
215