Changeset 28287

Show
Ignore:
Timestamp:
17.09.2013 19:02:36 (6 years ago)
Author:
ak19
Message:

Race condition in generating wrapper.h omitted the greenstonejar array variable declaration in the file so that wrapper.cpp failed to compile. Instead of using exec tasks to echo lines into the wrapper.h file, it uses a single echo task.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/release-kits/shared/core/ant-scripts/wrap.xml

    r23526 r28287  
    9898 
    9999            <else> 
    100               <exec executable="/usr/bin/objcopy" dir="wrapped-installer"> 
     100              <exec executable="/usr/bin/objcopy" dir="wrapped-installer" failonerror="true"> 
    101101                <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_greenstone_jar_start=greenstonejar --readonly-text greenstone.jar greenstone.jar.o"/> 
    102102              </exec> 
    103               <exec executable="/usr/bin/objcopy" dir="wrapped-installer"> 
     103              <exec executable="/usr/bin/objcopy" dir="wrapped-installer" failonerror="true"> 
    104104                <arg line="-I binary -O elf32-i386 -B i386 --redefine-sym _binary_${linux-java.installer}_start=java --readonly-text ${linux-java.installer} java.o"/> 
    105105              </exec> 
     
    122122            <!-- creating wrapper header file --> 
    123123            <delete file="wrapper.h"/> 
    124             <exec executable="echo" output="wrapped-installer/wrapper.h"><arg line="extern const char greenstonejar[${greenstone.jar.size}];"/></exec> 
    125             <exec executable="echo" output="wrapped-installer/wrapper.h" append="true"><arg line="extern const char java[${java.size}];"/></exec> 
    126             <exec executable="echo" output="wrapped-installer/wrapper.h" append="true"><arg line="#define java_is_bundled yes"/></exec> 
     124            <!-- ensure no tabs/whitespaces in front of each line in the .h file owing to indentation here --> 
     125            <echo file="wrapped-installer/wrapper.h">extern const char greenstonejar[${greenstone.jar.size}]; 
     126extern const char java[${java.size}]; 
     127#define java_is_bundled yes 
     128</echo> 
    127129 
    128130            <!-- compile the wrapper program --> 
    129             <exec executable="g++" dir="wrapped-installer"> 
     131            <exec executable="g++" dir="wrapped-installer" failonerror="true"> 
    130132                <arg line="-Wall -static -static-libgcc -c -o wrapper.o wrapper.cpp"/> 
    131133            </exec>