source: main/trunk/greenstone2/runtime-src/src/recpt/win32.mak@ 25560

Last change on this file since 25560 was 25560, checked in by ak19, 9 years ago

Dr Bainbridge has introduced the isPersistentAction (add the a=is-persistent to the library url). It is true for server.exe and when using mod_gsdl, but false for library.cgi which uses the apache web server (when not using mod_gsdl).

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 10.0 KB
Line 
1###########################################################################
2#
3# win32 makefile -- src/recpt
4# A component of the Greenstone digital library software
5# from the New Zealand Digital Library Project at the
6# University of Waikato, New Zealand.
7#
8# Copyright (C) 1999-2008 The New Zealand Digital Library Project
9#
10#
11# This program is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24#
25###########################################################################
26
27GSDL_DIR = ..\..\..
28COMMON_DIR = $(GSDL_DIR)\common-src
29RUNTIME_DIR = $(GSDL_DIR)\runtime-src
30
31INDEXERS_DIR = $(COMMON_DIR)\indexers
32COMMON_PACKAGES_DIR = $(COMMON_DIR)\packages
33PACKAGES_DIR = $(RUNTIME_DIR)\packages
34COLSERVR_DIR = $(RUNTIME_DIR)\src\colservr
35PROTOCOL_DIR = $(RUNTIME_DIR)\src\protocol
36Z3950_DIR = $(RUNTIME_DIR)\src\z3950
37
38
39GSDL_VC4 = 0
40LOCAL_LIBRARY = 0
41USE_Z3950 = 0
42USE_GSDL_MOD = 0
43DEBUG = 0
44DLL = 0
45DLLDEBUG = 0
46ENABLE_ACCENTFOLD = 1
47USE_RSS = 1
48USE_GDBM = 1
49USE_JDBM = 1
50USE_SQLITE = 1
51USE_MSSQL = 0
52ENABLE_MG = 1
53ENABLE_MGPP = 1
54ENABLE_LUCENE = 1
55
56!IF $(DEBUG)
57CXXFLAGS = -DEBUG -Z7 /errorReport:prompt
58LDFLAGS = -DEBUG -Z7 /errorReport:prompt
59!ELSE
60CXXFLAGS =
61LDFLAGS =
62!ENDIF
63
64!IF $(GSDL_VC4)
65CXXFLAGS = $(CXXFLAGS) -GX
66!ELSE
67CXXFLAGS = $(CXXFLAGS) -EHsc
68!ENDIF
69
70!IF $(DLL)
71CXXFLAGS = $(CXXFLAGS) -MD
72!ELSE
73!IF ($(DLLDEBUG))
74CXXFLAGS = $(CXXFLAGS) -MDd
75!ENDIF
76!ENDIF
77
78!IF $(ENABLE_ACCENTFOLD)
79ACCENTFOLD_LIBS = "$(INDEXERS_DIR)\packages\unac\libunac.lib" "$(INDEXERS_DIR)\packages\windows\iconv\iconv\lib\iconv.lib"
80!ELSE
81ACCENTFOLD_LIBS =
82!ENDIF
83
84!IF $(USE_RSS)
85RSS_DEFINES = -DUSE_RSS
86RSS_SOURCES = rssaction.cpp
87RSS_OBJECTS = rssaction.obj
88!ELSE
89RSS_DEFINES =
90RSS_SOURCES =
91RSS_OBJECTS =
92!ENDIF
93
94!IF $(USE_GDBM)
95GDBM_DEFINES = -DUSE_GDBM
96GDBM_LIBS = "$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\gdbm.lib"
97GDBM_INCLUDES = -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3" -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\windows"
98!ELSE
99GDBM_DEFINES =
100GDBM_LIBS =
101GDBM_INCLUDES =
102!ENDIF
103
104!IF $(USE_JDBM)
105JDBM_DEFINES = -DUSE_JDBM
106!ELSE
107JDBM_DEFINES =
108!ENDIF
109
110!IF $(USE_SQLITE)
111SQLITE_DEFINES = -DUSE_SQLITE
112SQL_SOURCES = sqlqueryaction.cpp
113SQL_OBJECTS = sqlqueryaction.obj
114SQLITE_LIBS = "$(COMMON_PACKAGES_DIR)\sqlite\lib\sqlite3.lib"
115!ELSE
116SQLITE_DEFINES =
117SQL_SOURCES =
118SQL_OBJECTS =
119SQLITE_LIBS =
120!ENDIF
121
122!IF $(USE_MSSQL)
123MSSQL_DEFINES = -DUSE_MSSQL
124!ELSE
125MSSQL_DEFINES =
126!ENDIF
127
128!IF $(USE_Z3950)
129Z3950_DEFS = -DUSE_Z3950
130Z3950_INCLUDES = -I$(Z3950_DIR)
131Z3950_LIBS = $(Z3950_DIR)\gsdlz3950.lib $(PACKAGES_DIR)\yaz\yaz-2.1.4\lib\yaz.lib
132!ELSE
133Z3950_DEFS =
134Z3950_INCLUDES =
135Z3950_LIBS =
136!ENDIF
137
138!IF $(USE_GSDL_MOD)
139APACHE_OBJS = string_pool.obj mod_gsdl.obj
140
141APACHE_INSTDIR=$(GSDL_DIR)\apache-httpd\windows
142APACHE_SRCLIBDIR=..\..\packages\apache-httpd\httpd-2.2.11\srclib
143
144APXS_CFLAGS=-I$(APACHE_INSTDIR)\include \
145 -I$(APACHE_SRCLIBDIR)\apr\include -I$(APACHE_SRCLIBDIR)\apr-util\include
146
147APXS_LINKFLAGS= /libpath:$(APACHE_INSTDIR)\lib \
148 /libpath:$(APACHE_SRCLIBDIR)\apr\include \
149 /libpath:$(APACHE_SRCLIBDIR)\apr-util\include
150
151APXS_LDFLAGS= -L$(APACHE_INSTDIR)\lib \
152 -L$(APACHE_SRCLIBDIR)\apr\include \
153 -L$(APACHE_SRCLIBDIR)\apr-util\include
154
155APXS_LIBS = libaprutil-1.lib libapr-1.lib libhttpd.lib
156
157APACHE_MODULE = mod_gsdl.so
158!ELSE
159APACHE_OBJS =
160APACHE_MODULE =
161!ENDIF
162
163
164!IF $(ENABLE_MG)
165MG_DEFS = -DENABLE_MG
166MG_LIBS = "$(INDEXERS_DIR)\mg\src\text\libmgtext.lib" \
167 "$(INDEXERS_DIR)\mg\lib\libmglib.lib"
168MG_INCLUDES = -I"$(INDEXERS_DIR)\mg" -I"$(INDEXERS_DIR)\mg\lib"
169!ELSE
170MG_DEFS =
171MG_LIBS =
172MG_INCLUDES =
173!ENDIF
174
175!IF $(ENABLE_MGPP)
176MGPP_DEFS = -DENABLE_MGPP
177MGPP_SOURCES = phindaction.cpp
178MGPP_OBJECTS = phindaction.obj
179MGPP_LIBS = "$(INDEXERS_DIR)\mgpp\text\libmgpptext.lib" \
180 "$(INDEXERS_DIR)\mgpp\lib\libmgpplib.lib"
181MGPP_INCLUDES = -I"$(INDEXERS_DIR)\mgpp\text" \
182 -I"$(INDEXERS_DIR)\mgpp\lib"
183!ELSE
184MGPP_DEFS =
185MGPP_SOURCES =
186MGPP_OBJECTS =
187MGPP_LIBS =
188MGPP_INCLUDES =
189!ENDIF
190
191!IF $(ENABLE_LUCENE)
192LUCENE_DEFS = -DENABLE_LUCENE
193!ELSE
194LUCENE_DEFS=
195!ENDIF
196
197AR = lib
198CC = cl
199DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE \
200 -DGSDL_NOCACHE $(RSS_DEFINES) $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(MSSQL_DEFINES) \
201 $(Z3950_DEFS) $(MG_DEFS) $(MGPP_DEFS) $(LUCENE_DEFS)
202INCLUDES = -I. -I"$(GSDL_DIR)" -I"$(COMMON_DIR)\src\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" \
203 $(MG_INCLUDES) $(MGPP_INCLUDES) \
204 -I"$(COMMON_PACKAGES_DIR)\windows\crypt\crypt" -I"$(COMMON_PACKAGES_DIR)\expat\include" \
205 $(GDBM_INCLUDES) \
206 $(Z3950_INCLUDES)
207LIBS = "$(COMMON_PACKAGES_DIR)\windows\crypt\crypt\crypt.lib" "$(COMMON_PACKAGES_DIR)\expat\lib\libexpat.lib" \
208 $(GDBM_LIBS) $(ACCENTFOLD_LIBS) $(SQLITE_LIBS) $(Z3950_LIBS)
209
210!IF $(GSDL_VC4)
211DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
212INCLUDES = $(INCLUDES) -I"$(COMMON_PACKAGES_DIR)\windows\stlport\stlport"
213!ENDIF
214!IF $(LOCAL_LIBRARY)
215DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
216!ENDIF
217
218CXXFLAGS = $(CXXFLAGS)
219
220COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
221LINK = $(CC) -nologo $(LDFLAGS) -Fe"$@"
222
223
224.SUFFIXES:
225.SUFFIXES: .cpp .obj
226.cpp.obj:
227 $(COMPILE) $<
228
229OSPROCESS_SOURCES = \
230 os_process.cpp \
231 os_process_windows.cpp \
232
233OSPROCESS_OBJECTS = \
234 os_process.obj \
235 os_process_windows.obj \
236
237
238SOURCES = \
239 action.cpp \
240 argdb.cpp \
241 authenaction.cpp \
242 basequeryaction.cpp \
243 browseaction.cpp \
244 browseactiontools.cpp \
245 browserclass.cpp \
246 browsetoolsclass.cpp \
247 cgiargs.cpp \
248 cgiutils.cpp \
249 cgiwrapper.cpp \
250 collectoraction.cpp \
251 configaction.cpp \
252 converter.cpp \
253 datelistbrowserclass.cpp \
254 depositoraction.cpp \
255 documentaction.cpp \
256 dynamicclassifieraction.cpp \
257 extlinkaction.cpp \
258 formattools.cpp \
259 gtiaction.cpp \
260 highlighttext.cpp \
261 historydb.cpp \
262 hlistbrowserclass.cpp \
263 htmlbrowserclass.cpp \
264 htmlutils.cpp \
265 invbrowserclass.cpp \
266 librarymain.cpp \
267 maincfg.cpp \
268 $(OSPROCESS_SOURCES) \
269 pageaction.cpp \
270 pagedbrowserclass.cpp \
271 $(MGPP_SOURCES) \
272 phindbrowserclass.cpp \
273 pingaction.cpp \
274 ispersistentaction.cpp \
275 queryaction.cpp \
276 querytools.cpp \
277 receptionist.cpp \
278 $(RSS_SOURCES) \
279 statusaction.cpp \
280 $(SQL_SOURCES) \
281 summarise.cpp \
282 tipaction.cpp \
283 userdb.cpp \
284 usersaction.cpp \
285 vlistbrowserclass.cpp \
286 wizardaction.cpp
287
288OBJECTS = \
289 action.obj \
290 argdb.obj \
291 authenaction.obj \
292 basequeryaction.obj \
293 browseaction.obj \
294 browseactiontools.obj \
295 browserclass.obj \
296 browsetoolsclass.obj \
297 cgiargs.obj \
298 cgiutils.obj \
299 cgiwrapper.obj \
300 collectoraction.obj \
301 configaction.obj \
302 converter.obj \
303 datelistbrowserclass.obj \
304 depositoraction.obj \
305 documentaction.obj \
306 dynamicclassifieraction.obj \
307 extlinkaction.obj \
308 formattools.obj \
309 gtiaction.obj \
310 highlighttext.obj \
311 historydb.obj \
312 hlistbrowserclass.obj \
313 htmlbrowserclass.obj \
314 htmlutils.obj \
315 invbrowserclass.obj \
316 librarymain.obj \
317 maincfg.obj \
318 $(OSPROCESS_OBJECTS) \
319 pageaction.obj \
320 pagedbrowserclass.obj \
321 $(MGPP_OBJECTS) \
322 phindbrowserclass.obj \
323 pingaction.obj \
324 ispersistentaction.obj \
325 queryaction.obj \
326 querytools.obj \
327 receptionist.obj \
328 $(RSS_OBJECTS) \
329 statusaction.obj \
330 $(SQL_OBJECTS) \
331 summarise.obj \
332 tipaction.obj \
333 userdb.obj \
334 usersaction.obj \
335 vlistbrowserclass.obj \
336 wizardaction.obj
337
338LIBRARY = gsdlrecpt.lib
339
340GSDL_LIBS = \
341 "$(PROTOCOL_DIR)\gsdlprotocol.lib" \
342 "$(COLSERVR_DIR)\gsdlcolservr.lib" \
343 $(MG_LIBS) \
344 $(MGPP_LIBS) \
345 "$(COMMON_DIR)\src\lib\gsdllib.lib"
346
347EXECUTABLE_OBJECTS = \
348 $(OBJECTS) \
349 $(GSDL_LIBS)
350
351EXECUTABLE = library.cgi
352
353
354# Default target: make gsdlrecpt.lib if LOCAL_LIBRARY is set, otherwise both gsdlrecpt.lib and library.exe
355!IF $(LOCAL_LIBRARY)
356all: $(LIBRARY) $(APACHE_MODULE)
357!ELSE
358all: $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE)
359!ENDIF
360
361gsdlrecpt.lib: $(OBJECTS)
362 if EXIST $(LIBRARY) del $(LIBRARY)
363 $(AR) -nologo /out:$(LIBRARY) $(OBJECTS)
364
365library.cgi: $(EXECUTABLE_OBJECTS)
366 $(LINK) $(EXECUTABLE_OBJECTS) $(LIBS)
367
368
369mod_gsdl.obj: mod_gsdl.cpp
370 $(CC) -nologo /MD /W3 /D WIN32 /D _WINDOWS /D NDEBUG -c $(CXXFLAGS) $(DEFS) $(INCLUDES) -D_APACHE_MOD=2 $(APXS_CFLAGS) mod_gsdl.cpp
371## cl.exe /nologo /MT /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG -I"C:\Program Files\xampp\apache\include" -c mod_gsdl.c
372
373mod_gsdl.so: $(APACHE_OBJS) $(LIBRARY)
374 $(CC) /nologo -Fe"mod_gsdl.dll" $(APACHE_OBJS) gsdlrecpt.lib $(GSDL_LIBS) $(LIBS) $(APXS_LDFLAGS) $(APXS_LIBS)
375
376# link /nologo /dll $(APACHE_OBJS) gsdlrecpt.lib $(GSDL_LIBS) $(LIBS) $(APXS_LDFLAGS) $(APXS_LIBS)
377 rename mod_gsdl.dll mod_gsdl.so
378
379## $(CC) -nologo /dll -Fe"$@" $(APACHE_OBJS) $(LIBRARY) $(GSDL_LIBS) $(LIBS)
380
381
382## link.exe kernel32.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"C:\Program Files\xampp\apache\lib" libaprutil-1.lib libapr-1.lib libhttpd.lib mod_gsdl.obj
383
384## rename mod_gsdl.dll mod_gsdl.so
385
386
387# COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
388# LINK = $(CC) -nologo -Fe"$@" $(LDFLAGS)
389
390
391
392
393
394
395osprocess-test.cgi: $(OSPROCESS_OBJECTS) os_process_test.obj
396 $(LINK) $(OSPROCESS_OBJECTS) os_process_test.obj ..\..\..\common-src\src\lib\gsdllib.lib
397
398!IF $(LOCAL_LIBRARY)
399install:
400!ELSE
401install: $(EXECUTABLE)
402!IF "$(PROCESSOR_ARCHITECTURE)"==""
403 copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows"
404!ELSE IF EXIST ("$(GSDL_DIR)\bin\windows")
405 copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows"
406!ELSE IF "$(PROCESSOR_ARCHITECTURE)"=="x86"
407 copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows32"
408!ELSE
409 copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows64"
410!ENDIF
411!ENDIF
412
413clean:
414 del *.obj
415 del $(LIBRARY)
416 del $(EXECUTABLE)
417
418
419# Always recompile configaction and statusaction in case GSDL_LOCAL_LIBRARY has changed
420statusaction.obj: FORCE
421configaction.obj: FORCE
422
423FORCE:
Note: See TracBrowser for help on using the repository browser.