tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bootstrap.mk issues for openjdk7
Le 04/10/13 23:00, Richard PALO a écrit :
I'm quite perplexed about the following, running on solaris.
In particular, as you can see I've ensured that the java version string
is correctly generated, both sun-jre7 and sun-jdk7 are added to
PREFER_NATIVE=, even added the oracle-binary-code-license to
ACCEPTABLE_LICENSES+= and are all verified with show-var.
But for some reason when bootstrap.mk is executed it sees other than
USE_BUILTIN.sun-jdk7=yes, even though show-var sees it fine.
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
To not get bitten like with mit-krb5, I checked the buildlink3.mk
respectively (which prescribe):
BUILDLINK_ABI_DEPENDS.sun-jdk7+= sun-jdk7>=7.0.9
BUILDLINK_ABI_DEPENDS.sun-jre7+= sun-jre7>=7.0.9
So with the version fixes above, these seem fine.
I'd really like to avoid re-installing sun-jdk7 in pkgsrc, only to build
openjdk! I guess an inplace mechanism would work, but this should
definitely work. Scratching my head on this one...
Any ideas, is there an execution order problem perhaps involving
bootstrap.mk? That is perhaps the statement is being evaluated prior to
the setting of BUILTIN_PKG.sun-jdk7?
Thanks in advance for any hints/advice...
Never did figure out why the evaluation why
> .if !empty(USE_BUILTIN.sun-jdk7:M[yY][eE][sS])
would never evalutate correctly but the attached patches provide
probably a better solution after fixing some things up in sun-j*7, in
particular removing the need of ${HEAD} which didn't seem to make it
into USE_TOOLS and correcting the path for, among other things, the
header files when using the native sun jre/jdk.
I'd like any solaris devs to check this out, please, as this will avoid
a double installation sun-j*7 along with openjdk7 in pkgsrc.
diff --git a/lang/openjdk7/bootstrap.mk b/lang/openjdk7/bootstrap.mk
index dcfcb7f..0ebee35 100644
--- a/lang/openjdk7/bootstrap.mk
+++ b/lang/openjdk7/bootstrap.mk
@@ -85,9 +85,11 @@ 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*)
+BUILDLINK_DEPMETHOD.sun-jdk7?= build
+.include "../../lang/sun-jdk7/buildlink3.mk"
+#NB: sun-jdk7 includes sun-jre7/buildlink3.mk
+JDK_BOOTDIR= ${BUILDLINK_JAVA_PREFIX.sun-jre7}
MAKE_ENV+= ALT_JDK_IMPORT_PATH=${JDK_BOOTDIR}
.endif
diff --git a/lang/sun-jdk7/buildlink3.mk b/lang/sun-jdk7/buildlink3.mk
index a7db3d0..d3445bc 100644
--- a/lang/sun-jdk7/buildlink3.mk
+++ b/lang/sun-jdk7/buildlink3.mk
@@ -24,6 +24,7 @@ BUILDLINK_CPPFLAGS.sun-jdk7=
\
-I${BUILDLINK_JAVA_PREFIX.sun-jre7}/include/linux
.endif
+BUILDLINK_DEPMETHOD.sun-jre7?= ${BUILDLINK_DEPMETHOD.sun-jdk7}
.include "../../lang/sun-jre7/buildlink3.mk"
.endif # SUN_JDK7_BUILDLINK3_MK
diff --git a/lang/sun-jdk7/builtin.mk b/lang/sun-jdk7/builtin.mk
index 99a75af..df6b25e 100644
--- a/lang/sun-jdk7/builtin.mk
+++ b/lang/sun-jdk7/builtin.mk
@@ -30,8 +30,9 @@ MAKEVARS+= IS_BUILTIN.sun-jdk7
!empty(IS_BUILTIN.sun-jdk7:M[yY][eE][sS]) && \
empty(JDK7:M__nonexistent__)
-BUILTIN_VERSION.sun-jdk7!= ${JDK7} -version 2>&1 | ${HEAD} -1 | \
- ${AWK} '{print $$2}'
+BUILTIN_VERSION.sun-jdk7!= ${JDK7} -version 2>&1 | \
+ ${AWK} '{print $$2; exit}' |\
+ ${AWK} '{sub(/^1\./,"");sub(/_/,".");print $$1}'
BUILTIN_PKG.sun-jdk7= sun-jdk7-${BUILTIN_VERSION.sun-jdk7}
.endif
diff --git a/lang/sun-jre7/buildlink3.mk b/lang/sun-jre7/buildlink3.mk
index 13d7049..a970c20 100644
--- a/lang/sun-jre7/buildlink3.mk
+++ b/lang/sun-jre7/buildlink3.mk
@@ -8,7 +8,16 @@ SUN_JRE7_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.sun-jre7+= sun-jre7-[0-9]*
BUILDLINK_ABI_DEPENDS.sun-jre7+= sun-jre7>=7.0.9
BUILDLINK_PKGSRCDIR.sun-jre7?= ../../lang/sun-jre7
+
+CHECK_BUILTIN.sun-jre7:= yes
+.include "../../lang/sun-jre7/builtin.mk"
+CHECK_BUILTIN.sun-jre7:= no
+
+.if !empty(USE_BUILTIN.sun-jre7:M[yY][eE][sS])
+BUILDLINK_JAVA_PREFIX.sun-jre7= ${JAVAVM7}
+.else
BUILDLINK_JAVA_PREFIX.sun-jre7= ${PREFIX}/java/sun-7
+.endif
UNLIMIT_RESOURCES+= datasize # Must be at least 131204
.endif # SUN_JRE7_BUILDLINK3_MK
diff --git a/lang/sun-jre7/builtin.mk b/lang/sun-jre7/builtin.mk
index 94b449f..e381b9b 100644
--- a/lang/sun-jre7/builtin.mk
+++ b/lang/sun-jre7/builtin.mk
@@ -30,8 +30,9 @@ MAKEVARS+= IS_BUILTIN.sun-jre7
!empty(IS_BUILTIN.sun-jre7:M[yY][eE][sS]) && \
empty(JAVAVM7:M__nonexistent__)
-BUILTIN_VERSION.sun-jre7!= ${JAVAVM7}/bin/java -version 2>&1 | ${HEAD} -1 | \
- ${AWK} -F \" '{print $$2}' | ${AWK} -F _ '{print $$1}'
+BUILTIN_VERSION.sun-jre7!= ${JAVAVM7}/bin/java -version 2>&1 | \
+ ${AWK} -F \" '{print $$2; exit}' | \
+ ${AWK} '{sub(/^1\./,"");sub(/_/,".");print $$1}'
BUILTIN_PKG.sun-jre7= sun-jre7-${BUILTIN_VERSION.sun-jre7}
.endif
Home |
Main Index |
Thread Index |
Old Index