Index: /main/trunk/greenstone2/config.h.in
===================================================================
--- /main/trunk/greenstone2/config.h.in	(revision 21329)
+++ /main/trunk/greenstone2/config.h.in	(revision 21330)
@@ -110,4 +110,9 @@
 #undef USE_CORBA
 
+/* Define ENABLE for indexers */
+#undef ENABLE_MG
+#undef ENABLE_MGPP
+#undef ENABLE_LUCENE
+
 /* Define MICO_DIR if needsbe */
 #undef MICO_DIR
Index: /main/trunk/greenstone2/configure
===================================================================
--- /main/trunk/greenstone2/configure	(revision 21329)
+++ /main/trunk/greenstone2/configure	(revision 21330)
@@ -310,5 +310,5 @@
 
 ac_subdirs_all="$ac_subdirs_all common-src build-src runtime-src"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION USE_FASTCGI USE_LANGACTION USE_CORBA MICO_DIR USE_Z3950 USE_YAZ ENABLE_ACCENTFOLD USE_SQLITE USE_APACHE_HTTPD LDFLAGS CFLAGS CC CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX AWK YACC build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB COMPAT32BITFLAGS MICO_VER CPP EGREP U ANSI2KNR ALLOCA LIBOBJS STATIC gsdlos MODULEDIRS subdirs LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION USE_FASTCGI USE_LANGACTION USE_CORBA MICO_DIR USE_Z3950 USE_YAZ ENABLE_ACCENTFOLD USE_SQLITE USE_APACHE_HTTPD ENABLE_MG ENABLE_MGPP ENABLE_LUCENE LDFLAGS CFLAGS CC CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX AWK YACC build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB COMPAT32BITFLAGS MICO_VER CPP EGREP U ANSI2KNR ALLOCA LIBOBJS STATIC gsdlos MODULEDIRS subdirs LTLIBOBJS'
 ac_subst_files=''
 
@@ -860,4 +860,7 @@
   --disable-sqlite        Disable SQLite support
   --enable-apache-httpd  Enable Apache httpd support
+  --disable-mg    Disable MG compilation
+  --disable-mgpp        Disable MGPP compilation
+  --disable-lucene        Disable Lucene compilation
 
 Optional Packages:
@@ -1369,5 +1372,5 @@
 if test "${with_micodir+set}" = set; then
   withval="$with_micodir"
-  MICO_DIR=$enableval
+  MICO_DIR=$withval
 else
   MICO_DIR="default"
@@ -1444,4 +1447,60 @@
 _ACEOF
 
+
+
+
+# Check whether --enable-mg or --disable-mg was given.
+if test "${enable_mg+set}" = set; then
+  enableval="$enable_mg"
+  ENABLE_MG=$enableval
+else
+  ENABLE_MG=yes
+fi;
+if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
+  ENABLE_MG=1
+  cat >>confdefs.h <<\_ACEOF
+#define ENABLE_MG
+_ACEOF
+
+ else
+  ENABLE_MG=0
+ fi
+
+
+
+# Check whether --enable-mgpp or --disable-mgpp was given.
+if test "${enable_mgpp+set}" = set; then
+  enableval="$enable_mgpp"
+  ENABLE_MGPP=$enableval
+else
+  ENABLE_MGPP=yes
+fi;
+if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
+  ENABLE_MGPP=1
+  cat >>confdefs.h <<\_ACEOF
+#define ENABLE_MGPP
+_ACEOF
+
+else
+  ENABLE_MGPP=0
+fi
+
+
+# Check whether --enable-lucene or --disable-lucene was given.
+if test "${enable_lucene+set}" = set; then
+  enableval="$enable_lucene"
+  ENABLE_LUCENE=$enableval
+else
+  ENABLE_LUCENE=yes
+fi;
+if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
+  ENABLE_LUCENE=1
+  cat >>confdefs.h <<\_ACEOF
+#define ENABLE_LUCENE
+_ACEOF
+
+else
+  ENABLE_LUCENE=0
+fi
 
 
@@ -7861,4 +7920,7 @@
 s,@USE_SQLITE@,$USE_SQLITE,;t t
 s,@USE_APACHE_HTTPD@,$USE_APACHE_HTTPD,;t t
+s,@ENABLE_MG@,$ENABLE_MG,;t t
+s,@ENABLE_MGPP@,$ENABLE_MGPP,;t t
+s,@ENABLE_LUCENE@,$ENABLE_LUCENE,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
 s,@CFLAGS@,$CFLAGS,;t t
Index: /main/trunk/greenstone2/configure.in
===================================================================
--- /main/trunk/greenstone2/configure.in	(revision 21329)
+++ /main/trunk/greenstone2/configure.in	(revision 21330)
@@ -38,5 +38,5 @@
 AC_SUBST(USE_CORBA)
 
-AC_ARG_WITH(micodir, [  --with-micodir          Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default")
+AC_ARG_WITH(micodir, [  --with-micodir          Use installed MICO directory], MICO_DIR=$withval, MICO_DIR="default")
 AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
 AC_SUBST(MICO_DIR)
@@ -80,4 +80,42 @@
 AC_DEFINE(USE_APACHE_HTTPD, $USE_APACHE_HTTPD)
 AC_SUBST(USE_APACHE_HTTPD)
+
+
+dnl
+dnl Set compilation of MG (enabled by default)
+dnl
+AC_ARG_ENABLE(mg, [  --disable-mg    Disable MG compilation], ENABLE_MG=$enableval, ENABLE_MG=yes)
+if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
+  ENABLE_MG=1
+  AC_DEFINE(ENABLE_MG,[])
+ else
+  ENABLE_MG=0
+ fi
+AC_SUBST(ENABLE_MG)
+
+
+dnl
+dnl Set compilation of MGPP (enabled by default)
+dnl
+AC_ARG_ENABLE(mgpp, [  --disable-mgpp        Disable MGPP compilation], ENABLE_MGPP=$enableval, ENABLE_MGPP=yes)
+if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
+  ENABLE_MGPP=1
+  AC_DEFINE(ENABLE_MGPP,[])
+else
+  ENABLE_MGPP=0
+fi
+AC_SUBST(ENABLE_MGPP)
+
+dnl
+dnl Set compilation of lucene (enabled by default)
+dnl
+AC_ARG_ENABLE(lucene, [  --disable-lucene        Disable Lucene compilation], ENABLE_LUCENE=$enableval, ENABLE_LUCENE=yes)
+if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
+  ENABLE_LUCENE=1
+  AC_DEFINE(ENABLE_LUCENE, [])
+else
+  ENABLE_LUCENE=0
+fi
+AC_SUBST(ENABLE_LUCENE)
 
 
Index: /main/trunk/greenstone2/win32.mak
===================================================================
--- /main/trunk/greenstone2/win32.mak	(revision 21329)
+++ /main/trunk/greenstone2/win32.mak	(revision 21330)
@@ -36,4 +36,10 @@
 USE_Z3950 = 0
 
+# by default, all indexers are enabled
+ENABLE_MG = 1
+ENABLE_MGPP = 1
+ENABLE_LUCENE = 1
+
+
 MDEFINES = /f win32.mak
 
@@ -61,6 +67,8 @@
 MAKECMD = $(MAKECMD) DLLDEBUG=1
 !ENDIF
-!IF $(USE_SQLITE)
+!IF "$(USE_SQLITE)" == ""
 MAKECMD = $(MAKECMD) USE_SQLITE=1
+!ELSE
+MAKECMD = $(MAKECMD) USE_SQLITE=$(USE_SQLITE)
 !ENDIF
 !IF $(USE_MSSQL)
@@ -69,4 +77,19 @@
 !IF $(USE_Z3950)
 MAKECMD = $(MAKECMD) USE_Z3950=1
+!ENDIF
+!IF "$(ENABLE_MG)" == ""
+MAKECMD = $(MAKECMD) ENABLE_MG=1
+!ELSE
+MAKECMD = $(MAKECMD) ENABLE_MG=$(ENABLE_MG)
+!ENDIF
+!IF "$(ENABLE_MGPP)" == ""
+MAKECMD = $(MAKECMD) ENABLE_MGPP=1
+!ELSE
+MAKECMD = $(MAKECMD) ENABLE_MGPP=$(ENABLE_MGPP)
+!ENDIF
+!IF "$(ENABLE_LUCENE)" == ""
+MAKECMD = $(MAKECMD) ENABLE_LUCENE=1
+!ELSE
+MAKECMD = $(MAKECMD) ENABLE_LUCENE=$(ENABLE_LUCENE)
 !ENDIF
 
