root/main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in @ 25149

Revision 25149, 7.9 KB (checked in by kjdon, 8 years ago)

getting greenstone to work properly on 64 bit machines. COMPAT32BITFLAGS is no more. Don't need -m32 option. Instead, have ARCH_DEP_FLAGS, which gets -fPIC on 64 bit machines. Note that I have used version 2.63 of autoconf. SOme configure files had previously been generated with v 2.65. Have also got rid of lib64 for compiling expat and iconv - only need one version now, not 32 bit version for greenstone and 64 bit version for apache

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1###########################################################################
2#
3# Makefile -- runtime-src/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
31GSDLOS = @gsdlos@
32GSDLARCH = @gsdlarch@
33
34INDEXERS_DIR = $(COMMON_DIR)/indexers
35COMMON_PACKAGES_DIR = $(COMMON_DIR)/packages
36RUNTIME_PACKAGES_DIR = $(RUNTIME_DIR)/packages
37COLSERVR_DIR = $(RUNTIME_DIR)/src/colservr
38PROTOCOL_DIR = $(RUNTIME_DIR)/src/protocol
39Z3950_DIR = $(RUNTIME_DIR)/src/z3950
40
41
42ENABLE_ACCENTFOLD = @ENABLE_ACCENTFOLD@
43ifeq ($(ENABLE_ACCENTFOLD), 1)
44ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a $(COMMON_PACKAGES_DIR)/iconv/lib/libiconv.a
45else
46ACCENTFOLD_LIBS =
47endif
48
49ENABLE_MG = @ENABLE_MG@
50ifeq ($(ENABLE_MG), 1)
51MG_INDEXERS_LIBS = $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
52    $(INDEXERS_DIR)/mg/lib/libmglib.a
53MG_INCLUDES = -I$(INDEXERS_DIR)/mg -I$(INDEXERS_DIR)/mg/lib
54else
55MG_INDEXERS_LIBS =
56MG_INCLUDES =
57endif
58
59ENABLE_MGPP = @ENABLE_MGPP@
60ifeq ($(ENABLE_MGPP), 1)
61MGPP_SOURCES = phindaction.cpp
62MGPP_OBJECTS = phindaction.o
63MGPP_INDEXERS_LIBS = $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
64    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a
65MGPP_INCLUDES = -I$(INDEXERS_DIR)/mgpp/text -I$(INDEXERS_DIR)/mgpp/lib
66else
67MGPP_SOURCES =
68MGPP_OBJECTS =
69MGPP_INDEXERS_LIBS =
70MGPP_INCLUDES =
71endif
72
73USE_FASTCGI = @USE_FASTCGI@
74ifeq ($(USE_FASTCGI), 1)
75FASTCGI_DEFS = -DUSE_FASTCGI
76FASTCGI_INCLUDES = -I$(RUNTIME_PACKAGES_DIR)/fcgi/include
77FASTCGI_LIBS = $(RUNTIME_PACKAGES_DIR)/fcgi/libfcgi/libfcgi.a
78else
79FASTCGI_DEFS =
80FASTCGI_INCLUDES =
81FASTCGI_LIBS =
82endif
83
84USE_GDBM = @USE_GDBM@
85ifeq ($(USE_GDBM), 1)
86GDBM_DEFINES = -DUSE_GDBM
87GDBM_INCLUDES = -I$(COMMON_PACKAGES_DIR)/gdbm/include
88GDBM_LIBS = $(COMMON_PACKAGES_DIR)/gdbm/lib/libgdbm.a
89else
90GDBM_DEFINES =
91GDBM_INCLUDES =
92GDBM_LIBS =
93endif
94
95USE_JDBM = @USE_JDBM@
96ifeq ($(USE_JDBM), 1)
97JDBM_DEFINES = -DUSE_JDBM
98else
99JDBM_DEFINES =
100endif
101
102USE_SQLITE = @USE_SQLITE@
103ifeq ($(USE_SQLITE), 1)
104SQLITE_DEFINES = -DUSE_SQLITE
105SQLITE_LIBS = $(COMMON_PACKAGES_DIR)/sqlite/lib/libsqlite3.a -ldl -lpthread
106SQL_SOURCES = sqlqueryaction.cpp
107SQL_OBJECTS = sqlqueryaction.o
108else
109SQLITE_DEFINES =
110SQLITE_LIBS =
111SQL_SOURCES =
112SQL_OBJECTS =
113endif
114
115USE_RSS = @USE_RSS@
116ifeq ($(USE_RSS), 1)
117RSS_DEFINES = -DUSE_RSS
118RSS_SOURCES = rssaction.cpp
119RSS_OBJECTS = rssaction.o
120else
121RSS_DEFINES =
122RSS_SOURCES =
123RSS_OBJECTS =
124endif
125
126
127USE_Z3950 = @USE_Z3950@
128ifeq ($(USE_Z3950), 1)
129Z3950_DEFS = -DUSE_Z3950
130Z3950_INCLUDES = -I$(Z3950_DIR)
131Z3950_LIBS = $(Z3950_DIR)/gsdlz3950.a $(RUNTIME_PACKAGES_DIR)/yaz/lib/libyaz.a
132else
133Z3950_DEFS =
134Z3950_INCLUDES =
135Z3950_LIBS =
136endif
137
138USE_APACHE_HTTPD=@USE_APACHE_HTTPD@
139#ifeq ($(USE_APACHE_HTTPD), 1)
140ifeq ($(USE_APACHE_HTTPD), "IGNORE_FOR_NOW")
141APACHE_OBJS = string_pool.o mod_gsdl.o
142
143APACHE_INSTDIR=$(GSDL_DIR)/apache-httpd/$(GSDLOS)
144APACHE_SRCLIBDIR=../../packages/apache-httpd/httpd-2.2.11/srclib
145
146APXS_CFLAGS=-I$(APACHE_INSTDIR)/include \
147  -I$(APACHE_SRCLIBDIR)/apr/include -I$(APACHE_SRCLIBDIR)/apr-util/include
148
149APXS_LDFLAGS= -L$(APACHE_INSTDIR)/lib \
150  -L$(APACHE_SRCLIBDIR)/apr/include -L$(APACHE_SRCLIBDIR)/apr-util/include
151
152APACHE_MODULE = mod_gsdl.so
153else
154APACHE_OBJS =
155APACHE_MODULE =
156endif
157
158
159AR = ar
160CC = @CC@
161CFLAGS=@CFLAGS@ @ARCH_DEP_FLAGS@
162CXX = @CXX@
163CXXFLAGS = @CXXFLAGS@ @ARCH_DEP_FLAGS@
164DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H $(FASTCGI_DEFS) $(RSS_DEFINES) $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(Z3950_DEFS)
165INCLUDES = -I. -I$(GSDL_DIR) -I$(COMMON_DIR)/src/lib \
166        -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) \
167    $(MG_INCLUDES) $(MGPP_INCLUDES) \
168        -I$(COMMON_PACKAGES_DIR)/expat/include $(FASTCGI_INCLUDES) $(GDBM_INCLUDES) $(Z3950_INCLUDES)
169INSTALL = @INSTALL@
170LDFLAGS = @LDFLAGS@ @ARCH_DEP_FLAGS@
171LIBS = @LIBS@ $(GDBM_LIBS) \
172    $(COMMON_PACKAGES_DIR)/expat/lib/libexpat.a \
173    $(ACCENTFOLD_LIBS) $(FASTCGI_LIBS) $(SQLITE_LIBS) $(Z3950_LIBS)
174RANLIB = @RANLIB@
175
176
177CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
178CXXLINK = $(CXX) $(LDFLAGS) -o $@
179
180
181SOURCES = \
182    action.cpp \
183    argdb.cpp \
184    authenaction.cpp \
185    browseaction.cpp \
186    browseactiontools.cpp \
187    browserclass.cpp \
188    browsetoolsclass.cpp \
189    cgiargs.cpp \
190    cgiutils.cpp \
191    cgiwrapper.cpp \
192    collectoraction.cpp \
193    configaction.cpp \
194        converter.cpp \
195    datelistbrowserclass.cpp \
196    depositoraction.cpp \
197    documentaction.cpp \
198    dynamicclassifieraction.cpp \
199    extlinkaction.cpp \
200    formattools.cpp \
201    gtiaction.cpp \
202    highlighttext.cpp \
203    historydb.cpp \
204    hlistbrowserclass.cpp \
205    htmlbrowserclass.cpp \
206    htmlutils.cpp \
207    invbrowserclass.cpp \
208    librarymain.cpp \
209    maincfg.cpp \
210    pageaction.cpp \
211    pagedbrowserclass.cpp \
212    $(MGPP_SOURCES) \
213    phindbrowserclass.cpp \
214    pingaction.cpp \
215    basequeryaction.cpp \
216    queryaction.cpp \
217    $(SQL_SOURCES) \
218    querytools.cpp \
219    receptionist.cpp \
220    $(RSS_SOURCES) \
221    statusaction.cpp \
222    summarise.cpp \
223    tipaction.cpp \
224    userdb.cpp \
225    usersaction.cpp \
226    vlistbrowserclass.cpp \
227    wizardaction.cpp
228
229OBJECTS = \
230    action.o \
231    argdb.o \
232    authenaction.o \
233    browseaction.o \
234    browseactiontools.o \
235    browserclass.o \
236    browsetoolsclass.o \
237    cgiargs.o \
238    cgiutils.o \
239    cgiwrapper.o \
240    collectoraction.o \
241    configaction.o \
242        converter.o \
243    datelistbrowserclass.o \
244    depositoraction.o \
245    documentaction.o \
246    dynamicclassifieraction.o \
247    extlinkaction.o \
248    formattools.o \
249    gtiaction.o \
250    highlighttext.o \
251    historydb.o \
252    hlistbrowserclass.o \
253    htmlbrowserclass.o \
254    htmlutils.o \
255    invbrowserclass.o \
256    librarymain.o \
257    maincfg.o \
258    pageaction.o \
259    pagedbrowserclass.o \
260    $(MGPP_OBJECTS) \
261    phindbrowserclass.o \
262    pingaction.o \
263    basequeryaction.o \
264    queryaction.o \
265    $(SQL_OBJECTS) \
266    querytools.o \
267    receptionist.o \
268    $(RSS_OBJECTS) \
269    statusaction.o \
270    summarise.o \
271    tipaction.o \
272    userdb.o \
273    usersaction.o \
274    vlistbrowserclass.o \
275    wizardaction.o
276
277LIBRARY = gsdlrecpt.a
278
279GSDL_LIBS = \
280    $(PROTOCOL_DIR)/gsdlprotocol.a \
281    $(COLSERVR_DIR)/gsdlcolservr.a \
282    $(MG_INDEXERS_LIBS) \
283    $(MGPP_INDEXERS_LIBS) \
284    $(COMMON_DIR)/src/lib/gsdllib.a
285
286EXECUTABLE_OBJECTS = \
287    $(OBJECTS) \
288    $(GSDL_LIBS)
289
290EXECUTABLE = library.cgi
291
292
293# Default target: make both gsdlrecpt.a and the library executable
294all: $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE)
295
296gsdlrecpt.a: $(OBJECTS)
297    rm -f $(LIBRARY)
298    $(AR) cru $(LIBRARY) $(OBJECTS)
299    $(RANLIB) $(LIBRARY)
300
301$(EXECUTABLE): $(EXECUTABLE_OBJECTS) $(GSDL_LIBS)
302    $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
303
304mod_gsdl.o: mod_gsdl.cpp
305    $(CXX) -c  $(CXXFLAGS) $(DEFS) $(INCLUDES) -D_APACHE_MOD=2 -fPIC $(APXS_CFLAGS) -Wall -o $@ $<
306
307mod_gsdl.so: $(APACHE_OBJS) $(LIBRARY)
308    $(CXX) -fPIC -shared -o $@ $(APACHE_OBJS) $(LIBRARY) $(GSDL_LIBS) $(LIBS)
309
310
311.SUFFIXES:
312.SUFFIXES: .cpp .o
313.cpp.o:
314    $(CXXCOMPILE) $<
315
316
317install: $(EXECUTABLE)
318    $(INSTALL) -m 755 -s $(EXECUTABLE) $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)
319#ifeq ($(USE_APACHE_HTTPD), 1)
320ifeq ($(USE_APACHE_HTTPD), "IGNORE_FOR_NOW")
321    $(GSDL_DIR)/apache-httpd/$(GSDLOS)/bin/apxs  -i -n gsdl mod_gsdl.so
322endif
323
324clean:
325    rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE) $(APACHE_OBJS)
326
327distclean:
328    rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) Makefile
329
330depend:
331    makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
Note: See TracBrowser for help on using the browser.