Changeset 26765


Ignore:
Timestamp:
2013-01-21T14:04:35+13:00 (9 years ago)
Author:
davidb
Message:

Introduction of some properties to help with cross compilation (specifically using mingw)

File:
1 edited

Legend:

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

    r26495 r26765  
    176176
    177177  <!-- is there a better way to do this?? what about solaris?? -->
     178  <condition property="os.bin.dir" value="${cross.os}">
     179      <istrue value="${compile.cross}"/>
     180  </condition>
    178181  <condition property="os.bin.dir" value="windows">
    179182    <os family="windows"/>
     
    190193    </and>
    191194  </condition>
    192  
     195
    193196 
    194197  <condition property="collection.building.disabled">
     
    348351  </if>
    349352  <property name="allargs" value="${cflags.arg} ${cxxflags.arg} ${cppflags.arg} ${ldflags.arg} ${path.arg} ${ldlpath.arg} ${pcpath.arg}"/>
     353
     354  <condition property="opt.cross.build"
     355         value="--build=${cross.build}" else=" ">
     356    <isset property="cross.build"/>
     357  </condition>
     358
     359
     360  <condition property="cross.configure.args"
     361         value="--host=${cross.host} ${opt.cross.build} CPP=${cross.host}-cpp CC=${cross.host}-gcc CXX=${cross.host}-g++ LD=${cross.host}-ld AR=${cross.host}-ar RANLIB=${cross.host}-ranlib ${cross.configure.extraargs} crossOS=${cross.os}">
     362    <istrue value="${compile.cross}"/>
     363  </condition>
     364
    350365
    351366  <condition property="gs2.opt.args" value= " " else="--disable-mg --disable-mgpp --disable-accentfold --disable-gdbm --disable-sqlite">
     
    17701785      <arg value="--libdir=${lib.jni}"/>
    17711786      <arg value="--with-gdbm=${gdbm.home}"/>
     1787      <arg line="${cross.configure.args}"/>
    17721788    </exec>   
    17731789  </target>
     
    18501866        <arg value="--bindir=${basedir}/bin"/>
    18511867        <arg value="${static.arg}"/>
     1868        <arg line="${cross.configure.args}"/>
    18521869      </exec>
    18531870      <exec executable="make" dir="${src.packages.home}/search4j" failonerror="true"/>
     
    18861903
    18871904  <target name="install-jni-files-linux" depends="init" if="current.os.isunixnotmac">
    1888     <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
    1889     <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
    1890     <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
    1891     <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
    1892     <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
    1893     <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
     1905
     1906    <if>
     1907
     1908      <bool><equals arg1="${os.bin.dir}" arg2="windows"/></bool>
     1909      <!-- cross compiling to windows -->
     1910      <copy file="${mg.home}/jni/mgretrievejni.dll" todir="${lib.jni}"/>
     1911      <copy file="${mg.home}/jni/mgsearchjni.dll" todir="${lib.jni}"/>
     1912      <copy file="${mg.home}/jni/mgpassjni.dll" todir="${lib.jni}"/>
     1913      <copy file="${mgpp.home}/jni/mgppretrievejni.dll" todir="${lib.jni}"/>
     1914      <copy file="${mgpp.home}/jni/mgppsearchjni.dll" todir="${lib.jni}"/>
     1915      <copy file="${mgpp.home}/jni/mgpppassjni.dll" todir="${lib.jni}"/>
     1916     
     1917      <else>
     1918    <!-- otherwise do the usual Unix copies -->
     1919    <copy file="${mg.home}/jni/libmgretrievejni.so" todir="${lib.jni}"/>
     1920    <copy file="${mg.home}/jni/libmgsearchjni.so" todir="${lib.jni}"/>
     1921    <copy file="${mg.home}/jni/libmgpassjni.so" todir="${lib.jni}"/>
     1922    <copy file="${mgpp.home}/jni/libmgppretrievejni.so" todir="${lib.jni}"/>
     1923    <copy file="${mgpp.home}/jni/libmgppsearchjni.so" todir="${lib.jni}"/>
     1924    <copy file="${mgpp.home}/jni/libmgpppassjni.so" todir="${lib.jni}"/>
     1925      </else>
     1926    </if>
     1927
     1928
    18941929  </target>
    18951930  <target name="install-jni-files-windows" depends="init" if="current.os.iswindows">
     
    19411976   
    19421977  <target name="configure-common-src" depends="init">
     1978<!--
     1979    <echo>cross configure args: ${cross.configure.args}</echo>
     1980-->
    19431981    <exec executable="${common.src.home}/configure" os="${os.unix}"
    19441982      dir="${common.src.home}" failonerror="true">
     
    19471985      <arg line="${gs2.opt.args}"/>
    19481986      <arg line="${static.arg}"/>
     1987      <arg line="${cross.configure.args}"/>
    19491988      <arg line="${allargs}"/>
    19501989    </exec>
     
    22812320      dir="${build.src.home}" failonerror="true">
    22822321      <arg value="--prefix=${gs2build.home}"/>
    2283       <arg line="${gs2.opt.args} ${static.arg} ${allargs}"/>
     2322      <arg line="${gs2.opt.args} ${static.arg} ${cross.configure.args} ${allargs}"/>
    22842323    </exec>
    22852324  </target>
Note: See TracChangeset for help on using the changeset viewer.