Changeset 21328 for main


Ignore:
Timestamp:
2009-12-09T21:49:32+13:00 (14 years ago)
Author:
ak19
Message:

Changes to makefiles, configure files, and source code to work with the new configure flags that allow indexers to be individually compiled up by setting each indexer to be enabled or disabled (enable-mg, enable-mgpp, enable-lucene).

Location:
main/trunk/greenstone2/common-src/indexers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/Makefile.in

    r19876 r21328  
    3737endif
    3838
    39 INDEXERDIRS = $(UNAC) mg mgpp lucene-gs
     39ENABLE_MG=@ENABLE_MG@
     40ifeq ($(ENABLE_MG), 1)
     41MG=mg
     42else
     43MG=
     44endif
     45
     46ENABLE_MGPP=@ENABLE_MGPP@
     47ifeq ($(ENABLE_MGPP), 1)
     48MGPP=mgpp
     49else
     50MGPP=
     51endif
     52
     53ENABLE_LUCENE=@ENABLE_LUCENE@
     54ifeq ($(ENABLE_LUCENE), 1)
     55LUCENE=lucene-gs
     56else
     57LUCENE=
     58endif
     59
     60INDEXERDIRS = $(UNAC) $(MG) $(MGPP) $(LUCENE)
     61
    4062
    4163all install clean:
    4264    for odir in $(INDEXERDIRS); do \
    43           echo making $@ in $$odir; \
    44           (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
     65      if test -d $$odir; then \
     66        echo making $@ in $$odir; \
     67        (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
     68      fi; \
    4569        done
    4670
     
    5074          (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
    5175        done
    52     for odir in mg mgpp; do \
     76    for odir in $(MG) $(MGPP); do \
    5377          echo making $@ in $$odir; \
    5478          (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
     
    6084          (cd $$odir && $(MAKE) $(MDEFINES) install) || exit 1; \
    6185        done
    62     for odir in mg mgpp; do \
     86    for odir in $(MG) $(MGPP); do \
    6387          echo making $@ in $$odir; \
    6488          (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
     
    6690
    6791javaonly:
    68     for odir in mg mgpp; do \
     92    for odir in $(MG) $(MGPP); do \
    6993          echo making $@ in $$odir; \
    7094          (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
    7195        done
    72     for odir in lucene-gs; do \
     96    for odir in $(LUCENE); do \
    7397          echo making $@ in $$odir; \
    7498          (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
     
    76100
    77101install-javaonly:
    78     for odir in mg mgpp; do \
     102    for odir in $(MG) $(MGPP); do \
    79103          echo making $@ in $$odir; \
    80104          (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
    81105        done
    82     for odir in lucene-gs; do \
     106    for odir in $(LUCENE); do \
    83107          echo making $@ in $$odir; \
    84108          (cd $$odir && $(MAKE) $(MDEFINES) install) || exit 1; \
     
    87111# make everything except jni stuff
    88112gs2:
    89     for odir in $(UNAC) lucene-gs; do \
     113    for odir in $(UNAC) $(LUCENE); do \
    90114          echo making $@ in $$odir; \
    91115          (cd $$odir && $(MAKE) $(MDEFINES) all) || exit 1; \
    92116        done
    93     for odir in mg mgpp; do \
     117    for odir in $(MG) $(MGPP); do \
    94118          echo making $@ in $$odir; \
    95119          (cd $$odir && $(MAKE) $(MDEFINES) nojava) || exit 1; \
     
    97121
    98122install-gs2:
    99     for odir in $(UNAC) lucene-gs; do \
     123    for odir in $(UNAC) $(LUCENE); do \
    100124          echo making $@ in $$odir; \
    101125          (cd $$odir && $(MAKE) $(MDEFINES) install) || exit 1; \
    102126        done
    103     for odir in mg mgpp; do \
     127    for odir in $(MG) $(MGPP); do \
    104128          echo making $@ in $$odir; \
    105129          (cd $$odir && $(MAKE) $(MDEFINES) install-nojava) || exit 1; \
     
    108132distclean:
    109133    for odir in $(INDEXERDIRS); do \
    110           echo making $@ in $$odir; \
    111           (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
     134      if test -d $$odir; then \
     135        echo making $@ in $$odir; \
     136        (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
     137      fi; \
    112138        done
    113139    rm -f Makefile config.status config.log
  • main/trunk/greenstone2/common-src/indexers/configure

    r20832 r21328  
    272272PACKAGE_BUGREPORT=
    273273
    274 ac_unique_file="mgpp/text/MGQuery.cpp"
    275274ac_subdirs_all="$ac_subdirs_all packages/unac"
    276 ac_subdirs_all="$ac_subdirs_all mg mgpp"
    277 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 COMPAT32BITFLAGS JAVAC JAVA uudecode subdirs LIBOBJS LTLIBOBJS'
     275ac_subdirs_all="$ac_subdirs_all mg"
     276ac_subdirs_all="$ac_subdirs_all mgpp"
     277ac_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'
    278278ac_subst_files=''
    279279
     
    786786  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
    787787  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
    788   --disable-accentfold    Disable Accent Folding support
     788  --disable-accentfolding    Disable Accent Folding support
     789  --disable-mg        Disable MG compilation
     790  --disable-mgpp        Disable MGPP compilation
     791  --disable-lucene        Disable Lucene compilation
    789792
    790793Optional Packages:
     
    12421245
    12431246
     1247
     1248# Check whether --enable-mg or --disable-mg was given.
     1249if test "${enable_mg+set}" = set; then
     1250  enableval="$enable_mg"
     1251  ENABLE_MG=$enableval
     1252else
     1253  ENABLE_MG=yes
     1254fi;
     1255if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
     1256  ENABLE_MG=1
     1257  cat >>confdefs.h <<\_ACEOF
     1258#define ENABLE_MG
     1259_ACEOF
     1260
     1261else
     1262  ENABLE_MG=0
     1263fi
     1264
     1265
     1266
     1267# Check whether --enable-mgpp or --disable-mgpp was given.
     1268if test "${enable_mgpp+set}" = set; then
     1269  enableval="$enable_mgpp"
     1270  ENABLE_MGPP=$enableval
     1271else
     1272  ENABLE_MGPP=yes
     1273fi;
     1274if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
     1275  ENABLE_MGPP=1
     1276  cat >>confdefs.h <<\_ACEOF
     1277#define ENABLE_MGPP
     1278_ACEOF
     1279
     1280else
     1281  ENABLE_MGPP=0
     1282fi
     1283
     1284
     1285# Check whether --enable-lucene or --disable-lucene was given.
     1286if test "${enable_lucene+set}" = set; then
     1287  enableval="$enable_lucene"
     1288  ENABLE_LUCENE=$enableval
     1289else
     1290  ENABLE_LUCENE=yes
     1291fi;
     1292if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
     1293  ENABLE_LUCENE=1
     1294  cat >>confdefs.h <<\_ACEOF
     1295#define ENABLE_LUCENE
     1296_ACEOF
     1297
     1298else
     1299  ENABLE_LUCENE=0
     1300fi
     1301
     1302
     1303
    12441304cat >>confdefs.h <<_ACEOF
    12451305#define COMPAT32BITFLAGS $COMPAT32BITFLAGS
     
    13481408CLASS_TEST=Test.class
    13491409cat << \EOF > $JAVA_TEST
    1350 /* #line 1350 "configure" */
     1410/* #line 1410 "configure" */
    13511411public class Test {
    13521412}
     
    15181578        ac_cv_prog_uudecode_base64=yes
    15191579else
    1520         echo "configure: 1520: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
     1580        echo "configure: 1580: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
    15211581        echo "configure: failed file was:" >&5
    15221582        cat Test.uue >&5
     
    16361696CLASS_TEST=Test.class
    16371697cat << \EOF > $JAVA_TEST
    1638 /* #line 1638 "configure" */
     1698/* #line 1698 "configure" */
    16391699public class Test {
    16401700}
     
    16731733TEST=Test
    16741734cat << \EOF > $JAVA_TEST
    1675 /* [#]line 1675 "configure" */
     1735/* [#]line 1735 "configure" */
    16761736public class Test {
    16771737public static void main (String args[]) {
     
    17651825
    17661826
    1767 
    1768 subdirs="$subdirs mg mgpp"
    1769 
     1827if test $ENABLE_MG = 1; then
     1828if test ! -d mg; then
     1829echo "***** Folder mg does not exist, cannot ENABLE_MG.";
     1830exit 1;
     1831fi
     1832
     1833
     1834subdirs="$subdirs mg"
     1835
     1836fi
     1837
     1838if test $ENABLE_MGPP = 1; then
     1839if test ! -d mgpp; then
     1840echo "***** Folder mgpp does not exist, cannot ENABLE_MGPP.";
     1841exit 1;
     1842fi
     1843
     1844
     1845subdirs="$subdirs mgpp"
     1846
     1847fi
     1848
     1849if test $ENABLE_LUCENE = 1; then
     1850if test ! -d lucene-gs; then
     1851echo "***** Folder lucene-gs does not exist, cannot ENABLE_LUCENE.";
     1852exit 1;
     1853fi
     1854fi
    17701855
    17711856          ac_config_files="$ac_config_files Makefile"
     
    24052490s,@LIBS@,$LIBS,;t t
    24062491s,@ENABLE_ACCENTFOLD@,$ENABLE_ACCENTFOLD,;t t
     2492s,@ENABLE_MG@,$ENABLE_MG,;t t
     2493s,@ENABLE_MGPP@,$ENABLE_MGPP,;t t
     2494s,@ENABLE_LUCENE@,$ENABLE_LUCENE,;t t
    24072495s,@COMPAT32BITFLAGS@,$COMPAT32BITFLAGS,;t t
    24082496s,@JAVAC@,$JAVAC,;t t
  • main/trunk/greenstone2/common-src/indexers/configure.ac

    r20832 r21328  
    33dnl
    44
    5 AC_INIT(mgpp/text/MGQuery.cpp)
    6 AC_ARG_ENABLE(accentfolding, [  --disable-accentfold    Disable Accent Folding support], ENABLE_ACCENTFOLD=0, ENABLE_ACCENTFOLD=1)
     5dnl AC_INIT(mgpp/text/MGQuery.cpp)
     6dnl http://www.gnu.org/software/hello/manual/autoconf/Initializing-configure.html
     7AC_INIT()
     8AC_ARG_ENABLE(accentfolding, [  --disable-accentfolding    Disable Accent Folding support], ENABLE_ACCENTFOLD=0, ENABLE_ACCENTFOLD=1)
    79AC_DEFINE_UNQUOTED(ENABLE_ACCENTFOLD, $ENABLE_ACCENTFOLD)
    810AC_SUBST(ENABLE_ACCENTFOLD)
     11
     12
     13dnl
     14dnl Set compilation of MG (enabled by default)
     15dnl
     16AC_ARG_ENABLE(mg, [  --disable-mg        Disable MG compilation], ENABLE_MG=$enableval, ENABLE_MG=yes)
     17if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
     18  ENABLE_MG=1
     19  AC_DEFINE(ENABLE_MG,[])
     20else
     21  ENABLE_MG=0
     22fi
     23AC_SUBST(ENABLE_MG)
     24
     25
     26dnl
     27dnl Set compilation of MGPP (enabled by default)
     28dnl
     29AC_ARG_ENABLE(mgpp, [  --disable-mgpp        Disable MGPP compilation], ENABLE_MGPP=$enableval, ENABLE_MGPP=yes)
     30if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
     31  ENABLE_MGPP=1
     32  AC_DEFINE(ENABLE_MGPP,[])
     33else
     34  ENABLE_MGPP=0
     35fi
     36AC_SUBST(ENABLE_MGPP)
     37
     38dnl
     39dnl Set compilation of Lucene (enabled by default)
     40dnl
     41AC_ARG_ENABLE(lucene, [  --disable-lucene        Disable Lucene compilation], ENABLE_LUCENE=$enableval, ENABLE_LUCENE=yes)
     42if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
     43  ENABLE_LUCENE=1
     44  AC_DEFINE(ENABLE_LUCENE,[])
     45else
     46  ENABLE_LUCENE=0
     47fi
     48AC_SUBST(ENABLE_LUCENE)
     49
    950
    1051AC_DEFINE_UNQUOTED(COMPAT32BITFLAGS, $COMPAT32BITFLAGS)
     
    3273fi
    3374
    34 AC_CONFIG_SUBDIRS(mg mgpp)
     75dnl AC_CONFIG_SUBDIRS(mg mgpp)
     76
     77if test $ENABLE_MG = 1; then
     78if test ! -d mg; then
     79echo "***** Folder mg does not exist, cannot ENABLE_MG.";
     80exit 1;
     81fi
     82AC_CONFIG_SUBDIRS(mg)
     83fi
     84
     85if test $ENABLE_MGPP = 1; then
     86if test ! -d mgpp; then
     87echo "***** Folder mgpp does not exist, cannot ENABLE_MGPP.";
     88exit 1;
     89fi
     90AC_CONFIG_SUBDIRS(mgpp)
     91fi
     92
     93if test $ENABLE_LUCENE = 1; then
     94if test ! -d lucene-gs; then
     95echo "***** Folder lucene-gs does not exist, cannot ENABLE_LUCENE.";
     96exit 1;
     97fi
     98fi
    3599
    36100AC_OUTPUT(Makefile)
  • main/trunk/greenstone2/common-src/indexers/winMake.bat

    r20861 r21328  
    1010)
    1111
     12:: ENABLE_MG/MGPP/LUCENE are guaranteed to be set to either 1 or 0 at this point
     13set MAKE_VARS=%MAKE_VARS% ENABLE_MG=%ENABLE_MG%
     14set MAKE_VARS=%MAKE_VARS% ENABLE_MGPP=%ENABLE_MGPP%
     15set MAKE_VARS=%MAKE_VARS% ENABLE_LUCENE=%ENABLE_LUCENE%
     16
     17if "%ENABLE_MG%" == "1" if not exist mg (
     18  echo ***** Folder mg does not exist, cannot ENABLE_MG.
     19  goto failed
     20)
     21
     22if "%ENABLE_MGPP%" == "1" if not exist mgpp (
     23  echo ***** Folder mgpp does not exist, cannot ENABLE_MGPP.
     24  goto failed
     25)
     26
     27if "%ENABLE_LUCENE%" == "1" if not exist lucene-gs (
     28  echo ***** Folder lucene-gs does not exist, cannot ENABLE_LUCENE.
     29  goto failed
     30)
     31
    1232if ""%1"" == """" goto all
    1333if ""%1"" == ""all"" goto go
     
    1737:unknown
    1838    echo Error: Unrecognized argument %1.
    19     goto done
     39    goto failed
    2040
    2141:clean
     
    4161    cd ..\..
    4262
    43     cd mg
    44     call winMake.bat %1
    45     cd ..
     63    if "%ENABLE_MG%" == "1" (
     64      cd mg
     65      call winMake.bat %1
     66      cd ..
     67    )
    4668
    47     cd mgpp
    48     call winMake.bat %1
    49     cd ..
    50    
    51     cd lucene-gs
    52     call winMake.bat %1
    53     cd ..
     69    if "%ENABLE_MGPP%" == "1" (
     70      cd mgpp
     71      call winMake.bat %1
     72      cd ..
     73    )
     74
     75    if "%ENABLE_LUCENE%" == "1" (
     76      cd lucene-gs
     77      call winMake.bat %1
     78      cd ..
     79    )
    5480
    5581    if ""%1"" == ""clean"" goto clean2
     
    6389
    6490:java
    65     cd mg
    66     call winMake.bat %1 javaonly
    67     cd ..
     91    if "%ENABLE_MG%" == "1" (
     92      cd mg
     93      call winMake.bat %1 javaonly
     94      cd ..
     95    )
    6896
    69     cd mgpp
    70     call winMake.bat %1 javaonly
    71     cd ..
     97    if "%ENABLE_MGPP%" == "1" (
     98      cd mgpp
     99      call winMake.bat %1 javaonly
     100      cd ..
     101    )
    72102   
    73     cd lucene-gs
    74     call winMake.bat %1
    75     cd ..
     103    if "%ENABLE_LUCENE%" == "1" (
     104      cd lucene-gs
     105      call winMake.bat %1
     106      cd ..
     107    )
    76108    goto done
    77109
     
    86118    cd ..\..
    87119
    88     cd mg
    89     call winMake.bat %1 nojava
    90     cd ..
    91 
    92     cd mgpp
    93     call winMake.bat %1 nojava
    94     cd ..
     120    if "%ENABLE_MG%" == "1" (
     121      cd mg
     122      call winMake.bat %1 nojava
     123      cd ..
     124    )
     125   
     126    if "%ENABLE_MGPP%" == "1" (
     127      cd mgpp
     128      call winMake.bat %1 nojava
     129      cd ..
     130    )
    95131    goto done
    96132
     
    107143    cd ..\..
    108144
    109     cd mg
    110     call winMake.bat %1 nojava
    111     cd ..
     145    if "%ENABLE_MG%" == "1" (
     146      cd mg
     147      call winMake.bat %1 nojava
     148      cd ..
     149    )
    112150
    113     cd mgpp
    114     call winMake.bat %1 nojava
    115     cd ..
    116    
    117     cd lucene-gs
    118     call winMake.bat %1
    119     cd ..
     151    if "%ENABLE_MGPP%" == "1" (
     152      cd mgpp
     153      call winMake.bat %1 nojava
     154      cd ..
     155    )
     156
     157    if "%ENABLE_LUCENE%" == "1" (   
     158      cd lucene-gs
     159      call winMake.bat %1
     160      cd ..
     161    )
    120162    goto done
    121163
     164
     165:failed
     166echo ***** Compilation terminated with failure in %~dp0%0
     167exit /b 1
     168
    122169:done
Note: See TracChangeset for help on using the changeset viewer.