Merge branch 'sigar-1.6'

This commit is contained in:
Doug MacEachern 2010-04-09 09:01:27 -07:00
commit 7c94ba7164
2 changed files with 15 additions and 9 deletions

View File

@ -54,15 +54,6 @@ USA.
<condition property="jni.javahome" value="${env.JAVA_HOME}">
<isset property="env.JAVA_HOME"/>
</condition>
<condition property="jni.javahome" value="${java.home}">
<not>
<isset property="jni.javahome"/>
</not>
</condition>
<echo>java.home=${jni.javahome}</echo>
<checksum file="${jni.javahome}/include/jni.h" property="jni.md5"/>
<condition property="linux">
<equals arg1="${os.name}" arg2="Linux"/>
@ -180,6 +171,10 @@ USA.
<libarch/>
<echo>java.home=${jni.javahome}</echo>
<checksum file="${jni.javahome}/include/jni.h" property="jni.md5"/>
<property name="jni.project.archname"
value="${project.name}-${jni.libarch}"/>

View File

@ -138,6 +138,17 @@ public class ArchNameTask extends Task {
}
}
getProject().setProperty("jni.scmrev", getSourceRevision());
//jni.javahome required to find include/jni.h
String home = getProject().getProperty("jni.javahome");
if (home == null) {
home = System.getProperty("java.home");
}
File dir = new File(home);
if (!new File(dir, "include").exists()) {
dir = dir.getParentFile(); //was /jre
}
getProject().setProperty("jni.javahome", dir.getPath());
}
//XXX source rev stuff should be in another task