-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makedefs.win32
465 lines (354 loc) · 11 KB
/
Makedefs.win32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# ----------------------------------------------------------------------------
# HlDig Win32 Makefile
#
# TODO: Fix up this file. There is lots of stuff in here that can be tossed.
#
ifeq ($(PRODUCT),hldig)
#BUILD_VER = 3.2.2
#BUILD_NUM = b5
BUILD_VER = 3.2.0b5
endif
#CMN_BUILD_VER = 3.2.0.0
#ifeq ($(RNT_PRODUCT),common)
#BUILD_VER = $(CMN_BUILD_VER)
#BUILD_NUM = 2
#endif
#BUILD_CE_VER = 0
BUILD_DATE =`date "+%m/%d/%Y"`
BUILD_TIME =`date "+%H:%M"`
# ----------------------------------------------------------------------------
ifndef RNTBASE
RNTBASE = ..
endif
# ----------------------------------------------------------------------------
# Need to set arch based upon host system
ifdef WINDIR # Win32 (includes Win2000) ---------------------------------
ARCH = win32
DLLSFX = .$(BUILD_VER).dll
CDLLSFX = .$(CMN_BUILD_VER).dll
EXESFX = .exe
LIBSFX = .lib
OBJSFX = .obj
ROSFX = .xxx
CC = cl
CXX = cl
EXELD = link
DLLLD = link
LD = lib
CCDEBUG = -Yd -ZI -FD -D_DEBUG -Fd"./"
LDDEBUG = -debug /pdbtype:sept
YACC = bison -y
LEX = flex
CFLAGS = -nologo -W3 -DZLIB_DLL
CXXFLAGS = -GX
ifdef DEBUG
CFLAGS += -MDd # The MDd is to link with the debug multithread dynamic library
LDDEBUG += /NODEFAULTLIB:LIBCMD
else
ifdef RNM
CFLAGS += -MT # The MT is to link with the multithread library
else
CFLAGS += -MD # The MD is to link with the multithread dynamic library
endif
endif
AR = lib
ARFLAGS = /nologo /out:$@
CCDLLFLAGS = -DCOMPILE_DL=1
LDFLAGS = -nologo /out:$@
LDLLFLAGS = -dll -machine:x86 -subsystem:windows
LDROFLAGS = $(ARFLAGS)
OTHERLIBS = ws2_32.lib advapi32.lib
else # Unix -----------------------------------------------------
DLLSFX = .so
CDLLSFX = .so
EXESFX =
LIBSFX = .a
OBJSFX = .o
ROSFX = .o
SYS = $(shell uname -s)
CC = gcc
CXX = g++
EXELD = gcc
DLLLD = gcc
LD = ld
CCDLLFLAGS = -DCOMPILE_DL=1
LDLLFLAGS = -Xlinker -h -Xlinker $(notdir $(TARGET)).$(BUILD_VER)
LDROFLAGS = -r
CCDEBUG = -g
LDDEBUG = -g
YACC = bison -y
LEX = flex
AR = ar
ARFLAGS = rcs $@
COPY = cp -f
RM = rm -f
CCVERS = $(shell $(CC) -v 2>&1 | sed -e '/^R.*$$/d' -e 's/gcc version [a-zA-Z-]*\([0-9\.]*\).*$$/\1/)
# begin platform dependent settings ---------------------------
ifeq ($(SYS), Linux)
ARCH = linux
CCOPT = -O2
CCDLLFLAGS += -fPIC
CDEFS += -DLINUX -DUNIX
LDLLFLAGS += -shared
OTHERLIBS += -lstdc++ -lm -ldl
ifeq ($(findstring $(DLLSFX), $(TARGET)),)
OTHERLIBS += -lpthread
endif
# newer versions have the resolver in libc
ifeq ($(shell ls /usr/lib/libresolv.a > /dev/null 2>&1 && echo y), y)
OTHERLIBS += -lresolv
else
OTHERLIBS += -lfl
endif
ifdef INSURE
CC = insure gcc
CXX = insure g++
EXELD = insure gcc
DLLLD = insure gcc
DEBUG = y
endif
BASIS_LIB_VERS = RH62-gcc-$(CCVERS)
endif
ifeq ($(SYS), SunOS)
ARCH = sunos
ifeq ($(shell uname -n), boulder)
ifneq ($(TARGET), $(BINDIR)/olpp$(EXESFX))
ifeq ($(findstring $(DLLSFX), $(TARGET)),)
PURIFY = purify -log-file=/home/httpd/cgi-bin/$(LOGNAME).cfg/purify -chain-length=14 -thread-report-at-exit=no -windows=no -fds-inuse-at-exit=no
#PURIFY = quantify -record-system-calls=yes
endif
endif
endif
ifdef DEBUG
EXELD = $(PURIFY) gcc
endif
CCOPT = -O2
CCDLLFLAGS += -fPIC
CDEFS += -DSOLARIS -DUNIX
LDLLFLAGS += -G
OTHERLIBS = -lsocket -lnsl -lstdc++ -ldl
ifeq ($(findstring $(DLLSFX), $(TARGET)),)
OTHERLIBS += -lpthread
endif
# newer versions have the resolver in libc
ifeq ($(shell ls /usr/lib/libresolv.*[oa] > /dev/null 2>&1 && echo y), y)
OTHERLIBS += -lresolv -lm
endif
BASIS_LIB_VERS = sol-gcc-$(CCVERS)
endif
LDFLAGS = -o $@
endif # Unix
# end of platform specific settings -------------------------------
ifneq ($(findstring $(DLLSFX),$(TARGET)),)
CFLAGS += $(CCDLLFLAGS)
LDFLAGS += $(LDLLFLAGS)
endif
ifneq ($(findstring $(ROSFX),$(TARGET)),)
CFLAGS += $(CCDLLFLAGS)
LDFLAGS += $(LDROFLAGS)
ifeq ($(SYS), SunOS)
LDDEBUG =
endif
endif
# ----------------------------------------------------------------------------
ifeq ($(CC), gcc)
CFLAGS += -Wall -Wmissing-prototypes -Wmissing-declarations
ifndef NOWERROR
CFLAGS += -Werror
endif
endif
# compile with ElectricFence malloc debugging library (man efence)
ifdef EFENCE
OTHERLIBS += -lefence
DEBUG = 1
endif
ifdef DEBUG
CFLAGS += $(CCDEBUG)
LDFLAGS += $(LDDEBUG)
else
CFLAGS += $(CCOPT)
endif
# ----------------------------------------------------------------------------
# Set appropriate database defines
ifndef RNTDB
ifdef WINDIR
RNTDB =
else
RNTDB = mysql
endif
endif
ifeq ($(RNTDB),mysql) # ----------------------------------------------
ifndef MYSQLLIB
MYSQLLIB = /home/mysql/current/lib
endif
ifndef MYSQLINC
MYSQLINC = /home/mysql/current/include
endif
CDEFS += -DMY_SQL
CPPFLAGS += -I$(MYSQLINC)
LIBS = $(RNTLIBS)
DBLIBS = $(MYSQLLIB)/libmysqlclient.a
# DBLIBS = -L$(MYSQLLIB) -lmysqlclient
endif
ifeq ($(RNTDB),ib) # InterBase --------------------------------------
ifndef INTERBASE_LIB
INTERBASE_LIB = /home/interbase/lib
endif
ifndef INTERBASE_INC
INTERBASE_INC = /home/interbase/include
endif
CDEFS += -DINTERBASE
CPPFLAGS += -I$(INTERBASE_INC)
LIBS = $(RNTLIBS)
DBLIBS = -L$(INTERBASE_LIB) -lgds -ldl -lcrypt
endif
ifeq ($(RNTDB),odbc) # -----------------------------------------------
CDEFS += -DODBC
LIBS = $(RNTLIBS)
DBLIBS = odbc32.lib
endif
ifneq ($(findstring $(RNTDB),oci oracle),) # -------------------------
RNTDB = oci
ifdef WINDIR
ifndef ORACLE_HOME
ORACLE_HOME = l:/oracle/win32ora816
endif
# LDFLAGS += /LIBPATH:/rnt/oraclent/lib
DBLIBS = $(ORACLE_HOME)/lib/oci.lib
CPPFLAGS += -I $(ORACLE_HOME)/include
else
ifndef ORACLE_HOME
ORACLE_HOME = /home/oracle
endif
LDFLAGS += -L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/rdbms/lib \
-L$(ORACLE_HOME)/network/lib
CPPFLAGS += -I$(ORACLE_HOME)/rdbms/demo \
-I$(ORACLE_HOME)/rdbms/public \
-I$(ORACLE_HOME)/plsql/public \
-I$(ORACLE_HOME)/network/public
endif
ifeq ($(ARCH),sunos)
DBLIBS = -lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh
endif
# 8.1.5
ifeq ($(shell ls $(ORACLE_HOME)/lib/libsql8.a > /dev/null 2>&1 && echo y), y)
DBLIBS = -lclntsh
endif
ifndef DBLIBS
DBLIBS = -lclntsh -lpsa -lcore4 -lnlsrtl3 -lclntsh
endif
CDEFS += -DORACLE
LIBS = $(RNTLIBS)
endif
# ----------------------------------------------------------------------------
# PHP specific
ifdef WINDIR
ifndef PHP_INCLUDE
PHP_INCLUDE = L:/win32/include/php-4.1.2
endif
ifndef PHP_LIBPATH
PHP_LIBPATH = L:/win32/lib
endif
PHP_LIB = $(PHP_LIBPATH)/php-4.1.2ts.lib
else # Unix
ifndef PHP_INCLUDE
PHP_INCLUDE = $(NFSDIR)/$(ARCH)/include/php-4.1.2
endif
endif
# ----------------------------------------------------------------------------
# check whether we are building for a hosted environment or not.
ifdef HOSTED
CDEFS += -DHOSTED
endif
# ----------------------------------------------------------------------------
# check whether we are building for a Metrics environment or not.
ifdef RNM
CDEFS += -DRNM
endif
# ---------------------------------------------------------------------------
# check whether we are building for production environment or not.
ifdef PRODUCT
CDEFS += -DPRODUCT
endif
# ----------------------------------------------------------------------------
# compile eval version
BUILDTARGET = $(ARCH)
ifdef EVAL
CDEFS += -DEVAL
BUILDTARGET = $(ARCH)_$(RNTDB)_eval
endif
# ----------------------------------------------------------------------------
ifdef WINDIR
ROOTDIR = $(RNTBASE)
else
ROOTDIR = $(shell cd $(RNTBASE); pwd)
endif
BINDIR = $(ROOTDIR)/bin/$(BUILDTARGET)
LIBDIR = $(ROOTDIR)/lib/$(BUILDTARGET)
OBJDIR = $(BUILDTARGET)
DEPDIR := makefiles/$(BUILDTARGET)
CXREFDIR = $(RNTBASE)/cxrefs
ifndef WINDIR
export LD_LIBRARY_PATH = $(LIBDIR)
endif
.PRECIOUS: $(DEPDIR)/.CREATED
%/.CREATED:
@echo Creating directory $(@D)...
@mkdir -p $(@D)
@touch $@
OBJDIRDEP = $(OBJDIR)/.CREATED
BINDIRDEP = $(BINDIR)/.CREATED
LIBDIRDEP = $(LIBDIR)/.CREATED
DEPDIRDEP = $(DEPDIR)/.CREATED
CXREFDIRDEP = $(CXREFDIR)/.CREATED
# ----------------------------------------------------------------------------
OBJS = $(addprefix $(OBJDIR)/, $(notdir $(patsubst %.c,%$(OBJSFX), $(SRC)) \
$(patsubst %.cc,%$(OBJSFX), $(CXXSRC)) \
$(patsubst %.yxx,%$(OBJSFX), $(YXXSRC)) \
$(patsubst %.lxx,%$(OBJSFX), $(LXXSRC)) \
$(patsubst %.y,%$(OBJSFX), $(YSRC)) \
$(patsubst %.l,%$(OBJSFX), $(LSRC))))
DEPLIBS = $(addprefix $(LIBDIR)/lib, $(addsuffix $(LIBSFX), $(LIBS)) \
$(addsuffix $(DLLSFX), $(RNWDLLS)) \
$(addsuffix $(CDLLSFX), $(CMNDLLS)))
ifeq ($(findstring $(DLLSFX), $(TARGET)),)
LDLIBS = $(OBJDIR)/cmdline$(OBJSFX)
endif
ifdef WINDIR
LDLIBS += /LIBPATH:$(LIBDIR) $(subst dll,lib,$(addprefix lib, $(addsuffix $(LIBSFX), $(LIBS)) $(addsuffix $(CDLLSFX), $(CMNDLLS)) $(addsuffix $(DLLSFX), $(RNWDLLS))))
else
LDLIBS += -L$(LIBDIR) $(addprefix -l, $(LIBS)) $(addprefix -l, $(RNWDLLS) $(CMNDLLS))
endif
# ----------------------------------------------------------------------------
ifndef BASIS_INSTALL
ifdef WINDIR
BASIS_INSTALL=L:/win32/basis/version_4
else
BASIS_INSTALL=/nfs/local/$(ARCH)/basis/version_4
endif
endif
#ROSETTE_VER = 3.0.7
ROSETTE_LIBS = -L $(BASIS_INSTALL)/rosette/lib/$(BASIS_LIB_VERS) -lbtunicode
# CPPFLAGS += -I$(BASIS_INSTALL)/rosette/include \
# -I$(BASIS_INSTALL)/euclid/include
#ifdef WINDIR
# LDLIBS += $(BASIS_INSTALL)/jma/lib/w32-msvc-60/btjma.lib
# LDLIBS += $(BASIS_INSTALL)/xma/lib/w32-msvc-60/btxma.lib
# LDLIBS += $(BASIS_INSTALL)/utilities/lib/w32-msvc-60/bttrie.lib
# LDLIBS += $(BASIS_INSTALL)/utilities/lib/w32-msvc-60/btutilities.lib
# LDLIBS += $(BASIS_INSTALL)/utilities/lib/w32-msvc-60/btopts.lib
# LDLIBS += $(BASIS_INSTALL)/euclid/bin/w32-msvc-60/bteuclid.lib
# LDLIBS += $(BASIS_INSTALL)/rosette/bin/w32-msvc-60/btuc.lib
#else
# LDFLAGS += -L$(BASIS_INSTALL)/rosette/lib \
# -L$(BASIS_INSTALL)/euclid/lib
# LDLIBS += -lbtunicode -lpthread -ldl
#endif
CFLAGS += -I../include -DDBUG_OFF -D_WIN32 -DWIN32 -D__WIN32__
# ZLIB
CFLAGS += -IL:/win32/include/zlib
#HlDig default defines
CFLAGS += -DDEFAULT_CONFIG_FILE=\"c:\hldig\demo.conf\" -DCOMMON_DIR=\"c:\hldig\demo.db\templates\" -DBIN_DIR=\"c:\hldig\demo.db\bin\" -DCONFIG_DIR=\"c:\hldig\" -DIMAGE_URL_PREFIX=\"/rnt/rnm/img\" -DDATABASE_DIR=\"c:\hldig\demo.db\"
ifdef TARGET
all: $(TARGET)
endif