richard@devzone:~/src/pkgsrc/lang/openjdk7$ git diff . ../sun-jdk7/
../sun-jre7/
diff --git a/lang/openjdk7/bootstrap.mk b/lang/openjdk7/bootstrap.mk
index dcfcb7f..959d626 100644
--- a/lang/openjdk7/bootstrap.mk
+++ b/lang/openjdk7/bootstrap.mk
@@ -85,9 +85,13 @@ DISTFILES+= ${BOOT.common-20110811}
EXTRACT_ONLY+= ${BOOT.common-20110811}
.endif
-.if ${OPSYS} == "SunOS"
-BUILD_DEPENDS+= sun-jdk7-[0-9]*:../../lang/sun-jdk7
-JDK_BOOTDIR= ${PREFIX}/java/sun-7
+.if !empty(MACHINE_PLATFORM:MSunOS*)
+.include "../../lang/sun-jdk7/buildlink3.mk"
+. if !empty(USE_BUILTIN.sun-jdk7:M[yY][eE][sS])
+JDK_BOOTDIR= ${JDK7:S/\/bin\/javac//}
+. else
+JDK_BOOTDIR= ${PREFIX}/java/sun-7
+. endif
MAKE_ENV+= ALT_JDK_IMPORT_PATH=${JDK_BOOTDIR}
.endif
diff --git a/lang/sun-jdk7/builtin.mk b/lang/sun-jdk7/builtin.mk
index 99a75af..9549b14 100644
--- a/lang/sun-jdk7/builtin.mk
+++ b/lang/sun-jdk7/builtin.mk
@@ -31,7 +31,7 @@ MAKEVARS+= IS_BUILTIN.sun-jdk7
empty(JDK7:M__nonexistent__)
BUILTIN_VERSION.sun-jdk7!= ${JDK7} -version 2>&1 | ${HEAD} -1 | \
- ${AWK} '{print $$2}'
+ ${AWK} '{print $$2}' | ${AWK} '{sub(/^1\./,"");sub(/_/,".");print $$1}'
BUILTIN_PKG.sun-jdk7= sun-jdk7-${BUILTIN_VERSION.sun-jdk7}
.endif
diff --git a/lang/sun-jre7/builtin.mk b/lang/sun-jre7/builtin.mk
index 94b449f..77af3df 100644
--- a/lang/sun-jre7/builtin.mk
+++ b/lang/sun-jre7/builtin.mk
@@ -31,7 +31,7 @@ MAKEVARS+= IS_BUILTIN.sun-jre7
empty(JAVAVM7:M__nonexistent__)
BUILTIN_VERSION.sun-jre7!= ${JAVAVM7}/bin/java -version 2>&1 | ${HEAD} -1 | \
- ${AWK} -F \" '{print $$2}' | ${AWK} -F _ '{print $$1}'
+ ${AWK} -F \" '{print $$2}' | ${AWK} '{sub(/^1\./,"");sub(/_/,".");print
$$1}'
BUILTIN_PKG.sun-jre7= sun-jre7-${BUILTIN_VERSION.sun-jre7}
.endif
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var
VARNAME=USE_BUILTIN.sun-jdk7
yes
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var
VARNAME=USE_BUILTIN.sun-jre7
yes
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var
VARNAME=BUILTIN_VERSION.sun-jdk7
7.0.40
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var
VARNAME=BUILTIN_VERSION.sun-jre7
7.0.40
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var
VARNAME=BUILTIN_PKG.sun-jdk7
sun-jdk7-7.0.40
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var
VARNAME=BUILTIN_PKG.sun-jre7
sun-jre7-7.0.40
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var VARNAME=JDK7
/usr/jdk/instances/jdk1.7.0/bin/javac
richard@devzone:~/src/pkgsrc/lang/openjdk7$ bmake show-var VARNAME=JDK_BOOTDIR
/opt/local/java/sun-7