Index: gsdl/trunk/src/colservr/Makefile.in
===================================================================
--- gsdl/trunk/src/colservr/Makefile.in	(revision 15425)
+++ gsdl/trunk/src/colservr/Makefile.in	(revision 15426)
@@ -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,5 +25,4 @@
 ###########################################################################
 
-
 AR = ar
 CC = @CC@
@@ -31,53 +30,59 @@
 CFLAGS = @CFLAGS@
 CXXFLAGS = @CXXFLAGS@
-MCFLAGS = @CFLAGS@ -Wall -Wunused
 DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER @DEFS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+RANLIB = @RANLIB@
 
-INDEXERS_DIR=../../indexers
+GSDLOS = @gsdlos@
+
 USE_FASTCGI = @USE_FASTCGI@
-USE_MGPP = @USE_MGPP@
 ifneq ($(USE_FASTCGI), 1)
 DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM @DEFS@
-
 CGI_INCLUDES = 
 else
 DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI @DEFS@
-
 CGI_INCLUDES = -I../../packages/fcgi/include 
 endif
 
-ifneq ($(USE_MGPP), 1)
-MG_INCLUDES = -I$(INDEXERS_DIR)/mg  -I$(INDEXERS_DIR)/mg/lib \
-		-I$(INDEXERS_DIR)/mg/src/text
-MG_HEADERS = mgq.h mgsearch.h mgqueryfilter.h 
+INDEXERS_DIR = ../../indexers
 
-MG_SOURCES = mgq.c mgsearch.cpp mgqueryfilter.cpp 
+MG_INCLUDES = -I$(INDEXERS_DIR)/mg -I$(INDEXERS_DIR)/mg/lib -I$(INDEXERS_DIR)/mg/src/text
+MG_HEADERS = mgq.h mgsearch.h mgqueryfilter.h
+MG_SOURCES = mgq.c mgsearch.cpp mgqueryfilter.cpp
+MG_OBJECTS = mgq.o mgsearch.o mgqueryfilter.o
 
-MG_OBJECTS = mgq.o mgsearch.o mgqueryfilter.o 
+MGPP_INCLUDES = -I$(INDEXERS_DIR)/mgpp/lib -I$(INDEXERS_DIR)/mgpp/text 
+MGPP_HEADERS = mgppsearch.h mgppqueryfilter.h
+MGPP_SOURCES = mgppsearch.cpp mgppqueryfilter.cpp
 MGPP_OBJECTS = mgppsearch.o mgppqueryfilter.o
 
-else
-MG_INCLUDES = -I$(INDEXERS_DIR)/mgpp/text -I$(INDEXERS_DIR)/mgpp/lib 
+LUCENE_INCLUDES = -I../../packages/expat/include
+LUCENE_HEADERS = lucenesearch.h lucenequeryfilter.h lucenegdbmsource.h \
+	         expat_resultset.h expat_document.h
+LUCENE_SOURCES = lucenesearch.cpp lucenequeryfilter.cpp lucenegdbmsource.cpp \
+	         expat_resultset.cpp expat_document.cpp
+LUCENE_OBJECTS = lucenesearch.o lucenequeryfilter.o lucenegdbmsource.o \
+	         expat_resultset.o expat_document.o
 
-MG_HEADERS = mgppsearch.h mgppqueryfilter.h
+# Do NOT add the "recpt" directory here: the colserver should be independent of the receptionist!
+INCLUDES = -I. -I../.. -I../../lib $(CGI_INCLUDES) \
+		$(MG_INCLUDES) $(MGPP_INCLUDES) $(LUCENE_INCLUDES) @GDBM_INCLUDE@
 
-MG_SOURCES = mgppsearch.cpp mgppqueryfilter.cpp
 
-MG_OBJECTS = mgppsearch.o mgppqueryfilter.o
+COMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
+LINK = $(CXX) $(LDFLAGS) -o $@
 
-endif
+CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
+CXXLINK = $(CXX) $(LDFLAGS) -o $@
 
-LC_INCLUDES = -I../../packages/expat/include
-LC_HEADERS  = lucenesearch.h   lucenequeryfilter.h   lucenegdbmsource.h \
-	      expat_resultset.h expat_document.h
 
-LC_SOURCES  = lucenesearch.cpp lucenequeryfilter.cpp lucenegdbmsource.cpp \
-	      expat_resultset.cpp expat_document.cpp
+# ===========================================================================================
+#   CORBA SUPPORT
 
-LC_OBJECTS  = lucenesearch.o   lucenequeryfilter.o   lucenegdbmsource.o \
-	      expat_resultset.o expat_document.o
+USE_CORBA = @USE_CORBA@
 
-INCLUDES = -I. -I../.. -I../../lib -I../recpt \
-		$(CGI_INCLUDES) $(MG_INCLUDES) $(LC_INCLUDES) @GDBM_INCLUDE@
+MCFLAGS = @CFLAGS@ -Wall -Wunused
+
 MICO_DIR = @MICO_DIR@
 ifeq ($(MICO_DIR), default)
@@ -95,21 +100,23 @@
 MINCLUDES = -I. -I../../lib -I../recpt  -I$(INDEXERS_DIR)/mgpp/text $(MICO_INC)
 
-USE_CORBA = @USE_CORBA@
-
-RANLIB = @RANLIB@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-
-GSDLOS = @gsdlos@
-
-
-COMPILE = $(CC) -c $(CFLAGS) $(DEFS) $(INCLUDES)
-LINK = $(CXX) $(LDFLAGS) -o $@
-
-CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
-CXXLINK = $(CXX) $(LDFLAGS) -o $@
-
 MCOMPILE = $(MICO_PATH)mico-c++ -x c++ $(MCFLAGS) $(DEFS) $(MINCLUDES) -c
 MLINK = $(MICO_PATH)mico-ld $(LDFLAGS) -lmico2.2.7 -o $@
+
+.SUFFIXES: .mpp .o
+.mpp.o:
+	$(MCOMPILE) $<
+
+ifneq ($(USE_CORBA), 0)
+CORBAHEADERS = corbaServer.h
+CORBASOURCES = corbaServer.mpp
+CORBAOBJECTS = corbaServer.o ../../lib/corbaiface_skel.o
+else
+CORBAHEADERS = 
+CORBASOURCES = 
+CORBAOBJECTS = 
+endif
+
+# ===========================================================================================
+
 
 .SUFFIXES:
@@ -122,30 +129,10 @@
 	$(CXXCOMPILE) $< 
 
-.SUFFIXES: .mpp .o
-.mpp.o:
-	$(MCOMPILE) $<
 
-ifneq ($(USE_CORBA), 0)
-CORBAHEADERS = \
-  corbaServer.h
-CORBASOURCES = \
-  corbaServer.mpp
-CORBAOBJECTS = \
-  corbaServer.o ../../lib/corbaiface_skel.o
-else
-CORBAHEADERS = 
-CORBASOURCES = 
-CORBAOBJECTS = 
-endif
-
-
-# following objects need both mg and mgpp stuff - jrm21
-MG_MGPP_OBJECTS=collectset.o
-
-HEADERS = comtypes.h search.h querycache.h queryinfo.h collectserver.h collectset.h \
-          colservrconfig.h maptools.h filter.h source.h browsefilter.h \
-          queryfilter.h mggdbmsource.h gdbmsource.h \
-	  phrasesearch.h phrasequeryfilter.h \
-	  $(MG_HEADERS) $(LC_HEADERS) $(CORBAHEADERS)
+HEADERS = comtypes.h search.h querycache.h queryinfo.h collectserver.h \
+          colservrconfig.h maptools.h filter.h source.h \
+          browsefilter.h queryfilter.h mggdbmsource.h gdbmsource.h \
+	  phrasesearch.h phrasequeryfilter.h collectset.h \
+	  $(MG_HEADERS) $(MGPP_HEADERS) $(LUCENE_HEADERS) $(CORBAHEADERS)
 
 SOURCES = comtypes.cpp search.cpp querycache.cpp queryinfo.cpp collectserver.cpp \
@@ -153,26 +140,22 @@
           browsefilter.cpp queryfilter.cpp mggdbmsource.cpp gdbmsource.cpp \
 	  phrasesearch.cpp phrasequeryfilter.cpp collectset.cpp \
-	  $(MG_SOURCES) $(LC_SOURCES) $(CORBASOURCES)
+	  $(MG_SOURCES) $(MGPP_SOURCES) $(LUCENE_SOURCES) $(CORBASOURCES)
 
 OBJECTS = comtypes.o search.o querycache.o queryinfo.o collectserver.o \
-          colservrconfig.o maptools.o filter.o source.o browsefilter.o \
-          queryfilter.o mggdbmsource.o gdbmsource.o \
-	  phrasesearch.o phrasequeryfilter.o \
-	  $(MG_MGPP_OBJECTS) $(MG_OBJECTS) $(LC_OBJECTS) $(CORBAOBJECTS) 
+          colservrconfig.o maptools.o filter.o source.o \
+          browsefilter.o queryfilter.o mggdbmsource.o gdbmsource.o \
+	  phrasesearch.o phrasequeryfilter.o collectset.o \
+	  $(MG_OBJECTS) $(MGPP_OBJECTS) $(LUCENE_OBJECTS) $(CORBAOBJECTS) 
+
 
 all : $(OBJECTS)
-	$(MAKE) USE_MGPP=1 $(MGPP_OBJECTS)
 
 distclean:
-	rm -f $(OBJECTS) Makefile mgppsearch.o mgppqueryfilter.o
+	rm -f $(OBJECTS) Makefile
 clean:
-	rm -f $(OBJECTS) mgppsearch.o mgppqueryfilter.o
+	rm -f $(OBJECTS)
 
 install:
 
-# needs IndexData.h from mgpp...
-$(MG_MGPP_OBJECTS): %.o : %.cpp
-	$(CXXCOMPILE) -I$(INDEXERS_DIR)/mgpp/text -I$(INDEXERS_DIR)/mgpp/lib -o $@ $<
-
 depend:
 	makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
