]> granicus.if.org Git - apache/blob - build/NWGNUenvironment.inc
67d15a760ac450a4554e25a3c4a4ff0095cd11e1
[apache] / build / NWGNUenvironment.inc
1 #
2 # Setup needed Tools and Libraries
3 #
4
5 ifeq "$(wildcard $(AP_WORK)\NWGNUcustom.ini)" "$(AP_WORK)\NWGNUcustom.ini"
6 include $(AP_WORK)\NWGNUcustom.ini
7 CUSTOM_INI = $(AP_WORK)\NWGNUcustom.ini
8 endif
9
10 ifndef VERBOSE
11 .SILENT:
12 endif
13
14 #
15 # Treat like an include
16 #
17 ifndef EnvironmentDefined
18
19 #
20 # simple macros for parsing makefiles
21 #
22 EOLIST:=
23 EMPTY :=
24 COMMA := ,
25 SPACE := $(EMPTY) $(EMPTY)
26
27 #
28 # Base environment
29 #
30
31 # Try and handle case issues
32 ifndef NOVELLLIBC
33 ifdef NovellLibC
34 NOVELLLIBC = $(NovellLibC)
35 endif
36 endif
37
38 ifndef NOVELLLIBC
39 NOVELLLIBC = C:/novell/ndk/libc
40 endif
41 ifneq "$(wildcard $(NOVELLLIBC)/include/ndkvers.h)" "$(NOVELLLIBC)/include/ndkvers.h"
42 $(error NOVELLLIBC does not point to a valid Novell LIBC SDK) 
43 endif
44
45 ifndef LDAPSDK
46 LDAPSDK = C:/novell/ndk/cldapsdk/NetWare/libc
47 endif
48 ifneq "$(wildcard $(LDAPSDK)/inc/ldap.h)" "$(LDAPSDK)/inc/ldap.h"
49 $(error LDAPSDK does not point to a valid Novell CLDAP SDK) 
50 endif
51
52 ifndef PCRESRC
53 ifeq "$(wildcard $(AP_WORK)/srclib/pcre/pcre.in)" "$(AP_WORK)/srclib/pcre/pcre.in"
54 PCRESRC = $(AP_WORK)/srclib/pcre
55 endif
56 endif
57 ifneq "$(wildcard $(PCRESRC)/pcre.in)" "$(PCRESRC)/pcre.in"
58 $(error PCRESRC does not point to a valid PCRE source tree) 
59 endif
60
61 # This is a placeholder
62 # ifndef ZLIBSDK
63 # ZLIBSDK = C:/novell/ndk/zlibsdk
64 # endif
65
66 ifndef METROWERKS
67 METROWERKS = C:\Program Files\Metrowerks\CodeWarrior
68 endif
69
70 # If LM_LICENSE_FILE isn't defined, define a variable that can be used to
71 # restart make with it defined
72 ifndef LM_LICENSE_FILE
73 NO_LICENSE_FILE = NO_LICENSE_FILE
74 endif
75
76 #
77 # Set the Release type that you want to build, possible values are:
78 #
79 #  debug        - full debug switches are set
80 #  noopt        - normal switches are set
81 #  release      - optimization switches are set (default)
82
83 ifdef reltype
84 RELEASE = $(reltype)
85 endif    
86
87 ifdef RELTYPE
88 RELEASE = $(RELTYPE)
89 endif
90
91 ifdef debug
92 RELEASE = debug
93 endif
94
95 ifdef DEBUG
96 RELEASE = debug
97 endif
98
99 ifdef noopt
100 RELEASE = noopt
101 endif
102
103 ifdef NOOPT
104 RELEASE = noopt
105 endif
106
107 ifdef optimized
108 RELEASE = release
109 endif
110
111 ifdef OPTIMIZED
112 RELEASE = release
113 endif
114
115 ifndef RELEASE
116 RELEASE = release
117 endif
118
119 OBJDIR = obj_$(RELEASE)
120
121 #
122 # Setup compiler information
123 #
124
125 # MetroWerks NLM tools
126 CC      = mwccnlm
127 CPP     = mwccnlm
128 LINK    = mwldnlm
129 LIB     = mwldnlm -type library -w nocmdline
130 WIN_CC  = mwcc
131
132 # Setup build tools
133 AWK     = awk
134
135 # Define minimum APR version to check for
136 APR_WANTED = 1004000
137
138 ifdef IPV6
139 ifndef USE_STDSOCKETS
140 USE_STDSOCKETS=1
141 endif
142 endif
143
144 NOVI    = $(NOVELLLIBC)\imports
145
146 INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock;
147 ifneq "$(LDAPSDK)" ""
148 INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
149 endif
150 ifneq "$(ZLIBSDK)" ""
151 INCDIRS := $(INCDIRS);$(ZLIBSDK)
152 endif
153 ifneq "$(PCRESRC)" ""
154 INCDIRS := $(INCDIRS);$(PCRESRC)
155 endif
156
157 DEFINES = -DNETWARE 
158 ifndef USE_STDSOCKETS
159 DEFINES += -DUSE_WINSOCK
160 endif
161 ifndef DEBUG
162 DEFINES += -DNDEBUG
163 endif
164
165 ifdef USE_STDSOCKETS
166 VERSION_SKT = (BSDSOCK)
167 else
168 VERSION_SKT = (WINSOCK)
169 endif
170
171 # MetroWerks static Libraries
172 CLIB3S  = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib
173 MATH3S  =
174 PLIB3S  = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib
175
176 # MetroWerks Win32 build flags to create build tool
177 MWCW_MSL   = "$(METROWERKS)/MSL"
178 MWCW_W32   = "$(METROWERKS)/Win32-x86 Support"
179 WIN_CFLAGS =  -O2 -gccinc -nodefaults -proc 586 -w off
180 WIN_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
181 WIN_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
182
183 # Base compile flags
184 # and prefix or precompiled header added here.
185
186 # The default flags are as follows:
187 #
188 # -c                    compile only, no link
189 # -nosyspath            treat #include <...> like #include "..."
190 # -Cpp_exceptions off   disable C++ exceptions
191 # -RTTI off             disable C++ run-time typing information
192 # -align 4              align on 4 byte bounderies
193 # -w nocmdline          disable command-line driver/parser warnings
194 # -proc PII             generate code base on Pentium II instruction set
195 # -inst mmx             use MMX extensions (Not used)
196
197 CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII 
198
199 # -g                    generate debugging information
200 # -O0                   level 0 optimizations
201
202 ifeq "$(RELEASE)" "debug"
203 CFLAGS += -g -O0
204 endif
205
206 # -O4,p                 level 4 optimizations, optimize for speed
207 ifeq "$(RELEASE)" "release"
208 CFLAGS += -O4,p
209 endif
210
211 # -prefix pre_nw.h      #include pre_nw.h for all files
212
213 CFLAGS += -prefix pre_nw.h
214
215
216 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
217
218 #
219 # Declare major project deliverables output directories here
220 #
221
222 ifdef DEST
223 INSTALL = $(DEST)
224 ifeq (\, $(findstring \,$(INSTALL)))
225 INSTDIRS = $(DEST)
226 endif
227 endif
228
229 ifdef dest
230 INSTALL = $(dest)
231 ifeq (\, $(findstring \,$(INSTALL)))
232 INSTDIRS = $(dest)
233 endif
234 endif
235
236 ifndef INSTALL
237 INSTALL = $(AP_WORK)\Dist
238 INSTDIRS = $(AP_WORK)\Dist
239 endif
240
241 ifndef BASEDIR
242 BASEDIR = Apache23
243 export BASEDIR
244 endif
245
246 ifndef PORT
247 PORT = 80
248 endif
249
250 ifndef SSLPORT
251 SSLPORT = 443
252 endif
253
254 # Add support for building IPV6 alongside
255 ifneq "$(IPV6)" ""
256 DEFINES += -DNW_BUILD_IPV6
257 # INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
258
259 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
260 OBJDIR := $(OBJDIR)_IPV6
261 endif
262         
263 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
264 INSTALL := $(INSTALL)_IPV6
265 endif        
266
267 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
268 INSTDIRS := $(INSTDIRS)_IPV6
269 endif
270
271 endif
272
273 INSTDEVDIRS := \
274         $(INSTDIRS) \
275         $(INSTALL)\$(BASEDIR)\include \
276         $(INSTALL)\$(BASEDIR)\lib \
277
278 INSTDIRS += \
279         $(INSTALL)\$(BASEDIR) \
280         $(INSTALL)\$(BASEDIR)\bin \
281         $(INSTALL)\$(BASEDIR)\cgi-bin \
282         $(INSTALL)\$(BASEDIR)\conf \
283         $(INSTALL)\$(BASEDIR)\error \
284         $(INSTALL)\$(BASEDIR)\htdocs \
285         $(INSTALL)\$(BASEDIR)\icons \
286         $(INSTALL)\$(BASEDIR)\logs \
287         $(INSTALL)\$(BASEDIR)\man \
288         $(INSTALL)\$(BASEDIR)\manual \
289         $(INSTALL)\$(BASEDIR)\modules \
290
291 #
292 # Declare Command and tool macros here
293 #
294
295 # Os2LibPath is an extra check to see if we are on NT
296 ifdef Os2LibPath
297 OS = Windows_NT
298 endif
299
300 ifeq "$(OS)" "Windows_NT"
301 CMD = cmd /C
302 DEL = del /F
303 DELTREE = rd /s/q
304 WINNT = 1
305 XCOPYSW = /E
306 else
307 CMD = command /C
308 DEL = del
309 DELTREE = deltree /y
310 XCOPYSW = /E /Y
311 endif
312
313 CHK = $(CMD) if exist
314 CHKNOT = $(CMD) if not exist
315
316
317 #
318 # Setup base C compiler flags
319 #
320
321 #
322 # Common directories
323 #
324
325 STDMOD          = $(AP_WORK)/modules
326 NWOS            = $(AP_WORK)/os/netware
327 SERVER          = $(AP_WORK)/server
328 SRC             = $(AP_WORK)
329 APR             = $(APR_WORK)
330 APRUTIL         = $(APU_WORK)
331 APULDAP         = $(APU_WORK)/ldap
332 SUPMOD          = $(AP_WORK)/support
333 PCRE            = $(PCRESRC)
334 APRTEST         = $(APR_WORK)/test
335 HTTPD           = $(AP_WORK)/modules/http
336 XML             = $(APU_WORK)/xml
337 PREBUILD_INST   = $(AP_WORK)/nwprebuild
338
339 #
340 # Internal Libraries
341 #
342
343 APRLIB          = $(APR)/$(OBJDIR)/aprlib.lib
344 APRUTLIB        = $(APRUTIL)/$(OBJDIR)/aprutil.lib
345 APULDAPLIB      = $(APULDAP)/$(OBJDIR)/apuldap.lib
346 STMODLIB        = $(STDMOD)/$(OBJDIR)/stdmod.lib
347 PCRELIB         = $(PCRE)/$(OBJDIR)/pcre.lib
348 NWOSLIB         = $(NWOS)/$(OBJDIR)/netware.lib
349 SERVLIB         = $(SERVER)/$(OBJDIR)/server.lib
350 HTTPDLIB        = $(HTTPD)/$(OBJDIR)/httpd.lib
351 XMLLIB          = $(XML)/$(OBJDIR)/xmllib.lib
352
353 #
354 # Additional general defines
355 #
356
357 EnvironmentDefined = 1
358 endif # ifndef EnvironmentDefined
359
360 # This is always set so that it will show up in lower directories
361
362 ifdef Path
363 Path = $(PATH)
364 endif
365