Index: /gsdl/trunk/src/recpt/Makefile.in
===================================================================
--- /gsdl/trunk/src/recpt/Makefile.in	(revision 15477)
+++ /gsdl/trunk/src/recpt/Makefile.in	(revision 15478)
@@ -6,5 +6,5 @@
 # University of Waikato, New Zealand.
 #
-# Copyright (C) 1999  The New Zealand Digital Library Project
+# Copyright (C) 1999-2008  The New Zealand Digital Library Project
 #
 #
@@ -25,79 +25,47 @@
 ###########################################################################
 
-USE_Z3950 = @USE_Z3950@
-ifeq ($(USE_Z3950), 1)
-Z_CFLAGS=-DUSE_Z3950
-else
-Z_CFLAGS=
-endif
-
-INDEXERS_DIR=../../indexers
+GSDL_DIR = ../..
+INDEXERS_DIR = $(GSDL_DIR)/indexers
+COLSERVR_DIR = $(GSDL_DIR)/src/colservr
+PROTOCOL_DIR = $(GSDL_DIR)/src/protocol
+
 
 ENABLE_ACCENTFOLD = @ENABLE_ACCENTFOLD@
 ifeq ($(ENABLE_ACCENTFOLD), 1)
-AFLIBS = $(INDEXERS_DIR)/packages/unac/libunac.a 
-AFFLAGS = -DENABLE_ACCENTFOLD
+ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a 
 else
-AFLIBS = 
-AFFLAGS = 
+ACCENTFOLD_LIBS = 
 endif
 
-AR = ar
+USE_FASTCGI = @USE_FASTCGI@
+ifeq ($(USE_FASTCGI), 1)
+FASTCGI_DEFS = -DUSE_FASTCGI
+FASTCGI_INCLUDES = -I$(GSDL_DIR)/packages/fcgi/include
+FASTCGI_LIBS = $(GSDL_DIR)/packages/fcgi/libfcgi/libfcgi.a
+else
+FASTCGI_DEFS =
+FASTCGI_INCLUDES =
+FASTCGI_LIBS = 
+endif
+
+
 CC = @CC@
-CXX = @CXX@
-
-CXXFLAGS = $(Z_CFLAGS) $(AFFLAGS) @CXXFLAGS@
-
-# YAZ kit for z39.50
-YAZDIR=../../packages/yaz
-
-
-USE_FASTCGI = @USE_FASTCGI@
-ifneq ($(USE_FASTCGI), 1)
-DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H
-INCLUDES = -I. -I../.. -I../../lib -I../colservr -I../protocol \
+CPP = @CXX@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CXXFLAGS@ $(Z_CFLAGS)
+DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H $(FASTCGI_DEFS)
+GSDLOS = @GSDLOS@
+INCLUDES = -I. -I$(GSDL_DIR) -I$(GSDL_DIR)/lib -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) \
 	   -I$(INDEXERS_DIR)/mg/lib -I$(INDEXERS_DIR)/mgpp/text \
-           -I../../packages/expat/include
-else 
-DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI -DHAVE_CONFIG_H
-INCLUDES = -I. -I../.. -I../../lib -I../colservr -I../protocol \
-	   -I$(INDEXERS_DIR)/mg/lib -I$(INDEXERS_DIR)/mgpp/text \
-           -I../../packages/expat/include -I../../packages/fcgi/include
-endif
-
-LC_LIBS     = -L../../packages/expat/lib -lexpat
-LC_OBJECTS  = \
-	../colservr/lucenesearch.o   \
-	../colservr/lucenequeryfilter.o \
-	../colservr/lucenegdbmsource.o \
-	../colservr/expat_resultset.o \
-	../colservr/expat_document.o
-
-RANLIB = @RANLIB@
+           -I$(GSDL_DIR)/packages/expat/include $(FASTCGI_INCLUDES)
+INSTALL = @INSTALL@
 LDFLAGS = @LDFLAGS@
-GDBM_LIBS=@GDBM_LIBPATH@ -lgdbm
-LIBS = $(GDBM_LIBS) $(LC_LIBS) $(AFLIBS) @LIBS@
-GSDLOS = @gsdlos@
-INSTALL = @INSTALL@
-
-COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
+LIBS = @LIBS@ @GDBM_LIBPATH@ -lgdbm -L$(GSDL_DIR)/packages/expat/lib -lexpat $(ACCENTFOLD_LIBS)
+
+
+COMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
 LINK = $(CC) $(LDFLAGS) -o $@
-
-CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
-CXXLINK = $(CXX) $(LDFLAGS) -o $@
-
-# in case gdbm.h/libgdbm.a are in a non-standard place...
-GDBM_OBJS=argdb.o authenaction.o collectoraction.o depositoraction.o wizardaction.o infodbclass.o userdb.o usersaction.o historydb.o librarymain.o nullproto.o queryaction.o z3950proto.o
-
-EXEC = library
-
-ifeq ($(USE_Z3950), 1)
-Z3950EXEC = z3950server
-else
-Z3950EXEC =
-endif
-
-all: $(EXEC) $(Z3950EXEC)
-
+CPPCOMPILE = $(CPP) -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
+CPPLINK = $(CPP) $(LDFLAGS) -o $@
 
 
@@ -109,227 +77,157 @@
 .SUFFIXES: .cpp .o
 .cpp.o:
-	$(CXXCOMPILE) $< 
-
-$(GDBM_OBJS) :%.o :%.cpp
-	$(CXXCOMPILE) @GDBM_INCLUDE@ $<
-
-
-COMMONHEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h browserclass.h \
-                converter.h maincfg.h cgiutils.h recptprototools.h browsetoolsclass.h \
-		statusaction.h pageaction.h \
-		pingaction.h queryaction.h documentaction.h  \
-		extlinkaction.h browseaction.h htmlutils.h argdb.h \
-		querytools.h browseactiontools.h formattools.h tipaction.h authenaction.h \
-                userdb.h usersaction.h vlistbrowserclass.h hlistbrowserclass.h \
-		datelistbrowserclass.h invbrowserclass.h pagedbrowserclass.h \
-		htmlbrowserclass.h phindbrowserclass.h historydb.h collectoraction.h depositoraction.h wizardaction.h \
-		phindaction.h summarise.h highlighttext.h gtiaction.h
-
-RECEPTHEADERS = 
-
-LIBRARYHEADERS = z3950proto.h z3950proxy.h
-
-HEADERS = $(COMMONHEADERS) $(RECPTHEADERS) $(LIBRARYHEADERS)
-
-
-COMMONSOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp action.cpp browserclass.cpp \
-                converter.cpp maincfg.cpp cgiutils.cpp recptprototools.cpp browsetoolsclass.cpp \
-		statusaction.cpp pageaction.cpp \
-		pingaction.cpp queryaction.cpp documentaction.cpp \
-		extlinkaction.cpp browseaction.h htmlutils.cpp querytools.cpp \
-		tipaction.cpp authenaction.cpp userdb.cpp usersaction.cpp \
-		vlistbrowserclass.cpp hlistbrowserclass.cpp datelistbrowserclass.cpp \
-		invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp \
-		phindbrowserclass.cpp  historydb.cpp collectoraction.cpp depositoraction.cpp wizardaction.cpp argdb.cpp \
-		browseactiontools.h formattools.cpp phindaction.cpp summarise.cpp \
-		highlighttext.cpp gtiaction.cpp
-
-
-RECPTSOURCES = recptmain.cpp
-
-ifeq ($(USE_Z3950), 1)
-Z_LIBSOURCES=z3950proto.cpp z3950proxy.cpp yaz_zclient.c zparse.tab.c zparse.yy.c $(YAZDIR)/yaz-2.1.4/client/tabcomplete.c
-else
-Z_LIBSOURCES=
-endif
-
-LIBRARYSOURCES = librarymain.cpp $(Z_LIBSOURCES)
-
-SOURCES = $(COMMONSOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES)
-
-
-ifeq ($(USE_Z3950), 1)
-Z_COMOBJS=zparse.yy.o
-else
-Z_COMOBJS=
-endif
-
-
-COMMONOBJECTS = receptionist.o cgiwrapper.o cgiargs.o action.o browserclass.o \
-                converter.o maincfg.o cgiutils.o recptprototools.o browsetoolsclass.o \
-		statusaction.o pageaction.o \
-		pingaction.o queryaction.o documentaction.o \
-		extlinkaction.o browseaction.o htmlutils.o querytools.o browseactiontools.o \
-		formattools.o tipaction.o authenaction.o argdb.o \
-                userdb.o usersaction.o vlistbrowserclass.o \
-		hlistbrowserclass.o datelistbrowserclass.o invbrowserclass.o \
-		pagedbrowserclass.o htmlbrowserclass.o phindbrowserclass.o \
-		historydb.o $(Z_COMOBJS) collectoraction.o depositoraction.o wizardaction.o phindaction.o \
-		summarise.o highlighttext.o gtiaction.o
-
-RECPTOBJECTS = recptmain.o
-
-
-ifeq ($(USE_Z3950), 1)
-Z_LIBOBJS=z3950proto.o z3950proxy.o yaz_zclient.o zparse.tab.o 
-Z_CLIENTOBJS=$(YAZDIR)/yaz-2.1.4/client/tabcomplete.o 
-else
-Z_LIBOBJS=
-Z_CLIENTOBJS=
-endif
-
-LIBRARYOBJECTS = librarymain.o $(Z_LIBOBJS)
-
-OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS)
-
-
-COLSERVROBJECTS = ../colservr/comtypes.o \
-		  ../colservr/mgq.o \
-		  ../colservr/search.o \
-                  ../colservr/mgsearch.o \
-                  ../colservr/querycache.o \
-                  ../colservr/queryinfo.o \
-                  ../colservr/collectserver.o \
-                  ../colservr/colservrconfig.o \
-                  ../colservr/maptools.o \
-                  ../colservr/filter.o \
-                  ../colservr/source.o \
-                  ../colservr/browsefilter.o \
-                  ../colservr/queryfilter.o \
-                  ../colservr/gdbmsource.o \
-                  ../colservr/mggdbmsource.o \
-                  ../colservr/phrasesearch.o \
-                  ../colservr/phrasequeryfilter.o \
-		  ../colservr/mgqueryfilter.o \
-		  ../colservr/mgppsearch.o \
-		  ../colservr/mgppqueryfilter.o \
-		  ../colservr/collectset.o \
-		  $(LC_OBJECTS)
-
-PROTOCOLOBJECTS = ../protocol/recptproto.o \
-                  ../protocol/nullproto.o
-
-
-## z39.50 rules
-# Note! If USE_FASTCGI=1, yaz is still compiled and linked, but never
-# called by librarymain.cpp.
-yaz_zclient.o: yaz_zclient.c
-	$(COMPILE) -I$(YAZDIR)/yaz-2.1.4/include -I$(YAZDIR)/yaz-2.1.4/client $<
-
-# this should be done by the top level makefile...
-$(YAZDIR)/lib/libyaz.a:
-	cd $(YAZDIR)/yaz-2.1.4/src && $(MAKE) && $(MAKE) install
-
-# put a separate rule here, as it speeds up compilation of other objects
-# if they don't need to include all the yaz headers
-z3950%.o: z3950%.cpp
-	$(COMPILE) -I$(YAZDIR)/include -I../../packages/d2m $<
-
-zparse.tab.c: zparse.y
-	@YACC@ -b zparse -d zparse.y
-
-zparse.tab.h: zparse.tab.c
-
-zparse.yy.c: zparse.fl zparse.tab.h
-	flex -Pzconfig -ozparse.yy.c zparse.fl
-
-
-
-# We'll keep the .c and .h files for those without lex/flex and yacc/bison.
-#PARSE_TMPFILES= zparse.tab.o zparse.tab.c zparse.tab.h zparse.yy.o zparse.yy.c
-PARSE_TMPFILE=zparse.tab.o zparse.yy.o
-
+	$(CPPCOMPILE) $< 
+
+
+COLSERVR_OBJECTS = \
+	$(COLSERVR_DIR)/comtypes.o \
+	$(COLSERVR_DIR)/mgq.o \
+	$(COLSERVR_DIR)/search.o \
+        $(COLSERVR_DIR)/mgsearch.o \
+        $(COLSERVR_DIR)/querycache.o \
+        $(COLSERVR_DIR)/queryinfo.o \
+        $(COLSERVR_DIR)/collectserver.o \
+        $(COLSERVR_DIR)/colservrconfig.o \
+        $(COLSERVR_DIR)/maptools.o \
+        $(COLSERVR_DIR)/filter.o \
+        $(COLSERVR_DIR)/source.o \
+        $(COLSERVR_DIR)/browsefilter.o \
+        $(COLSERVR_DIR)/queryfilter.o \
+        $(COLSERVR_DIR)/gdbmsource.o \
+        $(COLSERVR_DIR)/mggdbmsource.o \
+        $(COLSERVR_DIR)/phrasesearch.o \
+        $(COLSERVR_DIR)/phrasequeryfilter.o \
+	$(COLSERVR_DIR)/mgqueryfilter.o \
+	$(COLSERVR_DIR)/mgppsearch.o \
+	$(COLSERVR_DIR)/mgppqueryfilter.o \
+	$(COLSERVR_DIR)/collectset.o \
+	$(COLSERVR_DIR)/lucenesearch.o \
+	$(COLSERVR_DIR)/lucenequeryfilter.o \
+	$(COLSERVR_DIR)/lucenegdbmsource.o \
+	$(COLSERVR_DIR)/expat_resultset.o \
+	$(COLSERVR_DIR)/expat_document.o
+
+PROTOCOL_OBJECTS = \
+	$(PROTOCOL_DIR)/nullproto.o \
+	$(PROTOCOL_DIR)/recptproto.o
+
+SOURCES = \
+	action.cpp \
+	argdb.cpp \
+	authenaction.cpp \
+	browseaction.cpp \
+	browseactiontools.cpp \
+	browserclass.cpp \
+	browsetoolsclass.cpp \
+	cgiargs.cpp \
+	cgiutils.cpp \
+	cgiwrapper.cpp \
+	collectoraction.cpp \
+        converter.cpp \
+	datelistbrowserclass.cpp \
+	depositoraction.cpp \
+	documentaction.cpp \
+	extlinkaction.cpp \
+	formattools.cpp \
+	gtiaction.cpp \
+	highlighttext.cpp \
+	historydb.cpp \
+	hlistbrowserclass.cpp \
+	htmlbrowserclass.cpp \
+	htmlutils.cpp \
+	invbrowserclass.cpp \
+	librarymain.cpp \
+	maincfg.cpp \
+	pageaction.cpp \
+	pagedbrowserclass.cpp \
+	phindaction.cpp \
+	phindbrowserclass.cpp \
+	pingaction.cpp \
+	queryaction.cpp \
+	querytools.cpp \
+	receptionist.cpp \
+	recptprototools.cpp \
+	statusaction.cpp \
+	summarise.cpp \
+	tipaction.cpp \
+	userdb.cpp \
+	usersaction.cpp \
+	vlistbrowserclass.cpp \
+	wizardaction.cpp
+
+OBJECTS = \
+	action.o \
+	argdb.o \
+	authenaction.o \
+	browseaction.o \
+	browseactiontools.o \
+	browserclass.o \
+	browsetoolsclass.o \
+	cgiargs.o \
+	cgiutils.o \
+	cgiwrapper.o \
+	collectoraction.o \
+        converter.o \
+	datelistbrowserclass.o \
+	depositoraction.o \
+	documentaction.o \
+	extlinkaction.o \
+	formattools.o \
+	gtiaction.o \
+	highlighttext.o \
+	historydb.o \
+	hlistbrowserclass.o \
+	htmlbrowserclass.o \
+	htmlutils.o \
+	invbrowserclass.o \
+	librarymain.o \
+	maincfg.o \
+	pageaction.o \
+	pagedbrowserclass.o \
+	phindaction.o \
+	phindbrowserclass.o \
+	pingaction.o \
+	queryaction.o \
+	querytools.o \
+	receptionist.o \
+	recptprototools.o \
+	statusaction.o \
+	summarise.o \
+	tipaction.o \
+	userdb.o \
+	usersaction.o \
+	vlistbrowserclass.o \
+	wizardaction.o
+
+GSDL_LIBS = \
+	$(GSDL_DIR)/lib/gsdllib.a  \
+	$(INDEXERS_DIR)/mg/src/text/libmgtext.a \
+	$(INDEXERS_DIR)/mg/lib/libmglib.a \
+	$(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
+	$(INDEXERS_DIR)/mgpp/lib/libmgpplib.a
+
+EXEC_OBJECTS = \
+	$(OBJECTS) \
+	$(PROTOCOL_OBJECTS) \
+	$(COLSERVR_OBJECTS) \
+	$(GSDL_LIBS)
+
+EXEC = library
+
+
+library: $(EXEC_OBJECTS)
+	$(CPPLINK) $(EXEC_OBJECTS) $(LIBS)
+
+all: $(EXEC)
+
+install: $(EXEC)
+	$(INSTALL) -m 755 -s $(EXEC) $(GSDL_DIR)/cgi-bin
+
+clean:
+	rm -f $(OBJECTS) $(EXEC)
 
 distclean:
-	rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES) Makefile
-
-clean:
-	rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES)
-
-install:
-	$(INSTALL) -m 755 -s library ../../cgi-bin
-ifeq ($(USE_Z3950), 1)
-	$(INSTALL) -m 755 -s z3950server ../../bin/$(GSDLOS)
-endif
+	rm -f $(OBJECTS) $(EXEC) Makefile
 
 depend:
-	makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-ifeq ($(USE_FASTCGI), 1)
-    FASTCGI_OBJS = ../../packages/fcgi/libfcgi/libfcgi.a
-else
-    FASTCGI_OBJS =
-endif
-
-RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
-    ../../lib/gsdllib.a  \
-    $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
-    $(INDEXERS_DIR)/mg/lib/libmglib.a \
-    $(FASTCGI_OBJS) \
-    $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
-    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a 
-
-recpt: $(RECPT_OBJS)
-	$(CXXLINK) $(RECPT_OBJS) $(LIBS) 
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-ifeq ($(USE_Z3950), 1)
-Z_LIBYAZ_A=$(YAZDIR)/lib/libyaz.a
-else
-Z_LIBYAZ_A=
-endif
-
-
-LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) $(PROTOCOLOBJECTS) $(Z_CLIENTOBJS) \
-    ../../lib/gsdllib.a  \
-    $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
-    $(INDEXERS_DIR)/mg/lib/libmglib.a \
-    $(FASTCGI_OBJS) $(Z_LIBYAZ_A) \
-    $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
-    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a
-
-library: $(LIBRARY_OBJS)
-	$(CXXLINK) $(LIBRARY_OBJS) $(LIBS)
-
-# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-
-RECPTLIB_OBJECTS = nullproto.o
-
-RLIBRARY_OBJS = $(COMMONOBJECTS) $(RECPTLIB_OBJECTS) $(COLSERVROBJECTS) \
-    ../../lib/gsdllib.a  \
-    $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
-    $(INDEXERS_DIR)/mg/lib/libmglib.a \
-    $(FASTCGI_OBJS) $(Z_LIBOBJS) $(Z_LIBYAZ_A) \
-    $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
-    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a 
-
-RECPTLIB_OBJS = $(RLIBRARY_OBJS)
-
-
-test:
-
-Z3950_OBJECTS = z3950explain.o z3950parser.o z3950server.o z3950_to_gsdl.o
-
-Z3950_OBJS = $(Z3950_OBJECTS) recptproto.o recptprototools.o nullproto.o $(COLSERVROBJECTS) \
-    ../../lib/gsdllib.a  \
-    $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
-    $(INDEXERS_DIR)/mg/lib/libmglib.a \
-    $(FASTCGI_OBJS) \
-    $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
-    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a \
-    ../../packages/yaz/lib/libyaz.a ../../packages/d2m/libd2m.a
-
-z3950server: $(Z3950_OBJS)
-	@echo -e building z3950server
-	$(CXXLINK) $(Z3950_OBJS) $(LIBS) -lxml2
+	makedepend -Y -- $(DEFS) $(INCLUDES) $(CPPFLAGS) -- $(SOURCES)
