Index: main/trunk/greenstone2/common-src/indexers/Makefile.in
===================================================================
--- main/trunk/greenstone2/common-src/indexers/Makefile.in	(revision 21356)
+++ main/trunk/greenstone2/common-src/indexers/Makefile.in	(revision 21364)
@@ -61,5 +61,5 @@
 
 
-all install clean:
+clean:
 	for odir in $(INDEXERDIRS); do \
 	  if test -d $$odir; then \
@@ -67,4 +67,41 @@
 	    (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
 	  fi; \
+        done
+
+with-jni:
+	for odir in $(INDEXERDIRS); do \
+	  if test -d $$odir; then \
+	    echo making all in $$odir; \
+	    (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
+	  fi; \
+        done
+
+install-with-jni:
+	for odir in $(INDEXERDIRS); do \
+	  if test -d $$odir; then \
+	    echo making install in $$odir; \
+	    (cd $$odir && $(MAKE) $(MDEFINES) install) || exit 1; \
+	  fi; \
+        done
+
+# make everything except jni stuff
+without-jni:
+	for odir in $(UNAC) $(LUCENE); do \
+          echo making $@ in $$odir; \
+          (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
+        done
+	for odir in $(MG) $(MGPP); do \
+          echo making $@ in $$odir; \
+          (cd $$odir && $(MAKE) $(MDEFINES) nojava) || exit 1; \
+        done
+
+install-without-jni:
+	for odir in $(UNAC) $(LUCENE); do \
+          echo making $@ in $$odir; \
+          (cd $$odir && $(MAKE) $(MDEFINES) install) || exit 1; \
+        done
+	for odir in $(MG) $(MGPP); do \
+          echo making $@ in $$odir; \
+          (cd $$odir && $(MAKE) $(MDEFINES) install-nojava) || exit 1; \
         done
 
@@ -109,25 +146,4 @@
         done
 
-# make everything except jni stuff
-gs2:
-	for odir in $(UNAC) $(LUCENE); do \
-          echo making $@ in $$odir; \
-          (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
-        done
-	for odir in $(MG) $(MGPP); do \
-          echo making $@ in $$odir; \
-          (cd $$odir && $(MAKE) $(MDEFINES) nojava) || exit 1; \
-        done
-
-install-gs2:
-	for odir in $(UNAC) $(LUCENE); do \
-          echo making $@ in $$odir; \
-          (cd $$odir && $(MAKE) $(MDEFINES) install) || exit 1; \
-        done
-	for odir in $(MG) $(MGPP); do \
-          echo making $@ in $$odir; \
-          (cd $$odir && $(MAKE) $(MDEFINES) install-nojava) || exit 1; \
-        done
-
 distclean:
 	for odir in $(INDEXERDIRS); do \
Index: main/trunk/greenstone2/common-src/indexers/configure
===================================================================
--- main/trunk/greenstone2/common-src/indexers/configure	(revision 21356)
+++ main/trunk/greenstone2/common-src/indexers/configure	(revision 21364)
@@ -275,5 +275,5 @@
 ac_subdirs_all="$ac_subdirs_all mg"
 ac_subdirs_all="$ac_subdirs_all mgpp"
-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 ENABLE_ACCENTFOLD ENABLE_MG ENABLE_MGPP ENABLE_LUCENE COMPAT32BITFLAGS JAVAC JAVA uudecode subdirs LIBOBJS 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 ENABLE_ACCENTFOLD ENABLE_JNI ENABLE_MG ENABLE_MGPP ENABLE_LUCENE COMPAT32BITFLAGS JAVAC JAVA uudecode subdirs LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
@@ -787,4 +787,5 @@
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-accentfolding    Disable Accent Folding support
+  --enable-jni    Enable JNI compilation
   --disable-mg        Disable MG compilation
   --disable-mgpp        Disable MGPP compilation
@@ -1246,4 +1247,23 @@
 
 
+# Check whether --enable-jni or --disable-jni was given.
+if test "${enable_jni+set}" = set; then
+  enableval="$enable_jni"
+  ENABLE_JNI=$enableval
+else
+  ENABLE_JNI=no
+fi;
+if test $ENABLE_JNI = "yes" -o $ENABLE_JNI = "1" ; then
+  ENABLE_JNI=1
+  cat >>confdefs.h <<\_ACEOF
+#define ENABLE_JNI
+_ACEOF
+
+else
+  ENABLE_JNI=0
+fi
+
+
+
 # Check whether --enable-mg or --disable-mg was given.
 if test "${enable_mg+set}" = set; then
@@ -1408,5 +1428,5 @@
 CLASS_TEST=Test.class
 cat << \EOF > $JAVA_TEST
-/* #line 1410 "configure" */
+/* #line 1430 "configure" */
 public class Test {
 }
@@ -1578,5 +1598,5 @@
         ac_cv_prog_uudecode_base64=yes
 else
-        echo "configure: 1580: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
+        echo "configure: 1600: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
         echo "configure: failed file was:" >&5
         cat Test.uue >&5
@@ -1696,5 +1716,5 @@
 CLASS_TEST=Test.class
 cat << \EOF > $JAVA_TEST
-/* #line 1698 "configure" */
+/* #line 1718 "configure" */
 public class Test {
 }
@@ -1733,5 +1753,5 @@
 TEST=Test
 cat << \EOF > $JAVA_TEST
-/* [#]line 1735 "configure" */
+/* [#]line 1755 "configure" */
 public class Test {
 public static void main (String args[]) {
@@ -2490,4 +2510,5 @@
 s,@LIBS@,$LIBS,;t t
 s,@ENABLE_ACCENTFOLD@,$ENABLE_ACCENTFOLD,;t t
+s,@ENABLE_JNI@,$ENABLE_JNI,;t t
 s,@ENABLE_MG@,$ENABLE_MG,;t t
 s,@ENABLE_MGPP@,$ENABLE_MGPP,;t t
Index: main/trunk/greenstone2/common-src/indexers/configure.ac
===================================================================
--- main/trunk/greenstone2/common-src/indexers/configure.ac	(revision 21356)
+++ main/trunk/greenstone2/common-src/indexers/configure.ac	(revision 21364)
@@ -9,4 +9,17 @@
 AC_DEFINE_UNQUOTED(ENABLE_ACCENTFOLD, $ENABLE_ACCENTFOLD)
 AC_SUBST(ENABLE_ACCENTFOLD)
+
+
+dnl
+dnl Set compilation of JNI parts of MG and MGPP indexers (disabled by default, which is GS2's default behaviour)
+dnl
+AC_ARG_ENABLE(jni, [  --enable-jni    Enable JNI compilation], ENABLE_JNI=$enableval, ENABLE_JNI=no)
+if test $ENABLE_JNI = "yes" -o $ENABLE_JNI = "1" ; then
+  ENABLE_JNI=1
+  AC_DEFINE(ENABLE_JNI,[])
+else
+  ENABLE_JNI=0
+fi
+AC_SUBST(ENABLE_JNI)
 
 
Index: main/trunk/greenstone2/common-src/indexers/winMake.bat
===================================================================
--- main/trunk/greenstone2/common-src/indexers/winMake.bat	(revision 21356)
+++ main/trunk/greenstone2/common-src/indexers/winMake.bat	(revision 21364)
@@ -45,7 +45,8 @@
 	if ""%2"" == ""javaonly"" goto java
 	if ""%2"" == ""nojava"" goto nojava
-	if ""%2"" == ""gs2"" goto gs2
+	if ""%2"" == ""without-jni"" goto without-jni
 
 :all
+:with-jni
 	if NOT EXIST "bin" mkdir bin
 
@@ -87,4 +88,5 @@
 	for %%I in (lib srclib libcharset\lib) do if exist packages\windows\iconv\iconv\%%I\^*.obj del packages\windows\iconv\iconv\%%I\*.obj;
 	for %%I in (lib srclib libcharset\lib) do if exist packages\windows\iconv\iconv\%%I\^*.lib del packages\windows\iconv\iconv\%%I\*.lib;
+	goto done
 
 :java
@@ -131,5 +133,5 @@
 	goto done
 
-:gs2
+:without-jni
 	if NOT EXIST "bin" mkdir bin
 
