Wed, 29 May 2013 14:01:04 +0200
8013489: New build system does not run codesign on SA-related launchers on OS X
Reviewed-by: sla, tbell
1.1 --- a/common/autoconf/basics.m4 Wed May 29 13:58:40 2013 +0200 1.2 +++ b/common/autoconf/basics.m4 Wed May 29 14:01:04 2013 +0200 1.3 @@ -617,6 +617,20 @@ 1.4 1.5 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then 1.6 BASIC_REQUIRE_PROG(XATTR, xattr) 1.7 + AC_PATH_PROG(CODESIGN, codesign) 1.8 + if test "x$CODESIGN" != "x"; then 1.9 + # Verify that the openjdk_codesign certificate is present 1.10 + AC_MSG_CHECKING([if openjdk_codesign certificate is present]) 1.11 + rm -f codesign-testfile 1.12 + touch codesign-testfile 1.13 + codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN= 1.14 + rm -f codesign-testfile 1.15 + if test "x$CODESIGN" = x; then 1.16 + AC_MSG_RESULT([no]) 1.17 + else 1.18 + AC_MSG_RESULT([yes]) 1.19 + fi 1.20 + fi 1.21 fi 1.22 ]) 1.23
2.1 --- a/common/autoconf/generated-configure.sh Wed May 29 13:58:40 2013 +0200 2.2 +++ b/common/autoconf/generated-configure.sh Wed May 29 14:01:04 2013 +0200 2.3 @@ -797,6 +797,7 @@ 2.4 OS_VERSION_MINOR 2.5 OS_VERSION_MAJOR 2.6 PKG_CONFIG 2.7 +CODESIGN 2.8 XATTR 2.9 TIME 2.10 STAT 2.11 @@ -3780,7 +3781,7 @@ 2.12 #CUSTOM_AUTOCONF_INCLUDE 2.13 2.14 # Do not change or remove the following line, it is needed for consistency checks: 2.15 -DATE_WHEN_GENERATED=1369828684 2.16 +DATE_WHEN_GENERATED=1369828849 2.17 2.18 ############################################################################### 2.19 # 2.20 @@ -10493,6 +10494,62 @@ 2.21 fi 2.22 2.23 2.24 + # Extract the first word of "codesign", so it can be a program name with args. 2.25 +set dummy codesign; ac_word=$2 2.26 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 2.27 +$as_echo_n "checking for $ac_word... " >&6; } 2.28 +if test "${ac_cv_path_CODESIGN+set}" = set; then : 2.29 + $as_echo_n "(cached) " >&6 2.30 +else 2.31 + case $CODESIGN in 2.32 + [\\/]* | ?:[\\/]*) 2.33 + ac_cv_path_CODESIGN="$CODESIGN" # Let the user override the test with a path. 2.34 + ;; 2.35 + *) 2.36 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2.37 +for as_dir in $PATH 2.38 +do 2.39 + IFS=$as_save_IFS 2.40 + test -z "$as_dir" && as_dir=. 2.41 + for ac_exec_ext in '' $ac_executable_extensions; do 2.42 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then 2.43 + ac_cv_path_CODESIGN="$as_dir/$ac_word$ac_exec_ext" 2.44 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 2.45 + break 2 2.46 + fi 2.47 +done 2.48 + done 2.49 +IFS=$as_save_IFS 2.50 + 2.51 + ;; 2.52 +esac 2.53 +fi 2.54 +CODESIGN=$ac_cv_path_CODESIGN 2.55 +if test -n "$CODESIGN"; then 2.56 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CODESIGN" >&5 2.57 +$as_echo "$CODESIGN" >&6; } 2.58 +else 2.59 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 2.60 +$as_echo "no" >&6; } 2.61 +fi 2.62 + 2.63 + 2.64 + if test "x$CODESIGN" != "x"; then 2.65 + # Verify that the openjdk_codesign certificate is present 2.66 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openjdk_codesign certificate is present" >&5 2.67 +$as_echo_n "checking if openjdk_codesign certificate is present... " >&6; } 2.68 + rm -f codesign-testfile 2.69 + touch codesign-testfile 2.70 + codesign -s openjdk_codesign codesign-testfile 2>&5 >&5 || CODESIGN= 2.71 + rm -f codesign-testfile 2.72 + if test "x$CODESIGN" = x; then 2.73 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 2.74 +$as_echo "no" >&6; } 2.75 + else 2.76 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 2.77 +$as_echo "yes" >&6; } 2.78 + fi 2.79 + fi 2.80 fi 2.81 2.82
3.1 --- a/common/autoconf/spec.gmk.in Wed May 29 13:58:40 2013 +0200 3.2 +++ b/common/autoconf/spec.gmk.in Wed May 29 14:01:04 2013 +0200 3.3 @@ -478,6 +478,7 @@ 3.4 # CD is going away, but remains to cater for legacy makefiles. 3.5 CD:=cd 3.6 CHMOD:=@CHMOD@ 3.7 +CODESIGN:=@CODESIGN@ 3.8 COMM:=@COMM@ 3.9 CP:=@CP@ 3.10 CPIO:=@CPIO@
4.1 --- a/common/makefiles/MakeBase.gmk Wed May 29 13:58:40 2013 +0200 4.2 +++ b/common/makefiles/MakeBase.gmk Wed May 29 14:01:04 2013 +0200 4.3 @@ -361,8 +361,8 @@ 4.4 4.5 # This is to be called by all SetupFoo macros 4.6 define LogSetupMacroEntry 4.7 - $(if $(26),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) 4.8 - $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25,$(if $($i),$(NEWLINE) $(strip [$i] $($i)))))) 4.9 + $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) 4.10 + $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i)))))) 4.11 endef 4.12 4.13 # Make directory without forking mkdir if not needed
5.1 --- a/common/makefiles/NativeCompilation.gmk Wed May 29 13:58:40 2013 +0200 5.2 +++ b/common/makefiles/NativeCompilation.gmk Wed May 29 14:01:04 2013 +0200 5.3 @@ -147,9 +147,9 @@ 5.4 # CC the compiler to use, default is $(CC) 5.5 # LDEXE the linker to use for linking executables, default is $(LDEXE) 5.6 # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST 5.7 - $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 5.8 - $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25)) 5.9 - $(if $(26),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) 5.10 + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) 5.11 + $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)) 5.12 + $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) 5.13 5.14 ifneq (,$$($1_BIN)) 5.15 $$(error BIN has been replaced with OBJECT_DIR) 5.16 @@ -567,6 +567,12 @@ 5.17 ifneq (,$$($1_GEN_MANIFEST)) 5.18 $(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1 5.19 endif 5.20 - 5.21 + # This only works if the openjdk_codesign identity is present on the system. Let 5.22 + # silently fail otherwise. 5.23 + ifneq (,$(CODESIGN)) 5.24 + ifneq (,$$($1_CODESIGN)) 5.25 + $(CODESIGN) -s openjdk_codesign $$@ 5.26 + endif 5.27 + endif 5.28 endif 5.29 endef