]> granicus.if.org Git - apache/blob - build/NWGNUenvironment.inc
commented out non-existing directory.
[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 (default)
81 #  optimized    - optimization switches are set
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 optimized
100 RELEASE=optimized
101 endif
102
103 ifdef OPTIMIZED
104 RELEASE=optimized
105 endif
106
107 ifndef RELEASE
108 RELEASE = optimized
109 endif
110
111 ifeq "$(RELEASE)" "debug"
112 OBJDIR = Debug.o
113 endif
114
115 ifeq "$(RELEASE)" "noopt"
116 OBJDIR = Noopt
117 endif
118
119 ifeq "$(RELEASE)" "optimized"
120 OBJDIR = Release.o
121 endif
122
123 #
124 # Setup compiler information
125 #
126
127 # MetroWerks NLM tools
128 CC      = mwccnlm
129 CPP     = mwccnlm
130 LINK    = mwldnlm
131 LIB     = mwldnlm -type library -w nocmdline
132 WIN_CC  = mwcc
133
134 # Setup build tools
135 AWK     = awk
136
137 # Define minimum APR version to check for
138 APR_WANTED = 1004000
139
140 ifdef IPV6
141 ifndef USE_STDSOCKETS
142 USE_STDSOCKETS=1
143 endif
144 endif
145
146 NOVI    = $(NOVELLLIBC)\imports
147
148 INCDIRS = $(NOVELLLIBC)\include;$(NOVELLLIBC)\include\nks;$(NOVELLLIBC)\include\winsock;
149 ifneq "$(LDAPSDK)" ""
150 INCDIRS := $(INCDIRS);$(LDAPSDK)/inc
151 endif
152 ifneq "$(ZLIBSDK)" ""
153 INCDIRS := $(INCDIRS);$(ZLIBSDK)
154 endif
155 ifneq "$(PCRESRC)" ""
156 INCDIRS := $(INCDIRS);$(PCRESRC)
157 endif
158
159 DEFINES = -DNETWARE 
160 ifndef USE_STDSOCKETS
161 DEFINES += -DUSE_WINSOCK
162 endif
163 ifndef DEBUG
164 DEFINES += -DNDEBUG
165 endif
166
167 ifdef USE_STDSOCKETS
168 VERSION_SKT = (BSDSOCK)
169 else
170 VERSION_SKT = (WINSOCK)
171 endif
172
173 # MetroWerks static Libraries
174 CLIB3S  = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\Runtime\mwcrtl.lib
175 MATH3S  =
176 PLIB3S  = $(METROWERKS)\Novell Support\Metrowerks Support\Libraries\MSL C++\MWCPP.lib
177
178 # MetroWerks Win32 build flags to create build tool
179 MWCW_MSL   = "$(METROWERKS)/MSL"
180 MWCW_W32   = "$(METROWERKS)/Win32-x86 Support"
181 WIN_CFLAGS =  -O2 -gccinc -nodefaults -proc 586 -w off
182 WIN_CFLAGS += -ir $(MWCW_MSL) -ir $(MWCW_W32) -lr $(MWCW_MSL) -lr $(MWCW_W32)
183 WIN_CFLAGS += -lMSL_All_x86.lib -lkernel32.lib -luser32.lib
184
185 # Base compile flags
186 # and prefix or precompiled header added here.
187
188 # The default flags are as follows:
189 #
190 # -c                    compile only, no link
191 # -nosyspath            treat #include <...> like #include "..."
192 # -Cpp_exceptions off   disable C++ exceptions
193 # -RTTI off             disable C++ run-time typing information
194 # -align 4              align on 4 byte bounderies
195 # -w nocmdline          disable command-line driver/parser warnings
196 # -proc PII             generate code base on Pentium II instruction set
197 # -inst mmx             use MMX extensions (Not used)
198
199 CFLAGS = -c -nosyspath -Cpp_exceptions off -RTTI off -align 4 -w nocmdline -proc PII 
200
201 # -g                    generate debugging information
202 # -O0                   level 0 optimizations
203
204 ifeq "$(RELEASE)" "debug"
205 CFLAGS += -g -O0
206 endif
207
208 # -O4,p                 level 4 optimizations, optimize for speed
209 ifeq "$(RELEASE)" "optimized"
210 CFLAGS += -O4,p
211 endif
212
213 # -prefix pre_nw.h      #include pre_nw.h for all files
214
215 CFLAGS += -prefix pre_nw.h
216
217
218 PATH:=$(PATH);$(METROWERKS)\bin;$(METROWERKS)\Other Metrowerks Tools\Command Line Tools
219
220 #
221 # Declare major project deliverables output directories here
222 #
223
224 ifdef DEST
225 INSTALL = $(DEST)
226 ifeq (\, $(findstring \,$(INSTALL)))
227 INSTDIRS = $(DEST)
228 endif
229 endif
230
231 ifdef dest
232 INSTALL = $(dest)
233 ifeq (\, $(findstring \,$(INSTALL)))
234 INSTDIRS = $(dest)
235 endif
236 endif
237
238 ifndef INSTALL
239 INSTALL = $(AP_WORK)\Dist
240 INSTDIRS = $(AP_WORK)\Dist
241 endif
242
243 ifndef BASEDIR
244 BASEDIR = Apache23
245 export BASEDIR
246 endif
247
248 ifndef PORT
249 PORT = 80
250 endif
251
252 ifndef SSLPORT
253 SSLPORT = 443
254 endif
255
256 # Add support for building IPV6 alongside
257 ifneq "$(IPV6)" ""
258 DEFINES += -DNW_BUILD_IPV6
259 # INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS)
260
261 ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6"
262 OBJDIR := $(OBJDIR)_IPV6
263 endif
264         
265 ifneq "$(findstring IPV6,$(INSTALL))" "IPV6"
266 INSTALL := $(INSTALL)_IPV6
267 endif        
268
269 ifneq "$(findstring IPV6,$(INSTDIRS))" "IPV6"
270 INSTDIRS := $(INSTDIRS)_IPV6
271 endif
272
273 endif
274
275 INSTDEVDIRS := \
276         $(INSTDIRS) \
277         $(INSTALL)\$(BASEDIR)\include \
278         $(INSTALL)\$(BASEDIR)\lib \
279
280 INSTDIRS += \
281         $(INSTALL)\$(BASEDIR) \
282         $(INSTALL)\$(BASEDIR)\bin \
283         $(INSTALL)\$(BASEDIR)\cgi-bin \
284         $(INSTALL)\$(BASEDIR)\conf \
285         $(INSTALL)\$(BASEDIR)\error \
286         $(INSTALL)\$(BASEDIR)\htdocs \
287         $(INSTALL)\$(BASEDIR)\icons \
288         $(INSTALL)\$(BASEDIR)\logs \
289         $(INSTALL)\$(BASEDIR)\man \
290         $(INSTALL)\$(BASEDIR)\manual \
291         $(INSTALL)\$(BASEDIR)\modules \
292
293 #
294 # Declare Command and tool macros here
295 #
296
297 # Os2LibPath is an extra check to see if we are on NT
298 ifdef Os2LibPath
299 OS = Windows_NT
300 endif
301
302 ifeq "$(OS)" "Windows_NT"
303 CMD = cmd /C
304 DEL = del /F
305 DELTREE = rd /s/q
306 WINNT = 1
307 XCOPYSW = /E
308 else
309 CMD = command /C
310 DEL = del
311 DELTREE = deltree /y
312 XCOPYSW = /E /Y
313 endif
314
315 CHK = $(CMD) if exist
316 CHKNOT = $(CMD) if not exist
317
318
319 #
320 # Setup base C compiler flags
321 #
322
323 #
324 # Common directories
325 #
326
327 STDMOD          = $(AP_WORK)/modules
328 NWOS            = $(AP_WORK)/os/netware
329 SERVER          = $(AP_WORK)/server
330 SRC             = $(AP_WORK)
331 APR             = $(APR_WORK)
332 APRUTIL         = $(APU_WORK)
333 APULDAP         = $(APU_WORK)/ldap
334 SUPMOD          = $(AP_WORK)/support
335 PCRE            = $(PCRESRC)
336 APRTEST         = $(APR_WORK)/test
337 HTTPD           = $(AP_WORK)/modules/http
338 XML             = $(APU_WORK)/xml
339 PREBUILD_INST   = $(AP_WORK)\nwprebuild
340
341 #
342 # Internal Libraries
343 #
344
345 APRLIB          = $(APR)/$(OBJDIR)/aprlib.lib
346 APRUTLIB        = $(APRUTIL)/$(OBJDIR)/aprutil.lib
347 APULDAPLIB      = $(APULDAP)/$(OBJDIR)/apuldap.lib
348 STMODLIB        = $(STDMOD)/$(OBJDIR)/stdmod.lib
349 PCRELIB         = $(PCRE)/$(OBJDIR)/pcre.lib
350 NWOSLIB         = $(NWOS)/$(OBJDIR)/netware.lib
351 SERVLIB         = $(SERVER)/$(OBJDIR)/server.lib
352 HTTPDLIB        = $(HTTPD)/$(OBJDIR)/httpd.lib
353 XMLLIB          = $(XML)/$(OBJDIR)/xmllib.lib
354
355 #
356 # Additional general defines
357 #
358
359 EnvironmentDefined = 1
360 endif # ifndef EnvironmentDefined
361
362 # This is always set so that it will show up in lower directories
363
364 ifdef Path
365 Path = $(PATH)
366 endif
367