Changeset 22184

Show
Ignore:
Timestamp:
27.05.2010 11:34:47 (9 years ago)
Author:
davidb
Message:

Some initial work on being able to support Greenstone 3 without using JNI

Location:
main/trunk/greenstone3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/build.properties.in

    r19932 r22184  
    4747compile.optimize=true 
    4848 
    49 ## should compilation be static?? - used for distributions 
     49# Control whether or not JNI bindings are used 
     50#   e.g. MG, MG++ and GDBM and the like 
     51# Setting this false means these components are not available to the install 
     52# The expectation is that collections will be build from 100% Java components: 
     53#   e.g Lucene and JDBM 
     54#  
     55# Ant 1.7.1 and before only test for *existence* so this needs to be commented 
     56# in or out to control whether jni is used or not 
     57with.jni=true 
     58 
     59## Control if compilation of gs2 is static or not. Used, for example, for distributions 
     60# Same issue as 'with.jni' for how this gets used in ant 1.7.1 and before 
    5061#compile.static=true 
     62 
    5163 
    5264## windows c++ compilation 
  • main/trunk/greenstone3/build.xml

    r22101 r22184  
    218218  <condition property="static.arg" value="LDFLAGS=-static" else=" "> 
    219219    <isset property="compile.static"/> 
     220  </condition> 
     221 
     222  <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite"> 
     223    <istrue value="${with.jni}"/> 
     224  </condition> 
     225  <condition property="gs2.compile.target" value="with-jni" else="without-jni"> 
     226    <istrue value="${with.jni}"/> 
     227  </condition> 
     228  <condition property="gs2.install.target" value="install-with-jni" else="install-without-jni"> 
     229    <istrue value="${with.jni}"/> 
     230  </condition> 
     231  <condition property="gs2.windows.enablejni" value="1" else="0"> 
     232    <istrue value="${with.jni}"/> 
    220233  </condition> 
    221234   
     
    315328    <!-- mg and mgpp get installed into lib/jni but they may not be there yet 
    316329    so we add them in by name --> 
     330    <!-- *** is there any way to make this optional, based on ${with.jni}? --> 
    317331    <pathelement location="${lib.jni}/mg.jar"/> 
    318332    <pathelement location="${lib.jni}/mgpp.jar"/> 
     
    810824      <env key="CLASSPATH" path="${tomcat.classpath}"/> 
    811825      <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/> 
    812       <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here??--> 
     826      <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??--> 
    813827      <env key="WNHOME" path="${wn.home}"/> 
    814828    </exec> 
     
    11971211    description="Configure only the packages."/> 
    11981212   
    1199   <target name="configure-javagdbm"> 
     1213  <target name="configure-javagdbm" if="with.jni"> 
    12001214    <echo> 
    12011215      Configuring JavaGDBM 
     
    12281242   
    12291243  <target name="compile-packages" description="Compile only the source packages"> 
     1244    <!-- javagdbm --> 
     1245    <antcall target="compile-javagdbm"/> 
     1246    <!-- Search4j --> 
     1247    <antcall target="compile-search4j"/> 
     1248  </target> 
     1249 
     1250  <target name="compile-javagdbm" description="Compile JavaGDBM" if="with.jni"> 
    12301251     
    12311252    <!-- unix: --> 
     
    12461267    <echo>Install the javagdbm jar file</echo> 
    12471268    <copy file="${javagdbm.home}/javagdbm.jar" todir="${lib.jni}"/> 
    1248  
    1249  
    1250     <!-- Search4j --> 
    1251     <antcall target="compile-search4j"/> 
    12521269  </target> 
    12531270 
     
    12881305 
    12891306  <target name="install-auxiliary-jar-files" depends="init"> 
    1290     <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/> 
    1291     <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/> 
     1307 
     1308    <if> 
     1309      <bool><available file="${mg.home}/mg.jar"/></bool> 
     1310      <copy file="${mg.home}/mg.jar" todir="${lib.jni}"/> 
     1311    </if> 
     1312 
     1313    <if> 
     1314      <bool><available file="${mgpp.home}/mg.jar"/></bool> 
     1315      <copy file="${mgpp.home}/mgpp.jar" todir="${lib.jni}"/> 
     1316    </if> 
     1317 
    12921318    <copy file="${lucene.home}/LuceneWrapper.jar" todir="${web.lib}"/>     
    12931319  </target> 
    12941320   
    1295   <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos"/> 
     1321  <target name="install-jni-files" depends="init,install-jni-files-linux,install-jni-files-windows,install-jni-files-macos" if="with.jni"/> 
    12961322 
    12971323  <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac"> 
     
    13551381      <arg value="--prefix=${gs2build.home}"/> <!-- what value to use?? --> 
    13561382      <arg value="--bindir=${gs2build.home}/bin/${os.bin.dir}"/> <!-- what value to use?? --> 
    1357       <arg value="--enable-jni"/> 
     1383      <arg line="${gs2.opt.args}"/> 
    13581384      <arg line="${static.arg}"/> 
    13591385    </exec> 
     
    13891415    <!-- unix: --> 
    13901416    <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true"> 
    1391       <arg value="with-jni"/> 
     1417      <arg value="${gs2.compile.target}"/> 
    13921418    </exec> 
    13931419    <!-- windows: --> 
     
    13961422      <arg value="win32.mak"/> 
    13971423      <arg value="GSDLHOME=${gs2build.home}"/> 
    1398       <arg value="ENABLE_JNI=1"/> 
    1399       <arg value="USE_SQLITE=0"/> 
     1424      <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/> 
     1425      <arg value="USE_SQLITE=0"/> <!-- Why is this not on by default? --> 
    14001426    </exec> 
    14011427  </target> 
     
    14311457    <!-- unix: --> 
    14321458    <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true"> 
    1433       <arg value="install-with-jni"/> 
     1459      <arg value="${gs2.install.target}"/> 
    14341460    </exec> 
    14351461       
     
    14391465      <arg value="win32.mak"/> 
    14401466      <arg value="install"/> 
    1441       <arg value="ENABLE_JNI=1"/> 
    1442       <arg value="USE_SQLITE=0"/> 
     1467      <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/> 
     1468      <arg value="USE_SQLITE=0"/> <!-- why is this not on by default? --> 
    14431469    </exec> 
    14441470 
     
    16721698      dir="${build.src.home}" failonerror="true"> 
    16731699      <arg value="--prefix=${gs2build.home}"/> 
     1700      <arg line="${gs2.opt.args}"/> 
    16741701      <arg line="${static.arg}"/> 
    16751702    </exec> 
     
    18821909     
    18831910</project> 
     1911