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