fix MacOSX10.6.sdk build issues

This commit is contained in:
Doug MacEachern 2009-09-08 21:50:10 -07:00
parent 315c8474d9
commit cb1f3dafe7
2 changed files with 19 additions and 5 deletions

View File

@ -25,7 +25,6 @@ USA.
<property name="jni.src.java" value="src"/>
<property name="jni.libprefix" value="java"/>
<property name="jni.libversion" value=""/>
<property name="osx.min" value="-mmacosx-version-min=10.3"/>
<property name="cpptasks.jar" location="lib/cpptasks.jar"/>
@ -357,7 +356,7 @@ USA.
<compilerarg value="${uni.sdk}"/>
<compilerarg value="-arch"/>
<compilerarg value="${uni.arch}"/>
<compilerarg value="${osx.min}"/>
<compilerarg value="-mmacosx-version-min=${osx.min}"/>
<sysincludepath location="/Developer/Headers/FlatCarbon"/>
@ -372,7 +371,7 @@ USA.
<linkerarg value="-Wl,-syslibroot,${uni.sdk}"/>
<linkerarg value="-arch"/>
<linkerarg value="${uni.arch}"/>
<linkerarg value="${osx.min}"/>
<linkerarg value="-mmacosx-version-min=${osx.min}"/>
<!-- for Gestalt() -->
<linkerarg value="-framework"/>

View File

@ -97,13 +97,28 @@ public class ArchNameTask extends Task {
});
if (sdks != null) {
Arrays.sort(sdks);
final String prop = "uni.sdk";
String prop = "uni.sdk";
String sdk = getProject().getProperty(prop);
String defaultMin = "10.3";
if (sdk == null) {
sdk = sdks[sdks.length-1].getPath();
int ix = sdks.length-1;
sdk = sdks[ix].getPath();
if ((sdk.indexOf("10.6") != -1) && (ix > 0)) {
sdk = sdks[ix-1].getPath(); //downgrade due to 64-bit ppc issues XXX
defaultMin = "10.5";
}
getProject().setProperty(prop, sdk);
}
System.out.println("Using SDK=" + sdk);
prop = "osx.min";
String min = getProject().getProperty(prop);
if (min == null) {
min = defaultMin;
getProject().setProperty(prop, min);
}
System.out.println("Using -mmacosx-version-min=" + min);
}
}
}