Changeset 36521


Ignore:
Timestamp:
2022-08-27T19:00:00+12:00 (5 weeks ago)
Author:
davidb
Message:

To support Webswing, more environment variables need to be set when tomcat is launch. This in turn triggered a more careful study of when/how environement variables are both brough in to the ant-based build.xml file, and how those values are passed on in an <exec> task. As properties only get set once in ant, we don't have the freedom to use the traditional rule to bring in env vars, and then added in those through the 'setupenv' technique we have introduced. For example if PATH is already set as env.PATH, then the ant-based was of sourceing gs3-setup.bash isn't able to then redefine env.PATH with its new value. Solution here is to be more careful about which targets uses 'envbased' properites, and have those express a dependency that makes use a single pass setting envs is done

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/build.xml

    r36502 r36521  
    347347  <property name="oai.servlets" value="oaiserver"/> <!-- in case user has old version of build.properties-->
    348348  <property name="greenstone.default.servlet" value="/library"/>
    349   <!-- get properties from the environment -->
    350   <property environment="env"/>
    351349
    352350  <!-- get the filesets defining components and executables -->
     
    354352  <import file="resources/xml/executables.xml"/>
    355353   
    356   <if>
    357     <bool><isset property="env.VisualStudioVersion"/></bool>
    358     <property name="visualstudio.majorversion" value="${env.VisualStudioVersion}"/>
    359     <else>
    360       <!-- possible that earlier versions of VS don't set this, so default to VS13 to trigger iconv-PRE-VS14.zip -->
    361       <property name="visualstudio.majorversion" value="13"/>
    362     </else>
    363   </if>
    364 
    365354  <!-- version properties for external packages -->
    366355  <!-- for Java versions < 1.4, we print out the message that Java is too old.
     
    610599    <isset property="compile.static"/>
    611600  </condition>
    612 
    613   <!-- If building a release then we want to adjust environment variables so that the support library can be seen during compilation -->
    614   <if><bool><isset property="use.gnomelib.ext"/></bool>
    615     <property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
    616 
    617     <if><bool><isset property="env.CFLAGS"/></bool>
    618         <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2 ${env.CFLAGS}&quot;"/>
    619     <else>
    620         <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2&quot;"/>
    621     </else>
    622     </if>
    623 
    624     <if><bool><isset property="env.CPPFLAGS"/></bool>
    625         <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2 ${env.CPPFLAGS}&quot;"/>
    626     <else>
    627         <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2&quot;"/>
    628     </else>
    629     </if>
    630 
    631     <if><bool><isset property="env.CXXFLAGS"/></bool>
    632         <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2 ${env.CXXFLAGS}&quot;"/>
    633     <else>
    634             <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2&quot;"/>
    635     </else>
    636     </if>
    637 
    638     <!--https://groups.google.com/forum/#!topic/openkinect/m-hfXeYwKtU
    639       compiling up libwv on ElCapitan needs -framework CoreFoundation -->
    640     <if><bool><isset property="env.LDFLAGS"/></bool>
    641         <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib ${env.LDFLAGS}&quot;"/>
    642     <else>
    643             <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib&quot;"/>
    644     </else>
    645     </if>
    646 
    647     <if><bool><isset property="env.PATH"/></bool>
    648         <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin:${env.PATH}&quot;"/>
    649     <else>
    650             <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin&quot;"/>
    651     </else>
    652     </if>
    653 
    654     <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
    655         <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}&quot;"/>
    656     <else>
    657             <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig&quot;"/>
    658     </else>
    659     </if>
    660 
    661     <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
    662       <!--<if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
    663           <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.DYLD_LIBRARY_PATH}&quot;"/>
    664           <else>
    665         <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
    666               </else>
    667           </if>
    668             -->
    669       <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
    670     <else>
    671         <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
    672             <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.LD_LIBRARY_PATH}&quot;"/>
    673         <else>
    674             <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
    675         </else>
    676         </if>
    677     </else>
    678     </if>
    679 
    680 
    681     <else>
    682         <if><bool><isset property="env.CFLAGS"/></bool>
    683             <property name="cflags.arg" value="CFLAGS=&quot;${env.CFLAGS}&quot;"/>
    684             <else>
    685             <property name="cflags.arg" value=" "/>
    686         </else>
    687         </if>
    688 
    689         <if><bool><isset property="env.CPPFLAGS"/></bool>
    690                 <property name="cppflags.arg" value="CPPFLAGS=&quot;${env.CPPFLAGS}&quot;"/>
    691             <else>
    692             <property name="cppflags.arg" value=" "/>
    693         </else>
    694         </if>
    695 
    696         <if><bool><isset property="env.CXXFLAGS"/></bool>
    697             <property name="cxxflags.arg" value="CXXFLAGS=&quot;${env.CXXFLAGS}&quot;"/>
    698         <else>
    699             <property name="cxxflags.arg" value=" "/>
    700         </else>
    701         </if>
    702 
    703         <if><bool><isset property="env.LDFLAGS"/></bool>
    704             <property name="ldflags.arg" value="LDFLAGS=&quot;${env.LDFLAGS}&quot;"/>
    705         <else>
    706             <property name="ldflags.arg" value=" "/>
    707         </else>
    708         </if>
    709 
    710         <if><bool><isset property="env.PATH"/></bool>
    711             <property name="path.arg" value="PATH=&quot;${env.PATH}&quot;"/>
    712         <else>
    713             <property name="path.arg" value=" "/>
    714         </else>
    715         </if>
    716 
    717         <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
    718             <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${env.PKG_CONFIG_PATH}&quot;"/>
    719         <else>
    720             <property name="pcpath.arg" value=" "/>
    721         </else>
    722         </if>
    723 
    724         <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
    725             <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
    726                 <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
    727             <else>
    728                 <property name="ldlpath.arg" value=" "/>
    729             </else>
    730             </if>
    731         <else>
    732             <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
    733                 <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${env.LD_LIBRARY_PATH}&quot;"/>
    734             <else>
    735                 <property name="ldlpath.arg" value=" "/>
    736             </else>
    737             </if>
    738         </else> 
    739         </if>
    740     </else>
    741   </if>
    742   <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
    743601
    744602  <condition property="opt.cross.build"
     
    907765   
    908766  </path>
    909 
    910   <path id="local.tomcat.classpath">
    911     <!-- explicitly include the jni java wrappers in the classpath -->
    912     <pathelement location="${lib.jni}"/>
    913     <fileset dir="${lib.jni}">
    914       <include name="*.jar"/>
    915     </fileset>
    916    
    917     <pathelement location="${web.writablelib}"/>
    918     <fileset dir="${web.writablelib}">
    919       <include name="derbyclient.jar"/> <!--<include name="derby.jar"/>-->
    920     </fileset>
    921   </path>
    922767 
    923768  <path id="derby.server.classpath">
     
    927772
    928773 
     774
     775  <target name="test-setup" depends="needs-gs3-setup">
     776    <echo>ant.version   = ${ant.version}</echo>
     777    <echo>java.version  = ${java.specification.version} (specification version)</echo>
     778    <echo></echo>
     779    <echo>is unix       : ${current.os.isunix}</echo>
     780    <echo>is mac        : ${current.os.ismac}</echo>
     781    <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
     782    <echo>is windows    : ${current.os.iswindows}</echo>
     783    <echo>os.unix       : ${os.unix}</echo>
     784    <echo>env.PATH     : ${env.PATH}</echo>
     785    <!-- Windows can be case sensitive about env.PATH, preferring env.Path. See https://ant.apache.org/manual/Tasks/property.html  -->
     786    <echo>env.Path     : ${env.Path}</echo>       
     787  </target>
     788
     789  <target name="needs-gs3-setup">
     790
     791    <exec os="${os.unix}" executable="bash"  dir="${basedir}" failonerror="true" output="${basedir}/gs3-setupenv.properties">
     792      <arg value="-c" />
     793      <arg value=". ./gs3-setup.sh >/dev/null 2>gs3-setupenv.errors ; env" />
     794    </exec>
     795    <exec osfamily="windows" executable="cmd" dir="${basedir}" failonerror="true" output="${basedir}/gs3-setupenv.properties">
     796      <arg value="/c" />
     797      <arg value=".\gs3-setup.bat >nul 2>gs3-setupenv.errors &amp;&amp; set"/>
     798    </exec>         
     799
     800    <!-- Need to escape any backslashes (typically happens on Windows with file/dir paths) so can be parsed in correctly by
     801     property file read, otherwise can trigger errors such as Malformed \uXXXX -->
     802    <rsr verbosity="1" file="gs3-setupenv.properties" pattern="\\" replacement="\\\\" />
     803
     804    <!-- acts as a replacement for <property environment="env"/> -->
     805    <property file="${basedir}/gs3-setupenv.properties" prefix="env"/>
     806   
     807    <!-- Delete the error output file if it is empty -->
     808    <delete>
     809      <fileset dir="${basedir}" includes="gs3-setupenv.errors">
     810    <size value="0" when="equal"/>
     811      </fileset>
     812    </delete>
     813
     814    <!-- has the gs3-setup been sourced successfully -->
     815    <condition property="gs3-setup-not-done">
     816      <not>
     817    <isset property="env.GSDL3HOME"/>
     818      </not>
     819    </condition>
     820
     821    <fail if="gs3-setup-not-done" message="Failed to run 'gs3-setup' (Windows) or '. ./gs3-setup.sh' (Unix) before starting the Greenstone server."/>   
     822  </target>
     823
     824  <target name="needs-gs3-devel">
     825
     826    <if>
     827      <!-- only need to source gs3-devel if not already done so -->
     828      <bool><not><isset property="gs3-devel-done"/></not></bool>
     829     
     830      <exec os="${os.unix}" executable="bash"   dir="${basedir}" failonerror="true" output="${basedir}/gs3-develenv.properties">
     831    <arg value="-c" />
     832    <arg value=". ./gs3-devel.sh >/dev/null 2>gs3-develenv.errors ; env" />
     833      </exec>
     834      <exec osfamily="windows" executable="cmd" dir="${basedir}" failonerror="true" output="${basedir}/gs3-develenv.properties">
     835    <arg value="/c" />
     836    <arg value=".\gs3-devel.bat >nul 2>gs3-develenv.errors &amp;&amp; set" />
     837      </exec>         
     838
     839      <!-- Need to escape any backslashes (typically happens on Windows with file/dir paths) so can be parsed in correctly by
     840       property file read, otherwise can trigger errors such as Malformed \uXXXX -->
     841      <rsr verbosity="1" file="gs3-develenv.properties" pattern="\\" replacement="\\\\" />
     842
     843      <!-- acts as a replacement for <property environment="env"/> -->     
     844      <property file="${basedir}/gs3-develenv.properties" prefix="env"/>
     845
     846      <!-- Delete the error output file if it is empty -->
     847      <delete>
     848    <fileset dir="${basedir}" includes="gs3-develenv.errors">
     849      <size value="0" when="equal"/>
     850    </fileset>
     851      </delete>
     852
     853      <!-- has the gs3-setup been sourced successfully -->
     854      <condition property="gs3-devel-done">
     855    <isset property="env.GSDL3HOME"/>
     856      </condition>
     857     
     858      <if>
     859    <bool><isset property="env.JAVACFLAGS"/></bool>
     860    <property name="compile.javac.flags" value="${env.JAVACFLAGS}"/>
     861    <else>
     862      <property name="compile.javac.flags" value=""/>
     863    </else>
     864      </if>
     865    </if>
     866   
     867  </target>
     868
     869  <target name="envbased-devel-props" depends="needs-gs3-devel" if="current.os.iswindows">
     870    <if>
     871      <bool><isset property="env.VisualStudioVersion"/></bool>
     872      <property name="visualstudio.majorversion" value="${env.VisualStudioVersion}"/>
     873      <else>
     874    <!-- possible that earlier versions of VS don't set this, so default to VS13 to trigger iconv-PRE-VS14.zip -->
     875    <property name="visualstudio.majorversion" value="13"/>
     876      </else>
     877    </if>
     878  </target>
     879
     880  <target name="envbased-localtomcat-path" depends="needs-gs3-setup">
    929881    <if><bool><isset property="env.PATH"/></bool>
    930882      <path id="local.tomcat.path">
     
    948900        <echo>No env.PATH (or env.Path) set. Unable to set local.tomcat.path property</echo>
    949901      </else></if></else>   
    950     </if>   
    951 
    952   <target name="test-setup">
    953     <echo>ant.version   = ${ant.version}</echo>
    954     <echo>java.version  = ${java.specification.version} (specification version)</echo>
    955     <echo></echo>
    956     <echo>is unix       : ${current.os.isunix}</echo>
    957     <echo>is mac        : ${current.os.ismac}</echo>
    958     <echo>is unixnotmac : ${current.os.isunixnotmac}</echo>
    959     <echo>is windows    : ${current.os.iswindows}</echo>
    960     <echo>os.unix       : ${os.unix}</echo>
    961     <echo>env.PATH : ${env.PATH}</echo>
    962     <echo>env.Path : ${env.Path}</echo>
    963   </target>
    964 
    965   <target name="needs-gs3-setup">
    966 
    967     <exec os="${os.unix}" executable="bash"  dir="${basedir}" failonerror="true" output="${basedir}/gs3-setupenv.properties">
    968       <arg value="-c" />
    969       <arg value=". ./gs3-setup.sh >/dev/null 2>gs3-setupenv.errors ; env" />
    970     </exec>
    971     <exec osfamily="windows" executable="cmd" dir="${basedir}" failonerror="true" output="${basedir}/gs3-setupenv.properties">
    972       <arg value="/c" />
    973       <arg value=".\gs3-setup.bat >nul 2>gs3-setupenv.errors &amp;&amp; set"/>
    974     </exec>         
    975 
    976     <!-- Need to escape any backslashes (typically happens on Windows with file/dir paths) so can be parsed in correctly by
    977      property file read, otherwise can trigger errors such as Malformed \uXXXX -->
    978     <rsr verbosity="1" file="gs3-setupenv.properties" pattern="\\" replacement="\\\\" />
    979    
    980     <property file="${basedir}/gs3-setupenv.properties" prefix="env"/>
    981 
    982     <!-- Delete the error output file if it is empty -->
    983     <delete>
    984       <fileset dir="${basedir}" includes="gs3-setupenv.errors">
    985     <size value="0" when="equal"/>
    986       </fileset>
    987     </delete>
    988 
    989     <!-- has the gs3-setup been sourced successfully -->
    990     <condition property="gs3-setup-not-done">
    991       <not>
    992     <isset property="env.GSDL3HOME"/>
    993       </not>
    994     </condition>
    995 
    996     <fail if="gs3-setup-not-done" message="Failed to run 'gs3-setup' (Windows) or 'source ./gs3-setup.sh' (Unix) before starting the Greenstone server."/>   
    997   </target>
    998 
    999   <target name="needs-gs3-devel">
    1000 
    1001     <if>
    1002       <!-- only need to source gs3-devel if not already done so -->
    1003       <bool><not><isset property="gs3-devel-done"/></not></bool>
    1004      
    1005       <exec os="${os.unix}" executable="bash"   dir="${basedir}" failonerror="true" output="${basedir}/gs3-develenv.properties">
    1006     <arg value="-c" />
    1007     <arg value=". ./gs3-devel.sh >/dev/null 2>gs3-develenv.errors ; env" />
    1008       </exec>
    1009       <exec osfamily="windows" executable="cmd" dir="${basedir}" failonerror="true" output="${basedir}/gs3-develenv.properties">
    1010     <arg value="/c" />
    1011     <arg value=".\gs3-devel.bat >nul 2>gs3-develenv.errors &amp;&amp; set" />
    1012       </exec>         
    1013 
    1014       <!-- Need to escape any backslashes (typically happens on Windows with file/dir paths) so can be parsed in correctly by
    1015        property file read, otherwise can trigger errors such as Malformed \uXXXX -->
    1016       <rsr verbosity="1" file="gs3-develenv.properties" pattern="\\" replacement="\\\\" />
    1017 
    1018       <property file="${basedir}/gs3-develenv.properties" prefix="env"/>
    1019 
    1020       <!-- Delete the error output file if it is empty -->
    1021       <delete>
    1022     <fileset dir="${basedir}" includes="gs3-develenv.errors">
    1023       <size value="0" when="equal"/>
    1024     </fileset>
    1025       </delete>
    1026 
    1027       <!-- has the gs3-setup been sourced successfully -->
    1028       <condition property="gs3-devel-done">
    1029     <isset property="env.GSDL3HOME"/>
    1030       </condition>
    1031      
    1032       <if>
    1033     <bool><isset property="env.JAVACFLAGS"/></bool>
    1034     <property name="compile.javac.flags" value="${env.JAVACFLAGS}"/>
     902    </if>
     903
     904    <path id="local.tomcat.classpath">
     905      <!-- explicitly include the jni java wrappers in the classpath -->
     906      <pathelement location="${lib.jni}"/>
     907      <fileset dir="${lib.jni}">
     908        <include name="*.jar"/>
     909      </fileset>
     910     
     911      <pathelement location="${web.writablelib}"/>
     912      <fileset dir="${web.writablelib}">
     913        <include name="derbyclient.jar"/> <!--<include name="derby.jar"/>-->
     914      </fileset>
     915    </path>
     916   
     917  </target>
     918 
     919  <target name="envbased-gnomelib-allargs-prop" depends="needs-gs3-devel">
     920
     921    <!-- If building a release then we want to adjust environment variables so that the support library can be seen during compilation -->
     922    <if>
     923        <bool><isset property="use.gnomelib.ext"/></bool>
     924    <property name="gnome-lib-dir" value="${basedir}/ext/gnome-lib-minimal/${os.bin.dir}"/>
     925
     926    <if><bool><isset property="env.CFLAGS"/></bool>
     927        <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2 ${env.CFLAGS}&quot;"/>
    1035928    <else>
    1036       <property name="compile.javac.flags" value=""/>
    1037     </else>
    1038       </if>
    1039     </if>
    1040    
    1041   </target>
    1042  
    1043 
     929        <property name="cflags.arg" value="CFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2&quot;"/>
     930    </else>
     931    </if>
     932
     933    <if><bool><isset property="env.CPPFLAGS"/></bool>
     934        <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2 ${env.CPPFLAGS}&quot;"/>
     935    <else>
     936        <property name="cppflags.arg" value="CPPFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2&quot;"/>
     937    </else>
     938    </if>
     939
     940    <if><bool><isset property="env.CXXFLAGS"/></bool>
     941        <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2 ${env.CXXFLAGS}&quot;"/>
     942    <else>
     943            <property name="cxxflags.arg" value="CXXFLAGS=&quot;-I${gnome-lib-dir}/include -I${gnome-lib-dir}/include/libxml2&quot;"/>
     944    </else>
     945    </if>
     946
     947    <!--https://groups.google.com/forum/#!topic/openkinect/m-hfXeYwKtU
     948      compiling up libwv on ElCapitan needs -framework CoreFoundation -->
     949    <if><bool><isset property="env.LDFLAGS"/></bool>
     950        <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib ${env.LDFLAGS}&quot;"/>
     951    <else>
     952            <property name="ldflags.arg" value="LDFLAGS=&quot;-L${gnome-lib-dir}/lib&quot;"/>
     953    </else>
     954    </if>
     955
     956    <if><bool><isset property="env.PATH"/></bool>
     957        <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin:${env.PATH}&quot;"/>
     958    <else>
     959            <property name="path.arg" value="PATH=&quot;${gnome-lib-dir}/bin&quot;"/>
     960    </else>
     961    </if>
     962
     963    <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
     964        <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig:${env.PKG_CONFIG_PATH}&quot;"/>
     965    <else>
     966            <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${gnome-lib-dir}/lib/pkgconfig&quot;"/>
     967    </else>
     968    </if>
     969
     970    <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
     971      <!--<if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
     972          <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.DYLD_LIBRARY_PATH}&quot;"/>
     973          <else>
     974        <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
     975              </else>
     976          </if>
     977            -->
     978      <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
     979    <else>
     980        <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
     981            <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib:${env.LD_LIBRARY_PATH}&quot;"/>
     982        <else>
     983            <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${gnome-lib-dir}/lib&quot;"/>
     984        </else>
     985        </if>
     986    </else>
     987    </if>
     988
     989
     990    <else>
     991        <if><bool><isset property="env.CFLAGS"/></bool>
     992            <property name="cflags.arg" value="CFLAGS=&quot;${env.CFLAGS}&quot;"/>
     993            <else>
     994            <property name="cflags.arg" value=" "/>
     995        </else>
     996        </if>
     997
     998        <if><bool><isset property="env.CPPFLAGS"/></bool>
     999                <property name="cppflags.arg" value="CPPFLAGS=&quot;${env.CPPFLAGS}&quot;"/>
     1000            <else>
     1001            <property name="cppflags.arg" value=" "/>
     1002        </else>
     1003        </if>
     1004
     1005        <if><bool><isset property="env.CXXFLAGS"/></bool>
     1006            <property name="cxxflags.arg" value="CXXFLAGS=&quot;${env.CXXFLAGS}&quot;"/>
     1007        <else>
     1008            <property name="cxxflags.arg" value=" "/>
     1009        </else>
     1010        </if>
     1011
     1012        <if><bool><isset property="env.LDFLAGS"/></bool>
     1013            <property name="ldflags.arg" value="LDFLAGS=&quot;${env.LDFLAGS}&quot;"/>
     1014        <else>
     1015            <property name="ldflags.arg" value=" "/>
     1016        </else>
     1017        </if>
     1018
     1019        <if><bool><isset property="env.PATH"/></bool>
     1020            <property name="path.arg" value="PATH=&quot;${env.PATH}&quot;"/>
     1021        <else>
     1022            <property name="path.arg" value=" "/>
     1023        </else>
     1024        </if>
     1025
     1026        <if><bool><isset property="env.PKG_CONFIG_PATH"/></bool>
     1027            <property name="pcpath.arg" value="PKG_CONFIG_PATH=&quot;${env.PKG_CONFIG_PATH}&quot;"/>
     1028        <else>
     1029            <property name="pcpath.arg" value=" "/>
     1030        </else>
     1031        </if>
     1032
     1033        <if><bool><equals arg1="${os.bin.dir}" arg2="darwin"/></bool>
     1034            <if><bool><isset property="env.DYLD_LIBRARY_PATH"/></bool>
     1035                <property name="ldlpath.arg" value="DYLD_LIBRARY_PATH=&quot;${env.DYLD_LIBRARY_PATH}&quot;"/>
     1036            <else>
     1037                <property name="ldlpath.arg" value=" "/>
     1038            </else>
     1039            </if>
     1040        <else>
     1041            <if><bool><isset property="env.LD_LIBRARY_PATH"/></bool>
     1042                <property name="ldlpath.arg" value="LD_LIBRARY_PATH=&quot;${env.LD_LIBRARY_PATH}&quot;"/>
     1043            <else>
     1044                <property name="ldlpath.arg" value=" "/>
     1045            </else>
     1046            </if>
     1047        </else> 
     1048        </if>
     1049    </else>
     1050    </if>
     1051    <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
     1052  </target>
     1053 
    10441054  <!-- Appends the current env to the file environment.txt. For debugging env vars used by the release-kit. -->
    10451055  <target name="write-env" description="Writes out the environment that this build.xml is executed in to file environment.txt. For debugging.">
     
    26322642       on how to use this with eclipse
    26332643    -->
    2634   <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="init" if="tomcat.islocal">
     2644  <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="envbased-localtomcat-path,init" if="tomcat.islocal">
    26352645    <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
    26362646    <property name="tomcat.path" refid="local.tomcat.path"/>
     
    27072717
    27082718  <!-- Another way: http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/ -->
    2709   <target name="force-start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal">
     2719  <target name="force-start-tomcat" description="Startup only Tomcat" depends="envbased-localtomcat-path,init" if="tomcat.islocal">
    27102720
    27112721    <property name="tomcat.classpath" refid="local.tomcat.classpath"/>
     
    27282738    see http://ant-contrib.sourceforge.net/tasks/tasks/osfamily.html -->
    27292739
    2730     <!--<exec executable="${catalina.home}/bin/startup.sh" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">-->
    27312740    <exec executable="${sudo.or.not}" os="${os.unix}" dir="${catalina.home}/bin" spawn="false">
    2732       <!--<env key="GSDLOS" value="linux"/> do we need this?? -->
    27332741      <!--<env key="JAVA_TOOL_OPTIONS" value="-Dfile.encoding=UTF-8"/>--><!-- Was needed by Windows for on e.g. Chinese locales, but added to unix for symmetry-->
    2734       <env key="GSDL3HOME" value="${web.home}"/>
    2735       <env key="PATH" path="${tomcat.path}"/>
    27362742      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
    27372743      <env key="CATALINA_HOME" value="${catalina.home}"/>
    2738       <env key="CLASSPATH" path="${tomcat.classpath}"/>
    2739       <env key="LD_LIBRARY_PATH" path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
     2744      <env key="CLASSPATH"     path="${tomcat.classpath}"/>
     2745      <env key="PATH"          path="${tomcat.path}"/>
     2746
     2747      <env key="LD_LIBRARY_PATH"   path="${env.LD_LIBRARY_PATH}:${lib.jni}"/>
    27402748      <env key="DYLD_LIBRARY_PATH" path="${env.DYLD_LIBRARY_PATH}:${lib.jni}:${gdbm.home}/lib"/> <!-- for mac os --> <!-- need gdbm here these days ??-->
     2749
     2750      <!-- Webswing servlet needs the following enviornent variables to be set to be able to run GLI -->
     2751      <env key="GSDL3SRCHOME" value="${env.GSDL3SRCHOME}"/>
     2752      <env key="GSDL3HOME"    value="${web.home}"/>     <!-- consider changing to env.GSDL3HOME to be more consistent? -->
     2753      <env key="GSDLHOME"     value="${env.GSDLHOME}"/> <!-- i.e., gs2build.home -->
     2754      <env key="GSDL3EXTS"    value="${env.GSDL3EXTS}"/>
     2755      <env key="GSDLEXTS"     value="${env.GSDLEXTS}"/>
     2756      <env key="GEXT_SOLR"    value="${env.GEXT_SOLR}"/>
     2757      <env key="GSDLOS"       value="${env.GSDLOS}"/>
     2758
    27412759      <env key="WNHOME" path="${wn.home}"/>
    27422760      <env key="FEDORA_HOME" path="${fedora.home}"/>
     
    27452763    <exec executable="${catalina.home}/bin/startup.bat" osfamily="windows" dir="${catalina.home}/bin" spawn="true">
    27462764      <!--<env key="JAVA_TOOL_OPTIONS" value="-Dfile.encoding=UTF-8"/>-->
    2747       <env key="GSDLOS" value="windows"/>
    2748       <env key="GSDL3HOME" value="${web.home}"/>
    2749       <env key="Path" path="${tomcat.path}"/>
    2750       <env key="PATH" path="${tomcat.path}"/>
    27512765      <env key="CATALINA_OPTS" value="${catalina.opts}"/>
    27522766      <env key="CATALINA_HOME" value="${catalina.home}"/>
    2753       <env key="CLASSPATH" path="${tomcat.classpath}"/>
     2767      <env key="CLASSPATH"     path="${tomcat.classpath}"/>
     2768
     2769      <env key="PATH"          path="${tomcat.path}"/>
     2770      <env key="Path"          path="${tomcat.path}"/>
     2771      <!-- Should the equivalent LD_LIBRARY_PATH line above for Unix, be turned into an equivalent PATH update, as this is what Windows uses? -->
     2772
     2773      <!-- Webswing servlet needs the following enviornent variables to be set to be able to run GLI -->
     2774      <env key="GSDL3SRCHOME" value="${env.GSDL3SRCHOME}"/>       
     2775      <env key="GSDL3HOME"    value="${web.home}"/>     <!-- consider changing to env.GSDL3HOME to be more consistent? -->
     2776      <env key="GSDLHOME"     value="${env.GSDLHOME}"/> <!-- i.e., gs2build.home -->
     2777      <env key="GSDL3EXTS"    value="${env.GSDL3EXTS}"/>
     2778      <env key="GSDLEXTS"     value="${env.GSDLEXTS}"/>
     2779      <env key="GEXT_SOLR"    value="${env.GEXT_SOLR}"/>
     2780      <env key="GSDLOS"       value="${env.GSDLOS}"/>   <!-- used to be hardwired to 'windows', but now gs3-setup.sh run, GSDLOS should be set -->
     2781
     2782      <env key="WNHOME" path="${wn.home}"/>
    27542783      <env key="FEDORA_HOME" path="${fedora.home}"/>
    27552784    </exec>
     
    37703799  </target>
    37713800   
    3772   <target name="configure-common-src" depends="init">
     3801  <target name="configure-common-src" depends="envbased-gnomelib-allargs-prop,init">
    37733802<!--
    37743803    <echo>cross configure args: ${cross.configure.args}</echo>
     
    38153844    </exec>
    38163845  </target>
    3817   <target name="compile-common-src" depends="needs-gs3-devel,init">
     3846  <target name="compile-common-src" depends="needs-gs3-devel,envbased-devel-props,init">
    38183847    <!-- unix: -->
    38193848    <exec executable="make" os="${os.unix}" dir="${common.src.home}" failonerror="true">
     
    43604389  </target>
    43614390 
    4362   <target name="configure-build-src" depends="init" if="collection.building.enabled"
     4391  <target name="configure-build-src" depends="envbased-gnomelib-allargs-prop,init" if="collection.building.enabled"
    43634392    description="Configure the build-src component">
    43644393    <exec executable="${build.src.home}/configure" os="${os.unix}"
     
    43734402   
    43744403    <exec executable="make" dir="${build.src.home}" os="${os.unix}" failonerror="true">
    4375         <arg line="${ldlpath.arg}"/>
     4404        <!-- <arg line="${ldlpath.arg}"/> -->
     4405        <env key="LD_LIBRARY_PATH" value="${env.LD_LIBRARY_PATH}"/> <!--changed to specifying through 'env' rather than arg with ldlpath.arg -->
    43764406    </exec>
    43774407   
Note: See TracChangeset for help on using the changeset viewer.