Index: /main/trunk/gs2-core/common-src/src/lib/Makefile.am
===================================================================
--- /main/trunk/gs2-core/common-src/src/lib/Makefile.am	(revision 22823)
+++ /main/trunk/gs2-core/common-src/src/lib/Makefile.am	(revision 22824)
@@ -11,4 +11,5 @@
 
 COMMON_SRC_DIR = @top_srcdir@
+GSDL_DIR = $(COMMON_SRC_DIR)/..
 
 
@@ -19,4 +20,9 @@
 libgsdllib_a_CPPFLAGS = \
 	$(COMPAT32BITFLAGS)
+
+# Option: SQLite support
+if USE_SQLITE
+  libgsdllib_a_CPPFLAGS += -I$(GSDL_DIR)/common-src/packages/sqlite/include
+endif
 
 # Sources for libgsdllib.a
@@ -41,5 +47,4 @@
 # Option: SQLite support
 if USE_SQLITE
-  libgsdllib_a_CPPFLAGS += -I$(COMMON_SRC_DIR)/packages/sqlite/include
   libgsdllib_a_SOURCES += sqlitedbclass.cpp
 endif
Index: /main/trunk/gs2-core/common-src/src/lib/Makefile.in
===================================================================
--- /main/trunk/gs2-core/common-src/src/lib/Makefile.in	(revision 22823)
+++ /main/trunk/gs2-core/common-src/src/lib/Makefile.in	(revision 22824)
@@ -49,5 +49,7 @@
 
 # Option: SQLite support
-@USE_SQLITE_TRUE@am__append_1 = -I$(COMMON_SRC_DIR)/packages/sqlite/include
+@USE_SQLITE_TRUE@am__append_1 = -I$(GSDL_DIR)/common-src/packages/sqlite/include
+
+# Option: SQLite support
 @USE_SQLITE_TRUE@am__append_2 = sqlitedbclass.cpp
 subdir = src/lib
@@ -183,4 +185,5 @@
 target_alias = @target_alias@
 COMMON_SRC_DIR = @top_srcdir@
+GSDL_DIR = $(COMMON_SRC_DIR)/..
 
 # Libraries compiled
Index: /main/trunk/gs2-core/common-src/src/lib/win32.mak
===================================================================
--- /main/trunk/gs2-core/common-src/src/lib/win32.mak	(revision 22823)
+++ /main/trunk/gs2-core/common-src/src/lib/win32.mak	(revision 22824)
@@ -10,14 +10,21 @@
 
 
-GSDL_DIR = $(GSDLHOME)
+COMMON_SRC_DIR = ..\..
+GSDL_DIR = $(COMMON_SRC_DIR)\..
 
 
 # Libraries compiled
-LIBRARIES = gsdllib.lib
+LIBRARIES = libgsdllib.lib
 
-# Library: gsdllib.lib
+# Library: libgsdllib.lib
 LIBGSDL_CPPFLAGS =
 
-# Objects for gsdllib.lib
+# Option: SQLite support (enabled by default)
+USE_SQLITE = 1
+!IF $(USE_SQLITE)
+LIBGSDL_CPPFLAGS = -DUSE_SQLITE $(LIBGSDL_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\sqlite\include"
+!ENDIF
+
+# Objects for libgsdllib.lib
 LIBGSDL_OBJECTS = \
 	cfgread.obj \
@@ -38,8 +45,7 @@
 	unitool.obj
 
-
-# Option: SQLite support
+# Option: SQLite support (enabled by default)
+USE_SQLITE = 1
 !IF $(USE_SQLITE)
-LIBGSDL_CPPFLAGS = -DUSE_SQLITE $(LIBGSDL_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\sqlite\include"
 LIBGSDL_OBJECTS = $(LIBGSDL_OBJECTS) sqlitedbclass.obj
 !ENDIF
@@ -56,7 +62,7 @@
 
 
-gsdllib.lib: $(LIBGSDL_OBJECTS) 
-	if EXIST gsdllib.lib del gsdllib.lib
-	lib -nologo /out:gsdllib.lib $(LIBGSDL_OBJECTS)
+libgsdllib.lib: $(LIBGSDL_OBJECTS) 
+	if EXIST libgsdllib.lib del libgsdllib.lib
+	lib -nologo /out:libgsdllib.lib $(LIBGSDL_OBJECTS)
 
 all: $(LIBRARIES)
Index: /main/trunk/gs2-core/common-src/win32.mak
===================================================================
--- /main/trunk/gs2-core/common-src/win32.mak	(revision 22823)
+++ /main/trunk/gs2-core/common-src/win32.mak	(revision 22824)
@@ -10,10 +10,12 @@
 
 
-# Option: Lucene support
+# Option: Lucene support (enabled by default)
+ENABLE_LUCENE = 1
 !IF $(ENABLE_LUCENE)
 LUCENE_SUBDIRS = indexers packages\expat
 !ENDIF
 
-# Option: SQLite support
+# Option: SQLite support (enabled by default)
+USE_SQLITE = 1
 !IF $(USE_SQLITE)
 SQLITE_SUBDIRS = packages\sqlite
Index: /main/trunk/gs2-core/runtime-src/src/colservr/Makefile.am
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/colservr/Makefile.am	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/colservr/Makefile.am	(revision 22824)
@@ -22,4 +22,14 @@
 	-I$(GSDL_DIR)/common-src/src/lib \
 	$(COMPAT32BITFLAGS)
+
+# Option: Lucene support
+if ENABLE_LUCENE
+  libgsdlcolservr_a_CPPFLAGS += -I$(GSDL_DIR)/common-src/packages/expat/include
+endif
+
+# Option: SQLite support
+if USE_SQLITE
+  libgsdlcolservr_a_CPPFLAGS += -I$(GSDL_DIR)/common-src/packages/sqlite/include
+endif
 
 # Sources for libgsdlcolservr.a
@@ -47,10 +57,4 @@
 # Option: Lucene support
 if ENABLE_LUCENE
-  libgsdlcolservr_a_CPPFLAGS += -I$(GSDL_DIR)/common-src/packages/expat/include
   libgsdlcolservr_a_SOURCES += expat_document.cpp expat_resultset.cpp
 endif
-
-# Option: SQLite support
-if USE_SQLITE
-  libgsdlcolservr_a_CPPFLAGS += -I$(GSDL_DIR)/common-src/packages/sqlite/include
-endif
Index: /main/trunk/gs2-core/runtime-src/src/colservr/Makefile.in
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/colservr/Makefile.in	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/colservr/Makefile.in	(revision 22824)
@@ -50,8 +50,10 @@
 # Option: Lucene support
 @ENABLE_LUCENE_TRUE@am__append_1 = -I$(GSDL_DIR)/common-src/packages/expat/include
-@ENABLE_LUCENE_TRUE@am__append_2 = expat_document.cpp expat_resultset.cpp
 
 # Option: SQLite support
-@USE_SQLITE_TRUE@am__append_3 = -I$(GSDL_DIR)/common-src/packages/sqlite/include
+@USE_SQLITE_TRUE@am__append_2 = -I$(GSDL_DIR)/common-src/packages/sqlite/include
+
+# Option: Lucene support
+@ENABLE_LUCENE_TRUE@am__append_3 = expat_document.cpp expat_resultset.cpp
 subdir = src/colservr
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
@@ -210,5 +212,5 @@
 # Do NOT add the "recpt" directory here: the colserver should be independent of the receptionist!
 libgsdlcolservr_a_CPPFLAGS = -I$(GSDL_DIR)/common-src/src/lib \
-	$(COMPAT32BITFLAGS) $(am__append_1) $(am__append_3)
+	$(COMPAT32BITFLAGS) $(am__append_1) $(am__append_2)
 
 # Sources for libgsdlcolservr.a
@@ -218,5 +220,5 @@
 	maptools.cpp phrasesearch.cpp querycache.cpp queryfilter.cpp \
 	queryinfo.cpp search.cpp source.cpp sqlbrowsefilter.cpp \
-	sqlfilter.cpp sqlqueryfilter.cpp $(am__append_2)
+	sqlfilter.cpp sqlqueryfilter.cpp $(am__append_3)
 all: all-am
 
Index: /main/trunk/gs2-core/runtime-src/src/colservr/win32.mak
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/colservr/win32.mak	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/colservr/win32.mak	(revision 22824)
@@ -10,14 +10,27 @@
 
 
-GSDL_DIR = $(GSDLHOME)
+RUNTIME_SRC_DIR = ..\..
+GSDL_DIR = $(RUNTIME_SRC_DIR)\..
 
 
 # Libraries compiled
-LIBRARIES = gsdlcolservr.lib
+LIBRARIES = libgsdlcolservr.lib
 
-# Library: gsdlcolservr.lib
+# Library: libgsdlcolservr.lib
 # Do NOT add the "recpt" directory here: the colserver should be independent of the receptionist!
 LIBCOLSERVR_CPPFLAGS = \
 	-I"$(GSDL_DIR)\common-src\src\lib"
+
+# Option: Lucene support (enabled by default)
+ENABLE_LUCENE = 1
+!IF $(ENABLE_LUCENE)
+LIBCOLSERVR_CPPFLAGS = -DENABLE_LUCENE $(LIBCOLSERVR_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\expat\include"
+!ENDIF
+
+# Option: SQLite support (enabled by default)
+USE_SQLITE = 1
+!IF $(USE_SQLITE)
+LIBCOLSERVR_CPPFLAGS = -DUSE_SQLITE $(LIBCOLSERVR_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\sqlite\include"
+!ENDIF
 
 LIBCOLSERVR_OBJECTS = \
@@ -42,14 +55,8 @@
 	sqlqueryfilter.obj
 
-
-# Option: Lucene support
+# Option: Lucene support (enabled by default)
+ENABLE_LUCENE = 1
 !IF $(ENABLE_LUCENE)
-LIBCOLSERVR_CPPFLAGS = -DENABLE_LUCENE $(LIBCOLSERVR_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\expat\include"
 LIBCOLSERVR_OBJECTS = $(LIBCOLSERVR_OBJECTS) expat_document.obj expat_resultset.obj
-!ENDIF
-
-# Option: SQLite support
-!IF $(USE_SQLITE)
-LIBCOLSERVR_CPPFLAGS = -DUSE_SQLITE $(LIBCOLSERVR_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\sqlite\include"
 !ENDIF
 
@@ -65,7 +72,7 @@
 
 
-gsdlcolservr.lib: $(LIBCOLSERVR_OBJECTS)
-	if EXIST gsdlcolservr.lib del gsdlcolservr.lib
-	lib -nologo /out:gsdlcolservr.lib $(LIBCOLSERVR_OBJECTS)
+libgsdlcolservr.lib: $(LIBCOLSERVR_OBJECTS)
+	if EXIST libgsdlcolservr.lib del libgsdlcolservr.lib
+	lib -nologo /out:libgsdlcolservr.lib $(LIBCOLSERVR_OBJECTS)
 
 all: $(LIBRARIES)
Index: /main/trunk/gs2-core/runtime-src/src/oaiservr/Makefile.am
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/oaiservr/Makefile.am	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/oaiservr/Makefile.am	(revision 22824)
@@ -55,6 +55,4 @@
 	$(GSDL_DIR)/common-src/src/lib/libgsdllib.a
 
-oaiserver_cgi_LDFLAGS = $(COMPAT32BITFLAGS)
-
 # Option: Lucene support
 if ENABLE_LUCENE
@@ -66,2 +64,4 @@
   oaiserver_cgi_LDADD += $(GSDL_DIR)/common-src/packages/sqlite/lib/libsqlite3.a -ldl -lpthread
 endif
+
+oaiserver_cgi_LDFLAGS = $(COMPAT32BITFLAGS)
Index: /main/trunk/gs2-core/runtime-src/src/oaiservr/win32.mak
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/oaiservr/win32.mak	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/oaiservr/win32.mak	(revision 22824)
@@ -10,5 +10,6 @@
 
 
-GSDL_DIR = $(GSDLHOME)
+RUNTIME_SRC_DIR = ..\..
+GSDL_DIR = $(RUNTIME_SRC_DIR)\..
 
 
@@ -49,15 +50,16 @@
 
 OAISERVER_CGI_LDADD = \
-	"$(GSDL_DIR)\runtime-src\src\protocol\gsdlprotocol.lib" \
-	"$(GSDL_DIR)\runtime-src\src\colservr\gsdlcolservr.lib" \
-	"$(GSDL_DIR)\common-src\src\lib\gsdllib.lib"
+	"$(GSDL_DIR)\runtime-src\src\protocol\libgsdlprotocol.lib" \
+	"$(GSDL_DIR)\runtime-src\src\colservr\libgsdlcolservr.lib" \
+	"$(GSDL_DIR)\common-src\src\lib\libgsdllib.lib"
 
-
-# Option: Lucene support
+# Option: Lucene support (enabled by default)
+ENABLE_LUCENE = 1
 !IF $(ENABLE_LUCENE)
 OAISERVER_CGI_LDADD = $(OAISERVER_CGI_LDADD) "$(GSDL_DIR)\common-src\packages\expat\lib\libexpat.lib"
 !ENDIF
 
-# Option: SQLite support
+# Option: SQLite support (enabled by default)
+USE_SQLITE = 1
 !IF $(USE_SQLITE)
 OAISERVER_CGI_LDADD = $(OAISERVER_CGI_LDADD) "$(GSDL_DIR)\common-src\packages\sqlite\lib\sqlite3.lib"
Index: /main/trunk/gs2-core/runtime-src/src/protocol/win32.mak
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/protocol/win32.mak	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/protocol/win32.mak	(revision 22824)
@@ -10,11 +10,12 @@
 
 
-GSDL_DIR = $(GSDLHOME)
+RUNTIME_SRC_DIR = ..\..
+GSDL_DIR = $(RUNTIME_SRC_DIR)\..
 
 
 # Libraries compiled
-LIBRARIES = gsdlprotocol.lib
+LIBRARIES = libgsdlprotocol.lib
 
-# Library: gsdlprotocol.lib
+# Library: libgsdlprotocol.lib
 # Do NOT add the "recpt" directory here: the protocol should be independent of the receptionist!
 LIBPROTOCOL_CPPFLAGS = \
@@ -38,7 +39,7 @@
 
 
-gsdlprotocol.lib: $(LIBPROTOCOL_OBJECTS) 
-	if EXIST gsdlprotocol.lib del gsdlprotocol.lib
-	lib -nologo /out:gsdlprotocol.lib $(LIBPROTOCOL_OBJECTS)
+libgsdlprotocol.lib: $(LIBPROTOCOL_OBJECTS) 
+	if EXIST libgsdlprotocol.lib del libgsdlprotocol.lib
+	lib -nologo /out:libgsdlprotocol.lib $(LIBPROTOCOL_OBJECTS)
 
 all: $(LIBRARIES)
Index: /main/trunk/gs2-core/runtime-src/src/recpt/Makefile.am
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/recpt/Makefile.am	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/recpt/Makefile.am	(revision 22824)
@@ -24,4 +24,9 @@
 	-I$(GSDL_DIR)/runtime-src/src/protocol \
 	$(COMPAT32BITFLAGS)
+
+# Option: SQLite support
+if USE_SQLITE
+  library_cgi_CPPFLAGS += -I$(GSDL_DIR)/common-src/packages/sqlite/include
+endif
 
 # Sources for library.cgi
@@ -77,6 +82,4 @@
 	$(GSDL_DIR)/common-src/src/lib/libgsdllib.a
 
-library_cgi_LDFLAGS = $(COMPAT32BITFLAGS)
-
 # Option: Lucene support
 if ENABLE_LUCENE
@@ -86,5 +89,6 @@
 # Option: SQLite support
 if USE_SQLITE
-  library_cgi_CPPFLAGS += -I$(GSDL_DIR)/common-src/packages/sqlite/include
   library_cgi_LDADD += $(GSDL_DIR)/common-src/packages/sqlite/lib/libsqlite3.a -ldl -lpthread
 endif
+
+library_cgi_LDFLAGS = $(COMPAT32BITFLAGS)
Index: /main/trunk/gs2-core/runtime-src/src/recpt/Makefile.in
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/recpt/Makefile.in	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/recpt/Makefile.in	(revision 22824)
@@ -49,9 +49,11 @@
 cgibin_PROGRAMS = library.cgi$(EXEEXT)
 
+# Option: SQLite support
+@USE_SQLITE_TRUE@am__append_1 = -I$(GSDL_DIR)/common-src/packages/sqlite/include
+
 # Option: Lucene support
-@ENABLE_LUCENE_TRUE@am__append_1 = $(GSDL_DIR)/common-src/packages/expat/lib/libexpat.a
+@ENABLE_LUCENE_TRUE@am__append_2 = $(GSDL_DIR)/common-src/packages/expat/lib/libexpat.a
 
 # Option: SQLite support
-@USE_SQLITE_TRUE@am__append_2 = -I$(GSDL_DIR)/common-src/packages/sqlite/include
 @USE_SQLITE_TRUE@am__append_3 = $(GSDL_DIR)/common-src/packages/sqlite/lib/libsqlite3.a -ldl -lpthread
 subdir = src/recpt
@@ -228,5 +230,5 @@
 	-I$(GSDL_DIR)/runtime-src/src/colservr \
 	-I$(GSDL_DIR)/runtime-src/src/protocol $(COMPAT32BITFLAGS) \
-	$(am__append_2)
+	$(am__append_1)
 
 # Sources for library.cgi
@@ -280,5 +282,5 @@
 	$(GSDL_DIR)/runtime-src/src/protocol/libgsdlprotocol.a \
 	$(GSDL_DIR)/runtime-src/src/colservr/libgsdlcolservr.a \
-	$(GSDL_DIR)/common-src/src/lib/libgsdllib.a $(am__append_1) \
+	$(GSDL_DIR)/common-src/src/lib/libgsdllib.a $(am__append_2) \
 	$(am__append_3)
 library_cgi_LDFLAGS = $(COMPAT32BITFLAGS)
Index: /main/trunk/gs2-core/runtime-src/src/recpt/win32.mak
===================================================================
--- /main/trunk/gs2-core/runtime-src/src/recpt/win32.mak	(revision 22823)
+++ /main/trunk/gs2-core/runtime-src/src/recpt/win32.mak	(revision 22824)
@@ -10,5 +10,6 @@
 
 
-GSDL_DIR = $(GSDLHOME)
+RUNTIME_SRC_DIR = ..\..
+GSDL_DIR = $(RUNTIME_SRC_DIR)\..
 
 
@@ -23,4 +24,16 @@
 	-I"$(GSDL_DIR)\runtime-src\src\protocol" \
 	-I"$(GSDL_DIR)\common-src\packages\windows\crypt\crypt"
+
+# Option: Lucene support (enabled by default)
+ENABLE_LUCENE = 1
+!IF $(ENABLE_LUCENE)
+LIBRARY_CGI_CPPFLAGS = -DENABLE_LUCENE $(LIBRARY_CGI_CPPFLAGS)
+!ENDIF
+
+# Option: SQLite support (enabled by default)
+USE_SQLITE = 1
+!IF $(USE_SQLITE)
+LIBRARY_CGI_CPPFLAGS = -DUSE_SQLITE $(LIBRARY_CGI_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\sqlite\include"
+!ENDIF
 
 # Objects for library.cgi
@@ -72,19 +85,18 @@
 
 LIBRARY_CGI_LDADD = \
-	"$(GSDL_DIR)\runtime-src\src\protocol\gsdlprotocol.lib" \
-	"$(GSDL_DIR)\runtime-src\src\colservr\gsdlcolservr.lib" \
-	"$(GSDL_DIR)\common-src\src\lib\gsdllib.lib" \
+	"$(GSDL_DIR)\runtime-src\src\protocol\libgsdlprotocol.lib" \
+	"$(GSDL_DIR)\runtime-src\src\colservr\libgsdlcolservr.lib" \
+	"$(GSDL_DIR)\common-src\src\lib\libgsdllib.lib" \
 	"$(GSDL_DIR)\common-src\packages\windows\crypt\crypt\crypt.lib"
 
-
-# Option: Lucene support
+# Option: Lucene support (enabled by default)
+ENABLE_LUCENE = 1
 !IF $(ENABLE_LUCENE)
-LIBRARY_CGI_CPPFLAGS = -DENABLE_LUCENE $(LIBRARY_CGI_CPPFLAGS)
 LIBRARY_CGI_LDADD = $(LIBRARY_CGI_LDADD) "$(GSDL_DIR)\common-src\packages\expat\lib\libexpat.lib"
 !ENDIF
 
-# Option: SQLite support
+# Option: SQLite support (enabled by default)
+USE_SQLITE = 1
 !IF $(USE_SQLITE)
-LIBRARY_CGI_CPPFLAGS = -DUSE_SQLITE $(LIBRARY_CGI_CPPFLAGS) -I"$(GSDL_DIR)\common-src\packages\sqlite\include"
 LIBRARY_CGI_LDADD = $(LIBRARY_CGI_LDADD) "$(GSDL_DIR)\common-src\packages\sqlite\lib\sqlite3.lib"
 !ENDIF
Index: /main/trunk/gs2-core/win32.mak
===================================================================
--- /main/trunk/gs2-core/win32.mak	(revision 22823)
+++ /main/trunk/gs2-core/win32.mak	(revision 22824)
@@ -10,19 +10,11 @@
 
 
-GSDL_DIR = $(MAKEDIR)
-MAKE = $(MAKE) GSDLHOME=$(GSDL_DIR)
-
-
 # Option: Lucene support (enabled by default)
 ENABLE_LUCENE = 1
-!IF $(ENABLE_LUCENE)
-MAKE = $(MAKE) ENABLE_LUCENE=1
-!ENDIF
+MAKE = $(MAKE) ENABLE_LUCENE=$(ENABLE_LUCENE)
 
 # Option: SQLite support (enabled by default)
 USE_SQLITE = 1
-!IF $(USE_SQLITE)
-MAKE = $(MAKE) USE_SQLITE=1
-!ENDIF
+MAKE = $(MAKE) USE_SQLITE=$(USE_SQLITE)
 
 
