# HG changeset patch # User ohair # Date 1351286997 25200 # Node ID 2a82ecb35fc7b4d731cf8c1562076217b06df7be # Parent 8d9d430b4244b95f5cf1ebe719f834a1ac5d6cd5 8000992: Update new build-infra makefiles Summary: Build-infra project integration. Multiple authors on this work: erikj and ihse primarily, also changes from ohair, tbell, and dholmes. Special credit to ohstrom for his smartjavac work. Reviewed-by: erikj, ihse, dholmes, tbell diff -r 8d9d430b4244 -r 2a82ecb35fc7 NewMakefile.gmk --- a/NewMakefile.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/NewMakefile.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -31,8 +31,9 @@ CP=cp ECHO=echo MKDIR=mkdir +PRINTF=printf PWD=pwd -SH=sh +TAR=tar ifeq ($(PLATFORM),windows) ZIP=zip else @@ -63,9 +64,47 @@ $(ECHO) "ERROR: No configurations to build"; exit 1; \ fi @for bdir in $(dir $(ALL_MAKEFILES)) ; do \ - $(ECHO) "$(CD) $${bdir} && $(MAKE) $(EXTRA_MAKE_ARGS) $@" ; \ - $(CD) $${bdir} && $(MAKE) $(EXTRA_MAKE_ARGS) $@ ; \ + $(ECHO) "$(CD) $${bdir} && $(MAKE) $@" ; \ + $(CD) $${bdir} && $(MAKE) $@ ; \ + done + +# TBD: Deploy input +$(BUILD_DIR_ROOT)/.deploy_input: + @if [ "$(ALL_MAKEFILES)" = "" ] ; then \ + $(ECHO) "ERROR: No configurations to build"; exit 1; \ + fi + @for bdir in $(dir $(ALL_MAKEFILES)) ; do \ + if [ deploy/make/Makefile ] ; then \ + echo "Attempting deploy build." ; \ + ( \ + $(RM) -r $${bdir}/deploy_input ; \ + $(MKDIR) -p $${bdir}/deploy_input ; \ + ( $(CD) $${bdir}/images && $(TAR) -cf - j2sdk-image j2re-image ) \ + | ( $(CD) $${bdir}/deploy_input && $(TAR) -xf - ) ; \ + ) ; \ + fi; \ done + touch $@ + +# TBD: Deploy images +deploy: $(BUILD_DIR_ROOT)/.deploy_input + @if [ "$(ALL_MAKEFILES)" = "" ] ; then \ + $(ECHO) "ERROR: No configurations to build"; exit 1; \ + fi + @for bdir in $(dir $(ALL_MAKEFILES)) ; do \ + if [ deploy/make/Makefile ] ; then \ + echo "Attempting deploy build." ; \ + ( \ + $(CD) deploy/make && \ + $(MAKE) \ + ABS_OUTPUTDIR=$${bdir}/deploy_input \ + OUTPUTDIR=$${bdir}/deploy_input \ + ) ; \ + fi; \ + done + +# TBD: Install bundles +install: # Bundle creation bundles: @@ -91,8 +130,8 @@ checks: @$(ECHO) "No checks yet" -# Keep track of phony targets -PHONY_LIST += all images clean clobber checks +# Keep track of user targets +USER_TARGETS += all deploy install images clean clobber checks ########################################################################### # To help in adoption of the new configure&&make build process, a bridge @@ -102,32 +141,18 @@ bridgeBuild: bridge2configure images # Bridge from old Makefile ALT settings to configure options -bridge2configure: .bridge2configureOpts - $(CD) common/makefiles && sh ../autoconf/configure $(strip $(shell $(CAT) $<)) +bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts + bash ./configure $(strip $(shell $(CAT) $<)) # Create a file with configure options created from old Makefile mechanisms. -.bridge2configureOpts: .bridge2configureOptsLatest +$(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest $(RM) $@ $(CP) $< $@ -# In case make was invoked from a specific path -_MAKE_COMMAND_PATH:=$(firstword $(MAKE)) -ifneq ($(dir $(_MAKE_COMMAND_PATH)),./) - # This could be removed someday if JPRT was fixed and we could assume that - # the path to make was always in PATH. - MAKE_BINDIR:=$(call UnixPath,$(dir $(_MAKE_COMMAND_PATH))) - NEWPATH:=$(MAKE_BINDIR):${PATH} - PATH:=$(NEWPATH) - export PATH - MAKE_COMMAND=$(MAKE_BINDIR)/$(notdir $(_MAKE_COMMAND_PATH)) -else - MAKE_COMMAND=$(_MAKE_COMMAND_PATH) -endif - # Use this file to only change when obvious things have changed -.bridge2configureOptsLatest: FRC +$(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC $(RM) $@.tmp - @$(ECHO) " MAKE=$(MAKE_COMMAND) " >> $@.tmp + $(MKDIR) -p $(BUILD_DIR_ROOT) @$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp ifdef ARCH_DATA_MODEL @$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp @@ -156,20 +181,30 @@ # Clobber all the built files clobber:: bridge2clobber bridge2clobber:: - $(RM) .bridge2* + $(RM) $(BUILD_DIR_ROOT)/.bridge2* + $(RM) $(BUILD_DIR_ROOT)/.deploy_input # Keep track of phony targets PHONY_LIST += bridge2configure bridgeBuild bridge2clobber ########################################################################### +# Sanity checks (history target) +# + +sanity: checks + +# Keep track of user targets +USER_TARGETS += sanity + +########################################################################### # Javadocs # javadocs: cd common/makefiles && $(MAKE) -f MakefileJavadoc.gmk -# Keep track of phony targets -PHONY_LIST += javadocs +# Keep track of user targets +USER_TARGETS += javadocs ########################################################################### # JPRT targets @@ -190,7 +225,6 @@ jprt_build_debug: BUILD_DIRNAME=*-debug jprt_build_debug: jprt_build_generic -jprt_build_generic: EXTRA_MAKE_ARGS=LOG=nofile,info jprt_build_generic: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_BUNDLE): bridgeBuild bundles @@ -203,9 +237,59 @@ jprt_build_generic ########################################################################### +# Help target + +HELP_FORMAT=%12s%s\n + +help: + @$(PRINTF) "# JDK Makefile\n" + @$(PRINTF) "#\n" + @$(PRINTF) "# Usage: make [Target]\n" + @$(PRINTF) "#\n" + @$(PRINTF) "# $(HELP_FORMAT)" "Target " "Description" + @$(PRINTF) "# $(HELP_FORMAT)" "------ " "-----------" + @for i in $(USER_TARGETS) ; do \ + $(MAKE) help_$${i} ; \ + done + @$(PRINTF) "#\n" + +help_all: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Build the entire jdk but not the images" +help_images: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Create the jdk images for the builds" +help_deploy: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Create the jdk deploy images from the jdk images" +help_install: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Create the jdk install bundles from the deploy images" +help_clean: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Clean and prepare for a fresh build from scratch" +help_clobber: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Clean and also purge any hidden derived data" +help_checks: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Perform various checks to make sure we can build" +help_sanity: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Same as 'make checks'" +help_javadocs: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Build the javadocs" +help_help: + @$(PRINTF) "# $(HELP_FORMAT)" "$(subst help_,,$@) - " \ + "Print out the help messages" + +# Keep track of user targets +USER_TARGETS += help + +########################################################################### # Phony targets -.PHONY: $(PHONY_LIST) +.PHONY: $(PHONY_LIST) $(USER_TARGETS) # Force target FRC: - diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/autogen.sh --- a/common/autoconf/autogen.sh Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/autogen.sh Fri Oct 26 14:29:57 2012 -0700 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,14 +29,11 @@ # date +%s is not available on Solaris, use this workaround # from http://solarisjedi.blogspot.co.uk/2006/06/solaris-date-command-and-epoch-time.html TIMESTAMP=`/usr/bin/truss /usr/bin/date 2>&1 | nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}'` - # On Solaris /bin/sh doesn't support test -e but /usr/bin/test does. - TEST=`which test` else TIMESTAMP=`date +%s` - TEST="test" fi -if $TEST "$CUSTOM_CONFIG_DIR" = ""; then +if test "x$CUSTOM_CONFIG_DIR" = "x"; then custom_script_dir="$script_dir/../../jdk/make/closed/autoconf" else custom_script_dir=$CUSTOM_CONFIG_DIR @@ -44,16 +41,22 @@ custom_hook=$custom_script_dir/custom-hook.m4 +if test "x`which autoconf 2> /dev/null`" = x; then + echo You need autoconf installed to be able to regenerate the configure script + echo Error: Cannot find autoconf 1>&2 + exit 1 +fi + echo Generating generated-configure.sh cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh rm -rf autom4te.cache -if $TEST -e $custom_hook; then +if test -e $custom_hook; then echo Generating custom generated-configure.sh # We have custom sources available; also generate configure script # with custom hooks compiled in. cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \ - sed -e "s|AC_DEFUN_ONCE(\[CUSTOM_HOOK\])|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh + sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh rm -rf autom4te.cache else echo No custom hook found: $custom_hook diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/basics.m4 --- a/common/autoconf/basics.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/basics.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -34,84 +34,102 @@ fi ]) -AC_DEFUN([SET_FULL_PATH], +# This will make sure the given variable points to a full and proper +# path. This means: +# 1) There will be no spaces in the path. On posix platforms, +# spaces in the path will result in an error. On Windows, +# the path will be rewritten using short-style to be space-free. +# 2) The path will be absolute, and it will be in unix-style (on +# cygwin). +# $1: The name of the variable to fix +AC_DEFUN([BASIC_FIXUP_PATH], [ - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="[$]$1" - car="${tmp%% *}" - tmp="[$]$1 EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - SET_FULL_PATH_SPACESAFE(car) - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + BASIC_FIXUP_PATH_CYGWIN($1) + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + BASIC_FIXUP_PATH_MSYS($1) + else + # We're on a posix platform. Hooray! :) + path="[$]$1" + + if test ! -f "$path" && test ! -d "$path"; then + AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.]) fi - if test "x$cdr" != xEOL; then - $1="$car ${cdr% *}" - else - $1="$car" + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.]) + AC_MSG_ERROR([Spaces are not allowed in this path.]) fi + fi ]) -AC_DEFUN([SPACESAFE], +# This will make sure the given variable points to a executable +# with a full and proper path. This means: +# 1) There will be no spaces in the path. On posix platforms, +# spaces in the path will result in an error. On Windows, +# the path will be rewritten using short-style to be space-free. +# 2) The path will be absolute, and it will be in unix-style (on +# cygwin). +# Any arguments given to the executable is preserved. +# If the input variable does not have a directory specification, then +# it need to be in the PATH. +# $1: The name of the variable to fix +AC_DEFUN([BASIC_FIXUP_EXECUTABLE], [ - # Fail with message $2 if var $1 contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "[$]$1" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - $1=`$CYGPATH -s -m -a "[$]$1"` - # Now it's case insensitive; let's make it lowercase to improve readability - $1=`$ECHO "[$]$1" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - $1=`$CYGPATH -u "[$]$1"` - else - AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"]) + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + BASIC_FIXUP_EXECUTABLE_CYGWIN($1) + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + BASIC_FIXUP_EXECUTABLE_MSYS($1) + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="[$]$1" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + AC_MSG_NOTICE([Resolving $1 (as $path) with 'which' failed, using $path directly.]) + new_path="$path" + else + AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.]) fi + AC_MSG_ERROR([Cannot locate the the path of $1]) + fi fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + $1="$new_complete" + AC_MSG_NOTICE([Rewriting $1 to "$new_complete"]) + fi ]) -AC_DEFUN([SET_FULL_PATH_SPACESAFE], -[ - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="[$]$1" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "[$]$1"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - $1="$tmp" -]) - -AC_DEFUN([REMOVE_SYMBOLIC_LINKS], +AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS], [ if test "x$OPENJDK_BUILD_OS" != xwindows; then # Follow a chain of symbolic links. Use readlink # where it exists, else fall back to horribly # complicated shell code. - AC_PATH_PROG(READLINK, readlink) if test "x$READLINK_TESTED" != yes; then # On MacOSX there is a readlink tool with a different # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --help 2>&1 | grep GNU` + ISGNU=`$READLINK --help 2>&1 | $GREP GNU` if test "x$ISGNU" = x; then # A readlink that we do not know how to use. # Are there other non-GNU readlinks out there? @@ -125,23 +143,25 @@ else STARTDIR=$PWD COUNTER=0 - DIR=`dirname [$]$1` - FIL=`basename [$]$1` + DIR=`$DIRNAME [$]$1` + FILE=`$BASENAME [$]$1` while test $COUNTER -lt 20; do - ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'` + ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` if test "x$ISLINK" == x; then # This is not a symbolic link! We are done! break fi # The link might be relative! We have to use cd to travel safely. cd $DIR - cd `dirname $ISLINK` - DIR=`pwd` - FIL=`basename $ISLINK` + # ... and we must get the to the absolute path, not one using symbolic links. + cd `pwd -P` + cd `$DIRNAME $ISLINK` + DIR=`$THEPWDCMD` + FILE=`$BASENAME $ISLINK` let COUNTER=COUNTER+1 done cd $STARTDIR - $1=$DIR/$FIL + $1=$DIR/$FILE fi fi ]) @@ -152,6 +172,107 @@ AC_SUBST(CONFIGURE_COMMAND_LINE) DATE_WHEN_CONFIGURED=`LANG=C date` AC_SUBST(DATE_WHEN_CONFIGURED) +AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.]) +AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.]) +]) + +# Test that variable $1 denoting a program is not empty. If empty, exit with an error. +# $1: variable to check +# $2: executable name to print in warning (optional) +AC_DEFUN([BASIC_CHECK_NONEMPTY], +[ + if test "x[$]$1" = x; then + if test "x$2" = x; then + PROG_NAME=translit($1,A-Z,a-z) + else + PROG_NAME=$2 + fi + AC_MSG_NOTICE([Could not find $PROG_NAME!]) + AC_MSG_ERROR([Cannot continue]) + fi +]) + +# Does AC_PATH_PROG followed by BASIC_CHECK_NONEMPTY. +# Arguments as AC_PATH_PROG: +# $1: variable to set +# $2: executable name to look for +AC_DEFUN([BASIC_REQUIRE_PROG], +[ + AC_PATH_PROGS($1, $2) + BASIC_CHECK_NONEMPTY($1, $2) +]) + +# Setup the most fundamental tools that relies on not much else to set up, +# but is used by much of the early bootstrap code. +AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], +[ + +# Start with tools that do not need have cross compilation support +# and can be expected to be found in the default PATH. These tools are +# used by configure. Nor are these tools expected to be found in the +# devkit from the builddeps server either, since they are +# needed to download the devkit. + +# First are all the simple required tools. +BASIC_REQUIRE_PROG(BASENAME, basename) +BASIC_REQUIRE_PROG(BASH, bash) +BASIC_REQUIRE_PROG(CAT, cat) +BASIC_REQUIRE_PROG(CHMOD, chmod) +BASIC_REQUIRE_PROG(CMP, cmp) +BASIC_REQUIRE_PROG(CP, cp) +BASIC_REQUIRE_PROG(CUT, cut) +BASIC_REQUIRE_PROG(DATE, date) +BASIC_REQUIRE_PROG(DIFF, [gdiff diff]) +BASIC_REQUIRE_PROG(DIRNAME, dirname) +BASIC_REQUIRE_PROG(ECHO, echo) +BASIC_REQUIRE_PROG(EXPR, expr) +BASIC_REQUIRE_PROG(FILE, file) +BASIC_REQUIRE_PROG(FIND, find) +BASIC_REQUIRE_PROG(HEAD, head) +BASIC_REQUIRE_PROG(LN, ln) +BASIC_REQUIRE_PROG(LS, ls) +BASIC_REQUIRE_PROG(MKDIR, mkdir) +BASIC_REQUIRE_PROG(MKTEMP, mktemp) +BASIC_REQUIRE_PROG(MV, mv) +BASIC_REQUIRE_PROG(PRINTF, printf) +BASIC_REQUIRE_PROG(THEPWDCMD, pwd) +BASIC_REQUIRE_PROG(RM, rm) +BASIC_REQUIRE_PROG(SH, sh) +BASIC_REQUIRE_PROG(SORT, sort) +BASIC_REQUIRE_PROG(TAIL, tail) +BASIC_REQUIRE_PROG(TAR, tar) +BASIC_REQUIRE_PROG(TEE, tee) +BASIC_REQUIRE_PROG(TOUCH, touch) +BASIC_REQUIRE_PROG(TR, tr) +BASIC_REQUIRE_PROG(UNAME, uname) +BASIC_REQUIRE_PROG(UNIQ, uniq) +BASIC_REQUIRE_PROG(WC, wc) +BASIC_REQUIRE_PROG(WHICH, which) +BASIC_REQUIRE_PROG(XARGS, xargs) + +# Then required tools that require some special treatment. +AC_PROG_AWK +BASIC_CHECK_NONEMPTY(AWK) +AC_PROG_GREP +BASIC_CHECK_NONEMPTY(GREP) +AC_PROG_EGREP +BASIC_CHECK_NONEMPTY(EGREP) +AC_PROG_FGREP +BASIC_CHECK_NONEMPTY(FGREP) +AC_PROG_SED +BASIC_CHECK_NONEMPTY(SED) + +AC_PATH_PROGS(NAWK, [nawk gawk awk]) +BASIC_CHECK_NONEMPTY(NAWK) + +# Always force rm. +RM="$RM -f" + +# These are not required on all platforms +AC_PATH_PROG(CYGPATH, cygpath) +AC_PATH_PROG(READLINK, readlink) +AC_PATH_PROG(DF, df) +AC_PATH_PROG(SETFILE, SetFile) ]) # Setup basic configuration paths, and platform-specific stuff related to PATHs. @@ -159,46 +280,37 @@ [ # Locate the directory of this script. SCRIPT="[$]0" -REMOVE_SYMBOLIC_LINKS(SCRIPT) -AUTOCONF_DIR=`dirname [$]0` +BASIC_REMOVE_SYMBOLIC_LINKS(SCRIPT) +AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD` # Where is the source? It is located two levels above the configure script. CURDIR="$PWD" cd "$AUTOCONF_DIR/../.." SRC_ROOT="`pwd`" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - SRC_ROOT_LENGTH=`pwd|wc -m` - if test $SRC_ROOT_LENGTH -gt 100; then - AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported]) - fi + +if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + PATH_SEP=";" + BASIC_CHECK_PATHS_WINDOWS +else + PATH_SEP=":" fi + AC_SUBST(SRC_ROOT) +AC_SUBST(PATH_SEP) cd "$CURDIR" -SPACESAFE(SRC_ROOT,[the path to the source root]) -SPACESAFE(CURDIR,[the path to the current directory]) +BASIC_FIXUP_PATH(SRC_ROOT) +BASIC_FIXUP_PATH(CURDIR) if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then # Add extra search paths on solaris for utilities like ar and as etc... PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" fi -# For cygwin we need cygpath first, since it is used everywhere. -AC_PATH_PROG(CYGPATH, cygpath) -PATH_SEP=":" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$CYGPATH" = x; then - AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) - fi - PATH_SEP=";" -fi -AC_SUBST(PATH_SEP) - # You can force the sys-root if the sys-root encoded into the cross compiler tools # is not correct. AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root], - [pass this sys-root to the compilers and linker (useful if the sys-root encoded in - the cross compiler tools is incorrect)])]) + [pass this sys-root to the compilers and tools (for cross-compiling)])]) if test "x$with_sys_root" != x; then SYS_ROOT=$with_sys_root @@ -208,7 +320,7 @@ AC_SUBST(SYS_ROOT) AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir], - [search this directory for (cross-compiling) compilers and tools])], [TOOLS_DIR=$with_tools_dir]) + [search this directory for compilers and tools (for cross-compiling)])], [TOOLS_DIR=$with_tools_dir]) AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], [use this directory as base for tools-dir and sys-root (for cross-compiling)])], @@ -228,8 +340,9 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR], [ +AC_MSG_CHECKING([what configuration name to use]) AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name], - [use this as the name of the configuration, overriding the generated default])], + [use this as the name of the configuration @<:@generated from important configuration options@:>@])], [ CONF_NAME=${with_conf_name} ]) # Test from where we are running configure, in or outside of src root. @@ -240,7 +353,7 @@ CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" fi OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" - mkdir -p "$OUTPUT_ROOT" + $MKDIR -p "$OUTPUT_ROOT" if test ! -d "$OUTPUT_ROOT"; then AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT]) fi @@ -254,8 +367,9 @@ fi OUTPUT_ROOT="$CURDIR" fi +AC_MSG_RESULT([$CONF_NAME]) -SPACESAFE(OUTPUT_ROOT,[the path to the output root]) +BASIC_FIXUP_PATH(OUTPUT_ROOT) AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk) AC_SUBST(CONF_NAME, $CONF_NAME) @@ -287,7 +401,7 @@ # Setup default logging of stdout and stderr to build.log in the output root. BUILD_LOG='$(OUTPUT_ROOT)/build.log' BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' -BUILD_LOG_WRAPPER='$(SH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' +BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' AC_SUBST(BUILD_LOG) AC_SUBST(BUILD_LOG_PREVIOUS) AC_SUBST(BUILD_LOG_WRAPPER) @@ -305,7 +419,6 @@ DESCRIPTION="$2" if test "x$MAKE_CANDIDATE" != x; then AC_MSG_NOTICE([Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION]) - SET_FULL_PATH(MAKE_CANDIDATE) MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` if test "x$IS_GNU_MAKE" = x; then @@ -314,8 +427,27 @@ IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[[12346789]]'` if test "x$IS_MODERN_MAKE" = x; then AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.]) - else - FOUND_MAKE=$MAKE_CANDIDATE + else + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + MAKE_EXPECTED_ENV='cygwin' + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + MAKE_EXPECTED_ENV='msys' + else + AC_MSG_ERROR([Unknown Windows environment]) + fi + MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` + IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` + else + # Not relevant for non-Windows + IS_MAKE_CORRECT_ENV=true + fi + if test "x$IS_MAKE_CORRECT_ENV" = x; then + AC_MSG_NOTICE([Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring.]) + else + FOUND_MAKE=$MAKE_CANDIDATE + BASIC_FIXUP_EXECUTABLE(FOUND_MAKE) + fi fi fi fi @@ -330,7 +462,7 @@ if test ! -f "$MAKE"; then AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not found.]) fi - BASIC_CHECK_MAKE_VERSION("$MAKE", [user supplied MAKE=]) + BASIC_CHECK_MAKE_VERSION("$MAKE", [user supplied MAKE=$MAKE]) if test "x$FOUND_MAKE" = x; then AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer.]) fi @@ -375,7 +507,7 @@ AC_MSG_CHECKING([if find supports -delete]) FIND_DELETE="-delete" - DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) + DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete @@ -389,102 +521,22 @@ AC_MSG_RESULT([yes]) fi rmdir $DELETEDIR -]) - -# Test that variable $1 denoting a program is not empty. If empty, exit with an error. -# $1: variable to check -# $2: executable name to print in warning (optional) -AC_DEFUN([CHECK_NONEMPTY], -[ - if test "x[$]$1" = x; then - if test "x$2" = x; then - PROG_NAME=translit($1,A-Z,a-z) - else - PROG_NAME=$2 - fi - AC_MSG_NOTICE([Could not find $PROG_NAME!]) - AC_MSG_ERROR([Cannot continue]) - fi -]) - -# Does AC_PATH_PROG followed by CHECK_NONEMPTY. -# Arguments as AC_PATH_PROG: -# $1: variable to set -# $2: executable name to look for -AC_DEFUN([BASIC_REQUIRE_PROG], -[ - AC_PATH_PROGS($1, $2) - CHECK_NONEMPTY($1, $2) + AC_SUBST(FIND_DELETE) ]) -AC_DEFUN_ONCE([BASIC_SETUP_TOOLS], +AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], [ -# Start with tools that do not need have cross compilation support -# and can be expected to be found in the default PATH. These tools are -# used by configure. Nor are these tools expected to be found in the -# devkit from the builddeps server either, since they are -# needed to download the devkit. - -# First are all the simple required tools. -BASIC_REQUIRE_PROG(BASENAME, basename) -BASIC_REQUIRE_PROG(CAT, cat) -BASIC_REQUIRE_PROG(CHMOD, chmod) -BASIC_REQUIRE_PROG(CMP, cmp) -BASIC_REQUIRE_PROG(CP, cp) -BASIC_REQUIRE_PROG(CPIO, cpio) -BASIC_REQUIRE_PROG(CUT, cut) -BASIC_REQUIRE_PROG(DATE, date) -BASIC_REQUIRE_PROG(DF, df) -BASIC_REQUIRE_PROG(DIFF, [gdiff diff]) -BASIC_REQUIRE_PROG(ECHO, echo) -BASIC_REQUIRE_PROG(EXPR, expr) -BASIC_REQUIRE_PROG(FILE, file) -BASIC_REQUIRE_PROG(FIND, find) -BASIC_REQUIRE_PROG(HEAD, head) -BASIC_REQUIRE_PROG(LN, ln) -BASIC_REQUIRE_PROG(LS, ls) -BASIC_REQUIRE_PROG(MKDIR, mkdir) -BASIC_REQUIRE_PROG(MV, mv) -BASIC_REQUIRE_PROG(PRINTF, printf) -BASIC_REQUIRE_PROG(SH, sh) -BASIC_REQUIRE_PROG(SORT, sort) -BASIC_REQUIRE_PROG(TAIL, tail) -BASIC_REQUIRE_PROG(TAR, tar) -BASIC_REQUIRE_PROG(TEE, tee) -BASIC_REQUIRE_PROG(TOUCH, touch) -BASIC_REQUIRE_PROG(TR, tr) -BASIC_REQUIRE_PROG(UNIQ, uniq) -BASIC_REQUIRE_PROG(UNZIP, unzip) -BASIC_REQUIRE_PROG(WC, wc) -BASIC_REQUIRE_PROG(XARGS, xargs) -BASIC_REQUIRE_PROG(ZIP, zip) - -# Then required tools that require some special treatment. -AC_PROG_AWK -CHECK_NONEMPTY(AWK) -AC_PROG_GREP -CHECK_NONEMPTY(GREP) -AC_PROG_EGREP -CHECK_NONEMPTY(EGREP) -AC_PROG_FGREP -CHECK_NONEMPTY(FGREP) -AC_PROG_SED -CHECK_NONEMPTY(SED) - -AC_PATH_PROGS(NAWK, [nawk gawk awk]) -CHECK_NONEMPTY(NAWK) - BASIC_CHECK_GNU_MAKE -BASIC_REQUIRE_PROG(RM, rm) -RM="$RM -f" +BASIC_CHECK_FIND_DELETE -BASIC_CHECK_FIND_DELETE -AC_SUBST(FIND_DELETE) +# These tools might not be installed by default, +# need hint on how to install them. +BASIC_REQUIRE_PROG(UNZIP, unzip) +BASIC_REQUIRE_PROG(ZIP, zip) # Non-required basic tools -AC_PATH_PROG(THEPWDCMD, pwd) AC_PATH_PROG(LDD, ldd) if test "x$LDD" = "x"; then # List shared lib dependencies is used for @@ -497,52 +549,17 @@ OTOOL="true" fi AC_PATH_PROGS(READELF, [readelf greadelf]) -AC_PATH_PROGS(OBJDUMP, [objdump gobjdump]) AC_PATH_PROG(HG, hg) +AC_PATH_PROG(STAT, stat) +AC_PATH_PROG(TIME, time) + +if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + BASIC_REQUIRE_PROG(COMM, comm) +fi ]) -AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE], -[ -# When using cygwin, we need a wrapper binary that renames -# /cygdrive/c/ arguments into c:/ arguments and peeks into -# @files and rewrites these too! This wrapper binary is -# called uncygdrive.exe. -UNCYGDRIVE= -if test "x$OPENJDK_BUILD_OS" = xwindows; then - AC_MSG_CHECKING([if uncygdrive can be created]) - UNCYGDRIVE_SRC=`$CYGPATH -m $SRC_ROOT/common/src/uncygdrive.c` - rm -f $OUTPUT_ROOT/uncygdrive* - UNCYGDRIVE=`$CYGPATH -m $OUTPUT_ROOT/uncygdrive.exe` - cd $OUTPUT_ROOT - $CC $UNCYGDRIVE_SRC /Fe$UNCYGDRIVE > $OUTPUT_ROOT/uncygdrive1.log 2>&1 - cd $CURDIR - - if test ! -x $OUTPUT_ROOT/uncygdrive.exe; then - AC_MSG_RESULT([no]) - cat $OUTPUT_ROOT/uncygdrive1.log - AC_MSG_ERROR([Could not create $OUTPUT_ROOT/uncygdrive.exe]) - fi - AC_MSG_RESULT([$UNCYGDRIVE]) - AC_MSG_CHECKING([if uncygdrive.exe works]) - cd $OUTPUT_ROOT - $UNCYGDRIVE $CC $SRC_ROOT/common/src/uncygdrive.c /Fe$OUTPUT_ROOT/uncygdrive2.exe > $OUTPUT_ROOT/uncygdrive2.log 2>&1 - cd $CURDIR - if test ! -x $OUTPUT_ROOT/uncygdrive2.exe; then - AC_MSG_RESULT([no]) - cat $OUTPUT_ROOT/uncygdrive2.log - AC_MSG_ERROR([Uncygdrive did not work!]) - fi - AC_MSG_RESULT([yes]) - rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj - # The path to uncygdrive to use should be Unix-style - UNCYGDRIVE="$OUTPUT_ROOT/uncygdrive.exe" -fi - -AC_SUBST(UNCYGDRIVE) -]) - - -# Check if build directory is on local disk. +# Check if build directory is on local disk. If not possible to determine, +# we prefer to claim it's local. # Argument 1: directory to test # Argument 2: what to do if it is on local disk # Argument 3: what to do otherwise (remote disk or failure) @@ -550,11 +567,26 @@ [ # df -l lists only local disks; if the given directory is not found then # a non-zero exit code is given - if $DF -l $1 > /dev/null 2>&1; then - $2 - else - $3 - fi + if test "x$DF" = x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # msys does not have df; use Windows "net use" instead. + IS_NETWORK_DISK=`net use | grep \`pwd -W | cut -d ":" -f 1 | tr a-z A-Z\`:` + if test "x$IS_NETWORK_DISK" = x; then + $2 + else + $3 + fi + else + # No df here, say it's local + $2 + fi + else + if $DF -l $1 > /dev/null 2>&1; then + $2 + else + $3 + fi + fi ]) AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/basics_windows.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/autoconf/basics_windows.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,406 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +AC_DEFUN([BASIC_WINDOWS_REWRITE_AS_UNIX_PATH], +[ + windows_path="[$]$1" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + $1="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + $1="$unix_path" + fi +]) + +AC_DEFUN([BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH], +[ + unix_path="[$]$1" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + $1="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + $1="$windows_path" + fi +]) + +# Helper function which possibly converts a path using DOS-style short mode. +# If so, the updated path is stored in $new_path. +# $1: The path to check +AC_DEFUN([BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN], +[ + input_path="$1" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use @<:@ and @:>@ instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP @<:@^-._/a-zA-Z0-9@:>@` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $1 | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi +]) + +# Helper function which possibly converts a path using DOS-style short mode. +# If so, the updated path is stored in $new_path. +# $1: The path to check +AC_DEFUN([BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS], +[ + input_path="$1" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use @<:@ and @:>@ instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP @<:@^-_/:a-zA-Z0-9@:>@` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi +]) + +# FIXME: The BASIC_FIXUP_*_CYGWIN/MSYS is most likely too convoluted +# and could probably be heavily simplified. However, all changes in this +# area tend to need lot of testing in different scenarios, and in lack of +# proper unit testing, cleaning this up has not been deemed worth the effort +# at the moment. + +AC_DEFUN([BASIC_FIXUP_PATH_CYGWIN], +[ + # Input might be given as Windows format, start by converting to + # unix format. + path="[$]$1" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.]) + AC_MSG_ERROR([Cannot locate the the path of $1]) + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN([$new_path]) + + if test "x$path" != "x$new_path"; then + $1="$new_path" + AC_MSG_NOTICE([Rewriting $1 to "$new_path"]) + fi +]) + +AC_DEFUN([BASIC_FIXUP_PATH_MSYS], +[ + path="[$]$1" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS([$new_path]) + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path) + if test "x$path" != "x$new_path"; then + $1="$new_path" + AC_MSG_NOTICE([Rewriting $1 to "$new_path"]) + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes@<:@@@:>@}" "${new_path:0:10}") +]) + +AC_DEFUN([BASIC_FIXUP_EXECUTABLE_CYGWIN], +[ + # First separate the path from the arguments. This will split at the first + # space. + complete="[$]$1" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + AC_MSG_NOTICE([You might be mixing spaces in the path and extra arguments, which is not allowed.]) + fi + AC_MSG_ERROR([Cannot locate the the path of $1]) + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + AC_MSG_NOTICE([The path of $1, which resolves as "$new_path", is invalid.]) + AC_MSG_NOTICE([Neither "$new_path" nor "$new_path.exe/cmd" can be found]) + AC_MSG_ERROR([Cannot locate the the path of $1]) + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN([$input_to_shortpath]) + # remove trailing .exe if any + new_path="${new_path/%.exe/}" +]) + +AC_DEFUN([BASIC_FIXUP_EXECUTABLE_MSYS], +[ + # First separate the path from the arguments. This will split at the first + # space. + complete="[$]$1" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path) + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path) + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.]) + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + AC_MSG_NOTICE([You might be mixing spaces in the path and extra arguments, which is not allowed.]) + fi + AC_MSG_ERROR([Cannot locate the the path of $1]) + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + BASIC_MAKE_WINDOWS_SPACE_SAFE_MSYS([$new_path]) + # Output is in $new_path + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(new_path) + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes@<:@@@:>@}" "${new_path:0:10}") + fi +]) + +# Setup basic configuration paths, and platform-specific stuff related to PATHs. +AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], +[ + SRC_ROOT_LENGTH=`$THEPWDCMD|$WC -m` + if test $SRC_ROOT_LENGTH -gt 100; then + AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported]) + fi + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + AC_MSG_CHECKING([cygwin release]) + CYGWIN_VERSION=`$UNAME -r` + AC_MSG_RESULT([$CYGWIN_VERSION]) + WINDOWS_ENV_VENDOR='cygwin' + WINDOWS_ENV_VERSION="$CYGWIN_VERSION" + + CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.` + if test "x$CYGWIN_VERSION_OK" = x; then + AC_MSG_NOTICE([Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade.]) + AC_MSG_ERROR([Cannot continue]) + fi + if test "x$CYGPATH" = x; then + AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) + fi + AC_MSG_CHECKING([cygwin root directory as unix-style path]) + # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away + cygwin_winpath_root=`cd / ; cmd /c cd | grep ".*"` + # Force cygpath to report the proper root by including a trailing space, and then stripping it off again. + CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "` + AC_MSG_RESULT([$CYGWIN_ROOT_PATH]) + WINDOWS_ENV_ROOT_PATH="$CYGWIN_ROOT_PATH" + test_cygdrive_prefix=`$ECHO $CYGWIN_ROOT_PATH | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + AC_MSG_ERROR([Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c.]) + fi + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + AC_MSG_CHECKING([msys release]) + MSYS_VERSION=`$UNAME -r` + AC_MSG_RESULT([$MSYS_VERSION]) + + WINDOWS_ENV_VENDOR='msys' + WINDOWS_ENV_VERSION="$MSYS_VERSION" + + AC_MSG_CHECKING([msys root directory as unix-style path]) + # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away + MSYS_ROOT_PATH=`cd / ; cmd /c cd | grep ".*"` + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(MSYS_ROOT_PATH) + AC_MSG_RESULT([$MSYS_ROOT_PATH]) + WINDOWS_ENV_ROOT_PATH="$MSYS_ROOT_PATH" + else + AC_MSG_ERROR([Unknown Windows environment. Neither cygwin nor msys was detected.]) + fi + + # Test if windows or unix (cygwin/msys) find is first in path. + AC_MSG_CHECKING([what kind of 'find' is first on the PATH]) + FIND_BINARY_OUTPUT=`find --version 2>&1` + if test "x`echo $FIND_BINARY_OUTPUT | $GREP GNU`" != x; then + AC_MSG_RESULT([unix style]) + elif test "x`echo $FIND_BINARY_OUTPUT | $GREP FIND`" != x; then + AC_MSG_RESULT([Windows]) + AC_MSG_NOTICE([Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools.]) + AC_MSG_NOTICE([This will not work. Please correct and make sure /usr/bin (or similar) is first in path.]) + AC_MSG_ERROR([Cannot continue]) + else + AC_MSG_RESULT([unknown]) + AC_MSG_WARN([It seems that your find utility is non-standard.]) + fi +]) + +AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH], +[ +# When using cygwin or msys, we need a wrapper binary that renames +# /cygdrive/c/ arguments into c:/ arguments and peeks into +# @files and rewrites these too! This wrapper binary is +# called fixpath. +FIXPATH= +if test "x$OPENJDK_BUILD_OS" = xwindows; then + AC_MSG_CHECKING([if fixpath can be created]) + FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c" + FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe" + if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then + FIXPATH_SRC=`$CYGPATH -m $FIXPATH_SRC` + FIXPATH_BIN=`$CYGPATH -m $FIXPATH_BIN` + # Important to keep the .exe suffix on Cygwin for Hotspot makefiles + FIXPATH="$OUTPUT_ROOT/fixpath.exe -c" + elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then + FIXPATH_SRC=`cmd //c echo $FIXPATH_SRC` + FIXPATH_BIN=`cmd //c echo $FIXPATH_BIN` + + # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line + # @ was chosen as separator to minimize risk of other tools messing around with it + all_unique_prefixes=`echo "${all_fixpath_prefixes@<:@@@:>@}" | tr ' ' '\n' | grep '^/./' | sort | uniq` + fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` + + FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list" + fi + rm -f $OUTPUT_ROOT/fixpath* + cd $OUTPUT_ROOT + $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1 + cd $CURDIR + + if test ! -x $OUTPUT_ROOT/fixpath.exe; then + AC_MSG_RESULT([no]) + cat $OUTPUT_ROOT/fixpath1.log + AC_MSG_ERROR([Could not create $OUTPUT_ROOT/fixpath.exe]) + fi + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([if fixpath.exe works]) + cd $OUTPUT_ROOT + $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 + cd $CURDIR + if test ! -x $OUTPUT_ROOT/fixpath2.exe; then + AC_MSG_RESULT([no]) + cat $OUTPUT_ROOT/fixpath2.log + AC_MSG_ERROR([fixpath did not work!]) + fi + AC_MSG_RESULT([yes]) + rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj +fi + +AC_SUBST(FIXPATH) +]) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/boot-jdk.m4 --- a/common/autoconf/boot-jdk.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/boot-jdk.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -62,9 +62,12 @@ else # We're done! :-) BOOT_JDK_FOUND=yes - SPACESAFE(BOOT_JDK,[the path to the Boot JDK]) + BASIC_FIXUP_PATH(BOOT_JDK) AC_MSG_CHECKING([for Boot JDK]) - AC_MSG_RESULT([$BOOT_JDK ($BOOT_JDK_VERSION)]) + AC_MSG_RESULT([$BOOT_JDK]) + AC_MSG_CHECKING([Boot JDK version]) + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + AC_MSG_RESULT([$BOOT_JDK_VERSION]) fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -93,12 +96,8 @@ AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME], [ if test "x$JAVA_HOME" != x; then - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, JAVA_HOME is likely in DOS-style - JAVA_HOME_PROCESSED="`$CYGPATH -u "$JAVA_HOME"`" - else - JAVA_HOME_PROCESSED="$JAVA_HOME" - fi + JAVA_HOME_PROCESSED="$JAVA_HOME" + BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED) if test ! -d "$JAVA_HOME_PROCESSED"; then AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) else @@ -125,8 +124,7 @@ # Lets find the JDK/JRE directory by following symbolic links. # Linux/GNU systems often have links from /usr/bin/java to # /etc/alternatives/java to the real JDK binary. - SET_FULL_PATH_SPACESAFE(BINARY) - REMOVE_SYMBOLIC_LINKS(BINARY) + BASIC_REMOVE_SYMBOLIC_LINKS(BINARY) BOOT_JDK=`dirname "$BINARY"` BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then @@ -155,13 +153,17 @@ [ BOOT_JDK_PREFIX="$1" BOOT_JDK_SUFFIX="$2" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)]) - fi + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do + BOOTJDK_DO_CHECK([ + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)]) + fi + ]) + done fi ]) @@ -171,7 +173,9 @@ AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY], [ if test "x[$]$1" != x; then - BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([`$CYGPATH -u "[$]$1"`/Java]) + VIRTUAL_DIR="[$]$1/Java" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VIRTUAL_DIR) + BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY($VIRTUAL_DIR) fi ]) @@ -187,6 +191,8 @@ elif test "x$OPENJDK_TARGET_OS" = xmacosx; then BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])]) BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])]) + elif test "x$OPENJDK_TARGET_OS" = xlinux; then + BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/lib/jvm])]) fi ]) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/build-aux/config.guess --- a/common/autoconf/build-aux/config.guess Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/build-aux/config.guess Fri Oct 26 14:29:57 2012 -0700 @@ -48,6 +48,9 @@ # Test and fix cygwin on x86_64 echo $OUT | grep 86-pc-cygwin > /dev/null 2> /dev/null +if test $? != 0; then + echo $OUT | grep 86-pc-mingw > /dev/null 2> /dev/null +fi if test $? = 0; then case `echo $PROCESSOR_IDENTIFIER | cut -f1 -d' '` in intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/build-performance.m4 --- a/common/autoconf/build-performance.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/build-performance.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -41,6 +41,10 @@ # Looks like a MacOSX system NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'` FOUND_CORES=yes + elif test -n "$NUMBER_OF_PROCESSORS"; then + # On windows, look in the env + NUM_CORES=$NUMBER_OF_PROCESSORS + FOUND_CORES=yes fi # For c/c++ code we run twice as many concurrent build @@ -50,7 +54,8 @@ if test "x$FOUND_CORES" = xyes; then AC_MSG_RESULT([$NUM_CORES]) else - AC_MSG_RESULT([could not detect number of cores, defaulting to 1!]) + AC_MSG_RESULT([could not detect number of cores, defaulting to 1]) + AC_MSG_WARN([This will disable all parallelism from build!]) fi ]) @@ -76,16 +81,18 @@ MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'` MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` FOUND_MEM=yes - elif test "x$build_os" = xwindows; then + elif test "x$OPENJDK_BUILD_OS" = xwindows; then # Windows, but without cygwin - MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'` + MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` FOUND_MEM=yes fi if test "x$FOUND_MEM" = xyes; then AC_MSG_RESULT([$MEMORY_SIZE MB]) else - AC_MSG_RESULT([could not detect memory size defaulting to 1024 MB!]) + AC_MSG_RESULT([could not detect memory size, defaulting to 1024 MB]) + AC_MSG_WARN([This might seriously impact build performance!]) fi ]) @@ -123,7 +130,7 @@ [ AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--disable-ccache], - [use ccache to speed up recompilations @<:@enabled@:>@])], + [disable using ccache to speed up recompilations @<:@enabled@:>@])], [ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes]) if test "x$ENABLE_CCACHE" = xyes; then AC_PATH_PROG(CCACHE, ccache) @@ -196,7 +203,7 @@ # Can the C/C++ compiler use precompiled headers? # AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers], - [use precompiled headers when compiling C++ @<:@enabled@:>@])], + [disable using precompiled headers when compiling C++ @<:@enabled@:>@])], [ENABLE_PRECOMPH=${enable_precompiled-headers}], [ENABLE_PRECOMPH=yes]) USE_PRECOMPILED_HEADER=1 @@ -228,8 +235,7 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC], [ AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java], - [use this java binary for running the sjavac background server and other long running java tasks in the build process, - e.g. ---with-sjavac-server-java="/opt/jrockit/bin/java -server"])]) + [use this java binary for running the sjavac background server @<:@Boot JDK java@:>@])]) if test "x$with_sjavac_server_java" != x; then SJAVAC_SERVER_JAVA="$with_sjavac_server_java" diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/builddeps.m4 --- a/common/autoconf/builddeps.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/builddeps.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -235,26 +235,13 @@ [use this configuration file for the builddeps])]) AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server], - [download and use build dependencies from this server url, e.g. --with-builddeps-server=ftp://example.com/dir])]) + [download and use build dependencies from this server url])]) AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir], - [store downloaded build dependencies here @<:@d/localhome/builddeps@:>@])], + [store downloaded build dependencies here @<:@/localhome/builddeps@:>@])], [], [with_builddeps_dir=/localhome/builddeps]) AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group], [chgrp the downloaded build dependencies to this group])]) - -AC_ARG_ENABLE([list-builddeps], [AS_HELP_STRING([--enable-list-builddeps], - [list all build dependencies known to the configure script])], - [LIST_BUILDDEPS="${enableval}"], [LIST_BUILDDEPS='no']) - -if test "x$LIST_BUILDDEPS" = xyes; then - echo - echo List of build dependencies known to the configure script, - echo that can be used in builddeps.conf files: - cat $AUTOCONF_DIR/*.ac $AUTOCONF_DIR/*.m4 | grep BDEPS_CHECK_MODUL[E]\( | cut -f 2 -d ',' | tr -d ' ' | sort - echo - exit 1 -fi ]) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/closed.version.numbers --- a/common/autoconf/closed.version.numbers Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/closed.version.numbers Fri Oct 26 14:29:57 2012 -0700 @@ -26,3 +26,7 @@ PRODUCT_SUFFIX="SE Runtime Environment" JDK_RC_PLATFORM_NAME="Platform SE" COMPANY_NAME="Oracle Corporation" + +# Might need better names for these +MACOSX_BUNDLE_NAME_BASE="Java SE" +MACOSX_BUNDLE_ID_BASE="com.oracle.java" diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/compare.sh.in --- a/common/autoconf/compare.sh.in Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/compare.sh.in Fri Oct 26 14:29:57 2012 -0700 @@ -40,12 +40,12 @@ CP="@CP@" CUT="@CUT@" DIFF="@DIFF@" -DUMPBIN="@UNCYGDRIVE@ @DUMPBIN@" +DUMPBIN="@FIXPATH@ @DUMPBIN@" EXPR="@EXPR@" FILE="@FILE@" FIND="@FIND@" GREP="@GREP@" -JAVAP="@UNCYGDRIVE@ @BOOT_JDK@/bin/javap" +JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap" LDD="@LDD@" MKDIR="@MKDIR@" NM="@NM@" @@ -56,6 +56,7 @@ RM="@RM@" SED="@SED@" SORT="@SORT@" +STAT="@STAT@" STRIP="@POST_STRIP_CMD@" TEE="@TEE@" UNIQ="@UNIQ@" @@ -63,1607 +64,15 @@ SRC_ROOT="@SRC_ROOT@" -if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then - READELF_CMD="otool -v -V -h -X -t -d" -elif [ -n "$READELF" ] && [ "$OPENJDK_TARGET_OS" != "windows" ]; then - READELF_CMD="$READELF -a" -fi - -if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then - LDD_CMD="$OTOOL -L" -elif [ -n "$LDD" ]; then - LDD_CMD="$LDD" -fi - -########################################################################################## -# Diff exceptions - -if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then -STRIP_BEFORE_COMPARE=" -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so -./demo/jvmti/gctest/lib/libgctest.so -./demo/jvmti/heapTracker/lib/libheapTracker.so -./demo/jvmti/heapViewer/lib/libheapViewer.so -./demo/jvmti/hprof/lib/libhprof.so -./demo/jvmti/minst/lib/libminst.so -./demo/jvmti/mtrace/lib/libmtrace.so -./demo/jvmti/versionCheck/lib/libversionCheck.so -./demo/jvmti/waiters/lib/libwaiters.so -" - -KNOWN_BIN_DIFF=" -" - -ACCEPTED_BIN_DIFF=" -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so -./demo/jvmti/gctest/lib/libgctest.so -./demo/jvmti/heapTracker/lib/libheapTracker.so -./demo/jvmti/heapViewer/lib/libheapViewer.so -./demo/jvmti/hprof/lib/libhprof.so -./demo/jvmti/minst/lib/libminst.so -./demo/jvmti/mtrace/lib/libmtrace.so -./demo/jvmti/versionCheck/lib/libversionCheck.so -./demo/jvmti/waiters/lib/libwaiters.so -./jre/lib/amd64/libattach.so -./jre/lib/amd64/libdt_socket.so -./jre/lib/amd64/libhprof.so -./jre/lib/amd64/libinstrument.so -./jre/lib/amd64/libjava_crw_demo.so -./jre/lib/amd64/libjsdt.so -./jre/lib/amd64/libjsig.so -./jre/lib/amd64/libmanagement.so -./jre/lib/amd64/libnpt.so -./jre/lib/amd64/libsaproc.so -./jre/lib/amd64/libverify.so -./jre/lib/amd64/server/libjsig.so -./jre/lib/amd64/server/libjvm.so -./bin/appletviewer -./bin/extcheck -./bin/idlj -./bin/jar -./bin/jarsigner -./bin/java -./bin/javac -./bin/javadoc -./bin/javah -./bin/javap -./bin/jcmd -./bin/jconsole -./bin/jdb -./bin/jhat -./bin/jinfo -./bin/jmap -./bin/jps -./bin/jrunscript -./bin/jsadebugd -./bin/jstack -./bin/jstat -./bin/jstatd -./bin/keytool -./bin/native2ascii -./bin/orbd -./bin/pack200 -./bin/policytool -./bin/rmic -./bin/rmid -./bin/rmiregistry -./bin/schemagen -./bin/serialver -./bin/servertool -./bin/tnameserv -./bin/wsgen -./bin/wsimport -./bin/xjc -./jre/bin/java -./jre/bin/keytool -./jre/bin/orbd -./jre/bin/pack200 -./jre/bin/policytool -./jre/bin/rmid -./jre/bin/rmiregistry -./jre/bin/servertool -./jre/bin/tnameserv -" - -KNOWN_SIZE_DIFF=" -" - -KNOWN_SYM_DIFF=" -" - -KNOWN_ELF_DIFF=" -./demo/jvmti/heapTracker/lib/libheapTracker.so -./demo/jvmti/hprof/lib/libhprof.so -./demo/jvmti/waiters/lib/libwaiters.so -" -fi - -if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86" ]; then - -STRIP_BEFORE_COMPARE=" -./demo/jni/Poller/lib/libPoller.so -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so -./demo/jvmti/gctest/lib/libgctest.so -./demo/jvmti/heapTracker/lib/libheapTracker.so -./demo/jvmti/heapViewer/lib/libheapViewer.so -./demo/jvmti/hprof/lib/libhprof.so -./demo/jvmti/minst/lib/libminst.so -./demo/jvmti/mtrace/lib/libmtrace.so -./demo/jvmti/versionCheck/lib/libversionCheck.so -./demo/jvmti/waiters/lib/libwaiters.so -./jre/lib/i386/jexec -" - -SORT_SYMBOLS=" -./jre/lib/i386/client/libjvm.so -./jre/lib/i386/server/libjvm.so -" - -SKIP_BIN_DIFF="true" - -ACCEPTED_SMALL_SIZE_DIFF=" -./demo/jni/Poller/lib/libPoller.so -./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so -./demo/jvmti/gctest/lib/libgctest.so -./demo/jvmti/heapTracker/lib/libheapTracker.so -./demo/jvmti/heapViewer/lib/libheapViewer.so -./demo/jvmti/hprof/lib/libhprof.so -./demo/jvmti/minst/lib/libminst.so -./demo/jvmti/mtrace/lib/libmtrace.so -./demo/jvmti/versionCheck/lib/libversionCheck.so -./demo/jvmti/waiters/lib/libwaiters.so -./jre/lib/i386/client/libjvm.so -./jre/lib/i386/jli/libjli.so -./jre/lib/i386/libJdbcOdbc.so -./jre/lib/i386/libattach.so -./jre/lib/i386/libawt.so -./jre/lib/i386/libawt_headless.so -./jre/lib/i386/libawt_xawt.so -./jre/lib/i386/libdcpr.so -./jre/lib/i386/libdt_socket.so -./jre/lib/i386/libfontmanager.so -./jre/lib/i386/libhprof.so -./jre/lib/i386/libinstrument.so -./jre/lib/i386/libj2gss.so -./jre/lib/i386/libj2pcsc.so -./jre/lib/i386/libj2pkcs11.so -./jre/lib/i386/libj2ucrypto.so -./jre/lib/i386/libjaas_unix.so -./jre/lib/i386/libjava.so -./jre/lib/i386/libjava_crw_demo.so -./jre/lib/i386/libjawt.so -./jre/lib/i386/libjdwp.so -./jre/lib/i386/libjfr.so -./jre/lib/i386/libjpeg.so -./jre/lib/i386/libjsdt.so -./jre/lib/i386/libjsound.so -./jre/lib/i386/libkcms.so -./jre/lib/i386/libmanagement.so -./jre/lib/i386/libmlib_image.so -./jre/lib/i386/libnet.so -./jre/lib/i386/libnio.so -./jre/lib/i386/libnpt.so -./jre/lib/i386/libsctp.so -./jre/lib/i386/libsplashscreen.so -./jre/lib/i386/libsunec.so -./jre/lib/i386/libsunwjdga.so -./jre/lib/i386/libt2k.so -./jre/lib/i386/libunpack.so -./jre/lib/i386/libverify.so -./jre/lib/i386/libzip.so -./jre/lib/i386/server/libjvm.so -./bin/appletviewer -./bin/extcheck -./bin/idlj -./bin/jar -./bin/jarsigner -./bin/java -./bin/javac -./bin/javadoc -./bin/javah -./bin/javap -./bin/jcmd -./bin/jconsole -./bin/jdb -./bin/jhat -./bin/jinfo -./bin/jmap -./bin/jps -./bin/jrunscript -./bin/jsadebugd -./bin/jstack -./bin/jstat -./bin/jstatd -./bin/keytool -./bin/native2ascii -./bin/orbd -./bin/pack200 -./bin/policytool -./bin/rmic -./bin/rmid -./bin/rmiregistry -./bin/schemagen -./bin/serialver -./bin/servertool -./bin/tnameserv -./bin/unpack200 -./bin/wsgen -./bin/wsimport -./bin/xjc -./jre/bin/java -./jre/bin/keytool -./jre/bin/orbd -./jre/bin/pack200 -./jre/bin/policytool -./jre/bin/rmid -./jre/bin/rmiregistry -./jre/bin/servertool -./jre/bin/tnameserv -./jre/bin/unpack200 -./jre/lib/i386/jexec -" - -SKIP_ELF_DIFF="true" - -# libjvm.so differs in the random 15 char prefix on some symbols. -ACCEPTED_DIS_DIFF=" -./jre/lib/i386/client/libjvm.so -./jre/lib/i386/server/libjvm.so -" - -fi - -if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then - -STRIP_BEFORE_COMPARE=" -./demo/jni/Poller/lib/amd64/libPoller.so -./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so -./demo/jvmti/gctest/lib/amd64/libgctest.so -./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so -./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so -./demo/jvmti/hprof/lib/amd64/libhprof.so -./demo/jvmti/minst/lib/amd64/libminst.so -./demo/jvmti/mtrace/lib/amd64/libmtrace.so -./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so -./demo/jvmti/waiters/lib/amd64/libwaiters.so -" - -SORT_SYMBOLS=" -./jre/lib/amd64/server/libjvm.so -" - -SKIP_BIN_DIFF="true" - -ACCEPTED_SMALL_SIZE_DIFF=" -./demo/jni/Poller/lib/amd64/libPoller.so -./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so -./demo/jvmti/gctest/lib/amd64/libgctest.so -./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so -./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so -./demo/jvmti/hprof/lib/amd64/libhprof.so -./demo/jvmti/minst/lib/amd64/libminst.so -./demo/jvmti/mtrace/lib/amd64/libmtrace.so -./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so -./demo/jvmti/waiters/lib/amd64/libwaiters.so -./jre/lib/amd64/jli/libjli.so -./jre/lib/amd64/libJdbcOdbc.so -./jre/lib/amd64/libattach.so -./jre/lib/amd64/libawt.so -./jre/lib/amd64/libawt_headless.so -./jre/lib/amd64/libawt_xawt.so -./jre/lib/amd64/libdcpr.so -./jre/lib/amd64/libdt_socket.so -./jre/lib/amd64/libfontmanager.so -./jre/lib/amd64/libhprof.so -./jre/lib/amd64/libinstrument.so -./jre/lib/amd64/libj2gss.so -./jre/lib/amd64/libj2pcsc.so -./jre/lib/amd64/libj2pkcs11.so -./jre/lib/amd64/libj2ucrypto.so -./jre/lib/amd64/libjaas_unix.so -./jre/lib/amd64/libjava.so -./jre/lib/amd64/libjava_crw_demo.so -./jre/lib/amd64/libjawt.so -./jre/lib/amd64/libjdwp.so -./jre/lib/amd64/libjfr.so -./jre/lib/amd64/libjpeg.so -./jre/lib/amd64/libjsdt.so -./jre/lib/amd64/libjsound.so -./jre/lib/amd64/libkcms.so -./jre/lib/amd64/libmanagement.so -./jre/lib/amd64/libmlib_image.so -./jre/lib/amd64/libnet.so -./jre/lib/amd64/libnio.so -./jre/lib/amd64/libnpt.so -./jre/lib/amd64/libsctp.so -./jre/lib/amd64/libsplashscreen.so -./jre/lib/amd64/libsunec.so -./jre/lib/amd64/libsunwjdga.so -./jre/lib/amd64/libt2k.so -./jre/lib/amd64/libunpack.so -./jre/lib/amd64/libverify.so -./jre/lib/amd64/libzip.so -./jre/lib/amd64/server/64/libjvm_db.so -./jre/lib/amd64/server/64/libjvm_dtrace.so -./bin/amd64/appletviewer -./bin/amd64/extcheck -./bin/amd64/idlj -./bin/amd64/jar -./bin/amd64/jarsigner -./bin/amd64/java -./bin/amd64/javac -./bin/amd64/javadoc -./bin/amd64/javah -./bin/amd64/javap -./bin/amd64/jcmd -./bin/amd64/jconsole -./bin/amd64/jdb -./bin/amd64/jhat -./bin/amd64/jinfo -./bin/amd64/jmap -./bin/amd64/jps -./bin/amd64/jrunscript -./bin/amd64/jsadebugd -./bin/amd64/jstack -./bin/amd64/jstat -./bin/amd64/jstatd -./bin/amd64/keytool -./bin/amd64/native2ascii -./bin/amd64/orbd -./bin/amd64/pack200 -./bin/amd64/policytool -./bin/amd64/rmic -./bin/amd64/rmid -./bin/amd64/rmiregistry -./bin/amd64/schemagen -./bin/amd64/serialver -./bin/amd64/servertool -./bin/amd64/tnameserv -./bin/amd64/unpack200 -./bin/amd64/wsgen -./bin/amd64/wsimport -./bin/amd64/xjc -./jre/bin/amd64/java -./jre/bin/amd64/keytool -./jre/bin/amd64/orbd -./jre/bin/amd64/pack200 -./jre/bin/amd64/policytool -./jre/bin/amd64/rmid -./jre/bin/amd64/rmiregistry -./jre/bin/amd64/servertool -./jre/bin/amd64/tnameserv -./jre/bin/amd64/unpack200 -./jre/lib/amd64/jexec -" - -SKIP_ELF_DIFF="true" - -# Can't find an explaination for the diff in libmlib_image.so. -KNOWN_DIS_DIFF=" -./jre/lib/amd64/libmlib_image.so -" -# libjvm.so differs in the random 15 char prefix on some symbols. -ACCEPTED_DIS_DIFF=" -./jre/lib/amd64/server/libjvm.so -" - -fi - -if [ "$OPENJDK_TARGET_OS" = "windows" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then - -ACCEPTED_BIN_DIFF=" -./bin/jli.dll -./demo/jvmti/compiledMethodLoad/lib/compiledMethodLoad.dll -./demo/jvmti/gctest/lib/gctest.dll -./demo/jvmti/heapTracker/lib/heapTracker.dll -./demo/jvmti/heapViewer/lib/heapViewer.dll -./demo/jvmti/hprof/lib/hprof.dll -./demo/jvmti/minst/lib/minst.dll -./demo/jvmti/mtrace/lib/mtrace.dll -./demo/jvmti/versionCheck/lib/versionCheck.dll -./demo/jvmti/waiters/lib/waiters.dll -./jre/bin/attach.dll -./jre/bin/awt.dll -./jre/bin/dcpr.dll -./jre/bin/dt_shmem.dll -./jre/bin/dt_socket.dll -./jre/bin/fontmanager.dll -./jre/bin/hprof.dll -./jre/bin/instrument.dll -./jre/bin/j2pcsc.dll -./jre/bin/j2pkcs11.dll -./jre/bin/jaas_nt.dll -./jre/bin/java.dll -./jre/bin/java_crw_demo.dll -./jre/bin/jawt.dll -./jre/bin/JdbcOdbc.dll -./jre/bin/jdwp.dll -./jre/bin/jfr.dll -./jre/bin/jli.dll -./jre/bin/jpeg.dll -./jre/bin/jsdt.dll -./jre/bin/jsound.dll -./jre/bin/jsoundds.dll -./jre/bin/kcms.dll -./jre/bin/management.dll -./jre/bin/mlib_image.dll -./jre/bin/net.dll -./jre/bin/nio.dll -./jre/bin/npt.dll -./jre/bin/sawindbg.dll -./jre/bin/server/jvm.dll -./jre/bin/splashscreen.dll -./jre/bin/sunec.dll -./jre/bin/sunmscapi.dll -./jre/bin/t2k.dll -./jre/bin/unpack.dll -./jre/bin/verify.dll -./jre/bin/w2k_lsa_auth.dll -./jre/bin/zip.dll -./bin/appletviewer.exe -./bin/extcheck.exe -./bin/idlj.exe -./bin/jar.exe -./bin/jarsigner.exe -./bin/java.exe -./bin/javac.exe -./bin/javadoc.exe -./bin/javah.exe -./bin/javap.exe -./bin/java-rmi.exe -./bin/javaw.exe -./bin/jcmd.exe -./bin/jconsole.exe -./bin/jdb.exe -./bin/jhat.exe -./bin/jinfo.exe -./bin/jmap.exe -./bin/jps.exe -./bin/jrunscript.exe -./bin/jsadebugd.exe -./bin/jstack.exe -./bin/jstat.exe -./bin/jstatd.exe -./bin/keytool.exe -./bin/kinit.exe -./bin/klist.exe -./bin/ktab.exe -./bin/native2ascii.exe -./bin/orbd.exe -./bin/pack200.exe -./bin/policytool.exe -./bin/rmic.exe -./bin/rmid.exe -./bin/rmiregistry.exe -./bin/schemagen.exe -./bin/serialver.exe -./bin/servertool.exe -./bin/tnameserv.exe -./bin/unpack200.exe -./bin/wsgen.exe -./bin/wsimport.exe -./bin/xjc.exe -./jre/bin/java.exe -./jre/bin/java-rmi.exe -./jre/bin/javaw.exe -./jre/bin/keytool.exe -./jre/bin/kinit.exe -./jre/bin/klist.exe -./jre/bin/ktab.exe -./jre/bin/orbd.exe -./jre/bin/pack200.exe -./jre/bin/policytool.exe -./jre/bin/rmid.exe -./jre/bin/rmiregistry.exe -./jre/bin/servertool.exe -./jre/bin/tnameserv.exe -./jre/bin/unpack200.exe -" - -KNOWN_SIZE_DIFF=" -./demo/jvmti/heapTracker/lib/heapTracker.dll -./demo/jvmti/minst/lib/minst.dll -./jre/bin/awt.dll -./jre/bin/java_crw_demo.dll -./bin/java.exe -./bin/javaw.exe -./bin/unpack200.exe -./jre/bin/java.exe -./jre/bin/javaw.exe -./jre/bin/unpack200.exe -" - -KNOWN_SYM_DIFF=" -./jre/bin/awt.dll -./jre/bin/java_crw_demo.dll -" -fi - - - -if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then -ACCEPTED_JARZIP_CONTENTS=" -/META-INF/INDEX.LIST -" - -KNOWN_BIN_DIFF=" -./jre/lib/libJObjC.dylib -./jre/lib/libsaproc.dylib -./jre/lib/server/libjvm.dylib -" - -ACCEPTED_BIN_DIFF=" -./bin/appletviewer -./bin/extcheck -./bin/idlj -./bin/jar -./bin/jarsigner -./bin/java -./bin/javac -./bin/javadoc -./bin/javah -./bin/javap -./bin/jcmd -./bin/jconsole -./bin/jdb -./bin/jhat -./bin/jinfo -./bin/jmap -./bin/jps -./bin/jrunscript -./bin/jsadebugd -./bin/jstack -./bin/jstat -./bin/jstatd -./bin/keytool -./bin/native2ascii -./bin/orbd -./bin/pack200 -./bin/policytool -./bin/rmic -./bin/rmid -./bin/rmiregistry -./bin/schemagen -./bin/serialver -./bin/servertool -./bin/tnameserv -./bin/wsgen -./bin/wsimport -./bin/xjc -./jre/bin/java -./jre/bin/keytool -./jre/bin/orbd -./jre/bin/pack200 -./jre/bin/policytool -./jre/bin/rmid -./jre/bin/rmiregistry -./jre/bin/servertool -./jre/bin/tnameserv -" - -KNOWN_SIZE_DIFF=" -./jre/lib/libJObjC.dylib -./jre/lib/server/libjvm.dylib -" - -KNOWN_SYM_DIFF=" -./jre/lib/libJObjC.dylib -./jre/lib/server/libjvm.dylib -" - -KNOWN_ELF_DIFF=" -./jre/lib/libJObjC.dylib -./jre/lib/server/libjvm.dylib -" - -SKIP_DIS_DIFF="true" - +if [ "$OPENJDK_TARGET_OS" = "windows" ]; then + PATH="@VS_PATH@" fi -########################################################################################## -# Compare text files and ignore specific differences: -# -# * Timestamps in Java sources generated by idl2java -# * Sorting order and cleanup style in .properties files - -diff_text() { - OTHER_FILE=$1 - THIS_FILE=$2 - - SUFFIX="${THIS_FILE##*.}" - - TMP=1 - - if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then - TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ - $GREP '^[<>]' | \ - $SED -e '/[<>] Ant-Version: Apache Ant .*/d' \ - -e '/[<>] Created-By: .* (Oracle Corporation).*/d') - fi - if test "x$SUFFIX" = "xjava"; then - TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ - $GREP '^[<>]' | \ - $SED -e '/[<>] \* from.*\.idl/d' \ - -e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ - -e '/[<>] \*.*[0-9]\{4\} [0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \ - -e '/\/\/ Generated from input file.*/d' \ - -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \ - -e '/\/\/ java GenerateCharacter.*/d') - fi - # Ignore date strings in class files. - # On Macosx the system sources for generated java classes produce different output on - # consequtive invokations seemingly randomly. - # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this. - if test "x$SUFFIX" = "xclass"; then - $JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap - $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap - TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \ - $GREP '^[<>]' | \ - $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ - -e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \ - -e '/[<>].*public com\.apple\.jobjc\.Pointer].*public void setItemsPtr(com\.apple\.jobjc\.Pointer $OTHER_FILE.cleaned - TMP=$(LANG=C $DIFF $OTHER_FILE.cleaned $THIS_FILE) - fi - if test -n "$TMP"; then - echo Files $OTHER_FILE and $THIS_FILE differ - return 1 - fi - - return 0 -} - -########################################################################################## -# Compare directory structure - -compare_dirs() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - mkdir -p $WORK_DIR - - (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/other_dirs) - (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/this_dirs) - - echo -n Directory structure... - if $DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs > /dev/null; then - echo Identical! - else - echo Differences found. - REGRESSIONS=true - # Differences in directories found. - ONLY_OTHER=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '<') - if [ "$ONLY_OTHER" ]; then - echo Only in $OTHER - echo $ONLY_OTHER | $SED 's|< ./|\t|g' | $SED 's/ /\n/g' - fi - # Differences in directories found. - ONLY_THIS=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '>') - if [ "$ONLY_THIS" ]; then - echo Only in $THIS - echo $ONLY_THIS | $SED 's|> ./|\t|g' | $SED 's/ /\n/g' - fi - fi -} - - -########################################################################################## -# Compare file structure - -compare_files() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - mkdir -p $WORK_DIR - - (cd $OTHER_DIR && $FIND . -type f | $SORT > $WORK_DIR/other_files) - (cd $THIS_DIR && $FIND . -type f | $SORT > $WORK_DIR/this_files) - - echo -n File names... - if diff $WORK_DIR/other_files $WORK_DIR/this_files > /dev/null; then - echo Identical! - else - echo Differences found. - REGRESSIONS=true - # Differences in directories found. - ONLY_OTHER=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '<') - if [ "$ONLY_OTHER" ]; then - echo Only in $OTHER - echo "$ONLY_OTHER" | sed 's|< ./| |g' - fi - # Differences in directories found. - ONLY_THIS=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '>') - if [ "$ONLY_THIS" ]; then - echo Only in $THIS - echo "$ONLY_THIS" | sed 's|> ./| |g' - fi - fi -} - - -########################################################################################## -# Compare permissions - -compare_permissions() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - mkdir -p $WORK_DIR - - echo -n Permissions... - found="" - for f in `cd $OTHER_DIR && $FIND . -type f` - do - if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi - if [ ! -f ${THIS_DIR}/$f ]; then continue; fi - OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` - TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'` - if [ "$OP" != "$TP" ] - then - if [ -z "$found" ]; then echo ; found="yes"; fi - $PRINTF "\told: ${OP} new: ${TP}\t$f\n" - fi - done - if [ -z "$found" ]; then - echo "Identical!" - else - REGRESSIONS=true - fi -} - -########################################################################################## -# Compare file command output - -compare_file_types() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - $MKDIR -p $WORK_DIR - - echo -n File types... - found="" - for f in `cd $OTHER_DIR && $FIND . -type f` - do - if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi - if [ ! -f ${THIS_DIR}/$f ]; then continue; fi - OF=`cd ${OTHER_DIR} && $FILE $f` - TF=`cd ${THIS_DIR} && $FILE $f` - if [ "$f" = "./src.zip" ] || [ "$f" = "./jre/lib/JObjC.jar" ] || [ "$f" = "./lib/JObjC.jar" ] - then - if [ "`echo $OF | $GREP -ic zip`" -gt 0 -a "`echo $TF | $GREP -ic zip`" -gt 0 ] - then - # the way we produces zip-files make it so that directories are stored in old file - # but not in new (only files with full-path) - # this makes file-5.09 report them as different - continue; - fi - fi - - if [ "$OF" != "$TF" ] - then - if [ -z "$found" ]; then echo ; found="yes"; fi - $PRINTF "\tother: ${OF}\n\tthis : ${TF}\n" - fi - done - if [ -z "$found" ]; then - echo "Identical!" - else - REGRESSIONS=true - fi -} - -########################################################################################## -# Compare the rest of the files - -compare_general_files() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \ - ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \ - ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \ - ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ - ! -name "*.lib" \ - | $GREP -v "./bin/" | $SORT | $FILTER) - - echo General files... - for f in $GENERAL_FILES - do - if [ -e $OTHER_DIR/$f ]; then - DIFF_OUT=$($DIFF $OTHER_DIR/$f $THIS_DIR/$f 2>&1) - if [ -n "$DIFF_OUT" ]; then - echo $f - REGRESSIONS=true - if [ "$SHOW_DIFFS" = "true" ]; then - echo "$DIFF_OUT" - fi - fi - fi - done - - -} - -########################################################################################## -# Compare zip file - -compare_zip_file() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - ZIP_FILE=$4 - - THIS_ZIP=$THIS_DIR/$ZIP_FILE - OTHER_ZIP=$OTHER_DIR/$ZIP_FILE - - THIS_SUFFIX="${THIS_ZIP##*.}" - OTHER_SUFFIX="${OTHER_ZIP##*.}" - if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then - echo The files do not have the same suffix type! - return 2 - fi - - UNARCHIVE="$UNZIP -q" - - TYPE="$THIS_SUFFIX" - - if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null - then - return 0 - fi - # Not quite identical, the might still contain the same data. - # Unpack the jar/zip files in temp dirs - - THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this - OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other - $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR - $MKDIR -p $THIS_UNZIPDIR - $MKDIR -p $OTHER_UNZIPDIR - (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) - (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) - - CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff - LANG=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE - - ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE) - ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE) - - return_value=0 - - if [ -n "$ONLY_OTHER" ]; then - echo " Only OTHER $ZIP_FILE contains:" - echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g' - return_value=1 - fi - - if [ -n "$ONLY_THIS" ]; then - echo " Only THIS $ZIP_FILE contains:" - echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g' - return_value=1 - fi - - DIFFING_FILES=$($GREP differ $CONTENTS_DIFF_FILE | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") - - $RM -f $WORK_DIR/$ZIP_FILE.diffs - for file in $DIFFING_FILES; do - if [[ "$ACCEPTED_JARZIP_CONTENTS" != *"$file"* ]]; then - diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs - fi - done - - if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then - return_value=1 - echo " Differing files in $ZIP_FILE" - $CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP differ | cut -f 2 -d ' ' | \ - $SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist - $CAT $WORK_DIR/$ZIP_FILE.difflist - - if [ -n "$SHOW_DIFFS" ]; then - for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do - if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then - LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap - elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then - LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i - else - LANG=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i - fi - done - fi - fi - - return $return_value -} - - -########################################################################################## -# Compare all zip files - -compare_all_zip_files() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER ) - - if [ -n "$ZIPS" ]; then - echo Zip files... - - return_value=0 - for f in $ZIPS; do - if [ -f "$OTHER_DIR/$f" ]; then - compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f - if [ "$?" != "0" ]; then - return_value=1 - REGRESSIONS=true - fi - fi - done - fi - - return $return_value -} - -########################################################################################## -# Compare all jar files - -compare_all_jar_files() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - # TODO filter? - ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" | $SORT | $FILTER) - - if [ -n "$ZIPS" ]; then - echo Jar files... - - return_value=0 - for f in $ZIPS; do - if [ -f "$OTHER_DIR/$f" ]; then - compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f - if [ "$?" != "0" ]; then - return_value=1 - REGRESSIONS=true - fi - fi - done - fi - - return $return_value -} - -########################################################################################## -# Compare binary (executable/library) file - -compare_bin_file() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - BIN_FILE=$4 - - THIS_FILE=$THIS_DIR/$BIN_FILE - OTHER_FILE=$OTHER_DIR/$BIN_FILE - NAME=$(basename $BIN_FILE) - WORK_FILE_BASE=$WORK_DIR/$BIN_FILE - FILE_WORK_DIR=$(dirname $WORK_FILE_BASE) - - $MKDIR -p $FILE_WORK_DIR - - ORIG_THIS_FILE="$THIS_FILE" - ORIG_OTHER_FILE="$OTHER_FILE" - - if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then - THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME - OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME - $MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other - $CP $THIS_FILE $THIS_STRIPPED_FILE - $CP $OTHER_FILE $OTHER_STRIPPED_FILE - $STRIP $THIS_STRIPPED_FILE - $STRIP $OTHER_STRIPPED_FILE - THIS_FILE="$THIS_STRIPPED_FILE" - OTHER_FILE="$OTHER_STRIPPED_FILE" - fi - - if [ -z "$SKIP_BIN_DIFF" ]; then - if cmp $OTHER_FILE $THIS_FILE > /dev/null; then - # The files were bytewise identical. - if [ -n "$VERBOSE" ]; then - echo " : : : : : $BIN_FILE" - fi - return 0 - fi - BIN_MSG=" diff " - if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then - DIFF_BIN=true - if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then - BIN_MSG="*$BIN_MSG*" - REGRESSIONS=true - else - BIN_MSG=" $BIN_MSG " - fi - else - BIN_MSG="($BIN_MSG)" - DIFF_BIN= - fi - fi - - THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }') - OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }') - if [ $THIS_SIZE -ne $OTHER_SIZE ]; then - DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE) - DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE) - SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM) - if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] && [ "$DIFF_SIZE_REL" -lt 102 ]; then - SIZE_MSG="($SIZE_MSG)" - DIFF_SIZE= - else - if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then - DIFF_SIZE=true - if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then - SIZE_MSG="*$SIZE_MSG*" - REGRESSIONS=true - else - SIZE_MSG=" $SIZE_MSG " - fi - else - SIZE_MSG="($SIZE_MSG)" - DIFF_SIZE= - fi - fi - else - SIZE_MSG=" " - DIFF_SIZE= - if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then - SIZE_MSG=" ! " - fi - fi - - if [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then - SYM_SORT_CMD="sort" - else - SYM_SORT_CMD="cat" - fi - - # Check symbols - if [ "$OPENJDK_TARGET_OS" = "windows" ]; then - $DUMPBIN -exports $OTHER_FILE | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other - $DUMPBIN -exports $THIS_FILE | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this - elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then - # Some symbols get seemingly random 15 character prefixes. Filter them out. - $NM -a $ORIG_OTHER_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] \.\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other - $NM -a $ORIG_THIS_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] \.\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this - else - $NM -a $ORIG_OTHER_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other - $NM -a $ORIG_THIS_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this - fi - - LANG=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff - if [ -s $WORK_FILE_BASE.symbols.diff ]; then - SYM_MSG=" diff " - if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then - DIFF_SYM=true - if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then - SYM_MSG="*$SYM_MSG*" - REGRESSIONS=true - else - SYM_MSG=" $SYM_MSG " - fi - else - SYM_MSG="($SYM_MSG)" - DIFF_SYM= - fi - else - SYM_MSG=" " - DIFF_SYM= - if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then - SYM_MSG=" ! " - fi - fi - - # Check dependencies - if [ -n "$LDD_CMD" ];then - (cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq) - (cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq) - (cd $FILE_WORK_DIR && $RM -f $NAME) - - LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff - LANG=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq - - if [ -s $WORK_FILE_BASE.deps.diff ]; then - if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then - DEP_MSG=" diff " - else - DEP_MSG=" redun " - fi - if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then - DIFF_DEP=true - if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then - DEP_MSG="*$DEP_MSG*" - REGRESSIONS=true - else - DEP_MSG=" $DEP_MSG " - fi - else - DEP_MSG="($DEP_MSG)" - DIFF_DEP= - fi - else - DEP_MSG=" " - DIFF_DEP= - if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then - DEP_MSG=" ! " - fi - fi - fi - - # Compare readelf output - if [ -n "$READELF_CMD" ] && [ -z "$SKIP_ELF_DIFF" ]; then - $READELF_CMD $OTHER_FILE > $WORK_FILE_BASE.readelf.other 2>&1 - $READELF_CMD $THIS_FILE > $WORK_FILE_BASE.readelf.this 2>&1 - - LANG=C $DIFF $WORK_FILE_BASE.readelf.other $WORK_FILE_BASE.readelf.this > $WORK_FILE_BASE.readelf.diff - - if [ -s $WORK_FILE_BASE.readelf.diff ]; then - ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.readelf.diff | awk '{print $5}') - ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE) - if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then - DIFF_ELF=true - if [[ "$KNOWN_ELF_DIFF" != *"$BIN_FILE"* ]]; then - ELF_MSG="*$ELF_MSG*" - REGRESSIONS=true - else - ELF_MSG=" $ELF_MSG " - fi - else - ELF_MSG="($ELF_MSG)" - DIFF_ELF= - fi - else - ELF_MSG=" " - DIFF_ELF= - if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then - ELF_MSG=" ! " - fi - fi - fi - - # Compare disassemble output - if [ -f "$OBJDUMP" ] && [ -z "$SKIP_DIS_DIFF" ]; then - $OBJDUMP -d $OTHER_FILE | $GREP -v $NAME > $WORK_FILE_BASE.dis.other 2>&1 - $OBJDUMP -d $THIS_FILE | $GREP -v $NAME > $WORK_FILE_BASE.dis.this 2>&1 - - LANG=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff - - if [ -s $WORK_FILE_BASE.dis.diff ]; then - DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}') - DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE) - if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then - DIFF_DIS=true - if [[ "$KNOWN_DIS_DIFF" != *"$BIN_FILE"* ]]; then - DIS_MSG="*$DIS_MSG*" - REGRESSIONS=true - else - DIS_MSG=" $DIS_MSG " - fi - else - DIS_MSG="($DIS_MSG)" - DIFF_DIS= - fi - else - DIS_MSG=" " - DIFF_DIS= - if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then - DIS_MSG=" ! " - fi - fi - fi - - - if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_ELF$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then - if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi - if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi - if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi - if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi - if [ -n "$ELF_MSG" ]; then echo -n "$ELF_MSG:"; fi - if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi - echo " $BIN_FILE" - if [ "$SHOW_DIFFS" = "true" ]; then - if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then - echo "Symbols diff:" - $CAT $WORK_FILE_BASE.symbols.diff - fi - if [ -s "$WORK_FILE_BASE.deps.diff" ]; then - echo "Deps diff:" - $CAT $WORK_FILE_BASE.deps.diff - fi - if [ -s "$WORK_FILE_BASE.readelf.diff" ]; then - echo "Readelf diff:" - $CAT $WORK_FILE_BASE.readelf.diff - fi - if [ -s "$WORK_FILE_BASE.dis.diff" ]; then - echo "Disassembly diff:" - $CAT $WORK_FILE_BASE.dis.diff - fi - fi - return 1 - fi - return 0 -} - -########################################################################################## -# Print binary diff header - -print_binary_diff_header() { - if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi - if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi - if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi - if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi - if [ -z "$SKIP_ELF_DIFF" ]; then echo -n " Readelf :"; fi - if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi - echo -} - -########################################################################################## -# Compare all libraries - -compare_all_libs() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - LIBS=$(cd $THIS_DIR && $FIND . -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' | $SORT | $FILTER) - - if [ -n "$LIBS" ]; then - echo Libraries... - print_binary_diff_header - for l in $LIBS; do - if [ -f "$OTHER_DIR/$l" ]; then - compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l - if [ "$?" != "0" ]; then - return_value=1 - fi - fi - done - fi - - return $return_value -} - -########################################################################################## -# Compare all executables - -compare_all_execs() { - THIS_DIR=$1 - OTHER_DIR=$2 - WORK_DIR=$3 - - if [ "$OPENJDK_TARGET_OS" = "windows" ]; then - EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER) - else - EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \) | $SORT | $FILTER) - fi - - if [ -n "$EXECS" ]; then - echo Executables... - print_binary_diff_header - for e in $EXECS; do - if [ -f "$OTHER_DIR/$e" ]; then - compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e - if [ "$?" != "0" ]; then - return_value=1 - fi - fi - done - fi - - return $return_value -} - -########################################################################################## -# Initiate configuration - -COMPARE_ROOT=/tmp/cimages.$USER -$MKDIR -p $COMPARE_ROOT -if [ "$OPENJDK_TARGET_OS" = "windows" ]; then - if [ "$(uname -o)" = "Cygwin" ]; then - COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT) - fi -fi - -THIS="$( cd "$( dirname "$0" )" && pwd )" -echo "$THIS" -THIS_SCRIPT="$0" - -if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then - echo "bash ./compare.sh [OPTIONS] [FILTER]" - echo "" - echo "-all Compare all files in all known ways" - echo "-names Compare the file names and directory structure" - echo "-perms Compare the permission bits on all files and directories" - echo "-types Compare the output of the file command on all files" - echo "-general Compare the files not convered by the specialized comparisons" - echo "-zips Compare the contents of all zip files" - echo "-jars Compare the contents of all jar files" - echo "-libs Compare all native libraries" - echo "-execs Compare all executables" - echo "-v Verbose output, does not hide known differences" - echo "-vv More verbose output, shows diff output of all comparisons" - echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory" - echo "" - echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs" - echo "Example:" - echo "bash ./common/bin/compareimages.sh CodePointIM.jar" - exit 10 -fi - -CMP_NAMES=false -CMP_PERMS=false -CMP_TYPES=false -CMP_GENERAL=false -CMP_ZIPS=false -CMP_JARS=false -CMP_LIBS=false -CMP_EXECS=false - -while [ -n "$1" ]; do - case "$1" in - -v) - VERBOSE=true - ;; - -vv) - VERBOSE=true - SHOW_DIFFS=true - ;; - -o) - OTHER=$2 - shift - ;; - -all) - CMP_NAMES=true - if [ "$OPENJDK_TARGET_OS" != "windows" ]; then - CMP_PERMS=true - fi - CMP_TYPES=true - CMP_GENERAL=true - CMP_ZIPS=true - CMP_JARS=true - CMP_LIBS=true - CMP_EXECS=true - ;; - -names) - CMP_NAMES=true - ;; - -perms) - CMP_PERMS=true - ;; - -types) - CMP_TYPES=true - ;; - -general) - CMP_GENERAL=true - ;; - -zips) - CMP_ZIPS=true - ;; - -jars) - CMP_JARS=true - ;; - -libs) - CMP_LIBS=true - ;; - -execs) - CMP_EXECS=true - ;; - *) - CMP_NAMES=false - CMP_PERMS=false - CMP_TYPES=false - CMP_ZIPS=true - CMP_JARS=true - CMP_LIBS=true - CMP_EXECS=true - - if [ -z "$FILTER" ]; then - FILTER="$GREP" - fi - FILTER="$FILTER -e $1" - ;; - esac - shift -done - -if [ "$CMP_NAMES" = "false" ] && [ "$CMP_TYPES" = "false" ] && [ "$CMP_PERMS" = "false" ] && [ "$CMP_GENERAL" = "false" ] && [ "$CMP_ZIPS" = "false" ] && [ "$CMP_JARS" = "false" ] && [ "$CMP_LIBS" = "false" ] && [ "$CMP_EXECS" = "false" ]; then - CMP_NAMES=true - CMP_PERMS=true - CMP_TYPES=true - CMP_GENERAL=true - CMP_ZIPS=true - CMP_JARS=true - CMP_LIBS=true - CMP_EXECS=true -fi - -if [ -z "$FILTER" ]; then - FILTER="$CAT" -fi - -if [ -z "$OTHER" ]; then - OTHER="$THIS/../$LEGACY_BUILD_DIR" - if [ -d "$OTHER" ]; then - OTHER="$( cd "$OTHER" && pwd )" - else - echo "Default old build directory does not exist:" - echo "$OTHER" - fi - echo "Comparing to default old build:" - echo "$OTHER" - echo -else - echo "Comparing to:" - echo "$OTHER" - echo -fi - -if [ ! -d "$OTHER" ]; then - echo "Other build directory does not exist:" - echo "$OTHER" - exit 1; -fi - -# Figure out the layout of the new build. Which kinds of images have been produced -if [ -d "$THIS/images/j2sdk-image" ]; then - THIS_J2SDK="$THIS/images/j2sdk-image" - THIS_J2RE="$THIS/images/j2re-image" -fi -if [ -d "$THIS/images/j2sdk-overlay-image" ]; then - THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image" - THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image" -fi - -# Figure out the layout of the other build (old or new, normal or overlay image) -if [ -d "$OTHER/j2sdk-image" ]; then - if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then - OTHER_J2SDK="$OTHER/j2sdk-image" - OTHER_J2RE="$OTHER/j2re-image" - else - OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image" - OTHER_J2RE_OVERLAY="$OTHER/j2re-image" - fi - -fi - -if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then - echo "OTHER build only has an overlay image while this build does not. Nothing to compare!" +# Now locate the main script and run it. +REAL_COMPARE_SCRIPT="$SRC_ROOT/common/bin/compare.sh" +if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then + echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT" exit 1 fi - -########################################################################################## -# Do the work - -if [ "$CMP_NAMES" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - echo -n "J2SDK " - compare_dirs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - echo -n "J2RE " - compare_dirs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re - - echo -n "J2SDK " - compare_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - echo -n "J2RE " - compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re - fi - if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then - echo -n "J2SDK Overlay " - compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay - echo -n "J2RE Overlay " - compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay - - echo -n "J2SDK Overlay " - compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay - echo -n "J2RE Overlay " - compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay - fi -fi - -if [ "$CMP_PERMS" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - echo -n "J2SDK " - compare_permissions $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - echo -n "J2RE " - compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re - fi - if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then - echo -n "J2SDK Overlay " - compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay - echo -n "J2RE Overlay " - compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay - fi -fi - -if [ "$CMP_TYPES" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - echo -n "J2SDK " - compare_file_types $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - echo -n "J2RE " - compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re - fi - if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then - echo -n "J2SDK Overlay " - compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay - echo -n "J2RE Overlay " - compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay - fi -fi - -if [ "$CMP_GENERAL" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - echo -n "J2SDK " - compare_general_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - echo -n "J2RE " - compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re - fi - if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then - echo -n "J2SDK Overlay " - compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay - echo -n "J2RE Overlay " - compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay - fi -fi - -if [ "$CMP_ZIPS" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - compare_all_zip_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - fi -fi - -if [ "$CMP_JARS" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - compare_all_jar_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - fi -fi - -if [ "$CMP_LIBS" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - compare_all_libs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - fi - if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then - echo -n "Overlay " - compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay - fi -fi - -if [ "$CMP_EXECS" = "true" ]; then - if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then - compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk - fi - if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then - echo -n "Overlay " - compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay - fi -fi - -echo - -if [ -n "$REGRESSIONS" ]; then - echo "REGRESSIONS FOUND!" - echo - exit 1 -else - echo "No regressions found" - echo - exit 0 -fi +. "$REAL_COMPARE_SCRIPT" "$@" diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/configure --- a/common/autoconf/configure Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/configure Fri Oct 26 14:29:57 2012 -0700 @@ -1,4 +1,32 @@ -#!/bin/sh +#!/bin/bash +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +if test "x$BASH_VERSION" = x; then + echo This script needs bash to run. + echo It is recommended to use the configure script in the source tree root instead. + exit 1 +fi CONFIGURE_COMMAND_LINE="$@" conf_script_dir=`dirname $0` @@ -13,58 +41,81 @@ ### Test that the generated configure is up-to-date ### -# On Solaris /bin/sh doesn't support test -nt but /usr/bin/test does. -TEST=`which test` - -print_error_not_up_to_date() { - echo "Error: The configure source files is newer than the generated files." - echo "Please run 'sh autogen.sh' to update the generated files." - echo "Note that this test might trigger incorrectly sometimes due to hg timestamps". +run_autogen_or_fail() { + if test "x`which autoconf 2> /dev/null`" = x; then + echo "Cannot locate autoconf, unable to correct situation." + echo "Please install autoconf and run 'bash autogen.sh' to update the generated files." + echo "Error: Cannot continue" 1>&2 + exit 1 + else + echo "Running autogen.sh to correct the situation" + bash $conf_script_dir/autogen.sh + fi } -# NOTE: This test can occasionally go wrong due to the way mercurial handles -# timestamps. It it supposed to aid during development of build-infra, but should -# go away before making this the default build system. -for file in configure.ac *.m4 ; do - if $TEST $file -nt generated-configure.sh; then - print_error_not_up_to_date - exit 1 - fi -done - -if $TEST -e $conf_custom_script_dir/generated-configure.sh; then - # If custom source configure is available, make sure it is up-to-date as well. - for file in configure.ac *.m4 $conf_custom_script_dir/*.m4; do - if $TEST $file -nt $conf_custom_script_dir/generated-configure.sh; then - print_error_not_up_to_date - exit 1 +check_autoconf_timestamps() { + for file in $conf_script_dir/configure.ac $conf_script_dir/*.m4 ; do + if test $file -nt $conf_script_dir/generated-configure.sh; then + echo "Warning: The configure source files is newer than the generated files." + run_autogen_or_fail fi done + if test -e $conf_custom_script_dir/generated-configure.sh; then + # If custom source configure is available, make sure it is up-to-date as well. + for file in $conf_script_dir/configure.ac $conf_script_dir/*.m4 $conf_custom_script_dir/*.m4; do + if test $file -nt $conf_custom_script_dir/generated-configure.sh; then + echo "Warning: The configure source files is newer than the custom generated files." + run_autogen_or_fail + fi + done + fi +} + +check_hg_updates() { + if test "x`which hg 2> /dev/null`" != x; then + conf_updated_autoconf_files=`cd $conf_script_dir && hg status -mard 2> /dev/null | grep autoconf` + if test "x$conf_updated_autoconf_files" != x; then + echo "Configure source code has been updated, checking time stamps" + check_autoconf_timestamps + fi + + if test -e $conf_custom_script_dir; then + # If custom source configure is available, make sure it is up-to-date as well. + conf_custom_updated_autoconf_files=`cd $conf_custom_script_dir && hg status -mard 2> /dev/null | grep autoconf` + if test "x$conf_custom_updated_autoconf_files" != x; then + echo "Configure custom source code has been updated, checking time stamps" + check_autoconf_timestamps + fi + fi + + fi +} + +# Check for local changes +check_hg_updates + +if test -e $conf_custom_script_dir/generated-configure.sh; then # Test if open configure is newer than custom configure, if so, custom needs to # be regenerated. This test is required to ensure consistency with custom source. - conf_open_configure_timestamp=`grep DATE_WHEN_GENERATED: $conf_script_dir/generated-configure.sh | cut -d" " -f 3` - conf_custom_configure_timestamp=`grep DATE_WHEN_GENERATED: $conf_custom_script_dir/generated-configure.sh | cut -d" " -f 3` - if $TEST $conf_open_configure_timestamp -gt $conf_custom_configure_timestamp; then - echo "Error: The generated configure file contains changes not present in the custom generated file." - echo "Please run 'sh autogen.sh' to update the generated files." - exit 1 + conf_open_configure_timestamp=`grep DATE_WHEN_GENERATED= $conf_script_dir/generated-configure.sh | cut -d"=" -f 2` + conf_custom_configure_timestamp=`grep DATE_WHEN_GENERATED= $conf_custom_script_dir/generated-configure.sh | cut -d"=" -f 2` + if test $conf_open_configure_timestamp -gt $conf_custom_configure_timestamp; then + echo "Warning: The generated configure file contains changes not present in the custom generated file." + run_autogen_or_fail fi - fi # Autoconf calls the configure script recursively sometimes. # Don't start logging twice in that case -if $TEST "x$conf_debug_configure" = xtrue; then +if test "x$conf_debug_configure" = xtrue; then conf_debug_configure=recursive fi ### ### Process command-line arguments ### -conf_processed_arguments= +conf_processed_arguments=() conf_openjdk_target= -conf_extra_cflags= -conf_extra_cxxflags= for conf_option do @@ -72,20 +123,14 @@ --openjdk-target=*) conf_openjdk_target=`expr "X$conf_option" : '[^=]*=\(.*\)'` continue ;; - --with-extra-cflags=*) - conf_extra_cflags=`expr "X$conf_option" : '[^=]*=\(.*\)'` - continue ;; - --with-extra-cxxflags=*) - conf_extra_cxxflags=`expr "X$conf_option" : '[^=]*=\(.*\)'` - continue ;; --debug-configure) - if $TEST "x$conf_debug_configure" != xrecursive; then + if test "x$conf_debug_configure" != xrecursive; then conf_debug_configure=true export conf_debug_configure fi continue ;; *) - conf_processed_arguments="$conf_processed_arguments $conf_option" ;; + conf_processed_arguments=("${conf_processed_arguments[@]}" "$conf_option") ;; esac case $conf_option in @@ -95,11 +140,13 @@ conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; -host | --host | --hos | --ho | -host=* | --host=* | --hos=* | --ho=*) conf_legacy_crosscompile="$conf_legacy_crosscompile $conf_option" ;; + -help | --help | --hel | --he | -h) + conf_print_help=true ;; esac done -if $TEST "x$conf_legacy_crosscompile" != "x"; then - if $TEST "x$conf_openjdk_target" != "x"; then +if test "x$conf_legacy_crosscompile" != "x"; then + if test "x$conf_openjdk_target" != "x"; then echo "Error: Specifying --openjdk-target together with autoconf" echo "legacy cross-compilation flags is not supported." echo "You specified: --openjdk-target=$conf_openjdk_target and $conf_legacy_crosscompile." @@ -112,20 +159,20 @@ fi fi -if $TEST "x$conf_openjdk_target" != "x"; then +if test "x$conf_openjdk_target" != "x"; then conf_build_platform=`sh $conf_script_dir/build-aux/config.guess` - conf_processed_arguments="--build=$conf_build_platform --host=$conf_openjdk_target --target=$conf_openjdk_target $conf_processed_arguments" + conf_processed_arguments=("--build=$conf_build_platform" "--host=$conf_openjdk_target" "--target=$conf_openjdk_target" "${conf_processed_arguments[@]}") fi # Make configure exit with error on invalid options as default. # Can be overridden by --disable-option-checking, since we prepend our argument # and later options override earlier. -conf_processed_arguments="--enable-option-checking=fatal $conf_processed_arguments" +conf_processed_arguments=("--enable-option-checking=fatal" "${conf_processed_arguments[@]}") ### ### Call the configure script ### -if $TEST -e $conf_custom_script_dir/generated-configure.sh; then +if test -e $conf_custom_script_dir/generated-configure.sh; then # Custom source configure available; run that instead echo Running custom generated-configure.sh conf_script_to_run=$conf_custom_script_dir/generated-configure.sh @@ -134,17 +181,17 @@ conf_script_to_run=$conf_script_dir/generated-configure.sh fi -if $TEST "x$conf_debug_configure" != x; then +if test "x$conf_debug_configure" != x; then # Turn on shell debug output if requested (initial or recursive) set -x fi -if $TEST "x$conf_debug_configure" = xtrue; then +if test "x$conf_debug_configure" = xtrue; then # Turn on logging, but don't turn on twice when called recursive conf_debug_logfile=./debug-configure.log - (exec 3>&1 ; (. $conf_script_to_run $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags" 2>&1 1>&3 ) | tee -a $conf_debug_logfile 1>&2 ; exec 3>&-) | tee -a $conf_debug_logfile + (exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_debug_logfile 1>&2 ; exec 3>&-) | tee -a $conf_debug_logfile else - . $conf_script_to_run $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags" + ( . $conf_script_to_run "${conf_processed_arguments[@]}" ) fi conf_result_code=$? @@ -152,8 +199,28 @@ ### Post-processing ### +if test $conf_result_code -eq 0; then + if test "x$conf_print_help" = xtrue; then + cat < + --debug-configure Run the configure script with additional debug + logging enabled. + +Please be aware that, when cross-compiling, the OpenJDK configure script will +generally use 'target' where autoconf traditionally uses 'host'. +EOT + fi +else + echo configure exiting with result code $conf_result_code +fi + # Move the log file to the output root, if this was successfully created -if $TEST -d "$OUTPUT_ROOT"; then +if test -d "$OUTPUT_ROOT"; then mv -f config.log "$OUTPUT_ROOT" 2> /dev/null fi diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/configure.ac --- a/common/autoconf/configure.ac Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/configure.ac Fri Oct 26 14:29:57 2012 -0700 @@ -31,16 +31,14 @@ AC_PREREQ([2.61]) -AC_INIT(openjdk, jdk8, build-dev@openjdk.java.net) - -# Do not change or remove the following line, it is needed for consistency checks: -# DATE_WHEN_GENERATED: @DATE_WHEN_GENERATED@ +AC_INIT(OpenJDK, jdk8, build-dev@openjdk.java.net,,http://openjdk.java.net) AC_CONFIG_AUX_DIR([build-aux]) m4_include([build-aux/pkg.m4]) # Include these first... m4_include([basics.m4]) +m4_include([basics_windows.m4]) m4_include([builddeps.m4]) # ... then the rest m4_include([boot-jdk.m4]) @@ -51,35 +49,57 @@ m4_include([platform.m4]) m4_include([source-dirs.m4]) m4_include([toolchain.m4]) +m4_include([toolchain_windows.m4]) -# This line needs to be here, verbatim, after all includes. -# It is replaced with custom functionality when building +AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK]) +AC_DEFUN_ONCE([CUSTOM_LATE_HOOK]) + +# This line needs to be here, verbatim, after all includes and the dummy hook +# definitions. It is replaced with custom functionality when building # custom sources. -AC_DEFUN_ONCE([CUSTOM_HOOK]) +#CUSTOM_AUTOCONF_INCLUDE + +# Do not change or remove the following line, it is needed for consistency checks: +DATE_WHEN_GENERATED=@DATE_WHEN_GENERATED@ ############################################################################### # -# Initialization +# Initialization / Boot-strapping +# +# The bootstrapping process needs to solve the "chicken or the egg" problem, +# thus it jumps back and forth, each time gaining something needed later on. # ############################################################################### # Basic initialization that must happen first of all BASIC_INIT +BASIC_SETUP_FUNDAMENTAL_TOOLS # Now we can determine OpenJDK build and target platforms. This is required to # have early on. PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET -# Continue setting up basic stuff. +# Continue setting up basic stuff. Most remaining code require fundamental tools. BASIC_SETUP_PATHS BASIC_SETUP_LOGGING +# These are needed to be able to create a configuration name (and thus the output directory) +JDKOPT_SETUP_JDK_VARIANT +JDKOPT_SETUP_JVM_VARIANTS +JDKOPT_SETUP_DEBUG_LEVEL + +# With basic setup done, call the custom early hook. +CUSTOM_EARLY_HOOK + +# To properly create a configuration name, we need to have the OpenJDK target +# and options (variants and debug level) parsed. +BASIC_SETUP_OUTPUT_DIR + # Must be done before we can call HELP_MSG_MISSING_DEPENDENCY. HELP_SETUP_DEPENDENCY_HELP -# Setup simple tools, that do not need have cross compilation support. -# Without these, we can't properly run the rest of the configure script. -BASIC_SETUP_TOOLS +# Setup tools that requires more complex handling, or that is not needed by the configure script. +BASIC_SETUP_COMPLEX_TOOLS # Check if pkg-config is available. PKG_PROG_PKG_CONFIG @@ -100,16 +120,9 @@ ############################################################################### # We need build & target for this. -JDKOPT_SETUP_JDK_VARIANT -JDKOPT_SETUP_JVM_VARIANTS -JDKOPT_SETUP_DEBUG_LEVEL JDKOPT_SETUP_JDK_OPTIONS JDKOPT_SETUP_JDK_VERSION_NUMBERS -# To properly create a configuration name, we need to have the OpenJDK target -# and options (variants and debug level) parsed. -BASIC_SETUP_OUTPUT_DIR - ############################################################################### # # Setup BootJDK, used to bootstrap the build. @@ -137,7 +150,6 @@ ############################################################################### TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS -TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV # Locate the actual tools TOOLCHAIN_SETUP_PATHS @@ -152,10 +164,6 @@ TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK -# After we have toolchain, we can compile the uncygdrive helper -BASIC_COMPILE_UNCYGDRIVE - - # Setup debug symbols (need objcopy from the toolchain for that) JDKOPT_SETUP_DEBUG_SYMBOLS @@ -173,6 +181,9 @@ LIB_SETUP_MISC_LIBS LIB_SETUP_STATIC_LINK_LIBSTDCPP +# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper +BASIC_COMPILE_FIXPATH + ############################################################################### # # We need to do some final tweaking, when everything else is done. @@ -210,7 +221,7 @@ BASIC_TEST_USABILITY_ISSUES # At the end, call the custom hook. (Dummy macro if no custom sources available) -CUSTOM_HOOK +CUSTOM_LATE_HOOK # We're messing a bit with internal autoconf variables to put the config.status # in the output directory instead of the current directory. diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/generated-configure.sh Fri Oct 26 14:29:57 2012 -0700 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for openjdk jdk8. +# Generated by GNU Autoconf 2.67 for OpenJDK jdk8. # # Report bugs to . # @@ -550,12 +550,12 @@ MAKEFLAGS= # Identity of this package. -PACKAGE_NAME='openjdk' +PACKAGE_NAME='OpenJDK' PACKAGE_TARNAME='openjdk' PACKAGE_VERSION='jdk8' -PACKAGE_STRING='openjdk jdk8' +PACKAGE_STRING='OpenJDK jdk8' PACKAGE_BUGREPORT='build-dev@openjdk.java.net' -PACKAGE_URL='' +PACKAGE_URL='http://openjdk.java.net' # Factoring default headers for most tests. ac_includes_default="\ @@ -606,7 +606,9 @@ NUM_CORES SALIB_NAME HOTSPOT_MAKE_ARGS +FIXPATH LIBCXX +STATIC_CXX_SETTING LIBDL LIBM LIBZIP_CAN_USE_MMAP @@ -619,7 +621,6 @@ USING_SYSTEM_FT_LIB FREETYPE2_LIBS FREETYPE2_CFLAGS -CUPS_LIBS CUPS_CFLAGS OPENWIN_HOME X_EXTRA_LIBS @@ -631,7 +632,6 @@ CFLAGS_DEBUG_SYMBOLS ZIP_DEBUGINFO_FILES ENABLE_DEBUG_SYMBOLS -UNCYGDRIVE LDFLAGS_CXX_JDK LDFLAGS_JDKEXE_SUFFIX LDFLAGS_JDKLIB_SUFFIX @@ -672,6 +672,9 @@ SHARED_LIBRARY OBJ_SUFFIX LIPO +ac_ct_OBJDUMP +OBJDUMP +ac_ct_OBJCOPY OBJCOPY MCS STRIP @@ -683,9 +686,13 @@ RC_FLAGS DUMPBIN WINAR +HOTSPOT_RC +HOTSPOT_MT RC MT WINLD +HOTSPOT_LD +HOTSPOT_CXX ARFLAGS AR LDEXECXX @@ -698,6 +705,9 @@ ac_ct_CXX CXXFLAGS CXX +ac_ct_PROPER_COMPILER_CXX +PROPER_COMPILER_CXX +POTENTIAL_CXX OBJEXT EXEEXT ac_ct_CC @@ -705,12 +715,16 @@ LDFLAGS CFLAGS CC +ac_ct_PROPER_COMPILER_CC +PROPER_COMPILER_CC +POTENTIAL_CC BUILD_LD BUILD_CXX BUILD_CC -MSVCR100DLL -CHECK_FOR_VCINSTALLDIR -SETUPDEVENV +MSVCR_DLL +VS_PATH +VS_LIB +VS_INCLUDE CYGWIN_LINK AR_OUT_OPTION LD_OUT_OPTION @@ -733,15 +747,14 @@ BOOT_RTJAR JAVA_CHECK JAVAC_CHECK -OUTPUT_ROOT -CONF_NAME -SPEC COOKED_BUILD_NUMBER FULL_VERSION RELEASE JDK_VERSION RUNTIME_NAME COPYRIGHT_YEAR +MACOSX_BUNDLE_ID_BASE +MACOSX_BUNDLE_NAME_BASE COMPANY_NAME JDK_RC_PLATFORM_NAME PRODUCT_SUFFIX @@ -753,16 +766,38 @@ JDK_MICRO_VERSION JDK_MINOR_VERSION JDK_MAJOR_VERSION -ENABLE_JFR COMPRESS_JARS CACERTS_FILE TEST_IN_BUILD -DISABLE_NIMBUS BUILD_HEADLESS SUPPORT_HEADFUL SUPPORT_HEADLESS -JIGSAW SET_OPENJDK +BDEPS_FTP +BDEPS_UNZIP +OS_VERSION_MICRO +OS_VERSION_MINOR +OS_VERSION_MAJOR +PKG_CONFIG +COMM +TIME +STAT +HG +READELF +OTOOL +LDD +ZIP +UNZIP +FIND_DELETE +MAKE +CHECK_TOOLSDIR_MAKE +CHECK_TOOLSDIR_GMAKE +CHECK_MAKE +CHECK_GMAKE +PKGHANDLER +OUTPUT_ROOT +CONF_NAME +SPEC BUILD_VARIANT_RELEASE DEBUG_CLASSFILES FASTDEBUG @@ -776,72 +811,12 @@ JVM_VARIANT_SERVER JVM_VARIANTS JDK_VARIANT -BDEPS_FTP -BDEPS_UNZIP -OS_VERSION_MICRO -OS_VERSION_MINOR -OS_VERSION_MAJOR -PKG_CONFIG -HG -OBJDUMP -READELF -OTOOL -LDD -THEPWDCMD -FIND_DELETE -RM -MAKE -CHECK_TOOLSDIR_MAKE -CHECK_TOOLSDIR_GMAKE -CHECK_MAKE -CHECK_GMAKE -NAWK -SED -FGREP -EGREP -GREP -AWK -ZIP -XARGS -WC -UNZIP -UNIQ -TR -TOUCH -TEE -TAR -TAIL -SORT -SH -PRINTF -MV -MKDIR -LS -LN -HEAD -FIND -FILE -EXPR -ECHO -DIFF -DF -DATE -CUT -CPIO -CP -CMP -CHMOD -CAT -BASENAME -PKGHANDLER BUILD_LOG_WRAPPER BUILD_LOG_PREVIOUS BUILD_LOG SYS_ROOT PATH_SEP -CYGPATH SRC_ROOT -READLINK DEFINE_CROSS_COMPILE_ARCH LP64 OPENJDK_TARGET_OS_API_DIR @@ -854,18 +829,18 @@ REQUIRED_OS_VERSION REQUIRED_OS_NAME COMPILE_TYPE +OPENJDK_TARGET_CPU_ENDIAN +OPENJDK_TARGET_CPU_BITS +OPENJDK_TARGET_CPU_ARCH +OPENJDK_TARGET_CPU +OPENJDK_TARGET_OS_API +OPENJDK_TARGET_OS OPENJDK_BUILD_CPU_ENDIAN OPENJDK_BUILD_CPU_BITS OPENJDK_BUILD_CPU_ARCH OPENJDK_BUILD_CPU OPENJDK_BUILD_OS_API OPENJDK_BUILD_OS -OPENJDK_TARGET_CPU_ENDIAN -OPENJDK_TARGET_CPU_BITS -OPENJDK_TARGET_CPU_ARCH -OPENJDK_TARGET_CPU -OPENJDK_TARGET_OS_API -OPENJDK_TARGET_OS OPENJDK_BUILD_AUTOCONF_NAME OPENJDK_TARGET_AUTOCONF_NAME target_os @@ -880,6 +855,51 @@ build_vendor build_cpu build +SETFILE +DF +READLINK +CYGPATH +NAWK +SED +FGREP +EGREP +GREP +AWK +XARGS +WHICH +WC +UNIQ +UNAME +TR +TOUCH +TEE +TAR +TAIL +SORT +SH +RM +THEPWDCMD +PRINTF +MV +MKTEMP +MKDIR +LS +LN +HEAD +FIND +FILE +EXPR +ECHO +DIRNAME +DIFF +DATE +CUT +CP +CMP +CHMOD +CAT +BASH +BASENAME DATE_WHEN_CONFIGURED CONFIGURE_COMMAND_LINE CUSTOM_MAKE_DIR @@ -929,23 +949,19 @@ with_sys_root with_tools_dir with_devkit -with_builddeps_conf -with_builddeps_server -with_builddeps_dir -with_builddeps_group -enable_list_builddeps with_jdk_variant with_jvm_variants enable_debug with_debug_level +with_conf_name +with_builddeps_conf +with_builddeps_server +with_builddeps_dir +with_builddeps_group enable_openjdk_only -enable_jigsaw enable_headful -enable_nimbus enable_hotspot_test_in_build with_cacerts_file -enable_jfr -with_conf_name with_boot_jdk with_boot_jdk_jvmargs with_add_source_root @@ -957,7 +973,7 @@ with_override_jaxws with_override_hotspot with_override_jdk -with_msvcr100dll +with_msvcr_dll with_extra_cflags with_extra_cxxflags with_extra_ldflags @@ -967,7 +983,6 @@ with_x with_cups with_cups_include -with_cups_lib with_freetype with_alsa with_alsa_include @@ -1546,7 +1561,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures openjdk jdk8 to adapt to many kinds of systems. +\`configure' configures OpenJDK jdk8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1616,7 +1631,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of openjdk jdk8:";; + short | recursive ) echo "Configuration of OpenJDK jdk8:";; esac cat <<\_ACEOF @@ -1624,24 +1639,17 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-list-builddeps list all build dependencies known to the configure - script --enable-debug set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) [disabled] - --enable-openjdk-only build OpenJDK regardless of the presence of closed - repositories [disabled] - --enable-jigsaw build Jigsaw images (not yet available) [disabled] - --disable-headful build headful support (graphical UI support) - [enabled] - --disable-nimbus disable Nimbus L&F [enabled] + --enable-openjdk-only supress building closed source even if present + [disabled] + --disable-headful disable building headful support (graphical UI + support) [enabled] --enable-hotspot-test-in-build - enable running of Queens test after Hotspot build - (not yet available) [disabled] - --enable-jfr enable jfr (default is no) - ENABLE_JFR="${enableval}" - --disable-debug-symbols disable generation of debug symbols ([enabled]) + run the Queens test after Hotspot build [disabled] + --disable-debug-symbols disable generation of debug symbols [enabled] --disable-zip-debug-info - don't zip debug-info files ([enabled@:@) + disable zipping of debug-info files [enabled] --disable-macosx-runtime-support disable the use of MacOSX Java runtime support framework [enabled] @@ -1651,38 +1659,38 @@ --enable-sjavac use sjavac to do fast incremental compiles [disabled] --disable-precompiled-headers - use precompiled headers when compiling C++ [enabled] - --disable-ccache use ccache to speed up recompilations [enabled] + disable using precompiled headers when compiling C++ + [enabled] + --disable-ccache disable using ccache to speed up recompilations + [enabled] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-custom-make-dir directory containing custom build/make files + --with-custom-make-dir use this directory for custom build/make files --with-target-bits build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 [guessed] - --with-sys-root pass this sys-root to the compilers and linker - (useful if the sys-root encoded in the cross - compiler tools is incorrect) - --with-tools-dir search this directory for (cross-compiling) - compilers and tools + --with-sys-root pass this sys-root to the compilers and tools (for + cross-compiling) + --with-tools-dir search this directory for compilers and tools (for + cross-compiling) --with-devkit use this directory as base for tools-dir and sys-root (for cross-compiling) - --with-builddeps-conf use this configuration file for the builddeps - --with-builddeps-server download and use build dependencies from this server - url, e.g. - --with-builddeps-server=ftp://example.com/dir - --with-builddeps-dir store downloaded build dependencies here - [d/localhome/builddeps] - --with-builddeps-group chgrp the downloaded build dependencies to this - group --with-jdk-variant JDK variant to build (normal) [normal] --with-jvm-variants JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) [server] --with-debug-level set the debug level (release, fastdebug, slowdebug) [release] + --with-conf-name use this as the name of the configuration [generated + from important configuration options] + --with-builddeps-conf use this configuration file for the builddeps + --with-builddeps-server download and use build dependencies from this server + url + --with-builddeps-dir store downloaded build dependencies here + [/localhome/builddeps] + --with-builddeps-group chgrp the downloaded build dependencies to this + group --with-cacerts-file specify alternative cacerts file - --with-conf-name use this as the name of the configuration, - overriding the generated default --with-boot-jdk path to Boot JDK (used to bootstrap build) [probed] --with-boot-jdk-jvmargs specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default @@ -1707,16 +1715,15 @@ --with-override-jaxws use this jaxws dir for the build --with-override-hotspot use this hotspot dir for the build --with-override-jdk use this jdk dir for the build - --with-msvcr100dll copy this msvcr100.dll into the built JDK + --with-msvcr-dll copy this msvcr100.dll into the built JDK (Windows + only) [probed] --with-extra-cflags extra flags to be used when compiling jdk c-files --with-extra-cxxflags extra flags to be used when compiling jdk c++-files --with-extra-ldflags extra flags to be used when linking jdk --with-x use the X Window System --with-cups specify prefix directory for the cups package - (expecting the libraries under PATH/lib and the - headers under PATH/include) + (expecting the headers under PATH/include) --with-cups-include specify directory for the cups include files - --with-cups-lib specify directory for the cups library --with-freetype specify prefix directory for the freetype2 package (expecting the libraries under PATH/lib and the headers under PATH/include) @@ -1733,10 +1740,7 @@ --with-memory-size=1024 [probed] --with-sjavac-server-java use this java binary for running the sjavac - background server and other long running java tasks - in the build process, e.g. - ---with-sjavac-server-java="/opt/jrockit/bin/java - -server" + background server [Boot JDK java] --with-sjavac-server-cores use at most this number of concurrent threads on the sjavac server [probed] @@ -1769,6 +1773,7 @@ it to find libraries and programs with nonstandard names/locations. Report bugs to . +OpenJDK home page: . _ACEOF ac_status=$? fi @@ -1831,7 +1836,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -openjdk configure jdk8 +OpenJDK configure jdk8 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2488,101 +2493,41 @@ } # ac_fn_cxx_check_func -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no + eval "$3=yes" +else + eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------------- ## -## Report this to build-dev@openjdk.java.net ## -## ----------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} -} # ac_fn_c_check_header_mongrel +} # ac_fn_c_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by openjdk $as_me jdk8, which was +It was created by OpenJDK $as_me jdk8, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2931,9 +2876,6 @@ -# Do not change or remove the following line, it is needed for consistency checks: -# DATE_WHEN_GENERATED: 1347963060 - ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then @@ -3053,14 +2995,46 @@ - - - - - - - - +# This will make sure the given variable points to a full and proper +# path. This means: +# 1) There will be no spaces in the path. On posix platforms, +# spaces in the path will result in an error. On Windows, +# the path will be rewritten using short-style to be space-free. +# 2) The path will be absolute, and it will be in unix-style (on +# cygwin). +# $1: The name of the variable to fix + + +# This will make sure the given variable points to a executable +# with a full and proper path. This means: +# 1) There will be no spaces in the path. On posix platforms, +# spaces in the path will result in an error. On Windows, +# the path will be rewritten using short-style to be space-free. +# 2) The path will be absolute, and it will be in unix-style (on +# cygwin). +# Any arguments given to the executable is preserved. +# If the input variable does not have a directory specification, then +# it need to be in the PATH. +# $1: The name of the variable to fix + + + + + + +# Test that variable $1 denoting a program is not empty. If empty, exit with an error. +# $1: variable to check +# $2: executable name to print in warning (optional) + + +# Does AC_PATH_PROG followed by BASIC_CHECK_NONEMPTY. +# Arguments as AC_PATH_PROG: +# $1: variable to set +# $2: executable name to look for + + +# Setup the most fundamental tools that relies on not much else to set up, +# but is used by much of the early bootstrap code. # Setup basic configuration paths, and platform-specific stuff related to PATHs. @@ -3083,23 +3057,10 @@ -# Test that variable $1 denoting a program is not empty. If empty, exit with an error. -# $1: variable to check -# $2: executable name to print in warning (optional) - - -# Does AC_PATH_PROG followed by CHECK_NONEMPTY. -# Arguments as AC_PATH_PROG: -# $1: variable to set -# $2: executable name to look for - - - - - - - -# Check if build directory is on local disk. + + +# Check if build directory is on local disk. If not possible to determine, +# we prefer to claim it's local. # Argument 1: directory to test # Argument 2: what to do if it is on local disk # Argument 3: what to do otherwise (remote disk or failure) @@ -3136,6 +3097,64 @@ +# Helper function which possibly converts a path using DOS-style short mode. +# If so, the updated path is stored in $new_path. +# $1: The path to check + + +# Helper function which possibly converts a path using DOS-style short mode. +# If so, the updated path is stored in $new_path. +# $1: The path to check + + +# FIXME: The BASIC_FIXUP_*_CYGWIN/MSYS is most likely too convoluted +# and could probably be heavily simplified. However, all changes in this +# area tend to need lot of testing in different scenarios, and in lack of +# proper unit testing, cleaning this up has not been deemed worth the effort +# at the moment. + + + + + + + + + +# Setup basic configuration paths, and platform-specific stuff related to PATHs. + + + + +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + + + + + @@ -3287,6 +3306,19 @@ +cygwin_help() { + case $1 in + unzip) + PKGHANDLER_COMMAND="cd && cmd /c setup -q -P unzip" ;; + zip) + PKGHANDLER_COMMAND="cd && cmd /c setup -q -P zip" ;; + make) + PKGHANDLER_COMMAND="cd && cmd /c setup -q -P make" ;; + * ) + break ;; + esac +} + apt_help() { case $1 in devkit) @@ -3561,28 +3593,82 @@ # questions. # - - - - - - - - - - - - - - -# This line needs to be here, verbatim, after all includes. -# It is replaced with custom functionality when building +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) + + + + + +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) +# $3 = list of compiler names to search for + + + + + + + + + + + + +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + + + + + + + +# Check if the VS env variables were setup prior to running configure. +# If not, then find vcvarsall.bat and run it automatically, and integrate +# the set env variables into the spec file. + + + + + + +# This line needs to be here, verbatim, after all includes and the dummy hook +# definitions. It is replaced with custom functionality when building # custom sources. - - -############################################################################### -# -# Initialization +#CUSTOM_AUTOCONF_INCLUDE + +# Do not change or remove the following line, it is needed for consistency checks: +DATE_WHEN_GENERATED=1351257228 + +############################################################################### +# +# Initialization / Boot-strapping +# +# The bootstrapping process needs to solve the "chicken or the egg" problem, +# thus it jumps back and forth, each time gaining something needed later on. # ############################################################################### @@ -3592,789 +3678,12 @@ DATE_WHEN_CONFIGURED=`LANG=C date` - - -# Now we can determine OpenJDK build and target platforms. This is required to -# have early on. -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" -# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the -# product you're building. The target of this build is called "host". Since this is confusing to most people, we -# have not adopted that system, but use "target" as the platform we are building for. In some places though we need -# to use the configure naming style. - - - - - - # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME - # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME - # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, - # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. - OPENJDK_TARGET_AUTOCONF_NAME="$host" - OPENJDK_BUILD_AUTOCONF_NAME="$build" - - - - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. - - case "$host_os" in - *linux*) - VAR_OS=linux - VAR_OS_API=posix - ;; - *solaris*) - VAR_OS=solaris - VAR_OS_API=posix - ;; - *darwin*) - VAR_OS=macosx - VAR_OS_API=posix - ;; - *bsd*) - VAR_OS=bsd - VAR_OS_API=posix - ;; - *cygwin*|*windows*) - VAR_OS=windows - VAR_OS_API=winapi - ;; - *) - as_fn_error $? "unsupported operating system $host_os" "$LINENO" 5 - ;; - esac - - - # First argument is the cpu name from the trip/quad - case "$host_cpu" in - x86_64) - VAR_CPU=x86_64 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - i?86) - VAR_CPU=x86 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - arm*) - VAR_CPU=arm - VAR_CPU_ARCH=arm - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - powerpc) - VAR_CPU=ppc - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - powerpc64) - VAR_CPU=ppc64 - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - sparc) - VAR_CPU=sparc - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - sparcv9) - VAR_CPU=sparcv9 - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - *) - as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5 - ;; - esac - - # ... and setup our own variables. (Do this explicitely to facilitate searching) - OPENJDK_TARGET_OS="$VAR_OS" - OPENJDK_TARGET_OS_API="$VAR_OS_API" - OPENJDK_TARGET_CPU="$VAR_CPU" - OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" - - - - - - - - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. - - case "$build_os" in - *linux*) - VAR_OS=linux - VAR_OS_API=posix - ;; - *solaris*) - VAR_OS=solaris - VAR_OS_API=posix - ;; - *darwin*) - VAR_OS=macosx - VAR_OS_API=posix - ;; - *bsd*) - VAR_OS=bsd - VAR_OS_API=posix - ;; - *cygwin*|*windows*) - VAR_OS=windows - VAR_OS_API=winapi - ;; - *) - as_fn_error $? "unsupported operating system $build_os" "$LINENO" 5 - ;; - esac - - - # First argument is the cpu name from the trip/quad - case "$build_cpu" in - x86_64) - VAR_CPU=x86_64 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=little - ;; - i?86) - VAR_CPU=x86 - VAR_CPU_ARCH=x86 - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - arm*) - VAR_CPU=arm - VAR_CPU_ARCH=arm - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=little - ;; - powerpc) - VAR_CPU=ppc - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - powerpc64) - VAR_CPU=ppc64 - VAR_CPU_ARCH=ppc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - sparc) - VAR_CPU=sparc - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=32 - VAR_CPU_ENDIAN=big - ;; - sparcv9) - VAR_CPU=sparcv9 - VAR_CPU_ARCH=sparc - VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big - ;; - *) - as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5 - ;; - esac - - # ..and setup our own variables. (Do this explicitely to facilitate searching) - OPENJDK_BUILD_OS="$VAR_OS" - OPENJDK_BUILD_OS_API="$VAR_OS_API" - OPENJDK_BUILD_CPU="$VAR_CPU" - OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" - - - - - - - - - -# Check whether --with-target-bits was given. -if test "${with_target_bits+set}" = set; then : - withval=$with_target_bits; -fi - - - # We have three types of compiles: - # native == normal compilation, target system == build system - # cross == traditional cross compilation, target system != build system; special toolchain needed - # reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines - # - if test "x$OPENJDK_BUILD_AUTOCONF_NAME" != "x$OPENJDK_TARGET_AUTOCONF_NAME"; then - # We're doing a proper cross-compilation - COMPILE_TYPE="cross" - else - COMPILE_TYPE="native" - fi - - if test "x$with_target_bits" != x; then - if test "x$COMPILE_TYPE" = "xcross"; then - as_fn_error $? "It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either." "$LINENO" 5 - fi - - if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - # A reduced build is requested - COMPILE_TYPE="reduced" - OPENJDK_TARGET_CPU_BITS=32 - if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then - OPENJDK_TARGET_CPU=x86 - elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then - OPENJDK_TARGET_CPU=sparc - else - as_fn_error $? "Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9" "$LINENO" 5 - fi - elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - as_fn_error $? "It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead." "$LINENO" 5 - elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: --with-target-bits are set to build platform address size; argument has no meaning" >&5 -$as_echo "$as_me: --with-target-bits are set to build platform address size; argument has no meaning" >&6;} - else - as_fn_error $? "--with-target-bits can only be 32 or 64, you specified $with_target_bits!" "$LINENO" 5 - fi - fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compilation type" >&5 -$as_echo_n "checking for compilation type... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPILE_TYPE" >&5 -$as_echo "$COMPILE_TYPE" >&6; } - - - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - REQUIRED_OS_NAME=SunOS - REQUIRED_OS_VERSION=5.10 - fi - if test "x$OPENJDK_TARGET_OS" = "xlinux"; then - REQUIRED_OS_NAME=Linux - REQUIRED_OS_VERSION=2.6 - fi - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - REQUIRED_OS_NAME=Windows - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - REQUIRED_OS_VERSION=5.2 - else - REQUIRED_OS_VERSION=5.1 - fi - fi - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - REQUIRED_OS_NAME=Darwin - REQUIRED_OS_VERSION=11.2 - fi - - - - - - # Also store the legacy naming of the cpu. - # Ie i586 and amd64 instead of x86 and x86_64 - OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY="i586" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except MacOSX replace x86_64 with amd64. - OPENJDK_TARGET_CPU_LEGACY="amd64" - fi - - - # And the second legacy naming of the cpu. - # Ie i386 and amd64 instead of x86 and x86_64. - OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_LEGACY_LIB="i386" - elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" - fi - - - # This is the name of the cpu (but using i386 and amd64 instead of - # x86 and x86_64, respectively), preceeded by a /, to be used when - # locating libraries. On macosx, it's empty, though. - OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - OPENJDK_TARGET_CPU_LIBDIR="" - fi - - - # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to - # /amd64 or /sparcv9. This string is appended to some library paths, like this: - # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so - OPENJDK_TARGET_CPU_ISADIR="" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - if test "x$OPENJDK_TARGET_CPU" = xx86_64; then - OPENJDK_TARGET_CPU_ISADIR="/amd64" - elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then - OPENJDK_TARGET_CPU_ISADIR="/sparcv9" - fi - fi - - - # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property - OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then - # On linux only, we replace x86 with i386. - OPENJDK_TARGET_CPU_OSARCH="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_OSARCH="amd64" - fi - - - OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - OPENJDK_TARGET_CPU_JLI="i386" - elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - # On all platforms except macosx, we replace x86_64 with amd64. - OPENJDK_TARGET_CPU_JLI="amd64" - fi - # Now setup the -D flags for building libjli. - OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" - elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then - OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" - fi - fi - - - # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. - if test "x$OPENJDK_TARGET_OS_API" = xposix; then - OPENJDK_TARGET_OS_API_DIR="solaris" - fi - if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then - OPENJDK_TARGET_OS_API_DIR="windows" - fi - - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - A_LP64="LP64:=" - ADD_LP64="-D_LP64=1" - fi - LP64=$A_LP64 - - - if test "x$COMPILE_TYPE" = "xcross"; then - # FIXME: ... or should this include reduced builds..? - DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" - else - DEFINE_CROSS_COMPILE_ARCH="" - fi - - - - -# Continue setting up basic stuff. - -# Locate the directory of this script. -SCRIPT="$0" - - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - # Extract the first word of "readlink", so it can be a program name with args. -set dummy readlink; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_READLINK+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $READLINK in - [\\/]* | ?:[\\/]*) - ac_cv_path_READLINK="$READLINK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_READLINK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READLINK=$ac_cv_path_READLINK -if test -n "$READLINK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINK" >&5 -$as_echo "$READLINK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --help 2>&1 | grep GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - SCRIPT=`$READLINK -f $SCRIPT` - else - STARTDIR=$PWD - COUNTER=0 - DIR=`dirname $SCRIPT` - FIL=`basename $SCRIPT` - while test $COUNTER -lt 20; do - ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # The link might be relative! We have to use cd to travel safely. - cd $DIR - cd `dirname $ISLINK` - DIR=`pwd` - FIL=`basename $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - SCRIPT=$DIR/$FIL - fi - fi - -AUTOCONF_DIR=`dirname $0` - -# Where is the source? It is located two levels above the configure script. -CURDIR="$PWD" -cd "$AUTOCONF_DIR/../.." -SRC_ROOT="`pwd`" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - SRC_ROOT_LENGTH=`pwd|wc -m` - if test $SRC_ROOT_LENGTH -gt 100; then - as_fn_error $? "Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" "$LINENO" 5 - fi -fi - -cd "$CURDIR" - - - # Fail with message the path to the source root if var SRC_ROOT contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$SRC_ROOT" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - SRC_ROOT=`$CYGPATH -s -m -a "$SRC_ROOT"` - # Now it's case insensitive; let's make it lowercase to improve readability - SRC_ROOT=`$ECHO "$SRC_ROOT" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - SRC_ROOT=`$CYGPATH -u "$SRC_ROOT"` - else - as_fn_error $? "You cannot have spaces in the path to the source root! \"$SRC_ROOT\"" "$LINENO" 5 - fi - fi - - - # Fail with message the path to the current directory if var CURDIR contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$CURDIR" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - CURDIR=`$CYGPATH -s -m -a "$CURDIR"` - # Now it's case insensitive; let's make it lowercase to improve readability - CURDIR=`$ECHO "$CURDIR" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - CURDIR=`$CYGPATH -u "$CURDIR"` - else - as_fn_error $? "You cannot have spaces in the path to the current directory! \"$CURDIR\"" "$LINENO" 5 - fi - fi - - -if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then - # Add extra search paths on solaris for utilities like ar and as etc... - PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" -fi - -# For cygwin we need cygpath first, since it is used everywhere. -# Extract the first word of "cygpath", so it can be a program name with args. -set dummy cygpath; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CYGPATH+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $CYGPATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_CYGPATH="$CYGPATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CYGPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CYGPATH=$ac_cv_path_CYGPATH -if test -n "$CYGPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 -$as_echo "$CYGPATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -PATH_SEP=":" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - if test "x$CYGPATH" = x; then - as_fn_error $? "Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" "$LINENO" 5 - fi - PATH_SEP=";" -fi - - -# You can force the sys-root if the sys-root encoded into the cross compiler tools -# is not correct. - -# Check whether --with-sys-root was given. -if test "${with_sys_root+set}" = set; then : - withval=$with_sys_root; -fi - - -if test "x$with_sys_root" != x; then - SYS_ROOT=$with_sys_root -else - SYS_ROOT=/ -fi - - - -# Check whether --with-tools-dir was given. -if test "${with_tools_dir+set}" = set; then : - withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir -fi - - - -# Check whether --with-devkit was given. -if test "${with_devkit+set}" = set; then : - withval=$with_devkit; - if test "x$with_sys_root" != x; then - as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5 - fi - if test "x$with_tools_dir" != x; then - as_fn_error $? "Cannot specify both --with-devkit and --with-tools-dir at the same time" "$LINENO" 5 - fi - TOOLS_DIR=$with_devkit/bin - SYS_ROOT=$with_devkit/$host_alias/libc - -fi - - - - -# Setup default logging of stdout and stderr to build.log in the output root. -BUILD_LOG='$(OUTPUT_ROOT)/build.log' -BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' -BUILD_LOG_WRAPPER='$(SH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' - - - - - -# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY. - - for ac_prog in apt-get yum port pkgutil pkgadd -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_PKGHANDLER+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PKGHANDLER"; then - ac_cv_prog_PKGHANDLER="$PKGHANDLER" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_PKGHANDLER="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -PKGHANDLER=$ac_cv_prog_PKGHANDLER -if test -n "$PKGHANDLER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGHANDLER" >&5 -$as_echo "$PKGHANDLER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$PKGHANDLER" && break -done - - - -# Setup simple tools, that do not need have cross compilation support. -# Without these, we can't properly run the rest of the configure script. +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5 +$as_echo "$as_me: Configuration created at $DATE_WHEN_CONFIGURED." >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: configure script generated at timestamp $DATE_WHEN_GENERATED." >&5 +$as_echo "$as_me: configure script generated at timestamp $DATE_WHEN_GENERATED." >&6;} + + # Start with tools that do not need have cross compilation support # and can be expected to be found in the default PATH. These tools are @@ -4443,6 +3752,65 @@ + for ac_prog in bash +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_BASH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $BASH in + [\\/]* | ?:[\\/]*) + ac_cv_path_BASH="$BASH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +BASH=$ac_cv_path_BASH +if test -n "$BASH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5 +$as_echo "$BASH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$BASH" && break +done + + + if test "x$BASH" = x; then + if test "xbash" = x; then + PROG_NAME=bash + else + PROG_NAME=bash + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + for ac_prog in cat do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -4679,65 +4047,6 @@ - for ac_prog in cpio -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CPIO+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $CPIO in - [\\/]* | ?:[\\/]*) - ac_cv_path_CPIO="$CPIO" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CPIO="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CPIO=$ac_cv_path_CPIO -if test -n "$CPIO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPIO" >&5 -$as_echo "$CPIO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CPIO" && break -done - - - if test "x$CPIO" = x; then - if test "xcpio" = x; then - PROG_NAME=cpio - else - PROG_NAME=cpio - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - - for ac_prog in cut do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -4856,65 +4165,6 @@ - for ac_prog in df -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_DF+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $DF in - [\\/]* | ?:[\\/]*) - ac_cv_path_DF="$DF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_DF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -DF=$ac_cv_path_DF -if test -n "$DF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DF" >&5 -$as_echo "$DF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DF" && break -done - - - if test "x$DF" = x; then - if test "xdf" = x; then - PROG_NAME=df - else - PROG_NAME=df - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - - for ac_prog in gdiff diff do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -4974,6 +4224,65 @@ + for ac_prog in dirname +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_DIRNAME+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $DIRNAME in + [\\/]* | ?:[\\/]*) + ac_cv_path_DIRNAME="$DIRNAME" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DIRNAME=$ac_cv_path_DIRNAME +if test -n "$DIRNAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5 +$as_echo "$DIRNAME" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DIRNAME" && break +done + + + if test "x$DIRNAME" = x; then + if test "xdirname" = x; then + PROG_NAME=dirname + else + PROG_NAME=dirname + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + for ac_prog in echo do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -5446,6 +4755,65 @@ + for ac_prog in mktemp +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MKTEMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $MKTEMP in + [\\/]* | ?:[\\/]*) + ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MKTEMP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MKTEMP=$ac_cv_path_MKTEMP +if test -n "$MKTEMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKTEMP" >&5 +$as_echo "$MKTEMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$MKTEMP" && break +done + + + if test "x$MKTEMP" = x; then + if test "xmktemp" = x; then + PROG_NAME=mktemp + else + PROG_NAME=mktemp + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + for ac_prog in mv do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -5564,6 +4932,124 @@ + for ac_prog in pwd +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_THEPWDCMD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $THEPWDCMD in + [\\/]* | ?:[\\/]*) + ac_cv_path_THEPWDCMD="$THEPWDCMD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_THEPWDCMD="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +THEPWDCMD=$ac_cv_path_THEPWDCMD +if test -n "$THEPWDCMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THEPWDCMD" >&5 +$as_echo "$THEPWDCMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$THEPWDCMD" && break +done + + + if test "x$THEPWDCMD" = x; then + if test "xpwd" = x; then + PROG_NAME=thepwdcmd + else + PROG_NAME=pwd + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + + for ac_prog in rm +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_RM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $RM in + [\\/]* | ?:[\\/]*) + ac_cv_path_RM="$RM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +RM=$ac_cv_path_RM +if test -n "$RM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 +$as_echo "$RM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$RM" && break +done + + + if test "x$RM" = x; then + if test "xrm" = x; then + PROG_NAME=rm + else + PROG_NAME=rm + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + for ac_prog in sh do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -5977,6 +5463,65 @@ + for ac_prog in uname +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_UNAME+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $UNAME in + [\\/]* | ?:[\\/]*) + ac_cv_path_UNAME="$UNAME" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_UNAME="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +UNAME=$ac_cv_path_UNAME +if test -n "$UNAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5 +$as_echo "$UNAME" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$UNAME" && break +done + + + if test "x$UNAME" = x; then + if test "xuname" = x; then + PROG_NAME=uname + else + PROG_NAME=uname + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + for ac_prog in uniq do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -6036,65 +5581,6 @@ - for ac_prog in unzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_UNZIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $UNZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_UNZIP="$UNZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -UNZIP=$ac_cv_path_UNZIP -if test -n "$UNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5 -$as_echo "$UNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$UNZIP" && break -done - - - if test "x$UNZIP" = x; then - if test "xunzip" = x; then - PROG_NAME=unzip - else - PROG_NAME=unzip - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - - for ac_prog in wc do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -6154,6 +5640,65 @@ + for ac_prog in which +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_WHICH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $WHICH in + [\\/]* | ?:[\\/]*) + ac_cv_path_WHICH="$WHICH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_WHICH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +WHICH=$ac_cv_path_WHICH +if test -n "$WHICH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHICH" >&5 +$as_echo "$WHICH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$WHICH" && break +done + + + if test "x$WHICH" = x; then + if test "xwhich" = x; then + PROG_NAME=which + else + PROG_NAME=which + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + for ac_prog in xargs do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -6213,65 +5758,6 @@ - for ac_prog in zip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ZIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $ZIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ZIP=$ac_cv_path_ZIP -if test -n "$ZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5 -$as_echo "$ZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ZIP" && break -done - - - if test "x$ZIP" = x; then - if test "xzip" = x; then - PROG_NAME=zip - else - PROG_NAME=zip - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - - # Then required tools that require some special treatment. for ac_prog in gawk mawk nawk awk do @@ -6700,1231 +6186,1150 @@ fi - - # We need to find a recent version of GNU make. Especially on Solaris, this can be tricky. - if test "x$MAKE" != x; then - # User has supplied a make, test it. - if test ! -f "$MAKE"; then - as_fn_error $? "The specified make (by MAKE=$MAKE) is not found." "$LINENO" 5 - fi - - MAKE_CANDIDATE=""$MAKE"" - DESCRIPTION="user supplied MAKE=" - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$MAKE_CANDIDATE" - car="${tmp%% *}" - tmp="$MAKE_CANDIDATE EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - MAKE_CANDIDATE="$car ${cdr% *}" - else - MAKE_CANDIDATE="$car" - fi - - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - fi - fi - fi - - if test "x$FOUND_MAKE" = x; then - as_fn_error $? "The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer." "$LINENO" 5 - fi - else - # Try our hardest to locate a correct version of GNU make - for ac_prog in gmake -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_GMAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_GMAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_GMAKE="$CHECK_GMAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CHECK_GMAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_GMAKE=$ac_cv_path_CHECK_GMAKE -if test -n "$CHECK_GMAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_GMAKE" >&5 -$as_echo "$CHECK_GMAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_GMAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_GMAKE"" - DESCRIPTION="gmake in PATH" - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$MAKE_CANDIDATE" - car="${tmp%% *}" - tmp="$MAKE_CANDIDATE EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - MAKE_CANDIDATE="$car ${cdr% *}" - else - MAKE_CANDIDATE="$car" - fi - - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - fi - fi - fi - - - if test "x$FOUND_MAKE" = x; then - for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_MAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_MAKE="$CHECK_MAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CHECK_MAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_MAKE=$ac_cv_path_CHECK_MAKE -if test -n "$CHECK_MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_MAKE" >&5 -$as_echo "$CHECK_MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_MAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_MAKE"" - DESCRIPTION="make in PATH" - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$MAKE_CANDIDATE" - car="${tmp%% *}" - tmp="$MAKE_CANDIDATE EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - MAKE_CANDIDATE="$car ${cdr% *}" - else - MAKE_CANDIDATE="$car" - fi - - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - fi - fi - fi - - fi - - if test "x$FOUND_MAKE" = x; then - if test "x$TOOLS_DIR" != x; then - # We have a tools-dir, check that as well before giving up. - OLD_PATH=$PATH - PATH=$TOOLS_DIR:$PATH - for ac_prog in gmake -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_TOOLSDIR_GMAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_TOOLSDIR_GMAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_TOOLSDIR_GMAKE="$CHECK_TOOLSDIR_GMAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CHECK_TOOLSDIR_GMAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_TOOLSDIR_GMAKE=$ac_cv_path_CHECK_TOOLSDIR_GMAKE -if test -n "$CHECK_TOOLSDIR_GMAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_GMAKE" >&5 -$as_echo "$CHECK_TOOLSDIR_GMAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_TOOLSDIR_GMAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_TOOLSDIR_GMAKE"" - DESCRIPTION="gmake in tools-dir" - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$MAKE_CANDIDATE" - car="${tmp%% *}" - tmp="$MAKE_CANDIDATE EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - MAKE_CANDIDATE="$car ${cdr% *}" - else - MAKE_CANDIDATE="$car" - fi - - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - fi - fi - fi - - if test "x$FOUND_MAKE" = x; then - for ac_prog in make -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CHECK_TOOLSDIR_MAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $CHECK_TOOLSDIR_MAKE in - [\\/]* | ?:[\\/]*) - ac_cv_path_CHECK_TOOLSDIR_MAKE="$CHECK_TOOLSDIR_MAKE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_CHECK_TOOLSDIR_MAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -CHECK_TOOLSDIR_MAKE=$ac_cv_path_CHECK_TOOLSDIR_MAKE -if test -n "$CHECK_TOOLSDIR_MAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_MAKE" >&5 -$as_echo "$CHECK_TOOLSDIR_MAKE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CHECK_TOOLSDIR_MAKE" && break -done - - - MAKE_CANDIDATE=""$CHECK_TOOLSDIR_MAKE"" - DESCRIPTION="make in tools-dir" - if test "x$MAKE_CANDIDATE" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 -$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} - - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$MAKE_CANDIDATE" - car="${tmp%% *}" - tmp="$MAKE_CANDIDATE EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - MAKE_CANDIDATE="$car ${cdr% *}" - else - MAKE_CANDIDATE="$car" - fi - - MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` - IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` - if test "x$IS_GNU_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 -$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} - else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` - if test "x$IS_MODERN_MAKE" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 -$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} - else - FOUND_MAKE=$MAKE_CANDIDATE - fi - fi - fi - - fi - PATH=$OLD_PATH - fi - fi - - if test "x$FOUND_MAKE" = x; then - as_fn_error $? "Cannot find GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure." "$LINENO" 5 - fi - fi - - MAKE=$FOUND_MAKE - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&5 -$as_echo "$as_me: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&6;} - - - - for ac_prog in rm -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_RM+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 -$as_echo "$RM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$RM" && break -done - - - if test "x$RM" = x; then - if test "xrm" = x; then - PROG_NAME=rm - else - PROG_NAME=rm - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 -$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} - as_fn_error $? "Cannot continue" "$LINENO" 5 - fi - - +# Always force rm. RM="$RM -f" - - # Test if find supports -delete - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if find supports -delete" >&5 -$as_echo_n "checking if find supports -delete... " >&6; } - FIND_DELETE="-delete" - - DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) - - echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete - - TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` - if test -f $DELETEDIR/TestIfFindSupportsDelete; then - # No, it does not. - rm $DELETEDIR/TestIfFindSupportsDelete - FIND_DELETE="-exec rm \{\} \+" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - rmdir $DELETEDIR - - - -# Non-required basic tools - -# Extract the first word of "pwd", so it can be a program name with args. -set dummy pwd; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_THEPWDCMD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $THEPWDCMD in - [\\/]* | ?:[\\/]*) - ac_cv_path_THEPWDCMD="$THEPWDCMD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_THEPWDCMD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -THEPWDCMD=$ac_cv_path_THEPWDCMD -if test -n "$THEPWDCMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THEPWDCMD" >&5 -$as_echo "$THEPWDCMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "ldd", so it can be a program name with args. -set dummy ldd; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_LDD+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $LDD in - [\\/]* | ?:[\\/]*) - ac_cv_path_LDD="$LDD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_LDD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LDD=$ac_cv_path_LDD -if test -n "$LDD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5 -$as_echo "$LDD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test "x$LDD" = "x"; then - # List shared lib dependencies is used for - # debug output and checking for forbidden dependencies. - # We can build without it. - LDD="true" -fi -# Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_OTOOL+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $OTOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OTOOL=$ac_cv_path_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test "x$OTOOL" = "x"; then - OTOOL="true" -fi -for ac_prog in readelf greadelf -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_READELF+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $READELF in - [\\/]* | ?:[\\/]*) - ac_cv_path_READELF="$READELF" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_READELF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READELF=$ac_cv_path_READELF -if test -n "$READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -$as_echo "$READELF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$READELF" && break -done - -for ac_prog in objdump gobjdump -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_OBJDUMP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $OBJDUMP in - [\\/]* | ?:[\\/]*) - ac_cv_path_OBJDUMP="$OBJDUMP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OBJDUMP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OBJDUMP=$ac_cv_path_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJDUMP" && break -done - -# Extract the first word of "hg", so it can be a program name with args. -set dummy hg; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_HG+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $HG in - [\\/]* | ?:[\\/]*) - ac_cv_path_HG="$HG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -HG=$ac_cv_path_HG -if test -n "$HG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 -$as_echo "$HG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - -# Check if pkg-config is available. - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi - -fi - -# After basic tools have been setup, we can check build os specific details. - -############################################################################### - -# Note that this is the build platform OS version! - -OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" -OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" -OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" -OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" - - - - - -# Setup builddeps, for automatic downloading of tools we need. -# This is needed before we can call BDEPS_CHECK_MODULE, which is done in -# boot-jdk setup, but we need to have basic tools setup first. - - -# Check whether --with-builddeps-conf was given. -if test "${with_builddeps_conf+set}" = set; then : - withval=$with_builddeps_conf; -fi - - - -# Check whether --with-builddeps-server was given. -if test "${with_builddeps_server+set}" = set; then : - withval=$with_builddeps_server; -fi - - - -# Check whether --with-builddeps-dir was given. -if test "${with_builddeps_dir+set}" = set; then : - withval=$with_builddeps_dir; -else - with_builddeps_dir=/localhome/builddeps -fi - - - -# Check whether --with-builddeps-group was given. -if test "${with_builddeps_group+set}" = set; then : - withval=$with_builddeps_group; -fi - - -# Check whether --enable-list-builddeps was given. -if test "${enable_list_builddeps+set}" = set; then : - enableval=$enable_list_builddeps; LIST_BUILDDEPS="${enableval}" -else - LIST_BUILDDEPS='no' -fi - - -if test "x$LIST_BUILDDEPS" = xyes; then - echo - echo List of build dependencies known to the configure script, - echo that can be used in builddeps.conf files: - cat $AUTOCONF_DIR/*.ac $AUTOCONF_DIR/*.m4 | grep BDEPS_CHECK_MODULE\( | cut -f 2 -d ',' | tr -d ' ' | sort - echo - exit 1 -fi - - - - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - if test "x$with_builddeps_conf" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supplied builddeps configuration file" >&5 -$as_echo_n "checking for supplied builddeps configuration file... " >&6; } - builddepsfile=$with_builddeps_conf - if test -s $builddepsfile; then - . $builddepsfile - { $as_echo "$as_me:${as_lineno-$LINENO}: result: loaded!" >&5 -$as_echo "loaded!" >&6; } - else - as_fn_error $? "The given builddeps conf file $with_builddeps_conf could not be loaded!" "$LINENO" 5 - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builddeps.conf files in sources..." >&5 -$as_echo_n "checking for builddeps.conf files in sources...... " >&6; } - builddepsfile=`mktemp` - touch $builddepsfile - # Put all found confs into a single file. - find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile - # Source the file to acquire the variables - if test -s $builddepsfile; then - . $builddepsfile - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found at least one!" >&5 -$as_echo "found at least one!" >&6; } - else - as_fn_error $? "Could not find any builddeps.conf at all!" "$LINENO" 5 - fi - fi - # Create build and target names that use _ instead of "-" and ".". - # This is necessary to use them in variable names. - build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` - target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` - # Extract rewrite information for build and target - eval rewritten_build=\${REWRITE_${build_var}} - if test "x$rewritten_build" = x; then - rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME} - echo Build stays the same $rewritten_build - else - echo Rewriting build for builddeps into $rewritten_build - fi - eval rewritten_target=\${REWRITE_${target_var}} - if test "x$rewritten_target" = x; then - rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME} - echo Target stays the same $rewritten_target - else - echo Rewriting target for builddeps into $rewritten_target - fi - rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'` - rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'` - fi - for ac_prog in 7z unzip -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_BDEPS_UNZIP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$BDEPS_UNZIP"; then - ac_cv_prog_BDEPS_UNZIP="$BDEPS_UNZIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_BDEPS_UNZIP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -BDEPS_UNZIP=$ac_cv_prog_BDEPS_UNZIP -if test -n "$BDEPS_UNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BDEPS_UNZIP" >&5 -$as_echo "$BDEPS_UNZIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BDEPS_UNZIP" && break -done - - if test "x$BDEPS_UNZIP" = x7z; then - BDEPS_UNZIP="7z x" - fi - - for ac_prog in wget lftp ftp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_BDEPS_FTP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$BDEPS_FTP"; then - ac_cv_prog_BDEPS_FTP="$BDEPS_FTP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_BDEPS_FTP="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -BDEPS_FTP=$ac_cv_prog_BDEPS_FTP -if test -n "$BDEPS_FTP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BDEPS_FTP" >&5 -$as_echo "$BDEPS_FTP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BDEPS_FTP" && break -done - - - -############################################################################### -# -# Determine OpenJDK variants, options and version numbers. -# -############################################################################### - -# We need build & target for this. +# These are not required on all platforms +# Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CYGPATH+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $CYGPATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_CYGPATH="$CYGPATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CYGPATH="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CYGPATH=$ac_cv_path_CYGPATH +if test -n "$CYGPATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 +$as_echo "$CYGPATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "readlink", so it can be a program name with args. +set dummy readlink; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_READLINK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $READLINK in + [\\/]* | ?:[\\/]*) + ac_cv_path_READLINK="$READLINK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_READLINK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +READLINK=$ac_cv_path_READLINK +if test -n "$READLINK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINK" >&5 +$as_echo "$READLINK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "df", so it can be a program name with args. +set dummy df; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_DF+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $DF in + [\\/]* | ?:[\\/]*) + ac_cv_path_DF="$DF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_DF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DF=$ac_cv_path_DF +if test -n "$DF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DF" >&5 +$as_echo "$DF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "SetFile", so it can be a program name with args. +set dummy SetFile; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SETFILE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $SETFILE in + [\\/]* | ?:[\\/]*) + ac_cv_path_SETFILE="$SETFILE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_SETFILE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +SETFILE=$ac_cv_path_SETFILE +if test -n "$SETFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5 +$as_echo "$SETFILE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + +# Now we can determine OpenJDK build and target platforms. This is required to +# have early on. +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target" +# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the +# product you're building. The target of this build is called "host". Since this is confusing to most people, we +# have not adopted that system, but use "target" as the platform we are building for. In some places though we need +# to use the configure naming style. + + + + + + # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME + # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME + # Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build, + # but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME. + OPENJDK_TARGET_AUTOCONF_NAME="$host" + OPENJDK_BUILD_AUTOCONF_NAME="$build" + + + + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. + + case "$build_os" in + *linux*) + VAR_OS=linux + VAR_OS_API=posix + VAR_OS_ENV=linux + ;; + *solaris*) + VAR_OS=solaris + VAR_OS_API=posix + VAR_OS_ENV=solaris + ;; + *darwin*) + VAR_OS=macosx + VAR_OS_API=posix + VAR_OS_ENV=macosx + ;; + *bsd*) + VAR_OS=bsd + VAR_OS_API=posix + VAR_OS_ENV=bsd + ;; + *cygwin*) + VAR_OS=windows + VAR_OS_API=winapi + VAR_OS_ENV=windows.cygwin + ;; + *mingw*) + VAR_OS=windows + VAR_OS_API=winapi + VAR_OS_ENV=windows.msys + ;; + *) + as_fn_error $? "unsupported operating system $build_os" "$LINENO" 5 + ;; + esac + + + # First argument is the cpu name from the trip/quad + case "$build_cpu" in + x86_64) + VAR_CPU=x86_64 + VAR_CPU_ARCH=x86 + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; + i?86) + VAR_CPU=x86 + VAR_CPU_ARCH=x86 + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=little + ;; + arm*) + VAR_CPU=arm + VAR_CPU_ARCH=arm + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=little + ;; + powerpc) + VAR_CPU=ppc + VAR_CPU_ARCH=ppc + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=big + ;; + powerpc64) + VAR_CPU=ppc64 + VAR_CPU_ARCH=ppc + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=big + ;; + sparc) + VAR_CPU=sparc + VAR_CPU_ARCH=sparc + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=big + ;; + sparcv9) + VAR_CPU=sparcv9 + VAR_CPU_ARCH=sparc + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=big + ;; + *) + as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5 + ;; + esac + + # ..and setup our own variables. (Do this explicitely to facilitate searching) + OPENJDK_BUILD_OS="$VAR_OS" + OPENJDK_BUILD_OS_API="$VAR_OS_API" + OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" + OPENJDK_BUILD_CPU="$VAR_CPU" + OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" + OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" + OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-build os-cpu" >&5 +$as_echo_n "checking openjdk-build os-cpu... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&5 +$as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } + + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. + + case "$host_os" in + *linux*) + VAR_OS=linux + VAR_OS_API=posix + VAR_OS_ENV=linux + ;; + *solaris*) + VAR_OS=solaris + VAR_OS_API=posix + VAR_OS_ENV=solaris + ;; + *darwin*) + VAR_OS=macosx + VAR_OS_API=posix + VAR_OS_ENV=macosx + ;; + *bsd*) + VAR_OS=bsd + VAR_OS_API=posix + VAR_OS_ENV=bsd + ;; + *cygwin*) + VAR_OS=windows + VAR_OS_API=winapi + VAR_OS_ENV=windows.cygwin + ;; + *mingw*) + VAR_OS=windows + VAR_OS_API=winapi + VAR_OS_ENV=windows.msys + ;; + *) + as_fn_error $? "unsupported operating system $host_os" "$LINENO" 5 + ;; + esac + + + # First argument is the cpu name from the trip/quad + case "$host_cpu" in + x86_64) + VAR_CPU=x86_64 + VAR_CPU_ARCH=x86 + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; + i?86) + VAR_CPU=x86 + VAR_CPU_ARCH=x86 + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=little + ;; + arm*) + VAR_CPU=arm + VAR_CPU_ARCH=arm + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=little + ;; + powerpc) + VAR_CPU=ppc + VAR_CPU_ARCH=ppc + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=big + ;; + powerpc64) + VAR_CPU=ppc64 + VAR_CPU_ARCH=ppc + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=big + ;; + sparc) + VAR_CPU=sparc + VAR_CPU_ARCH=sparc + VAR_CPU_BITS=32 + VAR_CPU_ENDIAN=big + ;; + sparcv9) + VAR_CPU=sparcv9 + VAR_CPU_ARCH=sparc + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=big + ;; + *) + as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5 + ;; + esac + + # ... and setup our own variables. (Do this explicitely to facilitate searching) + OPENJDK_TARGET_OS="$VAR_OS" + OPENJDK_TARGET_OS_API="$VAR_OS_API" + OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" + OPENJDK_TARGET_CPU="$VAR_CPU" + OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" + OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" + OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-target os-cpu" >&5 +$as_echo_n "checking openjdk-target os-cpu... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&5 +$as_echo "$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&6; } + + + +# Check whether --with-target-bits was given. +if test "${with_target_bits+set}" = set; then : + withval=$with_target_bits; +fi + + + # We have three types of compiles: + # native == normal compilation, target system == build system + # cross == traditional cross compilation, target system != build system; special toolchain needed + # reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines + # + if test "x$OPENJDK_BUILD_AUTOCONF_NAME" != "x$OPENJDK_TARGET_AUTOCONF_NAME"; then + # We're doing a proper cross-compilation + COMPILE_TYPE="cross" + else + COMPILE_TYPE="native" + fi + + if test "x$with_target_bits" != x; then + if test "x$COMPILE_TYPE" = "xcross"; then + as_fn_error $? "It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either." "$LINENO" 5 + fi + + if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + # A reduced build is requested + COMPILE_TYPE="reduced" + OPENJDK_TARGET_CPU_BITS=32 + if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then + OPENJDK_TARGET_CPU=x86 + elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then + OPENJDK_TARGET_CPU=sparc + else + as_fn_error $? "Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9" "$LINENO" 5 + fi + elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + as_fn_error $? "It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead." "$LINENO" 5 + elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: --with-target-bits are set to build platform address size; argument has no meaning" >&5 +$as_echo "$as_me: --with-target-bits are set to build platform address size; argument has no meaning" >&6;} + else + as_fn_error $? "--with-target-bits can only be 32 or 64, you specified $with_target_bits!" "$LINENO" 5 + fi + fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compilation type" >&5 +$as_echo_n "checking compilation type... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPILE_TYPE" >&5 +$as_echo "$COMPILE_TYPE" >&6; } + + + if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + REQUIRED_OS_NAME=SunOS + REQUIRED_OS_VERSION=5.10 + fi + if test "x$OPENJDK_TARGET_OS" = "xlinux"; then + REQUIRED_OS_NAME=Linux + REQUIRED_OS_VERSION=2.6 + fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + REQUIRED_OS_NAME=Windows + if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then + REQUIRED_OS_VERSION=5.2 + else + REQUIRED_OS_VERSION=5.1 + fi + fi + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + REQUIRED_OS_NAME=Darwin + REQUIRED_OS_VERSION=11.2 + fi + + + + + + # Also store the legacy naming of the cpu. + # Ie i586 and amd64 instead of x86 and x86_64 + OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_LEGACY="i586" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except MacOSX replace x86_64 with amd64. + OPENJDK_TARGET_CPU_LEGACY="amd64" + fi + + + # And the second legacy naming of the cpu. + # Ie i386 and amd64 instead of x86 and x86_64. + OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_LEGACY_LIB="i386" + elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" + fi + + + # This is the name of the cpu (but using i386 and amd64 instead of + # x86 and x86_64, respectively), preceeded by a /, to be used when + # locating libraries. On macosx, it's empty, though. + OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB" + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_TARGET_CPU_LIBDIR="" + fi + + + # OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to + # /amd64 or /sparcv9. This string is appended to some library paths, like this: + # /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so + OPENJDK_TARGET_CPU_ISADIR="" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_TARGET_CPU_ISADIR="/amd64" + elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then + OPENJDK_TARGET_CPU_ISADIR="/sparcv9" + fi + fi + + + # Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property + OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then + # On linux only, we replace x86 with i386. + OPENJDK_TARGET_CPU_OSARCH="i386" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except macosx, we replace x86_64 with amd64. + OPENJDK_TARGET_CPU_OSARCH="amd64" + fi + + + OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU" + if test "x$OPENJDK_TARGET_CPU" = xx86; then + OPENJDK_TARGET_CPU_JLI="i386" + elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + # On all platforms except macosx, we replace x86_64 with amd64. + OPENJDK_TARGET_CPU_JLI="amd64" + fi + # Now setup the -D flags for building libjli. + OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'" + elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then + OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'" + fi + fi + + + # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. + if test "x$OPENJDK_TARGET_OS_API" = xposix; then + OPENJDK_TARGET_OS_API_DIR="solaris" + fi + if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then + OPENJDK_TARGET_OS_API_DIR="windows" + fi + + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + A_LP64="LP64:=" + # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in + # unpack200.exe + if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then + ADD_LP64="-D_LP64=1" + fi + fi + LP64=$A_LP64 + + + if test "x$COMPILE_TYPE" = "xcross"; then + # FIXME: ... or should this include reduced builds..? + DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY" + else + DEFINE_CROSS_COMPILE_ARCH="" + fi + + + + +# Continue setting up basic stuff. Most remaining code require fundamental tools. + +# Locate the directory of this script. +SCRIPT="$0" + + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --help 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi + fi + + if test "x$READLINK" != x; then + SCRIPT=`$READLINK -f $SCRIPT` + else + STARTDIR=$PWD + COUNTER=0 + DIR=`$DIRNAME $SCRIPT` + FILE=`$BASENAME $SCRIPT` + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # The link might be relative! We have to use cd to travel safely. + cd $DIR + # ... and we must get the to the absolute path, not one using symbolic links. + cd `pwd -P` + cd `$DIRNAME $ISLINK` + DIR=`$THEPWDCMD` + FILE=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + SCRIPT=$DIR/$FILE + fi + fi + +AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD` + +# Where is the source? It is located two levels above the configure script. +CURDIR="$PWD" +cd "$AUTOCONF_DIR/../.." +SRC_ROOT="`pwd`" + +if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + PATH_SEP=";" + + SRC_ROOT_LENGTH=`$THEPWDCMD|$WC -m` + if test $SRC_ROOT_LENGTH -gt 100; then + as_fn_error $? "Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" "$LINENO" 5 + fi + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin release" >&5 +$as_echo_n "checking cygwin release... " >&6; } + CYGWIN_VERSION=`$UNAME -r` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_VERSION" >&5 +$as_echo "$CYGWIN_VERSION" >&6; } + WINDOWS_ENV_VENDOR='cygwin' + WINDOWS_ENV_VERSION="$CYGWIN_VERSION" + + CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.` + if test "x$CYGWIN_VERSION_OK" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5 +$as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + if test "x$CYGPATH" = x; then + as_fn_error $? "Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5 +$as_echo_n "checking cygwin root directory as unix-style path... " >&6; } + # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away + cygwin_winpath_root=`cd / ; cmd /c cd | grep ".*"` + # Force cygpath to report the proper root by including a trailing space, and then stripping it off again. + CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_ROOT_PATH" >&5 +$as_echo "$CYGWIN_ROOT_PATH" >&6; } + WINDOWS_ENV_ROOT_PATH="$CYGWIN_ROOT_PATH" + test_cygdrive_prefix=`$ECHO $CYGWIN_ROOT_PATH | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + as_fn_error $? "Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c." "$LINENO" 5 + fi + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking msys release" >&5 +$as_echo_n "checking msys release... " >&6; } + MSYS_VERSION=`$UNAME -r` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSYS_VERSION" >&5 +$as_echo "$MSYS_VERSION" >&6; } + + WINDOWS_ENV_VENDOR='msys' + WINDOWS_ENV_VERSION="$MSYS_VERSION" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking msys root directory as unix-style path" >&5 +$as_echo_n "checking msys root directory as unix-style path... " >&6; } + # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away + MSYS_ROOT_PATH=`cd / ; cmd /c cd | grep ".*"` + + windows_path="$MSYS_ROOT_PATH" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + MSYS_ROOT_PATH="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + MSYS_ROOT_PATH="$unix_path" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSYS_ROOT_PATH" >&5 +$as_echo "$MSYS_ROOT_PATH" >&6; } + WINDOWS_ENV_ROOT_PATH="$MSYS_ROOT_PATH" + else + as_fn_error $? "Unknown Windows environment. Neither cygwin nor msys was detected." "$LINENO" 5 + fi + + # Test if windows or unix (cygwin/msys) find is first in path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what kind of 'find' is first on the PATH" >&5 +$as_echo_n "checking what kind of 'find' is first on the PATH... " >&6; } + FIND_BINARY_OUTPUT=`find --version 2>&1` + if test "x`echo $FIND_BINARY_OUTPUT | $GREP GNU`" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unix style" >&5 +$as_echo "unix style" >&6; } + elif test "x`echo $FIND_BINARY_OUTPUT | $GREP FIND`" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows" >&5 +$as_echo "Windows" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools." >&5 +$as_echo "$as_me: Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: This will not work. Please correct and make sure /usr/bin (or similar) is first in path." >&5 +$as_echo "$as_me: This will not work. Please correct and make sure /usr/bin (or similar) is first in path." >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 +$as_echo "unknown" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: It seems that your find utility is non-standard." >&5 +$as_echo "$as_me: WARNING: It seems that your find utility is non-standard." >&2;} + fi + +else + PATH_SEP=":" +fi + + + +cd "$CURDIR" + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$SRC_ROOT" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of SRC_ROOT" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + SRC_ROOT="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting SRC_ROOT to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting SRC_ROOT to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$SRC_ROOT" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + SRC_ROOT="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting SRC_ROOT to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting SRC_ROOT to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$SRC_ROOT" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of SRC_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$CURDIR" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of CURDIR" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + CURDIR="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$CURDIR" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + CURDIR="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$CURDIR" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + +if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then + # Add extra search paths on solaris for utilities like ar and as etc... + PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" +fi + +# You can force the sys-root if the sys-root encoded into the cross compiler tools +# is not correct. + +# Check whether --with-sys-root was given. +if test "${with_sys_root+set}" = set; then : + withval=$with_sys_root; +fi + + +if test "x$with_sys_root" != x; then + SYS_ROOT=$with_sys_root +else + SYS_ROOT=/ +fi + + + +# Check whether --with-tools-dir was given. +if test "${with_tools_dir+set}" = set; then : + withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir +fi + + + +# Check whether --with-devkit was given. +if test "${with_devkit+set}" = set; then : + withval=$with_devkit; + if test "x$with_sys_root" != x; then + as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5 + fi + if test "x$with_tools_dir" != x; then + as_fn_error $? "Cannot specify both --with-devkit and --with-tools-dir at the same time" "$LINENO" 5 + fi + TOOLS_DIR=$with_devkit/bin + SYS_ROOT=$with_devkit/$host_alias/libc + +fi + + + + +# Setup default logging of stdout and stderr to build.log in the output root. +BUILD_LOG='$(OUTPUT_ROOT)/build.log' +BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old' +BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)' + + + + + +# These are needed to be able to create a configuration name (and thus the output directory) ############################################################################### # @@ -7969,8 +7374,8 @@ # ie normal interpreter and C1, only the serial GC, kernel jvmti etc # zero: no machine code interpreter, no compiler # zeroshark: zero interpreter and shark/llvm compiler backend -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variants of the JVM that should be built" >&5 -$as_echo_n "checking which variants of the JVM that should be built... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variants of the JVM to build" >&5 +$as_echo_n "checking which variants of the JVM to build... " >&6; } # Check whether --with-jvm-variants was given. if test "${with_jvm_variants+set}" = set; then : @@ -8151,6 +7556,2661 @@ +# With basic setup done, call the custom early hook. + + +# To properly create a configuration name, we need to have the OpenJDK target +# and options (variants and debug level) parsed. + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what configuration name to use" >&5 +$as_echo_n "checking what configuration name to use... " >&6; } + +# Check whether --with-conf-name was given. +if test "${with_conf_name+set}" = set; then : + withval=$with_conf_name; CONF_NAME=${with_conf_name} +fi + + +# Test from where we are running configure, in or outside of src root. +if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then + # We are running configure from the src root. + # Create a default ./build/target-variant-debuglevel output root. + if test "x${CONF_NAME}" = x; then + CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" + fi + OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" + $MKDIR -p "$OUTPUT_ROOT" + if test ! -d "$OUTPUT_ROOT"; then + as_fn_error $? "Could not create build directory $OUTPUT_ROOT" "$LINENO" 5 + fi +else + # We are running configure from outside of the src dir. + # Then use the current directory as output dir! + # If configuration is situated in normal build directory, just use the build + # directory name as configuration name, otherwise use the complete path. + if test "x${CONF_NAME}" = x; then + CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` + fi + OUTPUT_ROOT="$CURDIR" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONF_NAME" >&5 +$as_echo "$CONF_NAME" >&6; } + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$OUTPUT_ROOT" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of OUTPUT_ROOT" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + OUTPUT_ROOT="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OUTPUT_ROOT to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$OUTPUT_ROOT" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + OUTPUT_ROOT="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OUTPUT_ROOT to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$OUTPUT_ROOT" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + +SPEC=$OUTPUT_ROOT/spec.gmk + +CONF_NAME=$CONF_NAME + +OUTPUT_ROOT=$OUTPUT_ROOT + + +# Most of the probed defines are put into config.h +ac_config_headers="$ac_config_headers $OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in" + +# The spec.gmk file contains all variables for the make system. +ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" + +# The hotspot-spec.gmk file contains legacy variables for the hotspot make system. +ac_config_files="$ac_config_files $OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in" + +# The bootcycle-spec.gmk file contains support for boot cycle builds. +ac_config_files="$ac_config_files $OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" + +# The compare.sh is used to compare the build output to other builds. +ac_config_files="$ac_config_files $OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in" + +# Spec.sh is currently used by compare-objects.sh +ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in" + +# The generated Makefile knows where the spec.gmk is and where the source is. +# You can run make from the OUTPUT_ROOT, or from the top-level Makefile +# which will look for generated configurations +ac_config_files="$ac_config_files $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" + + +# Save the arguments given to us +echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments + + +# Must be done before we can call HELP_MSG_MISSING_DEPENDENCY. + + for ac_prog in apt-get yum port pkgutil pkgadd +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_PKGHANDLER+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PKGHANDLER"; then + ac_cv_prog_PKGHANDLER="$PKGHANDLER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PKGHANDLER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PKGHANDLER=$ac_cv_prog_PKGHANDLER +if test -n "$PKGHANDLER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGHANDLER" >&5 +$as_echo "$PKGHANDLER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PKGHANDLER" && break +done + + + +# Setup tools that requires more complex handling, or that is not needed by the configure script. + + + # We need to find a recent version of GNU make. Especially on Solaris, this can be tricky. + if test "x$MAKE" != x; then + # User has supplied a make, test it. + if test ! -f "$MAKE"; then + as_fn_error $? "The specified make (by MAKE=$MAKE) is not found." "$LINENO" 5 + fi + + MAKE_CANDIDATE=""$MAKE"" + DESCRIPTION="user supplied MAKE=$MAKE" + if test "x$MAKE_CANDIDATE" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 +$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} + MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` + IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` + if test "x$IS_GNU_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 +$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} + else + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + if test "x$IS_MODERN_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 +$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} + else + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + MAKE_EXPECTED_ENV='cygwin' + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + MAKE_EXPECTED_ENV='msys' + else + as_fn_error $? "Unknown Windows environment" "$LINENO" 5 + fi + MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` + IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` + else + # Not relevant for non-Windows + IS_MAKE_CORRECT_ENV=true + fi + if test "x$IS_MAKE_CORRECT_ENV" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 +$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} + else + FOUND_MAKE=$MAKE_CANDIDATE + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi + + fi + fi + fi + fi + + if test "x$FOUND_MAKE" = x; then + as_fn_error $? "The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer." "$LINENO" 5 + fi + else + # Try our hardest to locate a correct version of GNU make + for ac_prog in gmake +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CHECK_GMAKE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $CHECK_GMAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path_CHECK_GMAKE="$CHECK_GMAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CHECK_GMAKE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CHECK_GMAKE=$ac_cv_path_CHECK_GMAKE +if test -n "$CHECK_GMAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_GMAKE" >&5 +$as_echo "$CHECK_GMAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CHECK_GMAKE" && break +done + + + MAKE_CANDIDATE=""$CHECK_GMAKE"" + DESCRIPTION="gmake in PATH" + if test "x$MAKE_CANDIDATE" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 +$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} + MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` + IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` + if test "x$IS_GNU_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 +$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} + else + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + if test "x$IS_MODERN_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 +$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} + else + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + MAKE_EXPECTED_ENV='cygwin' + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + MAKE_EXPECTED_ENV='msys' + else + as_fn_error $? "Unknown Windows environment" "$LINENO" 5 + fi + MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` + IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` + else + # Not relevant for non-Windows + IS_MAKE_CORRECT_ENV=true + fi + if test "x$IS_MAKE_CORRECT_ENV" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 +$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} + else + FOUND_MAKE=$MAKE_CANDIDATE + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi + + fi + fi + fi + fi + + + if test "x$FOUND_MAKE" = x; then + for ac_prog in make +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CHECK_MAKE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $CHECK_MAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path_CHECK_MAKE="$CHECK_MAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CHECK_MAKE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CHECK_MAKE=$ac_cv_path_CHECK_MAKE +if test -n "$CHECK_MAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_MAKE" >&5 +$as_echo "$CHECK_MAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CHECK_MAKE" && break +done + + + MAKE_CANDIDATE=""$CHECK_MAKE"" + DESCRIPTION="make in PATH" + if test "x$MAKE_CANDIDATE" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 +$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} + MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` + IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` + if test "x$IS_GNU_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 +$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} + else + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + if test "x$IS_MODERN_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 +$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} + else + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + MAKE_EXPECTED_ENV='cygwin' + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + MAKE_EXPECTED_ENV='msys' + else + as_fn_error $? "Unknown Windows environment" "$LINENO" 5 + fi + MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` + IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` + else + # Not relevant for non-Windows + IS_MAKE_CORRECT_ENV=true + fi + if test "x$IS_MAKE_CORRECT_ENV" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 +$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} + else + FOUND_MAKE=$MAKE_CANDIDATE + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi + + fi + fi + fi + fi + + fi + + if test "x$FOUND_MAKE" = x; then + if test "x$TOOLS_DIR" != x; then + # We have a tools-dir, check that as well before giving up. + OLD_PATH=$PATH + PATH=$TOOLS_DIR:$PATH + for ac_prog in gmake +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CHECK_TOOLSDIR_GMAKE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $CHECK_TOOLSDIR_GMAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path_CHECK_TOOLSDIR_GMAKE="$CHECK_TOOLSDIR_GMAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CHECK_TOOLSDIR_GMAKE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CHECK_TOOLSDIR_GMAKE=$ac_cv_path_CHECK_TOOLSDIR_GMAKE +if test -n "$CHECK_TOOLSDIR_GMAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_GMAKE" >&5 +$as_echo "$CHECK_TOOLSDIR_GMAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CHECK_TOOLSDIR_GMAKE" && break +done + + + MAKE_CANDIDATE=""$CHECK_TOOLSDIR_GMAKE"" + DESCRIPTION="gmake in tools-dir" + if test "x$MAKE_CANDIDATE" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 +$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} + MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` + IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` + if test "x$IS_GNU_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 +$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} + else + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + if test "x$IS_MODERN_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 +$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} + else + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + MAKE_EXPECTED_ENV='cygwin' + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + MAKE_EXPECTED_ENV='msys' + else + as_fn_error $? "Unknown Windows environment" "$LINENO" 5 + fi + MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` + IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` + else + # Not relevant for non-Windows + IS_MAKE_CORRECT_ENV=true + fi + if test "x$IS_MAKE_CORRECT_ENV" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 +$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} + else + FOUND_MAKE=$MAKE_CANDIDATE + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi + + fi + fi + fi + fi + + if test "x$FOUND_MAKE" = x; then + for ac_prog in make +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CHECK_TOOLSDIR_MAKE+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $CHECK_TOOLSDIR_MAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path_CHECK_TOOLSDIR_MAKE="$CHECK_TOOLSDIR_MAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CHECK_TOOLSDIR_MAKE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CHECK_TOOLSDIR_MAKE=$ac_cv_path_CHECK_TOOLSDIR_MAKE +if test -n "$CHECK_TOOLSDIR_MAKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_MAKE" >&5 +$as_echo "$CHECK_TOOLSDIR_MAKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CHECK_TOOLSDIR_MAKE" && break +done + + + MAKE_CANDIDATE=""$CHECK_TOOLSDIR_MAKE"" + DESCRIPTION="make in tools-dir" + if test "x$MAKE_CANDIDATE" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5 +$as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;} + MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1` + IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'` + if test "x$IS_GNU_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 +$as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} + else + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + if test "x$IS_MODERN_MAKE" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 +$as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} + else + if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + MAKE_EXPECTED_ENV='cygwin' + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + MAKE_EXPECTED_ENV='msys' + else + as_fn_error $? "Unknown Windows environment" "$LINENO" 5 + fi + MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'` + IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV` + else + # Not relevant for non-Windows + IS_MAKE_CORRECT_ENV=true + fi + if test "x$IS_MAKE_CORRECT_ENV" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5 +$as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;} + else + FOUND_MAKE=$MAKE_CANDIDATE + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$FOUND_MAKE" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + FOUND_MAKE="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;} + fi + + fi + fi + fi + fi + + fi + PATH=$OLD_PATH + fi + fi + + if test "x$FOUND_MAKE" = x; then + as_fn_error $? "Cannot find GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure." "$LINENO" 5 + fi + fi + + MAKE=$FOUND_MAKE + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&5 +$as_echo "$as_me: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&6;} + + + + # Test if find supports -delete + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if find supports -delete" >&5 +$as_echo_n "checking if find supports -delete... " >&6; } + FIND_DELETE="-delete" + + DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?) + + echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete + + TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1` + if test -f $DELETEDIR/TestIfFindSupportsDelete; then + # No, it does not. + rm $DELETEDIR/TestIfFindSupportsDelete + FIND_DELETE="-exec rm \{\} \+" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + rmdir $DELETEDIR + + + +# These tools might not be installed by default, +# need hint on how to install them. + + for ac_prog in unzip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_UNZIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $UNZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_UNZIP="$UNZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +UNZIP=$ac_cv_path_UNZIP +if test -n "$UNZIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5 +$as_echo "$UNZIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$UNZIP" && break +done + + + if test "x$UNZIP" = x; then + if test "xunzip" = x; then + PROG_NAME=unzip + else + PROG_NAME=unzip + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + + for ac_prog in zip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ZIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ZIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ZIP=$ac_cv_path_ZIP +if test -n "$ZIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5 +$as_echo "$ZIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ZIP" && break +done + + + if test "x$ZIP" = x; then + if test "xzip" = x; then + PROG_NAME=zip + else + PROG_NAME=zip + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + +# Non-required basic tools + +# Extract the first word of "ldd", so it can be a program name with args. +set dummy ldd; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_LDD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $LDD in + [\\/]* | ?:[\\/]*) + ac_cv_path_LDD="$LDD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_LDD="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +LDD=$ac_cv_path_LDD +if test -n "$LDD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5 +$as_echo "$LDD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "x$LDD" = "x"; then + # List shared lib dependencies is used for + # debug output and checking for forbidden dependencies. + # We can build without it. + LDD="true" +fi +# Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_OTOOL+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $OTOOL in + [\\/]* | ?:[\\/]*) + ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +OTOOL=$ac_cv_path_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +if test "x$OTOOL" = "x"; then + OTOOL="true" +fi +for ac_prog in readelf greadelf +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_READELF+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $READELF in + [\\/]* | ?:[\\/]*) + ac_cv_path_READELF="$READELF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_READELF="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +READELF=$ac_cv_path_READELF +if test -n "$READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +$as_echo "$READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$READELF" && break +done + +# Extract the first word of "hg", so it can be a program name with args. +set dummy hg; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_HG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $HG in + [\\/]* | ?:[\\/]*) + ac_cv_path_HG="$HG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +HG=$ac_cv_path_HG +if test -n "$HG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5 +$as_echo "$HG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "stat", so it can be a program name with args. +set dummy stat; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_STAT+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $STAT in + [\\/]* | ?:[\\/]*) + ac_cv_path_STAT="$STAT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_STAT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +STAT=$ac_cv_path_STAT +if test -n "$STAT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STAT" >&5 +$as_echo "$STAT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +# Extract the first word of "time", so it can be a program name with args. +set dummy time; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_TIME+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $TIME in + [\\/]* | ?:[\\/]*) + ac_cv_path_TIME="$TIME" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_TIME="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +TIME=$ac_cv_path_TIME +if test -n "$TIME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TIME" >&5 +$as_echo "$TIME" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + + for ac_prog in comm +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_COMM+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $COMM in + [\\/]* | ?:[\\/]*) + ac_cv_path_COMM="$COMM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +COMM=$ac_cv_path_COMM +if test -n "$COMM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5 +$as_echo "$COMM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$COMM" && break +done + + + if test "x$COMM" = x; then + if test "xcomm" = x; then + PROG_NAME=comm + else + PROG_NAME=comm + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + +fi + + +# Check if pkg-config is available. + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi + +# After basic tools have been setup, we can check build os specific details. + +############################################################################### + +# Note that this is the build platform OS version! + +OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`" +OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`" +OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`" +OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`" + + + + + +# Setup builddeps, for automatic downloading of tools we need. +# This is needed before we can call BDEPS_CHECK_MODULE, which is done in +# boot-jdk setup, but we need to have basic tools setup first. + + +# Check whether --with-builddeps-conf was given. +if test "${with_builddeps_conf+set}" = set; then : + withval=$with_builddeps_conf; +fi + + + +# Check whether --with-builddeps-server was given. +if test "${with_builddeps_server+set}" = set; then : + withval=$with_builddeps_server; +fi + + + +# Check whether --with-builddeps-dir was given. +if test "${with_builddeps_dir+set}" = set; then : + withval=$with_builddeps_dir; +else + with_builddeps_dir=/localhome/builddeps +fi + + + +# Check whether --with-builddeps-group was given. +if test "${with_builddeps_group+set}" = set; then : + withval=$with_builddeps_group; +fi + + + + + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + if test "x$with_builddeps_conf" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supplied builddeps configuration file" >&5 +$as_echo_n "checking for supplied builddeps configuration file... " >&6; } + builddepsfile=$with_builddeps_conf + if test -s $builddepsfile; then + . $builddepsfile + { $as_echo "$as_me:${as_lineno-$LINENO}: result: loaded!" >&5 +$as_echo "loaded!" >&6; } + else + as_fn_error $? "The given builddeps conf file $with_builddeps_conf could not be loaded!" "$LINENO" 5 + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builddeps.conf files in sources..." >&5 +$as_echo_n "checking for builddeps.conf files in sources...... " >&6; } + builddepsfile=`mktemp` + touch $builddepsfile + # Put all found confs into a single file. + find ${SRC_ROOT} -name builddeps.conf -exec cat \{\} \; >> $builddepsfile + # Source the file to acquire the variables + if test -s $builddepsfile; then + . $builddepsfile + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found at least one!" >&5 +$as_echo "found at least one!" >&6; } + else + as_fn_error $? "Could not find any builddeps.conf at all!" "$LINENO" 5 + fi + fi + # Create build and target names that use _ instead of "-" and ".". + # This is necessary to use them in variable names. + build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` + target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'` + # Extract rewrite information for build and target + eval rewritten_build=\${REWRITE_${build_var}} + if test "x$rewritten_build" = x; then + rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME} + echo Build stays the same $rewritten_build + else + echo Rewriting build for builddeps into $rewritten_build + fi + eval rewritten_target=\${REWRITE_${target_var}} + if test "x$rewritten_target" = x; then + rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME} + echo Target stays the same $rewritten_target + else + echo Rewriting target for builddeps into $rewritten_target + fi + rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'` + rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'` + fi + for ac_prog in 7z unzip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_BDEPS_UNZIP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$BDEPS_UNZIP"; then + ac_cv_prog_BDEPS_UNZIP="$BDEPS_UNZIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_BDEPS_UNZIP="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +BDEPS_UNZIP=$ac_cv_prog_BDEPS_UNZIP +if test -n "$BDEPS_UNZIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BDEPS_UNZIP" >&5 +$as_echo "$BDEPS_UNZIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$BDEPS_UNZIP" && break +done + + if test "x$BDEPS_UNZIP" = x7z; then + BDEPS_UNZIP="7z x" + fi + + for ac_prog in wget lftp ftp +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_BDEPS_FTP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$BDEPS_FTP"; then + ac_cv_prog_BDEPS_FTP="$BDEPS_FTP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_BDEPS_FTP="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +BDEPS_FTP=$ac_cv_prog_BDEPS_FTP +if test -n "$BDEPS_FTP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BDEPS_FTP" >&5 +$as_echo "$BDEPS_FTP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$BDEPS_FTP" && break +done + + + +############################################################################### +# +# Determine OpenJDK variants, options and version numbers. +# +############################################################################### + +# We need build & target for this. + ############################################################################### # @@ -8159,42 +10219,45 @@ # Check whether --enable-openjdk-only was given. if test "${enable_openjdk_only+set}" = set; then : enableval=$enable_openjdk_only; -fi - - -if test "x$enable_openjdk_only" = "xyes"; then +else + enable_openjdk_only="no" +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for presence of closed sources" >&5 +$as_echo_n "checking for presence of closed sources... " >&6; } +if test -d "$SRC_ROOT/jdk/src/closed"; then + CLOSED_SOURCE_PRESENT=yes +else + CLOSED_SOURCE_PRESENT=no +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLOSED_SOURCE_PRESENT" >&5 +$as_echo "$CLOSED_SOURCE_PRESENT" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if closed source is supressed (openjdk-only)" >&5 +$as_echo_n "checking if closed source is supressed (openjdk-only)... " >&6; } +SUPRESS_CLOSED_SOURCE="$enable_openjdk_only" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SUPRESS_CLOSED_SOURCE" >&5 +$as_echo "$SUPRESS_CLOSED_SOURCE" >&6; } + +if test "x$CLOSED_SOURCE_PRESENT" = xno; then + OPENJDK=true + if test "x$SUPRESS_CLOSED_SOURCE" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No closed source present, --enable-openjdk-only makes no sense" >&5 +$as_echo "$as_me: WARNING: No closed source present, --enable-openjdk-only makes no sense" >&2;} + fi +else + if test "x$SUPRESS_CLOSED_SOURCE" = "xyes"; then OPENJDK=true -elif test "x$enable_openjdk_only" = "xno"; then + else OPENJDK=false -elif test -d "$SRC_ROOT/jdk/src/closed"; then - OPENJDK=false -else - OPENJDK=true + fi fi if test "x$OPENJDK" = "xtrue"; then - SET_OPENJDK=OPENJDK=true -fi - - - -############################################################################### -# -# JIGSAW or not. The JIGSAW variable is used during the intermediate -# stage when we are building both the old style JDK and the new style modularized JDK. -# When the modularized JDK is finalized, this option will go away. -# -# Check whether --enable-jigsaw was given. -if test "${enable_jigsaw+set}" = set; then : - enableval=$enable_jigsaw; -fi - - -if test "x$enable_jigsaw" = "xyes"; then - JIGSAW=true -else - JIGSAW=false -fi + SET_OPENJDK="OPENJDK=true" +fi + ############################################################################### @@ -8233,28 +10296,6 @@ -############################################################################### -# -# Should we compile nimbus swing L&F? We can probably remove this option -# since nimbus is officially part of javax now. -# -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build nimbus L&F" >&5 -$as_echo_n "checking whether to build nimbus L&F... " >&6; } -# Check whether --enable-nimbus was given. -if test "${enable_nimbus+set}" = set; then : - enableval=$enable_nimbus; ENABLE_NIMBUS="${enableval}" -else - ENABLE_NIMBUS='yes' -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_NIMBUS" >&5 -$as_echo "$ENABLE_NIMBUS" >&6; } -DISABLE_NIMBUS= -if test "x$ENABLE_NIMBUS" = xno; then - DISABLE_NIMBUS=true -fi - - # Control wether Hotspot runs Queens test after build. # Check whether --enable-hotspot-test-in-build was given. if test "${enable_hotspot_test_in_build+set}" = set; then : @@ -8299,42 +10340,6 @@ -############################################################################### -# -# Should we compile JFR -# default no, except for on closed-jdk -# -ENABLE_JFR=no - -# Is the JFR source present - -# -# For closed default is yes -# -if test "x${OPENJDK}" != "xtrue"; then - ENABLE_JFR=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build jfr" >&5 -$as_echo_n "checking whether to build jfr... " >&6; } -# Check whether --enable-jfr was given. -if test "${enable_jfr+set}" = set; then : - enableval=$enable_jfr; -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ENABLE_JFR}" >&5 -$as_echo "${ENABLE_JFR}" >&6; } - -if test "x$ENABLE_JFR" = "xyes"; then - ENABLE_JFR=true -elif test "x$ENABLE_JFR" = "xno"; then - ENABLE_JFR=false -else - as_fn_error $? "Invalid argument to --enable-jfr" "$LINENO" 5 -fi - - - # Source the version numbers . $AUTOCONF_DIR/version.numbers @@ -8354,6 +10359,8 @@ + + COPYRIGHT_YEAR=`date +'%Y'` @@ -8381,7 +10388,7 @@ BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` # Avoid [:alnum:] since it depends on the locale. CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'` - USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` + USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}" fi @@ -8389,93 +10396,6 @@ -# To properly create a configuration name, we need to have the OpenJDK target -# and options (variants and debug level) parsed. - - - -# Check whether --with-conf-name was given. -if test "${with_conf_name+set}" = set; then : - withval=$with_conf_name; CONF_NAME=${with_conf_name} -fi - - -# Test from where we are running configure, in or outside of src root. -if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then - # We are running configure from the src root. - # Create a default ./build/target-variant-debuglevel output root. - if test "x${CONF_NAME}" = x; then - CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}" - fi - OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}" - mkdir -p "$OUTPUT_ROOT" - if test ! -d "$OUTPUT_ROOT"; then - as_fn_error $? "Could not create build directory $OUTPUT_ROOT" "$LINENO" 5 - fi -else - # We are running configure from outside of the src dir. - # Then use the current directory as output dir! - # If configuration is situated in normal build directory, just use the build - # directory name as configuration name, otherwise use the complete path. - if test "x${CONF_NAME}" = x; then - CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"` - fi - OUTPUT_ROOT="$CURDIR" -fi - - - # Fail with message the path to the output root if var OUTPUT_ROOT contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$OUTPUT_ROOT" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - OUTPUT_ROOT=`$CYGPATH -s -m -a "$OUTPUT_ROOT"` - # Now it's case insensitive; let's make it lowercase to improve readability - OUTPUT_ROOT=`$ECHO "$OUTPUT_ROOT" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - OUTPUT_ROOT=`$CYGPATH -u "$OUTPUT_ROOT"` - else - as_fn_error $? "You cannot have spaces in the path to the output root! \"$OUTPUT_ROOT\"" "$LINENO" 5 - fi - fi - - -SPEC=$OUTPUT_ROOT/spec.gmk - -CONF_NAME=$CONF_NAME - -OUTPUT_ROOT=$OUTPUT_ROOT - - -# Most of the probed defines are put into config.h -ac_config_headers="$ac_config_headers $OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in" - -# The spec.gmk file contains all variables for the make system. -ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" - -# The hotspot-spec.gmk file contains legacy variables for the hotspot make system. -ac_config_files="$ac_config_files $OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in" - -# The bootcycle-spec.gmk file contains support for boot cycle builds. -ac_config_files="$ac_config_files $OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" - -# The compare.sh is used to compare the build output to other builds. -ac_config_files="$ac_config_files $OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in" - -# Spec.sh is currently used by compare-objects.sh -ac_config_files="$ac_config_files $OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in" - -# The generated Makefile knows where the spec.gmk is and where the source is. -# You can run make from the OUTPUT_ROOT, or from the top-level Makefile -# which will look for generated configurations -ac_config_files="$ac_config_files $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" - - -# Save the arguments given to us -echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments - - ############################################################################### # # Setup BootJDK, used to bootstrap the build. @@ -8546,26 +10466,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -8768,26 +10795,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -8802,12 +10936,126 @@ # Now execute the test if test "x$JAVA_HOME" != x; then - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # On Windows, JAVA_HOME is likely in DOS-style - JAVA_HOME_PROCESSED="`$CYGPATH -u "$JAVA_HOME"`" - else - JAVA_HOME_PROCESSED="$JAVA_HOME" - fi + JAVA_HOME_PROCESSED="$JAVA_HOME" + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$JAVA_HOME_PROCESSED" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of JAVA_HOME_PROCESSED" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + JAVA_HOME_PROCESSED="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$JAVA_HOME_PROCESSED" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + JAVA_HOME_PROCESSED="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$JAVA_HOME_PROCESSED" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + if test ! -d "$JAVA_HOME_PROCESSED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Your JAVA_HOME points to a non-existing directory!" >&5 $as_echo "$as_me: Your JAVA_HOME points to a non-existing directory!" >&6;} @@ -8859,26 +11107,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -8937,26 +11292,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9060,75 +11522,14 @@ # Linux/GNU systems often have links from /usr/bin/java to # /etc/alternatives/java to the real JDK binary. - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$BINARY" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$BINARY"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - BINARY="$tmp" - - if test "x$OPENJDK_BUILD_OS" != xwindows; then # Follow a chain of symbolic links. Use readlink # where it exists, else fall back to horribly # complicated shell code. - # Extract the first word of "readlink", so it can be a program name with args. -set dummy readlink; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_READLINK+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $READLINK in - [\\/]* | ?:[\\/]*) - ac_cv_path_READLINK="$READLINK" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_READLINK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -READLINK=$ac_cv_path_READLINK -if test -n "$READLINK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINK" >&5 -$as_echo "$READLINK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$READLINK_TESTED" != yes; then # On MacOSX there is a readlink tool with a different # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --help 2>&1 | grep GNU` + ISGNU=`$READLINK --help 2>&1 | $GREP GNU` if test "x$ISGNU" = x; then # A readlink that we do not know how to use. # Are there other non-GNU readlinks out there? @@ -9142,23 +11543,25 @@ else STARTDIR=$PWD COUNTER=0 - DIR=`dirname $BINARY` - FIL=`basename $BINARY` + DIR=`$DIRNAME $BINARY` + FILE=`$BASENAME $BINARY` while test $COUNTER -lt 20; do - ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'` + ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` if test "x$ISLINK" == x; then # This is not a symbolic link! We are done! break fi # The link might be relative! We have to use cd to travel safely. cd $DIR - cd `dirname $ISLINK` - DIR=`pwd` - FIL=`basename $ISLINK` + # ... and we must get the to the absolute path, not one using symbolic links. + cd `pwd -P` + cd `$DIRNAME $ISLINK` + DIR=`$THEPWDCMD` + FILE=`$BASENAME $ISLINK` let COUNTER=COUNTER+1 done cd $STARTDIR - BINARY=$DIR/$FIL + BINARY=$DIR/$FILE fi fi @@ -9210,26 +11613,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9249,17 +11759,207 @@ # Now execute the test if test "x$ProgramW6432" != x; then - - BOOT_JDK_PREFIX="`$CYGPATH -u "$ProgramW6432"`/Java" + VIRTUAL_DIR="$ProgramW6432/Java" + + windows_path="$VIRTUAL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VIRTUAL_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VIRTUAL_DIR="$unix_path" + fi + + + BOOT_JDK_PREFIX="$VIRTUAL_DIR" BOOT_JDK_SUFFIX="" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&6;} - fi + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done fi fi @@ -9302,26 +12002,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9334,17 +12141,207 @@ # Now execute the test if test "x$PROGRAMW6432" != x; then - - BOOT_JDK_PREFIX="`$CYGPATH -u "$PROGRAMW6432"`/Java" + VIRTUAL_DIR="$PROGRAMW6432/Java" + + windows_path="$VIRTUAL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VIRTUAL_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VIRTUAL_DIR="$unix_path" + fi + + + BOOT_JDK_PREFIX="$VIRTUAL_DIR" BOOT_JDK_SUFFIX="" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&6;} - fi + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done fi fi @@ -9387,26 +12384,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9419,17 +12523,589 @@ # Now execute the test if test "x$PROGRAMFILES" != x; then - - BOOT_JDK_PREFIX="`$CYGPATH -u "$PROGRAMFILES"`/Java" + VIRTUAL_DIR="$PROGRAMFILES/Java" + + windows_path="$VIRTUAL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VIRTUAL_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VIRTUAL_DIR="$unix_path" + fi + + + BOOT_JDK_PREFIX="$VIRTUAL_DIR" BOOT_JDK_SUFFIX="" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&6;} - fi + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done + fi + + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + if test "x$ProgramFiles" != x; then + VIRTUAL_DIR="$ProgramFiles/Java" + + windows_path="$VIRTUAL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VIRTUAL_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VIRTUAL_DIR="$unix_path" + fi + + + BOOT_JDK_PREFIX="$VIRTUAL_DIR" + BOOT_JDK_SUFFIX="" + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done fi fi @@ -9472,26 +13148,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9503,20 +13286,195 @@ if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - if test "x$ProgramFiles" != x; then - - BOOT_JDK_PREFIX="`$CYGPATH -u "$ProgramFiles"`/Java" + BOOT_JDK_PREFIX="/cygdrive/c/Program Files/Java" BOOT_JDK_SUFFIX="" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&6;} - fi - fi - + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done fi @@ -9557,26 +13515,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9584,20 +13649,200 @@ fi # end check boot jdk found fi + elif test "x$OPENJDK_TARGET_OS" = xmacosx; then + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK_PREFIX="/Library/Java/JavaVirtualMachines" + BOOT_JDK_SUFFIX="/Contents/Home" + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - BOOT_JDK_PREFIX="/cygdrive/c/Program Files/Java" - BOOT_JDK_SUFFIX="" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&6;} - fi + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done fi @@ -9638,26 +13883,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9665,21 +14017,199 @@ fi # end check boot jdk found fi - elif test "x$OPENJDK_TARGET_OS" = xmacosx; then + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK_PREFIX="/System/Library/Java/JavaVirtualMachines" + BOOT_JDK_SUFFIX="/Contents/Home" + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - BOOT_JDK_PREFIX="/Library/Java/JavaVirtualMachines" - BOOT_JDK_SUFFIX="/Contents/Home" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&6;} - fi + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done fi @@ -9720,26 +14250,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9747,20 +14384,200 @@ fi # end check boot jdk found fi + elif test "x$OPENJDK_TARGET_OS" = xlinux; then + + if test "x$BOOT_JDK_FOUND" = xno; then + # Now execute the test + + BOOT_JDK_PREFIX="/usr/lib/jvm" + BOOT_JDK_SUFFIX="" + ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` + if test "x$ALL_JDKS_FOUND" != x; then + for JDK_TO_TRY in $ALL_JDKS_FOUND ; do if test "x$BOOT_JDK_FOUND" = xno; then # Now execute the test - BOOT_JDK_PREFIX="/System/Library/Java/JavaVirtualMachines" - BOOT_JDK_SUFFIX="/Contents/Home" - BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 ` - if test "x$BEST_JDK_FOUND" != x; then - BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}" - if test -d "$BOOT_JDK"; then - BOOT_JDK_FOUND=maybe - { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&5 -$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)" >&6;} - fi + BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" + if test -d "$BOOT_JDK"; then + BOOT_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5 +$as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;} + fi + + + # If previous step claimed to have found a JDK, check it to see if it seems to be valid. + if test "x$BOOT_JDK_FOUND" = xmaybe; then + # Do we have a bin/java? + if test ! -x "$BOOT_JDK/bin/java"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have a bin/javac? + if test ! -x "$BOOT_JDK/bin/javac"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;} + BOOT_JDK_FOUND=no + else + # Do we have an rt.jar? (On MacOSX it is called classes.jar) + if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;} + BOOT_JDK_FOUND=no + else + # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` + + # Extra M4 quote needed to protect [] in grep expression. + FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'` + if test "x$FOUND_VERSION_78" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5 +$as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;} + BOOT_JDK_FOUND=no + else + # We're done! :-) + BOOT_JDK_FOUND=yes + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 +$as_echo_n "checking for Boot JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check rt.jar + fi # end check javac + fi # end check java + fi # end check boot jdk found + fi + + done fi @@ -9801,26 +14618,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -9868,26 +14792,133 @@ # We're done! :-) BOOT_JDK_FOUND=yes - # Fail with message the path to the Boot JDK if var BOOT_JDK contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$BOOT_JDK" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - BOOT_JDK=`$CYGPATH -s -m -a "$BOOT_JDK"` - # Now it's case insensitive; let's make it lowercase to improve readability - BOOT_JDK=`$ECHO "$BOOT_JDK" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - BOOT_JDK=`$CYGPATH -u "$BOOT_JDK"` - else - as_fn_error $? "You cannot have spaces in the path to the Boot JDK! \"$BOOT_JDK\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BOOT_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BOOT_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BOOT_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$BOOT_JDK" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5 $as_echo_n "checking for Boot JDK... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK ($BOOT_JDK_VERSION)" >&5 -$as_echo "$BOOT_JDK ($BOOT_JDK_VERSION)" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5 +$as_echo "$BOOT_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5 +$as_echo_n "checking Boot JDK version... " >&6; } + BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5 +$as_echo "$BOOT_JDK_VERSION" >&6; } fi # end check jdk version fi # end check rt.jar fi # end check javac @@ -10465,16 +15496,13 @@ - - -# Check if the VS env variables were setup prior to running configure. -# If not, then find vcvarsall.bat and run it automatically, and integrate -# the set env variables into the spec file. -SETUPDEVENV="# No special vars" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # Store path to cygwin link.exe to help excluding it when searching for - # VS linker. - # Extract the first word of "link", so it can be a program name with args. +# Locate the actual tools + +if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + + # Store path to cygwin link.exe to help excluding it when searching for + # VS linker. This must be done before changing the PATH when looking for VS. + # Extract the first word of "link", so it can be a program name with args. set dummy link; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -10514,6 +15542,7 @@ fi + if test "x$CYGWIN_LINK" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the first found link.exe is actually the Cygwin link tool" >&5 $as_echo_n "checking if the first found link.exe is actually the Cygwin link tool... " >&6; } "$CYGWIN_LINK" --version > /dev/null @@ -10526,123 +15555,861 @@ # This might be the VS linker. Don't exclude it later on. CYGWIN_LINK="" fi - - # If vcvarsall.bat has been run, then VCINSTALLDIR is set. + fi + + # First-hand choice is to locate and run the vsvars bat file. + + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + VS_ENV_CMD="" + VS_ENV_ARGS="" + if test "x$with_toolsdir" != x; then + + if test "x$VS_ENV_CMD" = x; then + VS100BASE="$with_toolsdir/../.." + METHOD="--with-tools-dir" + + windows_path="$VS100BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS100BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VS100BASE="$unix_path" + fi + + if test -d "$VS100BASE"; then + if test -f "$VS100BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + fi + + if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then + # Having specified an argument which is incorrect will produce an instant failure; + # we should not go on looking + { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&5 +$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Please point to the VC/bin directory within the Visual Studio installation" >&5 +$as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio installation" >&6;} + as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5 + fi + + if test "x$ProgramW6432" != x; then + + if test "x$VS_ENV_CMD" = x; then + WIN_SDK_BASE="$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin" + METHOD="well-known name" + + windows_path="$WIN_SDK_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + WIN_SDK_BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + WIN_SDK_BASE="$unix_path" + fi + + if test -d "$WIN_SDK_BASE"; then + if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VS_ENV_ARGS="/x86" + else + VS_ENV_ARGS="/x64" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 +$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} + fi + fi + fi + + fi + if test "x$PROGRAMW6432" != x; then + + if test "x$VS_ENV_CMD" = x; then + WIN_SDK_BASE="$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin" + METHOD="well-known name" + + windows_path="$WIN_SDK_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + WIN_SDK_BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + WIN_SDK_BASE="$unix_path" + fi + + if test -d "$WIN_SDK_BASE"; then + if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VS_ENV_ARGS="/x86" + else + VS_ENV_ARGS="/x64" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 +$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} + fi + fi + fi + + fi + if test "x$PROGRAMFILES" != x; then + + if test "x$VS_ENV_CMD" = x; then + WIN_SDK_BASE="$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin" + METHOD="well-known name" + + windows_path="$WIN_SDK_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + WIN_SDK_BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + WIN_SDK_BASE="$unix_path" + fi + + if test -d "$WIN_SDK_BASE"; then + if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VS_ENV_ARGS="/x86" + else + VS_ENV_ARGS="/x64" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 +$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} + fi + fi + fi + + fi + + if test "x$VS_ENV_CMD" = x; then + WIN_SDK_BASE="C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin" + METHOD="well-known name" + + windows_path="$WIN_SDK_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + WIN_SDK_BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + WIN_SDK_BASE="$unix_path" + fi + + if test -d "$WIN_SDK_BASE"; then + if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VS_ENV_ARGS="/x86" + else + VS_ENV_ARGS="/x64" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 +$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} + fi + fi + fi + + + if test "x$VS_ENV_CMD" = x; then + WIN_SDK_BASE="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin" + METHOD="well-known name" + + windows_path="$WIN_SDK_BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + WIN_SDK_BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + WIN_SDK_BASE="$unix_path" + fi + + if test -d "$WIN_SDK_BASE"; then + if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VS_ENV_ARGS="/x86" + else + VS_ENV_ARGS="/x64" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5 +$as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5 +$as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;} + fi + fi + fi + + + if test "x$VS100COMNTOOLS" != x; then + + if test "x$VS_ENV_CMD" = x; then + VS100BASE="$VS100COMNTOOLS/../.." + METHOD="VS100COMNTOOLS variable" + + windows_path="$VS100BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS100BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VS100BASE="$unix_path" + fi + + if test -d "$VS100BASE"; then + if test -f "$VS100BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + fi + if test "x$PROGRAMFILES" != x; then + + if test "x$VS_ENV_CMD" = x; then + VS100BASE="$PROGRAMFILES/Microsoft Visual Studio 10.0" + METHOD="well-known name" + + windows_path="$VS100BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS100BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VS100BASE="$unix_path" + fi + + if test -d "$VS100BASE"; then + if test -f "$VS100BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + fi + + if test "x$VS_ENV_CMD" = x; then + VS100BASE="C:/Program Files/Microsoft Visual Studio 10.0" + METHOD="well-known name" + + windows_path="$VS100BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS100BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VS100BASE="$unix_path" + fi + + if test -d "$VS100BASE"; then + if test -f "$VS100BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + + if test "x$VS_ENV_CMD" = x; then + VS100BASE="C:/Program Files (x86)/Microsoft Visual Studio 10.0" + METHOD="well-known name" + + windows_path="$VS100BASE" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + VS100BASE="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + VS100BASE="$unix_path" + fi + + if test -d "$VS100BASE"; then + if test -f "$VS100BASE/$VCVARSFILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5 +$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;} + fi + fi + fi + + + if test "x$VS_ENV_CMD" != x; then + # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$VS_ENV_CMD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$VS_ENV_CMD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$VS_ENV_CMD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + VS_ENV_CMD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting VS_ENV_CMD to \"$new_complete\"" >&6;} + fi + + + # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat + { $as_echo "$as_me:${as_lineno-$LINENO}: Trying to extract Visual Studio environment variables" >&5 +$as_echo "$as_me: Trying to extract Visual Studio environment variables" >&6;} + cd $OUTPUT_ROOT + # FIXME: The code betweeen ---- was inlined from a separate script and is not properly adapted + # to autoconf standards. + + #---- + + # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment) + # but calculate the difference in Cygwin environment before/after running it and then + # apply the diff. + + if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then + _vs10varsall=`cygpath -a -m -s "$VS_ENV_CMD"` + _dosvs10varsall=`cygpath -a -w -s $_vs10varsall` + _dosbash=`cygpath -a -w -s \`which bash\`.*` + else + _dosvs10varsall=`cmd //c echo $VS_ENV_CMD` + _dosbash=`cmd //c echo \`which bash\`` + fi + + # generate the set of exported vars before/after the vs10 setup + $ECHO "@echo off" > localdevenvtmp.bat + $ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export0" >> localdevenvtmp.bat + $ECHO "call $_dosvs10varsall $VS_ENV_ARGS" >> localdevenvtmp.bat + $ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export1" >> localdevenvtmp.bat + + # Now execute the newly created bat file. + # The | cat is to stop SetEnv.Cmd to mess with system colors on msys + cmd /c localdevenvtmp.bat | cat + + # apply the diff (less some non-vs10 vars named by "!") + $SORT localdevenvtmp.export0 | $GREP -v "!" > localdevenvtmp.export0.sort + $SORT localdevenvtmp.export1 | $GREP -v "!" > localdevenvtmp.export1.sort + $COMM -1 -3 localdevenvtmp.export0.sort localdevenvtmp.export1.sort > localdevenv.sh + + # cleanup + $RM localdevenvtmp* + #---- + cd $CURDIR + if test ! -s $OUTPUT_ROOT/localdevenv.sh; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not succesfully extract the envionment variables needed for the VS setup." >&5 +$as_echo "$as_me: Could not succesfully extract the envionment variables needed for the VS setup." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5 +$as_echo "$as_me: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5 +$as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + # Now set all paths and other env variables. This will allow the rest of + # the configure script to find and run the compiler in the proper way. + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting extracted environment variables" >&5 +$as_echo "$as_me: Setting extracted environment variables" >&6;} + . $OUTPUT_ROOT/localdevenv.sh + else + # We did not find a vsvars bat file, let's hope we are run from a VS command prompt. + { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot locate a valid Visual Studio installation, checking current environment" >&5 +$as_echo "$as_me: Cannot locate a valid Visual Studio installation, checking current environment" >&6;} + fi + + # At this point, we should have corrent variables in the environment, or we can't continue. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Visual Studio variables" >&5 +$as_echo_n "checking for Visual Studio variables... " >&6; } + + if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then + if test "x$INCLUDE" = x || test "x$LIB" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: present but broken" >&5 +$as_echo "present but broken" >&6; } + as_fn_error $? "Your VC command prompt seems broken, INCLUDE and/or LIB is missing." "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + VS_INCLUDE="$INCLUDE" + VS_LIB="$LIB" + VS_PATH="$PATH" + + + + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + + if test "x$VS_ENV_CMD" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot locate a valid Visual Studio or Windows SDK installation on disk," >&5 +$as_echo "$as_me: Cannot locate a valid Visual Studio or Windows SDK installation on disk," >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: nor is this script run from a Visual Studio command prompt." >&5 +$as_echo "$as_me: nor is this script run from a Visual Studio command prompt." >&6;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Running the extraction script failed." >&5 +$as_echo "$as_me: Running the extraction script failed." >&6;} + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5 +$as_echo "$as_me: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5 +$as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + +# Check whether --with-msvcr-dll was given. +if test "${with_msvcr_dll+set}" = set; then : + withval=$with_msvcr_dll; +fi + + if test "x$with_msvcr_dll" != x; then + MSVCR_DLL="$with_msvcr_dll" + else if test "x$VCINSTALLDIR" != x; then - # No further setup is needed. The build will happen from this kind - # of shell. - SETUPDEVENV="# This spec file expects that you are running bash from within a VS command prompt." - # Make sure to remind you, if you forget to run make from a cygwin bash shell - # that is spawned "bash -l" from a VS command prompt. - CHECK_FOR_VCINSTALLDIR=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if you are running from within a VS command prompt" >&5 -$as_echo_n "checking if you are running from within a VS command prompt... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - # Ah, we have not yet run vcvarsall.bat/vsvars32.bat/vsvars64.bat. Lets do that. First find it. - if test "x$VS100COMNTOOLS" != x; then - VARSBAT=`find "$VS100COMNTOOLS/../.." -name vcvarsall.bat` - SEARCH_ROOT="$VS100COMNTOOLS" - else - VARSBAT=`find "$PROGRAMFILES" -name vcvarsall.bat` - SEARCH_ROOT="$PROGRAMFILES" - fi - VCPATH=`dirname "$VARSBAT"` - VCPATH=`cygpath -w "$VCPATH"` - if test "x$VARSBAT" = x || test ! -d "$VCPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can find the VS installation" >&5 -$as_echo_n "checking if we can find the VS installation... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Tried to find a VS installation using both $SEARCH_ROOT but failed. Please run \"c:\\cygwin\\bin\\bash.exe -l\" from a VS command prompt and then run configure/make from there." "$LINENO" 5 - fi - case "$OPENJDK_TARGET_CPU" in - x86) - VARSBAT_ARCH=x86 - ;; - x86_64) - VARSBAT_ARCH=amd64 - ;; - esac - # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat - cd $OUTPUT_ROOT - bash $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH" - cd $CURDIR - if test ! -s $OUTPUT_ROOT/localdevenv.sh || test ! -s $OUTPUT_ROOT/localdevenv.gmk; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can extract the needed env variables" >&5 -$as_echo_n "checking if we can extract the needed env variables... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Could not succesfully extract the env variables needed for the VS setup. Please run \"c:\\cygwin\\bin\\bash.exe -l\" from a VS command prompt and then run configure/make from there." "$LINENO" 5 - fi - # Now set all paths and other env variables. This will allow the rest of - # the configure script to find and run the compiler in the proper way. - . $OUTPUT_ROOT/localdevenv.sh - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can find the VS installation" >&5 -$as_echo_n "checking if we can find the VS installation... " >&6; } - if test "x$VCINSTALLDIR" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VCINSTALLDIR" >&5 -$as_echo "$VCINSTALLDIR" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Could not find VS installation. Please install. If you are sure you have installed VS, then please run \"c:\\cygwin\\bin\\bash.exe -l\" from a VS command prompt and then run configure/make from there." "$LINENO" 5 - fi - CHECK_FOR_VCINSTALLDIR=no - SETUPDEVENV="include $OUTPUT_ROOT/localdevenv.gmk" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - -# Check whether --with-msvcr100dll was given. -if test "${with_msvcr100dll+set}" = set; then : - withval=$with_msvcr100dll; -fi - - if test "x$with_msvcr100dll" != x; then - MSVCR100DLL="$with_msvcr100dll" - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x64 | head --lines 1` - else - MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` - if test "x$MSVCR100DLL" = x; then - MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | head --lines 1` - fi - fi - fi - if test "x$MSVCR100DLL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Could not find msvcr100.dll !" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR100DLL" >&5 -$as_echo "$MSVCR100DLL" >&6; } - - # Fail with message the path to msvcr100.dll if var MSVCR100DLL contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$MSVCR100DLL" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - MSVCR100DLL=`$CYGPATH -s -m -a "$MSVCR100DLL"` - # Now it's case insensitive; let's make it lowercase to improve readability - MSVCR100DLL=`$ECHO "$MSVCR100DLL" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - MSVCR100DLL=`$CYGPATH -u "$MSVCR100DLL"` - else - as_fn_error $? "You cannot have spaces in the path to msvcr100.dll! \"$MSVCR100DLL\"" "$LINENO" 5 - fi - fi - - fi -fi - - - - -# Locate the actual tools + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1` + else + MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` + if test "x$MSVCR_DLL" = x; then + MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1` + fi + fi + if test "x$MSVCR_DLL" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&5 +$as_echo "$as_me: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&6;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&5 +$as_echo "$as_me: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&6;} + fi + fi + if test "x$MSVCR_DLL" = x; then + if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $SYSTEMROOT/system32" >&5 +$as_echo "$as_me: msvcr100.dll found in $SYSTEMROOT/system32" >&6;} + MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll" + fi + fi + fi + if test "x$MSVCR_DLL" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Could not find msvcr100.dll !" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$MSVCR_DLL" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of MSVCR_DLL" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + MSVCR_DLL="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$MSVCR_DLL" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + MSVCR_DLL="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$MSVCR_DLL" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + +fi + + # If --build AND --host is set, then the configure script will find any # cross compilation tools in the PATH. Cross compilation tools @@ -10707,47 +16474,245 @@ done - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$BUILD_CC" - car="${tmp%% *}" - tmp="$BUILD_CC EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - BUILD_CC="$car ${cdr% *}" - else - BUILD_CC="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + BUILD_CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;} + fi for ac_prog in cl CC g++ do @@ -10795,47 +16760,245 @@ done - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$BUILD_CXX" - car="${tmp%% *}" - tmp="$BUILD_CXX EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - BUILD_CXX="$car ${cdr% *}" - else - BUILD_CXX="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + BUILD_CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;} + fi # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 @@ -10878,47 +17041,245 @@ - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$BUILD_LD" - car="${tmp%% *}" - tmp="$BUILD_LD EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - BUILD_LD="$car ${cdr% *}" - else - BUILD_LD="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_LD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_LD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_LD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + BUILD_LD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;} + fi fi @@ -11102,16 +17463,874 @@ PATH=$TOOLS_DIR:$PATH fi + +### Locate C compiler (CC) + # gcc is almost always present, but on Windows we # prefer cl.exe and on Solaris we prefer CC. # Thus test for them in this order. +if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Do not probe for cc on MacOSX. + COMPILER_CHECK_LIST="cl gcc" +else + COMPILER_CHECK_LIST="cl cc gcc" +fi + + + COMPILER_NAME=C + + # Do a first initial attempt at searching the list of compiler names. + # AC_PATH_PROGS can't be run multiple times with the same variable, + # so create a new name for this run. + for ac_prog in $COMPILER_CHECK_LIST +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_POTENTIAL_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $POTENTIAL_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_POTENTIAL_CC="$POTENTIAL_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +POTENTIAL_CC=$ac_cv_path_POTENTIAL_CC +if test -n "$POTENTIAL_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CC" >&5 +$as_echo "$POTENTIAL_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$POTENTIAL_CC" && break +done + + CC=$POTENTIAL_CC + + if test "x$$CC" = x; then + + # Print a helpful message on how to acquire the necessary build dependency. + # devkit is the help tag: freetyp2, cups, pulse, alsa etc + MISSING_DEPENDENCY=devkit + PKGHANDLER_COMMAND= + + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi + + as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 + fi + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CC (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving CC (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;} + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CC" >&5 +$as_echo_n "checking resolved symbolic links for CC... " >&6; } + TEST_COMPILER="$CC" + + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --help 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi + fi + + if test "x$READLINK" != x; then + TEST_COMPILER=`$READLINK -f $TEST_COMPILER` + else + STARTDIR=$PWD + COUNTER=0 + DIR=`$DIRNAME $TEST_COMPILER` + FILE=`$BASENAME $TEST_COMPILER` + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # The link might be relative! We have to use cd to travel safely. + cd $DIR + # ... and we must get the to the absolute path, not one using symbolic links. + cd `pwd -P` + cd `$DIRNAME $ISLINK` + DIR=`$THEPWDCMD` + FILE=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + TEST_COMPILER=$DIR/$FILE + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 +$as_echo "$TEST_COMPILER" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CC is disguised ccache" >&5 +$as_echo_n "checking if CC is disguised ccache... " >&6; } + + COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` + if test "x$COMPILER_BASENAME" = "xccache"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5 +$as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } + # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. + # We want to control ccache invocation ourselves, so ignore this cc and try + # searching again. + + # Remove the path to the fake ccache cc from the PATH + RETRY_COMPILER_SAVED_PATH="$PATH" + COMPILER_DIRNAME=`$DIRNAME $CC` + PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" + + # Try again looking for our compiler + if test -n "$ac_tool_prefix"; then + for ac_prog in $COMPILER_CHECK_LIST + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_PROPER_COMPILER_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PROPER_COMPILER_CC"; then + ac_cv_prog_PROPER_COMPILER_CC="$PROPER_COMPILER_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PROPER_COMPILER_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PROPER_COMPILER_CC=$ac_cv_prog_PROPER_COMPILER_CC +if test -n "$PROPER_COMPILER_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5 +$as_echo "$PROPER_COMPILER_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PROPER_COMPILER_CC" && break + done +fi +if test -z "$PROPER_COMPILER_CC"; then + ac_ct_PROPER_COMPILER_CC=$PROPER_COMPILER_CC + for ac_prog in $COMPILER_CHECK_LIST +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_PROPER_COMPILER_CC"; then + ac_cv_prog_ac_ct_PROPER_COMPILER_CC="$ac_ct_PROPER_COMPILER_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_PROPER_COMPILER_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_PROPER_COMPILER_CC=$ac_cv_prog_ac_ct_PROPER_COMPILER_CC +if test -n "$ac_ct_PROPER_COMPILER_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CC" >&5 +$as_echo "$ac_ct_PROPER_COMPILER_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_PROPER_COMPILER_CC" && break +done + + if test "x$ac_ct_PROPER_COMPILER_CC" = x; then + PROPER_COMPILER_CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PROPER_COMPILER_CC=$ac_ct_PROPER_COMPILER_CC + fi +fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + PROPER_COMPILER_CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;} + fi + + PATH="$RETRY_COMPILER_SAVED_PATH" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CC" >&5 +$as_echo_n "checking for resolved symbolic links for CC... " >&6; } + + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --help 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi + fi + + if test "x$READLINK" != x; then + PROPER_COMPILER_CC=`$READLINK -f $PROPER_COMPILER_CC` + else + STARTDIR=$PWD + COUNTER=0 + DIR=`$DIRNAME $PROPER_COMPILER_CC` + FILE=`$BASENAME $PROPER_COMPILER_CC` + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # The link might be relative! We have to use cd to travel safely. + cd $DIR + # ... and we must get the to the absolute path, not one using symbolic links. + cd `pwd -P` + cd `$DIRNAME $ISLINK` + DIR=`$THEPWDCMD` + FILE=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + PROPER_COMPILER_CC=$DIR/$FILE + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5 +$as_echo "$PROPER_COMPILER_CC" >&6; } + CC="$PROPER_COMPILER_CC" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CC" >&5 +$as_echo "no, keeping CC" >&6; } + CC="$TEST_COMPILER" + fi + + COMPILER=$CC + COMPILER_NAME=$COMPILER_NAME + + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work + COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1` + $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null + if test $? -ne 0; then + GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5 +$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&6;} + as_fn_error $? "Sun Studio compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + else + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p"` + COMPILER_VENDOR="Sun Studio" + fi + elif test "x$OPENJDK_TARGET_OS" = xwindows; then + # First line typically looks something like: + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 + COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1` + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` + COMPILER_VENDOR="Microsoft CL.EXE" + COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` + if test "x$OPENJDK_TARGET_CPU" = "xx86"; then + if test "x$COMPILER_CPU_TEST" != "x80x86"; then + as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5 + fi + elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then + if test "x$COMPILER_CPU_TEST" != "xx64"; then + as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5 + fi + fi + else + COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + # Check that this is likely to be GCC. + $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;} + as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + + # First line typically looks something like: + # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \([1-9][0-9.]*\)/\1/p"` + COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) [1-9][0-9.]*/\1/p"` + fi + # This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker) + CC_VERSION="$COMPILER_VERSION" + # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker) + CC_VENDOR="$COMPILER_VENDOR" + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5 +$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;} + + +# Now that we have resolved CC ourself, let autoconf have it's go at it ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then - for ac_prog in cl cc gcc + for ac_prog in $CC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 @@ -11155,7 +18374,7 @@ fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl cc gcc + for ac_prog in $CC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -11703,7 +18922,69 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test "x$CC" = x; then + +### Locate C++ compiler (CXX) + +if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Do not probe for CC on MacOSX. + COMPILER_CHECK_LIST="cl g++" +else + COMPILER_CHECK_LIST="cl CC g++" +fi + + COMPILER_NAME=C++ + + # Do a first initial attempt at searching the list of compiler names. + # AC_PATH_PROGS can't be run multiple times with the same variable, + # so create a new name for this run. + for ac_prog in $COMPILER_CHECK_LIST +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_POTENTIAL_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $POTENTIAL_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_POTENTIAL_CXX="$POTENTIAL_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +POTENTIAL_CXX=$ac_cv_path_POTENTIAL_CXX +if test -n "$POTENTIAL_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CXX" >&5 +$as_echo "$POTENTIAL_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$POTENTIAL_CXX" && break +done + + CXX=$POTENTIAL_CXX + + if test "x$$CXX" = x; then # Print a helpful message on how to acquire the necessary build dependency. # devkit is the help tag: freetyp2, cups, pulse, alsa etc @@ -11729,56 +19010,775 @@ HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi - as_fn_error $? "Could not find a compiler. $HELP_MSG" "$LINENO" 5 -fi -if test "x$CC" = xcc && test "x$OPENJDK_BUILD_OS" = xmacosx; then - # Do not use cc on MacOSX use gcc instead. - CC="gcc" -fi - - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$CC" - car="${tmp%% *}" - tmp="$CC EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - CC="$car ${cdr% *}" - else - CC="$car" - fi - - + as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 + fi + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXX (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving CXX (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;} + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CXX" >&5 +$as_echo_n "checking resolved symbolic links for CXX... " >&6; } + TEST_COMPILER="$CXX" + + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --help 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi + fi + + if test "x$READLINK" != x; then + TEST_COMPILER=`$READLINK -f $TEST_COMPILER` + else + STARTDIR=$PWD + COUNTER=0 + DIR=`$DIRNAME $TEST_COMPILER` + FILE=`$BASENAME $TEST_COMPILER` + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # The link might be relative! We have to use cd to travel safely. + cd $DIR + # ... and we must get the to the absolute path, not one using symbolic links. + cd `pwd -P` + cd `$DIRNAME $ISLINK` + DIR=`$THEPWDCMD` + FILE=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + TEST_COMPILER=$DIR/$FILE + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 +$as_echo "$TEST_COMPILER" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CXX is disguised ccache" >&5 +$as_echo_n "checking if CXX is disguised ccache... " >&6; } + + COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` + if test "x$COMPILER_BASENAME" = "xccache"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5 +$as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } + # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. + # We want to control ccache invocation ourselves, so ignore this cc and try + # searching again. + + # Remove the path to the fake ccache cc from the PATH + RETRY_COMPILER_SAVED_PATH="$PATH" + COMPILER_DIRNAME=`$DIRNAME $CXX` + PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" + + # Try again looking for our compiler + if test -n "$ac_tool_prefix"; then + for ac_prog in $COMPILER_CHECK_LIST + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_PROPER_COMPILER_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PROPER_COMPILER_CXX"; then + ac_cv_prog_PROPER_COMPILER_CXX="$PROPER_COMPILER_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PROPER_COMPILER_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PROPER_COMPILER_CXX=$ac_cv_prog_PROPER_COMPILER_CXX +if test -n "$PROPER_COMPILER_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5 +$as_echo "$PROPER_COMPILER_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PROPER_COMPILER_CXX" && break + done +fi +if test -z "$PROPER_COMPILER_CXX"; then + ac_ct_PROPER_COMPILER_CXX=$PROPER_COMPILER_CXX + for ac_prog in $COMPILER_CHECK_LIST +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_PROPER_COMPILER_CXX"; then + ac_cv_prog_ac_ct_PROPER_COMPILER_CXX="$ac_ct_PROPER_COMPILER_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_PROPER_COMPILER_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_PROPER_COMPILER_CXX=$ac_cv_prog_ac_ct_PROPER_COMPILER_CXX +if test -n "$ac_ct_PROPER_COMPILER_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CXX" >&5 +$as_echo "$ac_ct_PROPER_COMPILER_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_PROPER_COMPILER_CXX" && break +done + + if test "x$ac_ct_PROPER_COMPILER_CXX" = x; then + PROPER_COMPILER_CXX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PROPER_COMPILER_CXX=$ac_ct_PROPER_COMPILER_CXX + fi +fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$PROPER_COMPILER_CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + PROPER_COMPILER_CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;} + fi + + PATH="$RETRY_COMPILER_SAVED_PATH" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CXX" >&5 +$as_echo_n "checking for resolved symbolic links for CXX... " >&6; } + + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --help 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi + fi + + if test "x$READLINK" != x; then + PROPER_COMPILER_CXX=`$READLINK -f $PROPER_COMPILER_CXX` + else + STARTDIR=$PWD + COUNTER=0 + DIR=`$DIRNAME $PROPER_COMPILER_CXX` + FILE=`$BASENAME $PROPER_COMPILER_CXX` + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # The link might be relative! We have to use cd to travel safely. + cd $DIR + # ... and we must get the to the absolute path, not one using symbolic links. + cd `pwd -P` + cd `$DIRNAME $ISLINK` + DIR=`$THEPWDCMD` + FILE=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + PROPER_COMPILER_CXX=$DIR/$FILE + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5 +$as_echo "$PROPER_COMPILER_CXX" >&6; } + CXX="$PROPER_COMPILER_CXX" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CXX" >&5 +$as_echo "no, keeping CXX" >&6; } + CXX="$TEST_COMPILER" + fi + + COMPILER=$CXX + COMPILER_NAME=$COMPILER_NAME + + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work + COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1` + $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null + if test $? -ne 0; then + GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5 +$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&6;} + as_fn_error $? "Sun Studio compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + else + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p"` + COMPILER_VENDOR="Sun Studio" + fi + elif test "x$OPENJDK_TARGET_OS" = xwindows; then + # First line typically looks something like: + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 + COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1` + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` + COMPILER_VENDOR="Microsoft CL.EXE" + COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` + if test "x$OPENJDK_TARGET_CPU" = "xx86"; then + if test "x$COMPILER_CPU_TEST" != "x80x86"; then + as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5 + fi + elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then + if test "x$COMPILER_CPU_TEST" != "xx64"; then + as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5 + fi + fi + else + COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + # Check that this is likely to be GCC. + $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;} + as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + + # First line typically looks something like: + # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \([1-9][0-9.]*\)/\1/p"` + COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) [1-9][0-9.]*/\1/p"` + fi + # This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker) + CXX_VERSION="$COMPILER_VERSION" + # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker) + CXX_VENDOR="$COMPILER_VENDOR" + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5 +$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;} + + +# Now that we have resolved CXX ourself, let autoconf have it's go at it ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -11789,7 +19789,7 @@ CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in cl CC g++ + for ac_prog in $CXX do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 @@ -11833,7 +19833,7 @@ fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in cl CC g++ + for ac_prog in $CXX do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -12036,85 +20036,10 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then - # The found CC, even though it seems to be a g++ derivate, cannot compile - # c++ code. Override. - CXX="g++" -fi - - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$CXX" - car="${tmp%% *}" - tmp="$CXX EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - CXX="$car ${cdr% *}" - else - CXX="$car" - fi - - -if test "x$CXX" = x || test "x$CC" = x; then - - # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=devkit - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - - as_fn_error $? "Could not find the needed compilers! $HELP_MSG " "$LINENO" 5 -fi - -if test "x$OPENJDK_BUILD_OS" != xwindows; then + +### Locate other tools + +if test "x$OPENJDK_TARGET_OS" != xwindows; then ac_ext=m ac_cpp='$OBJCPP $CPPFLAGS' ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -12367,47 +20292,245 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$OBJC" - car="${tmp%% *}" - tmp="$OBJC EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - OBJC="$car ${cdr% *}" - else - OBJC="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of OBJC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + OBJC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting OBJC to \"$new_complete\"" >&6;} + fi else OBJC= @@ -12431,7 +20554,7 @@ # Linking C++ executables. -if test "x$OPENJDK_BUILD_OS" != xwindows; then +if test "x$OPENJDK_TARGET_OS" != xwindows; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -12525,59 +20648,263 @@ fi - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$AR" - car="${tmp%% *}" - tmp="$AR EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - AR="$car ${cdr% *}" - else - AR="$car" - fi - -fi -if test "x$OPENJDK_BUILD_OS" = xmacosx; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$AR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$AR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$AR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AR (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving AR (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + AR="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;} + fi + +fi +if test "x$OPENJDK_TARGET_OS" = xmacosx; then ARFLAGS="-r" else ARFLAGS="" fi +# For hotspot, we need these in Windows mixed path; other platforms keep them the same +HOTSPOT_CXX="$CXX" +HOTSPOT_LD="$LD" + + + COMPILER_NAME=gcc COMPILER_TYPE=CC -if test "x$OPENJDK_BUILD_OS" = xwindows; then : +if test "x$OPENJDK_TARGET_OS" = xwindows; then : # For now, assume that we are always compiling using cl.exe. CC_OUT_OPTION=-Fo @@ -12643,25 +20970,245 @@ # Since we must ignore the first found link, WINLD will contain # the full path to the link.exe program. - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$WINLD" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$WINLD"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - WINLD="$tmp" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$WINLD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of WINLD, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$WINLD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$WINLD" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + WINLD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINLD to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting WINLD to \"$new_complete\"" >&6;} + fi printf "Windows linker was found at $WINLD\n" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the found link.exe is actually the Visual Studio linker" >&5 @@ -12735,25 +21282,245 @@ - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$MT" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$MT"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - MT="$tmp" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$MT" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of MT, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$MT" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$MT" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MT (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving MT (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + MT="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;} + fi # The resource compiler # Extract the first word of "rc", so it can be a program name with args. @@ -12811,28 +21578,297 @@ - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$RC" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$RC"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - RC="$tmp" - - - RC_FLAGS="-nologo /l 0x409 /r" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$RC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of RC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$RC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$RC" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving RC (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving RC (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + RC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;} + fi + + + # For hotspot, we need these in Windows mixed path, + # so rewrite them all. Need added .exe suffix. + HOTSPOT_CXX="$CXX.exe" + HOTSPOT_LD="$LD.exe" + HOTSPOT_MT="$MT.exe" + HOTSPOT_RC="$RC.exe" + + unix_path="$HOTSPOT_CXX" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_CXX="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_CXX="$windows_path" + fi + + + unix_path="$HOTSPOT_LD" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_LD="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_LD="$windows_path" + fi + + + unix_path="$HOTSPOT_MT" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_MT="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_MT="$windows_path" + fi + + + unix_path="$HOTSPOT_RC" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_RC="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_RC="$windows_path" + fi + + + + + RC_FLAGS="-nologo -l 0x409 -r" if test "x$VARIANT" = xOPT; then : RC_FLAGS="$RC_FLAGS -d NDEBUG" @@ -12891,25 +21927,245 @@ - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$WINAR" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$WINAR"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - WINAR="$tmp" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$WINAR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of WINAR, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$WINAR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$WINAR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + WINAR="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINAR to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting WINAR to \"$new_complete\"" >&6;} + fi AR="$WINAR" ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" @@ -12952,25 +22208,245 @@ - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$DUMPBIN" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$DUMPBIN"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - DUMPBIN="$tmp" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$DUMPBIN" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$DUMPBIN" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$DUMPBIN" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + DUMPBIN="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;} + fi COMPILER_TYPE=CL @@ -13118,47 +22594,245 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$CPP" - car="${tmp%% *}" - tmp="$CPP EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - CPP="$car ${cdr% *}" - else - CPP="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CPP (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving CPP (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + CPP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;} + fi ac_ext=cpp @@ -13295,47 +22969,245 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$CXXCPP" - car="${tmp%% *}" - tmp="$CXXCPP EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - CXXCPP="$car ${cdr% *}" - else - CXXCPP="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXXCPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXXCPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXXCPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + CXXCPP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;} + fi if test "x$COMPILE_TYPE" != "xcross"; then @@ -13359,7 +23231,7 @@ fi # Find the right assembler. -if test "x$OPENJDK_BUILD_OS" = xsolaris; then +if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -13401,54 +23273,252 @@ - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$AS" - car="${tmp%% *}" - tmp="$AS EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - AS="$car ${cdr% *}" - else - AS="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$AS" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$AS" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$AS" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AS (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving AS (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + AS="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;} + fi else AS="$CC -c" fi -if test "x$OPENJDK_BUILD_OS" = xsolaris; then +if test "x$OPENJDK_TARGET_OS" = xsolaris; then for ac_prog in gnm nm do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -13495,47 +23565,245 @@ done - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$NM" - car="${tmp%% *}" - tmp="$NM EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - NM="$car ${cdr% *}" - else - NM="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + NM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} + fi # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 @@ -13578,47 +23846,245 @@ - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$STRIP" - car="${tmp%% *}" - tmp="$STRIP EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - STRIP="$car ${cdr% *}" - else - STRIP="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + STRIP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} + fi # Extract the first word of "mcs", so it can be a program name with args. set dummy mcs; ac_word=$2 @@ -13661,49 +24127,247 @@ - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$MCS" - car="${tmp%% *}" - tmp="$MCS EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - MCS="$car ${cdr% *}" - else - MCS="$car" - fi - -elif test "x$OPENJDK_BUILD_OS" != xwindows; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$MCS" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$MCS" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$MCS" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MCS (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving MCS (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + MCS="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;} + fi + +elif test "x$OPENJDK_TARGET_OS" != xwindows; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 @@ -13797,47 +24461,245 @@ fi - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$NM" - car="${tmp%% *}" - tmp="$NM EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - NM="$car ${cdr% *}" - else - NM="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$NM" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + NM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} + fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -13932,89 +24794,282 @@ fi - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$STRIP" - car="${tmp%% *}" - tmp="$STRIP EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - STRIP="$car ${cdr% *}" - else - STRIP="$car" - fi - -fi - -### -# -# Check for objcopy -# -# but search for gobjcopy first... -# since I on solaris found a broken objcopy...buhh -# -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gobjcopy", so it can be a program name with args. -set dummy ${ac_tool_prefix}gobjcopy; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_OBJCOPY+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OBJCOPY=$ac_cv_path_OBJCOPY + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + STRIP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} + fi + +fi + +# objcopy is used for moving debug symbols to separate files when +# full debug symbols are enabled. +if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then + if test -n "$ac_tool_prefix"; then + for ac_prog in gobjcopy objcopy + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJCOPY+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 $as_echo "$OBJCOPY" >&6; } @@ -14024,49 +25079,54 @@ fi -fi -if test -z "$ac_cv_path_OBJCOPY"; then - ac_pt_OBJCOPY=$OBJCOPY - # Extract the first word of "gobjcopy", so it can be a program name with args. -set dummy gobjcopy; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_OBJCOPY+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_OBJCOPY="$ac_pt_OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_OBJCOPY=$ac_cv_path_ac_pt_OBJCOPY -if test -n "$ac_pt_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OBJCOPY" >&5 -$as_echo "$ac_pt_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_OBJCOPY" = x; then + test -n "$OBJCOPY" && break + done +fi +if test -z "$OBJCOPY"; then + ac_ct_OBJCOPY=$OBJCOPY + for ac_prog in gobjcopy objcopy +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJCOPY"; then + ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJCOPY="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY +if test -n "$ac_ct_OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_OBJCOPY" && break +done + + if test "x$ac_ct_OBJCOPY" = x; then OBJCOPY="" else case $cross_compiling:$ac_tool_warned in @@ -14075,98 +25135,342 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OBJCOPY=$ac_pt_OBJCOPY - fi -else - OBJCOPY="$ac_cv_path_OBJCOPY" -fi - -if test "x$OBJCOPY" = x; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. -set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_OBJCOPY+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -OBJCOPY=$ac_cv_path_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_OBJCOPY"; then - ac_pt_OBJCOPY=$OBJCOPY - # Extract the first word of "objcopy", so it can be a program name with args. -set dummy objcopy; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ac_pt_OBJCOPY+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_OBJCOPY in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_OBJCOPY="$ac_pt_OBJCOPY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_ac_pt_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_OBJCOPY=$ac_cv_path_ac_pt_OBJCOPY -if test -n "$ac_pt_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_OBJCOPY" >&5 -$as_echo "$ac_pt_OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_OBJCOPY" = x; then - OBJCOPY="" + OBJCOPY=$ac_ct_OBJCOPY + fi +fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJCOPY" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJCOPY" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJCOPY" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + OBJCOPY="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;} + fi + +fi + +if test -n "$ac_tool_prefix"; then + for ac_prog in gobjdump objdump + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OBJDUMP" && break + done +fi +if test -z "$OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + for ac_prog in gobjdump objdump +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_OBJDUMP" && break +done + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -14174,11 +25478,252 @@ $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OBJCOPY=$ac_pt_OBJCOPY - fi -else - OBJCOPY="$ac_cv_path_OBJCOPY" -fi + OBJDUMP=$ac_ct_OBJDUMP + fi +fi + +if test "x$OBJDUMP" != x; then + # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJDUMP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJDUMP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$OBJDUMP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + OBJDUMP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;} + fi fi @@ -14224,47 +25769,245 @@ - # Translate "gcc -E" into "`which gcc` -E" ie - # extract the full path to the binary and at the - # same time maintain any arguments passed to it. - # The command MUST exist in the path, or else! - tmp="$LIPO" - car="${tmp%% *}" - tmp="$LIPO EOL" - cdr="${tmp#* }" - # On windows we want paths without spaces. - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - - # Translate long cygdrive or C:\sdfsf path - # into a short mixed mode path that has no - # spaces in it. - tmp="$car" - - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - tmp=`$CYGPATH -u "$car"` - tmp=`which "$tmp"` - # If file exists with .exe appended, that's the real filename - # and cygpath needs that to convert to short style path. - if test -f "${tmp}.exe"; then - tmp="${tmp}.exe" - elif test -f "${tmp}.cmd"; then - tmp="${tmp}.cmd" - fi - # Convert to C:/ mixed style path without spaces. - tmp=`$CYGPATH -s -m "$tmp"` - fi - car="$tmp" - - else - # "which" is not portable, but is used here - # because we know that the command exists! - car=`which $car` - fi - if test "x$cdr" != xEOL; then - LIPO="$car ${cdr% *}" - else - LIPO="$car" - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$LIPO" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$LIPO" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$LIPO" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + new_path=`$WHICH $path 2> /dev/null` + if test "x$new_path" = x; then + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test "x$is_absolute_path" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&5 +$as_echo "$as_me: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&6;} + new_path="$path" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 + fi + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + LIPO="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;} + fi fi @@ -14800,7 +26543,7 @@ POST_STRIP_CMD="$STRIP -g" # Linking is different on MacOSX - if test "x$OPENJDK_BUILD_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then # Might change in the future to clang. COMPILER_NAME=gcc SHARED_LIBRARY='lib$1.dylib' @@ -14814,7 +26557,7 @@ POST_STRIP_CMD="$STRIP -S" fi else - if test "x$OPENJDK_BUILD_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_OS" = xsolaris; then # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler COMPILER_NAME=ossc PICFLAG="-KPIC" @@ -14838,7 +26581,7 @@ POST_STRIP_CMD="$STRIP -x" POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" fi - if test "x$OPENJDK_BUILD_OS" = xwindows; then + if test "x$OPENJDK_TARGET_OS" = xwindows; then # If it is not gcc, then assume it is the MS Visual Studio compiler COMPILER_NAME=cl PICFLAG="" @@ -14986,6 +26729,11 @@ # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now #CC_HIGHEST="$CC_HIGHEST -xlibmopt" + if test "x$OPENJDK_TARGET_CPU" = xsparc; then + CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" + fi + case $OPENJDK_TARGET_CPU_ARCH in x86) C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" @@ -15002,8 +26750,6 @@ fi ;; sparc) - CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" @@ -15132,7 +26878,7 @@ CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" case $OPENJDK_TARGET_CPU_ARCH in x86 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -Di386" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" ;; esac @@ -15232,7 +26978,7 @@ # libraries will link to whatever is in memory. Yuck. # # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. -if test "x$COMPILER_TYPE" = xCL; then +if test "x$COMPILER_NAME" = xcl; then LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" if test "x$OPENJDK_TARGET_CPU" = xx86; then LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" @@ -15248,19 +26994,23 @@ fi LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" else - # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` - if test -n "$HAS_GNU_HASH"; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both -Xlinker -z -Xlinker defs" - if test "x$DEBUG_LEVEL" == "xrelease"; then - # When building release libraries, tell the linker optimize them. - # Should this be supplied to the OSS linker as well? - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" - fi - fi - + if test "x$COMPILER_NAME" = xgcc; then + # If this is a --hash-style=gnu system, use --hash-style=both, why? + HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` + if test -n "$HAS_GNU_HASH"; then + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " + fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then + # And since we now know that the linker is gnu, then add -z defs, to forbid + # undefined symbols in object files. + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" + if test "x$DEBUG_LEVEL" = "xrelease"; then + # When building release libraries, tell the linker optimize them. + # Should this be supplied to the OSS linker as well? + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" + fi + fi + fi LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server \ -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client \ @@ -15307,53 +27057,6 @@ -# After we have toolchain, we can compile the uncygdrive helper - -# When using cygwin, we need a wrapper binary that renames -# /cygdrive/c/ arguments into c:/ arguments and peeks into -# @files and rewrites these too! This wrapper binary is -# called uncygdrive.exe. -UNCYGDRIVE= -if test "x$OPENJDK_BUILD_OS" = xwindows; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uncygdrive can be created" >&5 -$as_echo_n "checking if uncygdrive can be created... " >&6; } - UNCYGDRIVE_SRC=`$CYGPATH -m $SRC_ROOT/common/src/uncygdrive.c` - rm -f $OUTPUT_ROOT/uncygdrive* - UNCYGDRIVE=`$CYGPATH -m $OUTPUT_ROOT/uncygdrive.exe` - cd $OUTPUT_ROOT - $CC $UNCYGDRIVE_SRC /Fe$UNCYGDRIVE > $OUTPUT_ROOT/uncygdrive1.log 2>&1 - cd $CURDIR - - if test ! -x $OUTPUT_ROOT/uncygdrive.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $OUTPUT_ROOT/uncygdrive1.log - as_fn_error $? "Could not create $OUTPUT_ROOT/uncygdrive.exe" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNCYGDRIVE" >&5 -$as_echo "$UNCYGDRIVE" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if uncygdrive.exe works" >&5 -$as_echo_n "checking if uncygdrive.exe works... " >&6; } - cd $OUTPUT_ROOT - $UNCYGDRIVE $CC $SRC_ROOT/common/src/uncygdrive.c /Fe$OUTPUT_ROOT/uncygdrive2.exe > $OUTPUT_ROOT/uncygdrive2.log 2>&1 - cd $CURDIR - if test ! -x $OUTPUT_ROOT/uncygdrive2.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $OUTPUT_ROOT/uncygdrive2.log - as_fn_error $? "Uncygdrive did not work!" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj - # The path to uncygdrive to use should be Unix-style - UNCYGDRIVE="$OUTPUT_ROOT/uncygdrive.exe" -fi - - - - - # Setup debug symbols (need objcopy from the toolchain for that) # @@ -15384,7 +27087,7 @@ if test "x$ENABLE_DEBUG_SYMBOLS" = "xdefault"; then # Default is on if objcopy is found, otherwise off - if test "x$OBJCOPY" != x; then + if test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then ENABLE_DEBUG_SYMBOLS=yes else ENABLE_DEBUG_SYMBOLS=no @@ -15536,7 +27239,6 @@ - ############################################################################### # # Check for X Windows @@ -16308,10 +28010,15 @@ OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $X_CFLAGS" + +# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 for ac_header in X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " # include + # include + +" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -16323,6 +28030,7 @@ done + CFLAGS="$OLD_CFLAGS" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -16382,28 +28090,20 @@ fi -# Check whether --with-cups-lib was given. -if test "${with_cups_lib+set}" = set; then : - withval=$with_cups_lib; -fi - - if test "x$CUPS_NOT_NEEDED" = xyes; then - if test "x${with_cups}" != x || test "x${with_cups_include}" != x || test "x${with_cups_lib}" != x; then + if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cups not used, so --with-cups is ignored" >&5 $as_echo "$as_me: WARNING: cups not used, so --with-cups is ignored" >&2;} fi CUPS_CFLAGS= - CUPS_LIBS= else CUPS_FOUND=no - if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno || test "x${with_cups_lib}" = xno; then + if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then as_fn_error $? "It is not possible to disable the use of cups. Remove the --without-cups option." "$LINENO" 5 fi if test "x${with_cups}" != x; then - CUPS_LIBS="-L${with_cups}/lib -lcups" CUPS_CFLAGS="-I${with_cups}/include" CUPS_FOUND=yes fi @@ -16411,10 +28111,6 @@ CUPS_CFLAGS="-I${with_cups_include}" CUPS_FOUND=yes fi - if test "x${with_cups_lib}" != x; then - CUPS_LIBS="-L${with_cups_lib} -lcups" - CUPS_FOUND=yes - fi if test "x$CUPS_FOUND" = xno; then @@ -16572,7 +28268,6 @@ _ACEOF CUPS_FOUND=yes CUPS_CFLAGS= - CUPS_LIBS="-lcups" DEFAULT_CUPS=yes fi @@ -16582,18 +28277,16 @@ if test "x$CUPS_FOUND" = xno; then # Getting nervous now? Lets poke around for standard Solaris third-party # package installation locations. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers and libs" >&5 -$as_echo_n "checking for cups headers and libs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5 +$as_echo_n "checking for cups headers... " >&6; } if test -s /opt/sfw/cups/include/cups/cups.h; then # An SFW package seems to be installed! CUPS_FOUND=yes CUPS_CFLAGS="-I/opt/sfw/cups/include" - CUPS_LIBS="-L/opt/sfw/cups/lib -lcups" elif test -s /opt/csw/include/cups/cups.h; then # A CSW package seems to be installed! CUPS_FOUND=yes CUPS_CFLAGS="-I/opt/csw/include" - CUPS_LIBS="-L/opt/csw/lib -lcups" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5 $as_echo "$CUPS_FOUND" >&6; } @@ -16633,7 +28326,6 @@ - ############################################################################### # # The ubiquitous freetype2 library is used to render fonts. @@ -16661,32 +28353,138 @@ if test "x$with_freetype" != x; then - # Fail with message the path to freetype if var with_freetype contains a path with no spaces in it. - # Unless on Windows, where we can rewrite the path. - HAS_SPACE=`echo "$with_freetype" | grep " "` - if test "x$HAS_SPACE" != x; then - if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # First convert it to DOS-style, short mode (no spaces) - with_freetype=`$CYGPATH -s -m -a "$with_freetype"` - # Now it's case insensitive; let's make it lowercase to improve readability - with_freetype=`$ECHO "$with_freetype" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` - # Now convert it back to Unix-stile (cygpath) - with_freetype=`$CYGPATH -u "$with_freetype"` - else - as_fn_error $? "You cannot have spaces in the path to freetype! \"$with_freetype\"" "$LINENO" 5 - fi - fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$with_freetype" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of with_freetype" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + with_freetype="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$with_freetype" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + with_freetype="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$with_freetype" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" + FREETYPE2_LIB_PATH="$with_freetype/lib" + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then + FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" + FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" + fi if test "x$OPENJDK_TARGET_OS" = xwindows; then FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" fi - FREETYPE2_LIB_PATH="$with_freetype/lib" FREETYPE2_CFLAGS="-I$with_freetype/include" if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" fi - FREETYPE2_FOUND=yes + FREETYPE2_FOUND=yes if test "x$FREETYPE2_FOUND" = xyes; then # Verify that the directories exist if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then @@ -16695,7 +28493,7 @@ # List the contents of the lib. FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` if test "x$FREETYPELIB" = x; then - as_fn_error $? "Could not find libfreetype.se nor freetype.dll in $with_freetype/lib" "$LINENO" 5 + as_fn_error $? "Could not find libfreetype.so nor freetype.dll in $with_freetype/lib" "$LINENO" 5 fi # Check one h-file if ! test -s "$with_freetype/include/ft2build.h"; then @@ -16851,6 +28649,145 @@ USING_SYSTEM_FT_LIB=true fi + if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPELOCATION="$PROGRAMFILES/GnuWin32" + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$FREETYPELOCATION" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of FREETYPELOCATION" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + FREETYPELOCATION="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$FREETYPELOCATION" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + FREETYPELOCATION="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$FREETYPELOCATION" + + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard windows locations" >&5 +$as_echo_n "checking for freetype in some standard windows locations... " >&6; } + if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then + FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include" + FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib" + FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib" + if ! test -s "$FREETYPE2_LIBS"; then + as_fn_error $? "Could not find $FREETYPE2_LIBS" "$LINENO" 5 + fi + if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then + as_fn_error $? "Could not find $FREETYPE2_LIB_PATH/freetype.dll" "$LINENO" 5 + fi + USING_SYSTEM_FT_LIB=true + FREETYPE2_FOUND=yes + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE2_FOUND" >&5 +$as_echo "$FREETYPE2_FOUND" >&6; } + fi if test "x$FREETYPE2_FOUND" = xno; then pkg_failed=no @@ -16919,7 +28856,13 @@ $as_echo "yes" >&6; } FREETYPE2_FOUND=yes fi + # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. + FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` USING_SYSTEM_FT_LIB=true + # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 + if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` + fi fi if test "x$FREETYPE2_FOUND" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard locations" >&5 @@ -16993,6 +28936,60 @@ as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5 fi + + if test "x$OPENJDK_TARGET_OS" != xwindows; then + # AC_CHECK_LIB does not support use of cl.exe + PREV_LDFLAGS="$LDFLAGS" + LDFLAGS="$FREETYPE2_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 +$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } +if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfreetype $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char FT_Init_FreeType (); +int +main () +{ +return FT_Init_FreeType (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_lib_freetype_FT_Init_FreeType=yes +else + ac_cv_lib_freetype_FT_Init_FreeType=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 +$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } +if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBFREETYPE 1 +_ACEOF + + LIBS="-lfreetype $LIBS" + +else + as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5 +fi + + LDFLAGS="$PREV_LDFLAGS" + fi fi @@ -17795,16 +29792,19 @@ if test "x$enable_static_link_stdc__" = xyes; then LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" LDCXX="$CC" + STATIC_CXX_SETTING="STATIC_CXX=true" { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 $as_echo "static" >&6; } else LIBCXX="$LIBCXX -lstdc++" LDCXX="$CXX" + STATIC_CXX_SETTING="STATIC_CXX=false" { $as_echo "$as_me:${as_lineno-$LINENO}: result: dynamic" >&5 $as_echo "dynamic" >&6; } fi fi + # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" @@ -17819,6 +29819,66 @@ +# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper + +# When using cygwin or msys, we need a wrapper binary that renames +# /cygdrive/c/ arguments into c:/ arguments and peeks into +# @files and rewrites these too! This wrapper binary is +# called fixpath. +FIXPATH= +if test "x$OPENJDK_BUILD_OS" = xwindows; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath can be created" >&5 +$as_echo_n "checking if fixpath can be created... " >&6; } + FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c" + FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe" + if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then + FIXPATH_SRC=`$CYGPATH -m $FIXPATH_SRC` + FIXPATH_BIN=`$CYGPATH -m $FIXPATH_BIN` + # Important to keep the .exe suffix on Cygwin for Hotspot makefiles + FIXPATH="$OUTPUT_ROOT/fixpath.exe -c" + elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then + FIXPATH_SRC=`cmd //c echo $FIXPATH_SRC` + FIXPATH_BIN=`cmd //c echo $FIXPATH_BIN` + + # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line + # @ was chosen as separator to minimize risk of other tools messing around with it + all_unique_prefixes=`echo "${all_fixpath_prefixes[@]}" | tr ' ' '\n' | grep '^/./' | sort | uniq` + fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` + + FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list" + fi + rm -f $OUTPUT_ROOT/fixpath* + cd $OUTPUT_ROOT + $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1 + cd $CURDIR + + if test ! -x $OUTPUT_ROOT/fixpath.exe; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cat $OUTPUT_ROOT/fixpath1.log + as_fn_error $? "Could not create $OUTPUT_ROOT/fixpath.exe" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath.exe works" >&5 +$as_echo_n "checking if fixpath.exe works... " >&6; } + cd $OUTPUT_ROOT + $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 + cd $CURDIR + if test ! -x $OUTPUT_ROOT/fixpath2.exe; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cat $OUTPUT_ROOT/fixpath2.log + as_fn_error $? "fixpath did not work!" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj +fi + + + + ############################################################################### # # We need to do some final tweaking, when everything else is done. @@ -17873,6 +29933,10 @@ # Looks like a MacOSX system NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print $5}'` FOUND_CORES=yes + elif test -n "$NUMBER_OF_PROCESSORS"; then + # On windows, look in the env + NUM_CORES=$NUMBER_OF_PROCESSORS + FOUND_CORES=yes fi # For c/c++ code we run twice as many concurrent build @@ -17883,8 +29947,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUM_CORES" >&5 $as_echo "$NUM_CORES" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect number of cores, defaulting to 1!" >&5 -$as_echo "could not detect number of cores, defaulting to 1!" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect number of cores, defaulting to 1" >&5 +$as_echo "could not detect number of cores, defaulting to 1" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This will disable all parallelism from build!" >&5 +$as_echo "$as_me: WARNING: This will disable all parallelism from build!" >&2;} fi @@ -17926,9 +29992,10 @@ MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print $2}'` MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` FOUND_MEM=yes - elif test "x$build_os" = xwindows; then + elif test "x$OPENJDK_BUILD_OS" = xwindows; then # Windows, but without cygwin - MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print $4 }' | sed 's/,//'` + MEMORY_SIZE=`wmic computersystem get totalphysicalmemory -value | grep = | cut -d "=" -f 2-` + MEMORY_SIZE=`expr $MEMORY_SIZE / 1024 / 1024` FOUND_MEM=yes fi @@ -17936,8 +30003,10 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEMORY_SIZE MB" >&5 $as_echo "$MEMORY_SIZE MB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size defaulting to 1024 MB!" >&5 -$as_echo "could not detect memory size defaulting to 1024 MB!" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to 1024 MB" >&5 +$as_echo "could not detect memory size, defaulting to 1024 MB" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This might seriously impact build performance!" >&5 +$as_echo "$as_me: WARNING: This might seriously impact build performance!" >&2;} fi else @@ -18366,11 +30435,26 @@ # df -l lists only local disks; if the given directory is not found then # a non-zero exit code is given - if $DF -l $OUTPUT_ROOT > /dev/null 2>&1; then - OUTPUT_DIR_IS_LOCAL="yes" - else - OUTPUT_DIR_IS_LOCAL="no" - fi + if test "x$DF" = x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + # msys does not have df; use Windows "net use" instead. + IS_NETWORK_DISK=`net use | grep \`pwd -W | cut -d ":" -f 1 | tr a-z A-Z\`:` + if test "x$IS_NETWORK_DISK" = x; then + OUTPUT_DIR_IS_LOCAL="yes" + else + OUTPUT_DIR_IS_LOCAL="no" + fi + else + # No df here, say it's local + OUTPUT_DIR_IS_LOCAL="yes" + fi + else + if $DF -l $OUTPUT_ROOT > /dev/null 2>&1; then + OUTPUT_DIR_IS_LOCAL="yes" + else + OUTPUT_DIR_IS_LOCAL="no" + fi + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OUTPUT_DIR_IS_LOCAL" >&5 $as_echo "$OUTPUT_DIR_IS_LOCAL" >&6; } @@ -18909,7 +30993,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by openjdk $as_me jdk8, which was +This file was extended by OpenJDK $as_me jdk8, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18965,13 +31049,14 @@ Configuration headers: $config_headers -Report bugs to ." +Report bugs to . +OpenJDK home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -openjdk config.status jdk8 +OpenJDK config.status jdk8 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" @@ -19718,7 +31803,15 @@ printf "* JDK variant: $JDK_VARIANT\n" printf "* JVM variants: $with_jvm_variants\n" printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" -printf "* Boot JDK: $BOOT_JDK\n" + +printf "\n" +printf "Tools summary:\n" +if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" +fi +printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" +printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" +printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" printf "\n" printf "Build performance summary:\n" diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/help.m4 --- a/common/autoconf/help.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/help.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -55,6 +55,19 @@ fi ]) +cygwin_help() { + case $1 in + unzip) + PKGHANDLER_COMMAND="cd && cmd /c setup -q -P unzip" ;; + zip) + PKGHANDLER_COMMAND="cd && cmd /c setup -q -P zip" ;; + make) + PKGHANDLER_COMMAND="cd && cmd /c setup -q -P make" ;; + * ) + break ;; + esac +} + apt_help() { case $1 in devkit) @@ -149,7 +162,15 @@ printf "* JDK variant: $JDK_VARIANT\n" printf "* JVM variants: $with_jvm_variants\n" printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n" -printf "* Boot JDK: $BOOT_JDK\n" + +printf "\n" +printf "Tools summary:\n" +if test "x$OPENJDK_BUILD_OS" = "xwindows"; then + printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" +fi +printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" +printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" +printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" printf "\n" printf "Build performance summary:\n" diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/hotspot-spec.gmk.in --- a/common/autoconf/hotspot-spec.gmk.in Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/hotspot-spec.gmk.in Fri Oct 26 14:29:57 2012 -0700 @@ -48,8 +48,8 @@ # The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the # compiler that produces code that can be run on the build platform. -HOSTCC:=@UNCYGDRIVE@ @BUILD_CC@ -HOSTCXX:=@UNCYGDRIVE@ @BUILD_CXX@ +HOSTCC:=@FIXPATH@ @BUILD_CC@ +HOSTCXX:=@FIXPATH@ @BUILD_CXX@ #################################################### # @@ -78,13 +78,23 @@ ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR) ALT_EXPORT_PATH=$(HOTSPOT_DIST) -HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ +HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ @STATIC_CXX_SETTING@ # This is used from the libjvm build for C/C++ code. HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@ # Control wether Hotspot runs Queens test after building TEST_IN_BUILD=@TEST_IN_BUILD@ +# For hotspot, override compiler/tools definition to not include FIXPATH prefix. +# Hotspot has its own handling on the Windows path situation. +CXX:=@CCACHE@ @HOTSPOT_CXX@ +LD:=@HOTSPOT_LD@ +MT:=@HOTSPOT_MT@ +RC:=@HOTSPOT_RC@ EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@ + +# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files. +# This is needed to get the LOG setting to work properly. +include $(SRC_ROOT)/common/makefiles/MakeBase.gmk diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/jdk-options.m4 --- a/common/autoconf/jdk-options.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/jdk-options.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -64,7 +64,7 @@ # ie normal interpreter and C1, only the serial GC, kernel jvmti etc # zero: no machine code interpreter, no compiler # zeroshark: zero interpreter and shark/llvm compiler backend -AC_MSG_CHECKING([which variants of the JVM that should be built]) +AC_MSG_CHECKING([which variants of the JVM to build]) AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants], [JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])]) @@ -241,48 +241,47 @@ # Should we build only OpenJDK even if closed sources are present? # AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only], - [build OpenJDK regardless of the presence of closed repositories @<:@disabled@:>@])],,) + [supress building closed source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"]) + +AC_MSG_CHECKING([for presence of closed sources]) +if test -d "$SRC_ROOT/jdk/src/closed"; then + CLOSED_SOURCE_PRESENT=yes +else + CLOSED_SOURCE_PRESENT=no +fi +AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT]) -if test "x$enable_openjdk_only" = "xyes"; then +AC_MSG_CHECKING([if closed source is supressed (openjdk-only)]) +SUPRESS_CLOSED_SOURCE="$enable_openjdk_only" +AC_MSG_RESULT([$SUPRESS_CLOSED_SOURCE]) + +if test "x$CLOSED_SOURCE_PRESENT" = xno; then + OPENJDK=true + if test "x$SUPRESS_CLOSED_SOURCE" = "xyes"; then + AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense]) + fi +else + if test "x$SUPRESS_CLOSED_SOURCE" = "xyes"; then OPENJDK=true -elif test "x$enable_openjdk_only" = "xno"; then + else OPENJDK=false -elif test -d "$SRC_ROOT/jdk/src/closed"; then - OPENJDK=false -else - OPENJDK=true + fi fi if test "x$OPENJDK" = "xtrue"; then - SET_OPENJDK=OPENJDK=true + SET_OPENJDK="OPENJDK=true" fi AC_SUBST(SET_OPENJDK) ############################################################################### # -# JIGSAW or not. The JIGSAW variable is used during the intermediate -# stage when we are building both the old style JDK and the new style modularized JDK. -# When the modularized JDK is finalized, this option will go away. -# -AC_ARG_ENABLE([jigsaw], [AS_HELP_STRING([--enable-jigsaw], - [build Jigsaw images (not yet available) @<:@disabled@:>@])],,) - -if test "x$enable_jigsaw" = "xyes"; then - JIGSAW=true -else - JIGSAW=false -fi -AC_SUBST(JIGSAW) - -############################################################################### -# # Should we build a JDK/JVM with headful support (ie a graphical ui)? # We always build headless support. # AC_MSG_CHECKING([headful support]) AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful], - [build headful support (graphical UI support) @<:@enabled@:>@])], + [disable building headful support (graphical UI support) @<:@enabled@:>@])], [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes]) SUPPORT_HEADLESS=yes @@ -305,25 +304,9 @@ AC_SUBST(SUPPORT_HEADFUL) AC_SUBST(BUILD_HEADLESS) -############################################################################### -# -# Should we compile nimbus swing L&F? We can probably remove this option -# since nimbus is officially part of javax now. -# -AC_MSG_CHECKING([whether to build nimbus L&F]) -AC_ARG_ENABLE([nimbus], [AS_HELP_STRING([--disable-nimbus], - [disable Nimbus L&F @<:@enabled@:>@])], - [ENABLE_NIMBUS="${enableval}"], [ENABLE_NIMBUS='yes']) -AC_MSG_RESULT([$ENABLE_NIMBUS]) -DISABLE_NIMBUS= -if test "x$ENABLE_NIMBUS" = xno; then - DISABLE_NIMBUS=true -fi -AC_SUBST(DISABLE_NIMBUS) - # Control wether Hotspot runs Queens test after build. AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build], - [enable running of Queens test after Hotspot build (not yet available) @<:@disabled@:>@])],, + [run the Queens test after Hotspot build @<:@disabled@:>@])],, [enable_hotspot_test_in_build=no]) if test "x$enable_hotspot_test_in_build" = "xyes"; then TEST_IN_BUILD=true @@ -356,38 +339,6 @@ COMPRESS_JARS=false AC_SUBST(COMPRESS_JARS) - -############################################################################### -# -# Should we compile JFR -# default no, except for on closed-jdk -# -ENABLE_JFR=no - -# Is the JFR source present - -# -# For closed default is yes -# -if test "x${OPENJDK}" != "xtrue"; then - ENABLE_JFR=yes -fi - -AC_MSG_CHECKING([whether to build jfr]) -AC_ARG_ENABLE([jfr], [AS_HELP_STRING([--enable-jfr], - [enable jfr (default is no)])] - [ENABLE_JFR="${enableval}"]) -AC_MSG_RESULT([${ENABLE_JFR}]) - -if test "x$ENABLE_JFR" = "xyes"; then - ENABLE_JFR=true -elif test "x$ENABLE_JFR" = "xno"; then - ENABLE_JFR=false -else - AC_MSG_ERROR([Invalid argument to --enable-jfr]) -fi - -AC_SUBST(ENABLE_JFR) ]) AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], @@ -409,6 +360,8 @@ AC_SUBST(PRODUCT_SUFFIX) AC_SUBST(JDK_RC_PLATFORM_NAME) AC_SUBST(COMPANY_NAME) +AC_SUBST(MACOSX_BUNDLE_NAME_BASE) +AC_SUBST(MACOSX_BUNDLE_ID_BASE) COPYRIGHT_YEAR=`date +'%Y'` AC_SUBST(COPYRIGHT_YEAR) @@ -437,7 +390,7 @@ BUILD_DATE=`date '+%Y_%m_%d_%H_%M'` # Avoid [:alnum:] since it depends on the locale. CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'` - USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'` + USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}" fi AC_SUBST(FULL_VERSION) @@ -473,7 +426,7 @@ fi AC_ARG_ENABLE([debug-symbols], - [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols (@<:@enabled@:>@)])], + [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols @<:@enabled@:>@])], [ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols}], ) @@ -487,7 +440,7 @@ if test "x$ENABLE_DEBUG_SYMBOLS" = "xdefault"; then # Default is on if objcopy is found, otherwise off - if test "x$OBJCOPY" != x; then + if test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then ENABLE_DEBUG_SYMBOLS=yes else ENABLE_DEBUG_SYMBOLS=no @@ -502,7 +455,7 @@ ZIP_DEBUGINFO_FILES=yes AC_ARG_ENABLE([zip-debug-info], - [AS_HELP_STRING([--disable-zip-debug-info],[don't zip debug-info files (@<:@enabled@:@)])], + [AS_HELP_STRING([--disable-zip-debug-info],[disable zipping of debug-info files @<:@enabled@:>@])], [ZIP_DEBUGINFO_FILES=${enable_zip_debug_info}], ) @@ -528,5 +481,5 @@ # for a degree of customization of the build targets and the rules/recipes # to create them AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir], - [directory containing custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir]) + [use this directory for custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir]) AC_SUBST(CUSTOM_MAKE_DIR) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/libraries.m4 --- a/common/autoconf/libraries.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/libraries.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -172,9 +172,15 @@ AC_LANG_PUSH(C) OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $X_CFLAGS" + +# Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10 AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h], - [X11_A_OK=yes], - [X11_A_OK=no]) + [X11_A_OK=yes], + [X11_A_OK=no], + [ # include + # include + ]) + CFLAGS="$OLD_CFLAGS" AC_LANG_POP(C) @@ -196,27 +202,23 @@ # AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups], [specify prefix directory for the cups package - (expecting the libraries under PATH/lib and the headers under PATH/include)])]) + (expecting the headers under PATH/include)])]) AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include], [specify directory for the cups include files])]) -AC_ARG_WITH(cups-lib, [AS_HELP_STRING([--with-cups-lib], - [specify directory for the cups library])]) if test "x$CUPS_NOT_NEEDED" = xyes; then - if test "x${with_cups}" != x || test "x${with_cups_include}" != x || test "x${with_cups_lib}" != x; then + if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then AC_MSG_WARN([cups not used, so --with-cups is ignored]) fi CUPS_CFLAGS= - CUPS_LIBS= else CUPS_FOUND=no - if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno || test "x${with_cups_lib}" = xno; then + if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.]) fi if test "x${with_cups}" != x; then - CUPS_LIBS="-L${with_cups}/lib -lcups" CUPS_CFLAGS="-I${with_cups}/include" CUPS_FOUND=yes fi @@ -224,10 +226,6 @@ CUPS_CFLAGS="-I${with_cups_include}" CUPS_FOUND=yes fi - if test "x${with_cups_lib}" != x; then - CUPS_LIBS="-L${with_cups_lib} -lcups" - CUPS_FOUND=yes - fi if test "x$CUPS_FOUND" = xno; then BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes]) fi @@ -236,23 +234,20 @@ AC_CHECK_HEADERS([cups/cups.h cups/ppd.h], [CUPS_FOUND=yes CUPS_CFLAGS= - CUPS_LIBS="-lcups" DEFAULT_CUPS=yes]) fi if test "x$CUPS_FOUND" = xno; then # Getting nervous now? Lets poke around for standard Solaris third-party # package installation locations. - AC_MSG_CHECKING([for cups headers and libs]) + AC_MSG_CHECKING([for cups headers]) if test -s /opt/sfw/cups/include/cups/cups.h; then # An SFW package seems to be installed! CUPS_FOUND=yes CUPS_CFLAGS="-I/opt/sfw/cups/include" - CUPS_LIBS="-L/opt/sfw/cups/lib -lcups" elif test -s /opt/csw/include/cups/cups.h; then # A CSW package seems to be installed! CUPS_FOUND=yes CUPS_CFLAGS="-I/opt/csw/include" - CUPS_LIBS="-L/opt/csw/lib -lcups" fi AC_MSG_RESULT([$CUPS_FOUND]) fi @@ -263,7 +258,6 @@ fi AC_SUBST(CUPS_CFLAGS) -AC_SUBST(CUPS_LIBS) ]) @@ -292,17 +286,21 @@ FREETYPE2_FOUND=no if test "x$with_freetype" != x; then - SPACESAFE(with_freetype,[the path to freetype]) + BASIC_FIXUP_PATH(with_freetype) FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" + FREETYPE2_LIB_PATH="$with_freetype/lib" + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then + FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" + FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" + fi if test "x$OPENJDK_TARGET_OS" = xwindows; then FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" fi - FREETYPE2_LIB_PATH="$with_freetype/lib" FREETYPE2_CFLAGS="-I$with_freetype/include" if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" fi - FREETYPE2_FOUND=yes + FREETYPE2_FOUND=yes if test "x$FREETYPE2_FOUND" = xyes; then # Verify that the directories exist if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then @@ -311,7 +309,7 @@ # List the contents of the lib. FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` if test "x$FREETYPELIB" = x; then - AC_MSG_ERROR([Could not find libfreetype.se nor freetype.dll in $with_freetype/lib]) + AC_MSG_ERROR([Could not find libfreetype.so nor freetype.dll in $with_freetype/lib]) fi # Check one h-file if ! test -s "$with_freetype/include/ft2build.h"; then @@ -323,9 +321,34 @@ BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) USING_SYSTEM_FT_LIB=true fi + if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPELOCATION="$PROGRAMFILES/GnuWin32" + BASIC_FIXUP_PATH(FREETYPELOCATION) + AC_MSG_CHECKING([for freetype in some standard windows locations]) + if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then + FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include" + FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib" + FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib" + if ! test -s "$FREETYPE2_LIBS"; then + AC_MSG_ERROR([Could not find $FREETYPE2_LIBS]) + fi + if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then + AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll]) + fi + USING_SYSTEM_FT_LIB=true + FREETYPE2_FOUND=yes + fi + AC_MSG_RESULT([$FREETYPE2_FOUND]) + fi if test "x$FREETYPE2_FOUND" = xno; then PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) + # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. + FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` USING_SYSTEM_FT_LIB=true + # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 + if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` + fi fi if test "x$FREETYPE2_FOUND" = xno; then AC_MSG_CHECKING([for freetype in some standard locations]) @@ -364,7 +387,15 @@ if test "x$FREETYPE2_FOUND" = xno; then HELP_MSG_MISSING_DEPENDENCY([freetype2]) AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]) - fi + fi + + if test "x$OPENJDK_TARGET_OS" != xwindows; then + # AC_CHECK_LIB does not support use of cl.exe + PREV_LDFLAGS="$LDFLAGS" + LDFLAGS="$FREETYPE2_LIBS" + AC_CHECK_LIB(freetype, FT_Init_FreeType, [], AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])) + LDFLAGS="$PREV_LDFLAGS" + fi fi AC_SUBST(USING_SYSTEM_FT_LIB) @@ -621,13 +652,16 @@ if test "x$enable_static_link_stdc__" = xyes; then LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS" LDCXX="$CC" + STATIC_CXX_SETTING="STATIC_CXX=true" AC_MSG_RESULT([static]) else LIBCXX="$LIBCXX -lstdc++" LDCXX="$CXX" + STATIC_CXX_SETTING="STATIC_CXX=false" AC_MSG_RESULT([dynamic]) fi fi +AC_SUBST(STATIC_CXX_SETTING) # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/platform.m4 --- a/common/autoconf/platform.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/platform.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -87,22 +87,32 @@ *linux*) VAR_OS=linux VAR_OS_API=posix + VAR_OS_ENV=linux ;; *solaris*) VAR_OS=solaris VAR_OS_API=posix + VAR_OS_ENV=solaris ;; *darwin*) VAR_OS=macosx VAR_OS_API=posix + VAR_OS_ENV=macosx ;; *bsd*) VAR_OS=bsd VAR_OS_API=posix + VAR_OS_ENV=bsd ;; - *cygwin*|*windows*) + *cygwin*) VAR_OS=windows VAR_OS_API=winapi + VAR_OS_ENV=windows.cygwin + ;; + *mingw*) + VAR_OS=windows + VAR_OS_API=winapi + VAR_OS_ENV=windows.msys ;; *) AC_MSG_ERROR([unsupported operating system $1]) @@ -128,11 +138,33 @@ AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME) # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. + PLATFORM_EXTRACT_VARS_FROM_OS($build_os) + PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) + # ..and setup our own variables. (Do this explicitely to facilitate searching) + OPENJDK_BUILD_OS="$VAR_OS" + OPENJDK_BUILD_OS_API="$VAR_OS_API" + OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" + OPENJDK_BUILD_CPU="$VAR_CPU" + OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" + OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" + OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" + AC_SUBST(OPENJDK_BUILD_OS) + AC_SUBST(OPENJDK_BUILD_OS_API) + AC_SUBST(OPENJDK_BUILD_CPU) + AC_SUBST(OPENJDK_BUILD_CPU_ARCH) + AC_SUBST(OPENJDK_BUILD_CPU_BITS) + AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) + + AC_MSG_CHECKING([openjdk-build os-cpu]) + AC_MSG_RESULT([$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU]) + + # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. PLATFORM_EXTRACT_VARS_FROM_OS($host_os) PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) # ... and setup our own variables. (Do this explicitely to facilitate searching) OPENJDK_TARGET_OS="$VAR_OS" OPENJDK_TARGET_OS_API="$VAR_OS_API" + OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" OPENJDK_TARGET_CPU="$VAR_CPU" OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" @@ -144,22 +176,8 @@ AC_SUBST(OPENJDK_TARGET_CPU_BITS) AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN) - # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables. - PLATFORM_EXTRACT_VARS_FROM_OS($build_os) - PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) - # ..and setup our own variables. (Do this explicitely to facilitate searching) - OPENJDK_BUILD_OS="$VAR_OS" - OPENJDK_BUILD_OS_API="$VAR_OS_API" - OPENJDK_BUILD_CPU="$VAR_CPU" - OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" - OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" - OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" - AC_SUBST(OPENJDK_BUILD_OS) - AC_SUBST(OPENJDK_BUILD_OS_API) - AC_SUBST(OPENJDK_BUILD_CPU) - AC_SUBST(OPENJDK_BUILD_CPU_ARCH) - AC_SUBST(OPENJDK_BUILD_CPU_BITS) - AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN) + AC_MSG_CHECKING([openjdk-target os-cpu]) + AC_MSG_RESULT([$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU]) ]) # Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour @@ -208,7 +226,7 @@ fi AC_SUBST(COMPILE_TYPE) -AC_MSG_CHECKING([for compilation type]) +AC_MSG_CHECKING([compilation type]) AC_MSG_RESULT([$COMPILE_TYPE]) ]) @@ -299,7 +317,11 @@ if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then A_LP64="LP64:=" - ADD_LP64="-D_LP64=1" + # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in + # unpack200.exe + if test "x$OPENJDK_TARGET_OS" = xlinux || test "x$OPENJDK_TARGET_OS" = xmacosx; then + ADD_LP64="-D_LP64=1" + fi fi AC_SUBST(LP64,$A_LP64) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/spec.gmk.in --- a/common/autoconf/spec.gmk.in Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/spec.gmk.in Fri Oct 26 14:29:57 2012 -0700 @@ -41,7 +41,9 @@ #' DQUOTE:=" #" -define NEWLINE:= +define NEWLINE + + endef # A self-referential reference to this file. @@ -50,11 +52,7 @@ # Specify where the spec file is. MAKE_ARGS="SPEC=$(SPEC)" -# TODO The logic for finding and setting MAKE is currently not working -# well on windows. Disable it TEMPORARILY there for now. -ifneq (@OPENJDK_TARGET_OS@,windows) - MAKE:=@MAKE@ -endif +MAKE:=@MAKE@ # Pass along the verbosity setting. ifeq (,$(findstring VERBOSE=,$(MAKE))) @@ -77,6 +75,7 @@ # The built jdk will run in this target system. OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@ OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@ +OPENJDK_TARGET_OS_ENV:=@OPENJDK_TARGET_OS_ENV@ OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@ OPENJDK_TARGET_CPU_ARCH:=@OPENJDK_TARGET_CPU_ARCH@ @@ -109,16 +108,21 @@ REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@ @SET_OPENJDK@ -JIGSAW:=@JIGSAW@ LIBM:=-lm LIBDL:=@LIBDL@ # colon or semicolon PATH_SEP:=@PATH_SEP@ -# Set special env variables, to be passed to external tools. -# Used for cygwin setups. -@SETUPDEVENV@ +ifeq ($(OPENJDK_TARGET_OS), windows) + # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE + # environment variables (in Windows path style), and the PATH needs to + # be adjusted to include Visual Studio tools (but this needs to be in + # cygwin/msys style). + export PATH:=@VS_PATH@ + export INCLUDE:=@VS_INCLUDE@ + export LIB:=@VS_LIB@ +endif # The sys root where standard headers and libraries are found. # Usually not needed since the configure script should have @@ -131,7 +135,6 @@ OVERRIDE_SRC_ROOT:=@OVERRIDE_SRC_ROOT@ TOPDIR:=@SRC_ROOT@ OUTPUT_ROOT:=@OUTPUT_ROOT@ -JDK_MAKE_SHARED_DIR:=@JDK_TOPDIR@/makefiles/common/shared JDK_TOPDIR:=@JDK_TOPDIR@ LANGTOOLS_TOPDIR:=@LANGTOOLS_TOPDIR@ CORBA_TOPDIR:=@CORBA_TOPDIR@ @@ -155,6 +158,8 @@ PRODUCT_SUFFIX:=@PRODUCT_SUFFIX@ JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@ COMPANY_NAME:=@COMPANY_NAME@ +MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@ +MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@ # Different version strings generated from the above information. JDK_VERSION:=@JDK_VERSION@ @@ -289,7 +294,7 @@ CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@ # Tools that potentially need to be cross compilation aware. -CC:=@UNCYGDRIVE@ @CCACHE@ @CC@ +CC:=@FIXPATH@ @CCACHE@ @CC@ # CFLAGS used to compile the jdk native libraries (C-code) CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@ @@ -299,17 +304,17 @@ CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@ CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@ -CXX:=@UNCYGDRIVE@ @CCACHE@ @CXX@ +CXX:=@FIXPATH@ @CCACHE@ @CXX@ #CXXFLAGS:=@CXXFLAGS@ OBJC:=@CCACHE@ @OBJC@ #OBJCFLAGS:=@OBJCFLAGS@ -CPP:=@UNCYGDRIVE@ @CPP@ +CPP:=@FIXPATH@ @CPP@ #CPPFLAGS:=@CPPFLAGS@ # The linker can be gcc or ld on posix systems, or link.exe on windows systems. -LD:=@UNCYGDRIVE@ @LD@ +LD:=@FIXPATH@ @LD@ # LDFLAGS used to link the jdk native libraries (C-code) LDFLAGS_JDKLIB:=@LDFLAGS_JDKLIB@ @@ -317,7 +322,7 @@ # On some platforms the linker cannot be used to create executables, thus # the need for a separate LDEXE command. -LDEXE:=@UNCYGDRIVE@ @LDEXE@ +LDEXE:=@FIXPATH@ @LDEXE@ # LDFLAGS used to link the jdk native launchers (C-code) LDFLAGS_JDKEXE:=@LDFLAGS_JDKEXE@ @@ -327,22 +332,22 @@ LDFLAGS_CXX_JDK:=@LDFLAGS_CXX_JDK@ # Sometimes a different linker is needed for c++ libs -LDCXX:=@UNCYGDRIVE@ @LDCXX@ +LDCXX:=@FIXPATH@ @LDCXX@ # The flags for linking libstdc++ linker. LIBCXX:=@LIBCXX@ # Sometimes a different linker is needed for c++ executables -LDEXECXX:=@UNCYGDRIVE@ @LDEXECXX@ +LDEXECXX:=@FIXPATH@ @LDEXECXX@ # BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the # build platform. -BUILD_CC:=@UNCYGDRIVE@ @BUILD_CC@ -BUILD_LD:=@UNCYGDRIVE@ @BUILD_LD@ +BUILD_CC:=@FIXPATH@ @BUILD_CC@ +BUILD_LD:=@FIXPATH@ @BUILD_LD@ -AS:=@UNCYGDRIVE@ @AS@ +AS:=@FIXPATH@ @AS@ # AR is used to create a static library (is ar in posix, lib.exe in windows) -AR:=@UNCYGDRIVE@ @AR@ +AR:=@FIXPATH@ @AR@ ARFLAGS:=@ARFLAGS@ NM:=@NM@ @@ -400,20 +405,20 @@ JAVA_FLAGS:=@BOOT_JDK_JVMARGS@ -JAVA=@UNCYGDRIVE@ $(BOOT_JDK)/bin/java $(JAVA_FLAGS) +JAVA=@FIXPATH@ $(BOOT_JDK)/bin/java $(JAVA_FLAGS) -JAVAC=@UNCYGDRIVE@ $(BOOT_JDK)/bin/javac +JAVAC=@FIXPATH@ $(BOOT_JDK)/bin/javac # Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid # overriding that value by using ?=. JAVAC_FLAGS?=@JAVAC_FLAGS@ -JAVAH=@UNCYGDRIVE@ $(BOOT_JDK)/bin/javah +JAVAH=@FIXPATH@ $(BOOT_JDK)/bin/javah -JAR=@UNCYGDRIVE@ $(BOOT_JDK)/bin/jar +JAR=@FIXPATH@ $(BOOT_JDK)/bin/jar -RMIC=@UNCYGDRIVE@ $(BOOT_JDK)/bin/rmic +RMIC=@FIXPATH@ $(BOOT_JDK)/bin/rmic -NATIVE2ASCII=@UNCYGDRIVE@ $(BOOT_JDK)/bin/native2ascii +NATIVE2ASCII=@FIXPATH@ $(BOOT_JDK)/bin/native2ascii # Base flags for RC # Guarding this against resetting value. Legacy make files include spec multiple @@ -424,21 +429,20 @@ # A specific java binary with specific options can be used to run # the long running background sjavac servers and other long running tasks. -SJAVAC_SERVER_JAVA:=@UNCYGDRIVE@ @SJAVAC_SERVER_JAVA@ +SJAVAC_SERVER_JAVA:=@FIXPATH@ @SJAVAC_SERVER_JAVA@ # Tools adhering to a minimal and common standard of posix compliance. AWK:=@AWK@ BASENAME:=@BASENAME@ +BASH:=@BASH@ CAT:=@CAT@ CCACHE:=@CCACHE@ # CD is going away, but remains to cater for legacy makefiles. CD:=cd CHMOD:=@CHMOD@ CP:=@CP@ -CPIO:=@CPIO@ CUT:=@CUT@ DATE:=@DATE@ -DF:=@DF@ DIFF:=@DIFF@ FIND:=@FIND@ FIND_DELETE:=@FIND_DELETE@ @@ -461,6 +465,7 @@ TAR:=@TAR@ TAIL:=@TAIL@ TEE:=@TEE@ +TIME:=@TIME@ TR:=@TR@ TOUCH:=@TOUCH@ WC:=@WC@ @@ -468,9 +473,9 @@ ZIPEXE:=@ZIP@ ZIP:=@ZIP@ UNZIP:=@UNZIP@ -MT:=@UNCYGDRIVE@ @MT@ -RC:=@UNCYGDRIVE@ @RC@ -DUMPBIN:=@UNCYGDRIVE@ @DUMPBIN@ +MT:=@FIXPATH@ @MT@ +RC:=@FIXPATH@ @RC@ +DUMPBIN:=@FIXPATH@ @DUMPBIN@ CYGPATH:=@CYGPATH@ LDD:=@LDD@ OTOOL:=@OTOOL@ @@ -479,8 +484,9 @@ FILE:=@FILE@ HG:=@HG@ OBJCOPY:=@OBJCOPY@ +SETFILE:=@SETFILE@ -UNCYGDRIVE:=@UNCYGDRIVE@ +FIXPATH:=@FIXPATH@ # Where the build output is stored for your convenience. BUILD_LOG:=@BUILD_LOG@ @@ -488,14 +494,12 @@ BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@ # Build setup -DISABLE_NIMBUS:=@DISABLE_NIMBUS@ ENABLE_JFR=@ENABLE_JFR@ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@ -CHECK_FOR_VCINSTALLDIR=@CHECK_FOR_VCINSTALLDIR@ -MSVCRNN_DLL:=@MSVCR100DLL@ +MSVCR_DLL:=@MSVCR_DLL@ # ADD_SRCS takes a single argument with source roots diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/toolchain.m4 --- a/common/autoconf/toolchain.m4 Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/toolchain.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -23,111 +23,67 @@ # questions. # -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) +AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], [ + COMPILER=[$]$1 + COMPILER_NAME=$2 -# Check if the VS env variables were setup prior to running configure. -# If not, then find vcvarsall.bat and run it automatically, and integrate -# the set env variables into the spec file. -SETUPDEVENV="# No special vars" -if test "x$OPENJDK_BUILD_OS" = "xwindows"; then - # Store path to cygwin link.exe to help excluding it when searching for - # VS linker. - AC_PATH_PROG(CYGWIN_LINK, link) - AC_MSG_CHECKING([if the first found link.exe is actually the Cygwin link tool]) - "$CYGWIN_LINK" --version > /dev/null - if test $? -eq 0 ; then - AC_MSG_RESULT([yes]) + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work + COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1` + $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null + if test $? -ne 0; then + GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler.]) + AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_TEST" and with --version: "$GCC_VERSION_TEST"]) + AC_MSG_ERROR([Sun Studio compiler is required. Try setting --with-tools-dir.]) else - AC_MSG_RESULT([no]) - # This might be the VS linker. Don't exclude it later on. - CYGWIN_LINK="" + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/p"` + COMPILER_VENDOR="Sun Studio" + fi + elif test "x$OPENJDK_TARGET_OS" = xwindows; then + # First line typically looks something like: + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86 + COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1` + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \(@<:@1-9@:>@@<:@0-9.@:>@*\) .*/\1/p"` + COMPILER_VENDOR="Microsoft CL.EXE" + COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` + if test "x$OPENJDK_TARGET_CPU" = "xx86"; then + if test "x$COMPILER_CPU_TEST" != "x80x86"; then + AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".]) + fi + elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then + if test "x$COMPILER_CPU_TEST" != "xx64"; then + AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".]) + fi + fi + else + COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + # Check that this is likely to be GCC. + $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null + if test $? -ne 0; then + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler.]) + AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"]) + AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.]) fi - # If vcvarsall.bat has been run, then VCINSTALLDIR is set. - if test "x$VCINSTALLDIR" != x; then - # No further setup is needed. The build will happen from this kind - # of shell. - SETUPDEVENV="# This spec file expects that you are running bash from within a VS command prompt." - # Make sure to remind you, if you forget to run make from a cygwin bash shell - # that is spawned "bash -l" from a VS command prompt. - CHECK_FOR_VCINSTALLDIR=yes - AC_MSG_CHECKING([if you are running from within a VS command prompt]) - AC_MSG_RESULT([yes]) - else - # Ah, we have not yet run vcvarsall.bat/vsvars32.bat/vsvars64.bat. Lets do that. First find it. - if test "x$VS100COMNTOOLS" != x; then - VARSBAT=`find "$VS100COMNTOOLS/../.." -name vcvarsall.bat` - SEARCH_ROOT="$VS100COMNTOOLS" - else - VARSBAT=`find "$PROGRAMFILES" -name vcvarsall.bat` - SEARCH_ROOT="$PROGRAMFILES" - fi - VCPATH=`dirname "$VARSBAT"` - VCPATH=`cygpath -w "$VCPATH"` - if test "x$VARSBAT" = x || test ! -d "$VCPATH"; then - AC_MSG_CHECKING([if we can find the VS installation]) - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Tried to find a VS installation using both $SEARCH_ROOT but failed. Please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.]) - fi - case "$OPENJDK_TARGET_CPU" in - x86) - VARSBAT_ARCH=x86 - ;; - x86_64) - VARSBAT_ARCH=amd64 - ;; - esac - # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat - cd $OUTPUT_ROOT - bash $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH" - cd $CURDIR - if test ! -s $OUTPUT_ROOT/localdevenv.sh || test ! -s $OUTPUT_ROOT/localdevenv.gmk; then - AC_MSG_CHECKING([if we can extract the needed env variables]) - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not succesfully extract the env variables needed for the VS setup. Please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.]) - fi - # Now set all paths and other env variables. This will allow the rest of - # the configure script to find and run the compiler in the proper way. - . $OUTPUT_ROOT/localdevenv.sh - AC_MSG_CHECKING([if we can find the VS installation]) - if test "x$VCINSTALLDIR" != x; then - AC_MSG_RESULT([$VCINSTALLDIR]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find VS installation. Please install. If you are sure you have installed VS, then please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.]) - fi - CHECK_FOR_VCINSTALLDIR=no - SETUPDEVENV="include $OUTPUT_ROOT/localdevenv.gmk" + # First line typically looks something like: + # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/p"` + COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) @<:@1-9@:>@@<:@0-9.@:>@*/\1/p"` + fi + # This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker) + $1_VERSION="$COMPILER_VERSION" + # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker) + $1_VENDOR="$COMPILER_VENDOR" - AC_MSG_CHECKING([for msvcr100.dll]) - AC_ARG_WITH(msvcr100dll, [AS_HELP_STRING([--with-msvcr100dll], - [copy this msvcr100.dll into the built JDK])]) - if test "x$with_msvcr100dll" != x; then - MSVCR100DLL="$with_msvcr100dll" - else - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x64 | head --lines 1` - else - MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` - if test "x$MSVCR100DLL" = x; then - MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | head --lines 1` - fi - fi - fi - if test "x$MSVCR100DLL" = x; then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find msvcr100.dll !]) - fi - AC_MSG_RESULT([$MSVCR100DLL]) - SPACESAFE(MSVCR100DLL,[the path to msvcr100.dll]) - fi -fi -AC_SUBST(SETUPDEVENV) -AC_SUBST(CHECK_FOR_VCINSTALLDIR) -AC_SUBST(MSVCR100DLL) + AC_MSG_NOTICE([Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)]) ]) + AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS], [ ############################################################################### @@ -151,8 +107,67 @@ AC_SUBST(AR_OUT_OPTION) ]) -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_PATHS], +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) +# $3 = list of compiler names to search for +AC_DEFUN([TOOLCHAIN_FIND_COMPILER], [ + COMPILER_NAME=$2 + + # Do a first initial attempt at searching the list of compiler names. + # AC_PATH_PROGS can't be run multiple times with the same variable, + # so create a new name for this run. + AC_PATH_PROGS(POTENTIAL_$1, $3) + $1=$POTENTIAL_$1 + + if test "x$[$]$1" = x; then + HELP_MSG_MISSING_DEPENDENCY([devkit]) + AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) + fi + BASIC_FIXUP_EXECUTABLE($1) + AC_MSG_CHECKING([resolved symbolic links for $1]) + TEST_COMPILER="[$]$1" + BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) + AC_MSG_RESULT([$TEST_COMPILER]) + AC_MSG_CHECKING([if $1 is disguised ccache]) + + COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` + if test "x$COMPILER_BASENAME" = "xccache"; then + AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler]) + # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. + # We want to control ccache invocation ourselves, so ignore this cc and try + # searching again. + + # Remove the path to the fake ccache cc from the PATH + RETRY_COMPILER_SAVED_PATH="$PATH" + COMPILER_DIRNAME=`$DIRNAME [$]$1` + PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" + + # Try again looking for our compiler + AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3) + BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1) + PATH="$RETRY_COMPILER_SAVED_PATH" + + AC_MSG_CHECKING([for resolved symbolic links for $1]) + BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1) + AC_MSG_RESULT([$PROPER_COMPILER_$1]) + $1="$PROPER_COMPILER_$1" + else + AC_MSG_RESULT([no, keeping $1]) + $1="$TEST_COMPILER" + fi + TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) +]) + + +AC_DEFUN([TOOLCHAIN_SETUP_PATHS], +[ +if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV +fi + +AC_SUBST(MSVCR_DLL) + # If --build AND --host is set, then the configure script will find any # cross compilation tools in the PATH. Cross compilation tools # follows the cross compilation standard where they are prefixed with ${host}. @@ -171,11 +186,11 @@ # Otherwise, we'll set the BUILD_tools to the native tools, but that'll have # to wait until they are properly discovered. AC_PATH_PROGS(BUILD_CC, [cl cc gcc]) - SET_FULL_PATH(BUILD_CC) + BASIC_FIXUP_EXECUTABLE(BUILD_CC) AC_PATH_PROGS(BUILD_CXX, [cl CC g++]) - SET_FULL_PATH(BUILD_CXX) + BASIC_FIXUP_EXECUTABLE(BUILD_CXX) AC_PATH_PROG(BUILD_LD, ld) - SET_FULL_PATH(BUILD_LD) + BASIC_FIXUP_EXECUTABLE(BUILD_LD) fi AC_SUBST(BUILD_CC) AC_SUBST(BUILD_CXX) @@ -218,36 +233,40 @@ PATH=$TOOLS_DIR:$PATH fi + +### Locate C compiler (CC) + # gcc is almost always present, but on Windows we # prefer cl.exe and on Solaris we prefer CC. # Thus test for them in this order. -AC_PROG_CC([cl cc gcc]) -if test "x$CC" = x; then - HELP_MSG_MISSING_DEPENDENCY([devkit]) - AC_MSG_ERROR([Could not find a compiler. $HELP_MSG]) -fi -if test "x$CC" = xcc && test "x$OPENJDK_BUILD_OS" = xmacosx; then - # Do not use cc on MacOSX use gcc instead. - CC="gcc" -fi -SET_FULL_PATH(CC) - -AC_PROG_CXX([cl CC g++]) -if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then - # The found CC, even though it seems to be a g++ derivate, cannot compile - # c++ code. Override. - CXX="g++" -fi -SET_FULL_PATH(CXX) - -if test "x$CXX" = x || test "x$CC" = x; then - HELP_MSG_MISSING_DEPENDENCY([devkit]) - AC_MSG_ERROR([Could not find the needed compilers! $HELP_MSG ]) +if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Do not probe for cc on MacOSX. + COMPILER_CHECK_LIST="cl gcc" +else + COMPILER_CHECK_LIST="cl cc gcc" fi -if test "x$OPENJDK_BUILD_OS" != xwindows; then +TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST]) +# Now that we have resolved CC ourself, let autoconf have it's go at it +AC_PROG_CC([$CC]) + +### Locate C++ compiler (CXX) + +if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # Do not probe for CC on MacOSX. + COMPILER_CHECK_LIST="cl g++" +else + COMPILER_CHECK_LIST="cl CC g++" +fi +TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST]) +# Now that we have resolved CXX ourself, let autoconf have it's go at it +AC_PROG_CXX([$CXX]) + +### Locate other tools + +if test "x$OPENJDK_TARGET_OS" != xwindows; then AC_PROG_OBJC - SET_FULL_PATH(OBJC) + BASIC_FIXUP_EXECUTABLE(OBJC) else OBJC= fi @@ -270,20 +289,26 @@ # Linking C++ executables. AC_SUBST(LDEXECXX) -if test "x$OPENJDK_BUILD_OS" != xwindows; then +if test "x$OPENJDK_TARGET_OS" != xwindows; then AC_CHECK_TOOL(AR, ar) - SET_FULL_PATH(AR) + BASIC_FIXUP_EXECUTABLE(AR) fi -if test "x$OPENJDK_BUILD_OS" = xmacosx; then +if test "x$OPENJDK_TARGET_OS" = xmacosx; then ARFLAGS="-r" else ARFLAGS="" fi AC_SUBST(ARFLAGS) +# For hotspot, we need these in Windows mixed path; other platforms keep them the same +HOTSPOT_CXX="$CXX" +HOTSPOT_LD="$LD" +AC_SUBST(HOTSPOT_CXX) +AC_SUBST(HOTSPOT_LD) + COMPILER_NAME=gcc COMPILER_TYPE=CC -AS_IF([test "x$OPENJDK_BUILD_OS" = xwindows], [ +AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ # For now, assume that we are always compiling using cl.exe. CC_OUT_OPTION=-Fo EXE_OUT_OPTION=-out: @@ -294,7 +319,7 @@ AC_CHECK_PROG([WINLD], [link],[link],,, [$CYGWIN_LINK]) # Since we must ignore the first found link, WINLD will contain # the full path to the link.exe program. - SET_FULL_PATH_SPACESAFE([WINLD]) + BASIC_FIXUP_EXECUTABLE(WINLD) printf "Windows linker was found at $WINLD\n" AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker]) "$WINLD" --version > /dev/null @@ -310,12 +335,25 @@ LDEXECXX="$WINLD" AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) - SET_FULL_PATH_SPACESAFE([MT]) + BASIC_FIXUP_EXECUTABLE(MT) # The resource compiler AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) - SET_FULL_PATH_SPACESAFE([RC]) + BASIC_FIXUP_EXECUTABLE(RC) - RC_FLAGS="-nologo /l 0x409 /r" + # For hotspot, we need these in Windows mixed path, + # so rewrite them all. Need added .exe suffix. + HOTSPOT_CXX="$CXX.exe" + HOTSPOT_LD="$LD.exe" + HOTSPOT_MT="$MT.exe" + HOTSPOT_RC="$RC.exe" + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX) + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD) + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT) + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC) + AC_SUBST(HOTSPOT_MT) + AC_SUBST(HOTSPOT_RC) + + RC_FLAGS="-nologo -l 0x409 -r" AS_IF([test "x$VARIANT" = xOPT], [ RC_FLAGS="$RC_FLAGS -d NDEBUG" ]) @@ -333,12 +371,12 @@ # lib.exe is used to create static libraries. AC_CHECK_PROG([WINAR], [lib],[lib],,,) - SET_FULL_PATH_SPACESAFE([WINAR]) + BASIC_FIXUP_EXECUTABLE(WINAR) AR="$WINAR" ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) - SET_FULL_PATH_SPACESAFE([DUMPBIN]) + BASIC_FIXUP_EXECUTABLE(DUMPBIN) COMPILER_TYPE=CL CCXXFLAGS="$CCXXFLAGS -nologo" @@ -347,10 +385,10 @@ AC_SUBST(COMPILER_TYPE) AC_PROG_CPP -SET_FULL_PATH(CPP) +BASIC_FIXUP_EXECUTABLE(CPP) AC_PROG_CXXCPP -SET_FULL_PATH(CXXCPP) +BASIC_FIXUP_EXECUTABLE(CXXCPP) if test "x$COMPILE_TYPE" != "xcross"; then # If we are not cross compiling, use the same compilers for @@ -373,43 +411,44 @@ fi # Find the right assembler. -if test "x$OPENJDK_BUILD_OS" = xsolaris; then +if test "x$OPENJDK_TARGET_OS" = xsolaris; then AC_PATH_PROG(AS, as) - SET_FULL_PATH(AS) + BASIC_FIXUP_EXECUTABLE(AS) else AS="$CC -c" fi AC_SUBST(AS) -if test "x$OPENJDK_BUILD_OS" = xsolaris; then +if test "x$OPENJDK_TARGET_OS" = xsolaris; then AC_PATH_PROGS(NM, [gnm nm]) - SET_FULL_PATH(NM) + BASIC_FIXUP_EXECUTABLE(NM) AC_PATH_PROG(STRIP, strip) - SET_FULL_PATH(STRIP) + BASIC_FIXUP_EXECUTABLE(STRIP) AC_PATH_PROG(MCS, mcs) - SET_FULL_PATH(MCS) -elif test "x$OPENJDK_BUILD_OS" != xwindows; then + BASIC_FIXUP_EXECUTABLE(MCS) +elif test "x$OPENJDK_TARGET_OS" != xwindows; then AC_CHECK_TOOL(NM, nm) - SET_FULL_PATH(NM) + BASIC_FIXUP_EXECUTABLE(NM) AC_CHECK_TOOL(STRIP, strip) - SET_FULL_PATH(STRIP) + BASIC_FIXUP_EXECUTABLE(STRIP) fi -### -# -# Check for objcopy -# -# but search for gobjcopy first... -# since I on solaris found a broken objcopy...buhh -# -AC_PATH_TOOL(OBJCOPY, gobjcopy) -if test "x$OBJCOPY" = x; then - AC_PATH_TOOL(OBJCOPY, objcopy) +# objcopy is used for moving debug symbols to separate files when +# full debug symbols are enabled. +if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then + AC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy]) + BASIC_FIXUP_EXECUTABLE(OBJCOPY) +fi + +AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) +if test "x$OBJDUMP" != x; then + # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. + BASIC_FIXUP_EXECUTABLE(OBJDUMP) fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then AC_PATH_PROG(LIPO, lipo) - SET_FULL_PATH(LIPO) + BASIC_FIXUP_EXECUTABLE(LIPO) fi # Restore old path without tools dir @@ -449,7 +488,7 @@ POST_STRIP_CMD="$STRIP -g" # Linking is different on MacOSX - if test "x$OPENJDK_BUILD_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then # Might change in the future to clang. COMPILER_NAME=gcc SHARED_LIBRARY='lib[$]1.dylib' @@ -463,7 +502,7 @@ POST_STRIP_CMD="$STRIP -S" fi else - if test "x$OPENJDK_BUILD_OS" = xsolaris; then + if test "x$OPENJDK_TARGET_OS" = xsolaris; then # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler COMPILER_NAME=ossc PICFLAG="-KPIC" @@ -487,7 +526,7 @@ POST_STRIP_CMD="$STRIP -x" POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" fi - if test "x$OPENJDK_BUILD_OS" = xwindows; then + if test "x$OPENJDK_TARGET_OS" = xwindows; then # If it is not gcc, then assume it is the MS Visual Studio compiler COMPILER_NAME=cl PICFLAG="" @@ -626,6 +665,11 @@ # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now #CC_HIGHEST="$CC_HIGHEST -xlibmopt" + if test "x$OPENJDK_TARGET_CPU" = xsparc; then + CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" + fi + case $OPENJDK_TARGET_CPU_ARCH in x86) C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" @@ -642,8 +686,6 @@ fi ;; sparc) - CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" @@ -759,7 +801,7 @@ CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" case $OPENJDK_TARGET_CPU_ARCH in x86 ) - CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -Di386" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" ;; esac @@ -859,7 +901,7 @@ # libraries will link to whatever is in memory. Yuck. # # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. -if test "x$COMPILER_TYPE" = xCL; then +if test "x$COMPILER_NAME" = xcl; then LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" if test "x$OPENJDK_TARGET_CPU" = xx86; then LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" @@ -875,19 +917,23 @@ fi LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" else - # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` - if test -n "$HAS_GNU_HASH"; then - # And since we now know that the linker is gnu, then add -z defs, to forbid - # undefined symbols in object files. - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both -Xlinker -z -Xlinker defs" - if test "x$DEBUG_LEVEL" == "xrelease"; then - # When building release libraries, tell the linker optimize them. - # Should this be supplied to the OSS linker as well? - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" + if test "x$COMPILER_NAME" = xgcc; then + # If this is a --hash-style=gnu system, use --hash-style=both, why? + HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` + if test -n "$HAS_GNU_HASH"; then + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " + fi + if test "x$OPENJDK_TARGET_OS" = xlinux; then + # And since we now know that the linker is gnu, then add -z defs, to forbid + # undefined symbols in object files. + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" + if test "x$DEBUG_LEVEL" = "xrelease"; then + # When building release libraries, tell the linker optimize them. + # Should this be supplied to the OSS linker as well? + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" + fi fi fi - LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server \ -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client \ diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/toolchain_windows.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/autoconf/toolchain_windows.m4 Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,258 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], +[ + if test "x$VS_ENV_CMD" = x; then + VS100BASE="$1" + METHOD="$2" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS100BASE) + if test -d "$VS100BASE"; then + if test -f "$VS100BASE/$VCVARSFILE"; then + AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD]) + VS_ENV_CMD="$VS100BASE/$VCVARSFILE" + else + AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD]) + AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring]) + fi + fi + fi +]) + +AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT], +[ + if test "x$VS_ENV_CMD" = x; then + WIN_SDK_BASE="$1" + METHOD="$2" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE) + if test -d "$WIN_SDK_BASE"; then + if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then + AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) + VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd" + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VS_ENV_ARGS="/x86" + else + VS_ENV_ARGS="/x64" + fi + else + AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) + AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring]) + fi + fi + fi +]) + +AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], +[ + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + VCVARSFILE="vc/bin/vcvars32.bat" + else + VCVARSFILE="vc/bin/amd64/vcvars64.bat" + fi + + VS_ENV_CMD="" + VS_ENV_ARGS="" + if test "x$with_toolsdir" != x; then + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$with_toolsdir/../..], [--with-tools-dir]) + fi + + if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then + # Having specified an argument which is incorrect will produce an instant failure; + # we should not go on looking + AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid Visual Studio installation]) + AC_MSG_NOTICE([Please point to the VC/bin directory within the Visual Studio installation]) + AC_MSG_ERROR([Cannot locate a valid Visual Studio installation]) + fi + + if test "x$ProgramW6432" != x; then + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) + fi + if test "x$PROGRAMW6432" != x; then + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) + fi + if test "x$PROGRAMFILES" != x; then + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) + fi + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) + TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin], [well-known name]) + + if test "x$VS100COMNTOOLS" != x; then + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable]) + fi + if test "x$PROGRAMFILES" != x; then + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$PROGRAMFILES/Microsoft Visual Studio 10.0], [well-known name]) + fi + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files/Microsoft Visual Studio 10.0], [well-known name]) + TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files (x86)/Microsoft Visual Studio 10.0], [well-known name]) +]) + +# Check if the VS env variables were setup prior to running configure. +# If not, then find vcvarsall.bat and run it automatically, and integrate +# the set env variables into the spec file. +AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], +[ + # Store path to cygwin link.exe to help excluding it when searching for + # VS linker. This must be done before changing the PATH when looking for VS. + AC_PATH_PROG(CYGWIN_LINK, link) + if test "x$CYGWIN_LINK" != x; then + AC_MSG_CHECKING([if the first found link.exe is actually the Cygwin link tool]) + "$CYGWIN_LINK" --version > /dev/null + if test $? -eq 0 ; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + # This might be the VS linker. Don't exclude it later on. + CYGWIN_LINK="" + fi + fi + + # First-hand choice is to locate and run the vsvars bat file. + TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE + if test "x$VS_ENV_CMD" != x; then + # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. + BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD) + + # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat + AC_MSG_NOTICE([Trying to extract Visual Studio environment variables]) + cd $OUTPUT_ROOT + # FIXME: The code betweeen ---- was inlined from a separate script and is not properly adapted + # to autoconf standards. + + #---- + + # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment) + # but calculate the difference in Cygwin environment before/after running it and then + # apply the diff. + + if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then + _vs10varsall=`cygpath -a -m -s "$VS_ENV_CMD"` + _dosvs10varsall=`cygpath -a -w -s $_vs10varsall` + _dosbash=`cygpath -a -w -s \`which bash\`.*` + else + _dosvs10varsall=`cmd //c echo $VS_ENV_CMD` + _dosbash=`cmd //c echo \`which bash\`` + fi + + # generate the set of exported vars before/after the vs10 setup + $ECHO "@echo off" > localdevenvtmp.bat + $ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export0" >> localdevenvtmp.bat + $ECHO "call $_dosvs10varsall $VS_ENV_ARGS" >> localdevenvtmp.bat + $ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export1" >> localdevenvtmp.bat + + # Now execute the newly created bat file. + # The | cat is to stop SetEnv.Cmd to mess with system colors on msys + cmd /c localdevenvtmp.bat | cat + + # apply the diff (less some non-vs10 vars named by "!") + $SORT localdevenvtmp.export0 | $GREP -v "!" > localdevenvtmp.export0.sort + $SORT localdevenvtmp.export1 | $GREP -v "!" > localdevenvtmp.export1.sort + $COMM -1 -3 localdevenvtmp.export0.sort localdevenvtmp.export1.sort > localdevenv.sh + + # cleanup + $RM localdevenvtmp* + #---- + cd $CURDIR + if test ! -s $OUTPUT_ROOT/localdevenv.sh; then + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Could not succesfully extract the envionment variables needed for the VS setup.]) + AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) + AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) + AC_MSG_ERROR([Cannot continue]) + fi + + # Now set all paths and other env variables. This will allow the rest of + # the configure script to find and run the compiler in the proper way. + AC_MSG_NOTICE([Setting extracted environment variables]) + . $OUTPUT_ROOT/localdevenv.sh + else + # We did not find a vsvars bat file, let's hope we are run from a VS command prompt. + AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment]) + fi + + # At this point, we should have corrent variables in the environment, or we can't continue. + AC_MSG_CHECKING([for Visual Studio variables]) + + if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then + if test "x$INCLUDE" = x || test "x$LIB" = x; then + AC_MSG_RESULT([present but broken]) + AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.]) + else + AC_MSG_RESULT([ok]) + VS_INCLUDE="$INCLUDE" + VS_LIB="$LIB" + VS_PATH="$PATH" + AC_SUBST(VS_INCLUDE) + AC_SUBST(VS_LIB) + AC_SUBST(VS_PATH) + fi + else + AC_MSG_RESULT([not found]) + + if test "x$VS_ENV_CMD" = x; then + AC_MSG_NOTICE([Cannot locate a valid Visual Studio or Windows SDK installation on disk,]) + AC_MSG_NOTICE([nor is this script run from a Visual Studio command prompt.]) + else + AC_MSG_NOTICE([Running the extraction script failed.]) + fi + AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) + AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) + AC_MSG_ERROR([Cannot continue]) + fi + + AC_MSG_CHECKING([for msvcr100.dll]) + AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll], + [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])]) + if test "x$with_msvcr_dll" != x; then + MSVCR_DLL="$with_msvcr_dll" + else + if test "x$VCINSTALLDIR" != x; then + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1` + else + MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` + if test "x$MSVCR_DLL" = x; then + MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1` + fi + fi + if test "x$MSVCR_DLL" != x; then + AC_MSG_NOTICE([msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR]) + else + AC_MSG_NOTICE([Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR]) + fi + fi + if test "x$MSVCR_DLL" = x; then + if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then + AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32]) + MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll" + fi + fi + fi + if test "x$MSVCR_DLL" = x; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Could not find msvcr100.dll !]) + fi + AC_MSG_RESULT([$MSVCR_DLL]) + BASIC_FIXUP_PATH(MSVCR_DLL) +]) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/autoconf/version.numbers --- a/common/autoconf/version.numbers Wed Jul 05 18:26:51 2017 +0200 +++ b/common/autoconf/version.numbers Fri Oct 26 14:29:57 2012 -0700 @@ -34,3 +34,7 @@ PRODUCT_SUFFIX="Runtime Environment" JDK_RC_PLATFORM_NAME=Platform COMPANY_NAME=N/A + +# Might need better names for these +MACOSX_BUNDLE_NAME_BASE="OpenJDK" +MACOSX_BUNDLE_ID_BASE="net.java.openjdk" diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/compare.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/bin/compare.sh Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,1220 @@ +#!/bin/bash +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script is processed by configure before it's usable. It is run from +# the root of the build directory. + + +########################################################################################## + +# Check that we are run via the wrapper generated by configure +if [ -z "$SRC_ROOT" ]; then + echo "Error: You must run this script using build/[conf]/compare.sh" + exit 1 +fi + +if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then + FULLDUMP_CMD="$OTOOL -v -V -h -X -t -d" + LDD_CMD="$OTOOL -L" + DIS_CMD="$OTOOL -v -t" + STAT_PRINT_SIZE="-f %z" +elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then + FULLDUMP_CMD="$DUMPBIN -all" + LDD_CMD="$DUMPBIN -dependants | $GREP .dll" + DIS_CMD="$DUMPBIN -disasm:nobytes" + STAT_PRINT_SIZE="-c %s" +else + FULLDUMP_CMD="$READELF -a" + LDD_CMD="$LDD" + DIS_CMD="$OBJDUMP -d" + STAT_PRINT_SIZE="-c %s" +fi + +UNARCHIVE="$UNZIP -q" + +COMPARE_EXCEPTIONS_INCLUDE="$SRC_ROOT/common/bin/compare_exceptions.sh.incl" +if [ ! -e "$COMPARE_EXCEPTIONS_INCLUDE" ]; then + echo "Error: Cannot locate the exceptions file, it should have been here: $COMPARE_EXCEPTIONS_INCLUDE" + exit 1 +fi +# Include exception definitions +. "$COMPARE_EXCEPTIONS_INCLUDE" + +########################################################################################## +# Compare text files and ignore specific differences: +# +# * Timestamps in Java sources generated by idl2java +# * Sorting order and cleanup style in .properties files + +diff_text() { + OTHER_FILE=$1 + THIS_FILE=$2 + + SUFFIX="${THIS_FILE##*.}" + + TMP=1 + + if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then + TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ + $GREP '^[<>]' | \ + $SED -e '/[<>] Ant-Version: Apache Ant .*/d' \ + -e '/[<>] Created-By: .* (Oracle Corporation).*/d') + fi + if test "x$SUFFIX" = "xjava"; then + TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \ + $GREP '^[<>]' | \ + $SED -e '/[<>] \* from.*\.idl/d' \ + -e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ + -e '/[<>] \*.*[0-9]\{4\} [0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \ + -e '/\/\/ Generated from input file.*/d' \ + -e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \ + -e '/\/\/ java GenerateCharacter.*/d') + fi + # Ignore date strings in class files. + # On Macosx the system sources for generated java classes produce different output on + # consequtive invokations seemingly randomly. + # For example a method parameter randomly named "thePoint" or "aPoint". Ignore this. + if test "x$SUFFIX" = "xclass"; then + # To improve performance when large diffs are found, do a rough filtering of classes + # elibeble for these exceptions + if $GREP -R -e '[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}' -e thePoint -e aPoint -e setItemsPtr ${THIS_FILE} > /dev/null; then + $JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap + $JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap + TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \ + $GREP '^[<>]' | \ + $SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \ + -e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \ + -e '/[<>].*public com\.apple\.jobjc\.Pointer].*public void setItemsPtr(com\.apple\.jobjc\.Pointer $OTHER_FILE.cleaned + TMP=$(LANG=C $DIFF $OTHER_FILE.cleaned $THIS_FILE) + fi + if test -n "$TMP"; then + echo Files $OTHER_FILE and $THIS_FILE differ + return 1 + fi + + return 0 +} + +########################################################################################## +# Compare directory structure + +compare_dirs() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + mkdir -p $WORK_DIR + + (cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_other) + (cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/dirs_this) + + $DIFF $WORK_DIR/dirs_other $WORK_DIR/dirs_other > $WORK_DIR/dirs_diff + + echo -n Directory structure... + if [ -s $WORK_DIR/dirs_diff ]; then + echo Differences found. + REGRESSIONS=true + # Differences in directories found. + ONLY_OTHER=$($GREP '<' $WORK_DIR/dirs_diff) + if [ "$ONLY_OTHER" ]; then + echo Only in $OTHER + $GREP '<' $WORK_DIR/dirs_diff | $SED 's|< ./| |g' + fi + ONLY_THIS=$($GREP '>' $WORK_DIR/dirs_diff) + if [ "$ONLY_THIS" ]; then + echo Only in $THIS + $GREP '>' $WORK_DIR/dirs_diff | $SED 's|> ./| |g' + fi + else + echo Identical! + fi +} + + +########################################################################################## +# Compare file structure + +compare_files() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + $MKDIR -p $WORK_DIR + + (cd $OTHER_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_other) + (cd $THIS_DIR && $FIND . ! -type d | $SORT > $WORK_DIR/files_this) + + $DIFF $WORK_DIR/files_other $WORK_DIR/files_this > $WORK_DIR/files_diff + + echo -n File names... + if [ -s $WORK_DIR/files_diff ]; then + echo Differences found. + REGRESSIONS=true + # Differences in files found. + ONLY_OTHER=$($GREP '<' $WORK_DIR/files_diff) + if [ "$ONLY_OTHER" ]; then + echo Only in $OTHER + $GREP '<' $WORK_DIR/files_diff | $SED 's|< ./| |g' + fi + ONLY_THIS=$($GREP '>' $WORK_DIR/files_diff) + if [ "$ONLY_THIS" ]; then + echo Only in $THIS + $GREP '>' $WORK_DIR/files_diff | $SED 's|> ./| |g' + fi + else + echo Identical! + fi +} + + +########################################################################################## +# Compare permissions + +compare_permissions() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + mkdir -p $WORK_DIR + + echo -n Permissions... + found="" + for f in `cd $OTHER_DIR && $FIND . -type f` + do + if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi + if [ ! -f ${THIS_DIR}/$f ]; then continue; fi + OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'` + TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'` + if [ "$OP" != "$TP" ] + then + if [ -z "$found" ]; then echo ; found="yes"; fi + $PRINTF "\told: ${OP} new: ${TP}\t$f\n" + fi + done + if [ -z "$found" ]; then + echo "Identical!" + else + REGRESSIONS=true + fi +} + +########################################################################################## +# Compare file command output + +compare_file_types() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + $MKDIR -p $WORK_DIR + + echo -n File types... + found="" + for f in `cd $OTHER_DIR && $FIND . ! -type d` + do + if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi + if [ ! -f ${THIS_DIR}/$f ]; then continue; fi + OF=`cd ${OTHER_DIR} && $FILE -h $f` + TF=`cd ${THIS_DIR} && $FILE -h $f` + if [ "$f" = "./src.zip" ] || [[ "$f" = *"/Home/src.zip" ]] || [[ "$f" = *"/lib/JObjC.jar" ]] + then + if [ "`echo $OF | $GREP -ic zip`" -gt 0 -a "`echo $TF | $GREP -ic zip`" -gt 0 ] + then + # the way we produces zip-files make it so that directories are stored in old file + # but not in new (only files with full-path) + # this makes file-5.09 report them as different + continue; + fi + fi + + if [ "$OF" != "$TF" ] + then + if [ -z "$found" ]; then echo ; found="yes"; fi + $PRINTF "\tother: ${OF}\n\tthis : ${TF}\n" + fi + done + if [ -z "$found" ]; then + echo "Identical!" + else + REGRESSIONS=true + fi +} + +########################################################################################## +# Compare the rest of the files + +compare_general_files() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \ + ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \ + ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \ + ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \ + ! -name "*.lib" ! -name "*.war" \ + | $GREP -v "./bin/" | $SORT | $FILTER) + + echo General files... + for f in $GENERAL_FILES + do + if [ -e $OTHER_DIR/$f ]; then + if [ "$(basename $f)" = "release" ]; then + # Ignore differences in change numbers in release file. + OTHER_FILE=$WORK_DIR/$f.other + THIS_FILE=$WORK_DIR/$f.this + $MKDIR -p $(dirname $OTHER_FILE) + $MKDIR -p $(dirname $THIS_FILE) + $CAT $OTHER_DIR/$f | $SED 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' > $OTHER_FILE + $CAT $THIS_DIR/$f | $SED 's/\:[0-9a-f]\{12,12\}/:CHANGE/g' > $THIS_FILE + else + OTHER_FILE=$OTHER_DIR/$f + THIS_FILE=$THIS_DIR/$f + fi + DIFF_OUT=$($DIFF $OTHER_FILE $THIS_FILE 2>&1) + if [ -n "$DIFF_OUT" ]; then + echo $f + REGRESSIONS=true + if [ "$SHOW_DIFFS" = "true" ]; then + echo "$DIFF_OUT" + fi + fi + fi + done + + +} + +########################################################################################## +# Compare zip file + +compare_zip_file() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + ZIP_FILE=$4 + + THIS_ZIP=$THIS_DIR/$ZIP_FILE + OTHER_ZIP=$OTHER_DIR/$ZIP_FILE + + THIS_SUFFIX="${THIS_ZIP##*.}" + OTHER_SUFFIX="${OTHER_ZIP##*.}" + if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then + echo The files do not have the same suffix type! + return 2 + fi + + TYPE="$THIS_SUFFIX" + + if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null + then + return 0 + fi + # Not quite identical, the might still contain the same data. + # Unpack the jar/zip files in temp dirs + + THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this + OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other + $RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR + $MKDIR -p $THIS_UNZIPDIR + $MKDIR -p $OTHER_UNZIPDIR + (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP) + (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP) + + CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff + # On solaris, there is no -q option. + if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then + LANG=C $DIFF -r $OTHER_UNZIPDIR $THIS_UNZIPDIR \ + | $GREP -v -e "^<" -e "^>" -e "^Common subdirectories:" \ + > $CONTENTS_DIFF_FILE + else + LANG=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE + fi + + ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE) + ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE) + + return_value=0 + + if [ -n "$ONLY_OTHER" ]; then + echo " Only OTHER $ZIP_FILE contains:" + echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g' + return_value=1 + fi + + if [ -n "$ONLY_THIS" ]; then + echo " Only THIS $ZIP_FILE contains:" + echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g' + return_value=1 + fi + + if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then + DIFFING_FILES=$($GREP -e "differ$" -e "^diff " $CONTENTS_DIFF_FILE \ + | $CUT -f 3 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") + else + DIFFING_FILES=$($GREP -e "differ$" $CONTENTS_DIFF_FILE \ + | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g") + fi + + $RM -f $WORK_DIR/$ZIP_FILE.diffs + for file in $DIFFING_FILES; do + if [[ "$ACCEPTED_JARZIP_CONTENTS" != *"$file"* ]]; then + diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs + fi + done + + if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then + return_value=1 + echo " Differing files in $ZIP_FILE" + $CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP differ | cut -f 2 -d ' ' | \ + $SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist + $CAT $WORK_DIR/$ZIP_FILE.difflist + + if [ -n "$SHOW_DIFFS" ]; then + for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do + if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then + LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap + elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then + LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i + else + LANG=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i + fi + done + fi + fi + + return $return_value +} + + +########################################################################################## +# Compare all zip files + +compare_all_zip_files() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER ) + + if [ -n "$ZIPS" ]; then + echo Zip files... + + return_value=0 + for f in $ZIPS; do + if [ -f "$OTHER_DIR/$f" ]; then + compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f + if [ "$?" != "0" ]; then + return_value=1 + REGRESSIONS=true + fi + fi + done + fi + + return $return_value +} + +########################################################################################## +# Compare all jar files + +compare_all_jar_files() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + # TODO filter? + ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" | $SORT | $FILTER) + + if [ -n "$ZIPS" ]; then + echo Jar files... + + return_value=0 + for f in $ZIPS; do + if [ -f "$OTHER_DIR/$f" ]; then + compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f + if [ "$?" != "0" ]; then + return_value=1 + REGRESSIONS=true + fi + fi + done + fi + + return $return_value +} + +########################################################################################## +# Compare binary (executable/library) file + +compare_bin_file() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + BIN_FILE=$4 + + THIS_FILE=$THIS_DIR/$BIN_FILE + OTHER_FILE=$OTHER_DIR/$BIN_FILE + NAME=$(basename $BIN_FILE) + WORK_FILE_BASE=$WORK_DIR/$BIN_FILE + FILE_WORK_DIR=$(dirname $WORK_FILE_BASE) + + $MKDIR -p $FILE_WORK_DIR + + ORIG_THIS_FILE="$THIS_FILE" + ORIG_OTHER_FILE="$OTHER_FILE" + + if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then + THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME + OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME + $MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other + $CP $THIS_FILE $THIS_STRIPPED_FILE + $CP $OTHER_FILE $OTHER_STRIPPED_FILE + $STRIP $THIS_STRIPPED_FILE + $STRIP $OTHER_STRIPPED_FILE + THIS_FILE="$THIS_STRIPPED_FILE" + OTHER_FILE="$OTHER_STRIPPED_FILE" + fi + + if [ "$OPENJDK_TARGET_OS" = "windows" ]; then + unset _NT_SYMBOL_PATH + # On windows we need to unzip the debug symbols, if present + OTHER_FILE_BASE=${OTHER_FILE/.dll/} + OTHER_FILE_BASE=${OTHER_FILE_BASE/.exe/} + DIZ_NAME=$(basename $OTHER_FILE_BASE).diz + # java.exe and java.dll diz files will have the same name. Have to + # make sure java.exe gets the right one. This is only needed for + # OTHER since in the new build, all pdb files are left around. + if [ "$NAME" = "java.exe" ] && [ -f "$OTHER/tmp/java/java/obj64/java.diz" ]; then + OTHER_DIZ_FILE="$OTHER/tmp/java/java/obj64/java.diz" + elif [ -f "${OTHER_FILE_BASE}.diz" ]; then + OTHER_DIZ_FILE=${OTHER_FILE_BASE}.diz + else + # Some files, jli.dll, appears twice in the image but only one of + # thme has a diz file next to it. + OTHER_DIZ_FILE="$($FIND $OTHER_DIR -name $DIZ_NAME | $SED 1q)" + if [ ! -f "$OTHER_DIZ_FILE" ]; then + # As a last resort, look for diz file in the whole build output + # dir. + OTHER_DIZ_FILE="$($FIND $OTHER -name $DIZ_NAME | $SED 1q)" + fi + fi + if [ -n "$OTHER_DIZ_FILE" ]; then + $MKDIR -p $FILE_WORK_DIR/other + (cd $FILE_WORK_DIR/other ; $UNARCHIVE -o $OTHER_DIZ_FILE) + export _NT_SYMBOL_PATH="$FILE_WORK_DIR/other" + fi + THIS_FILE_BASE=${THIS_FILE/.dll/} + THIS_FILE_BASE=${THIS_FILE_BASE/.exe/} + if [ -f "${THIS_FILE/.dll/}.diz" ]; then + THIS_DIZ_FILE=${THIS_FILE/.dll/}.diz + else + THIS_DIZ_FILE="$($FIND $THIS_DIR -name $DIZ_NAME | $SED 1q)" + if [ ! -f "$THIS_DIZ_FILE" ]; then + # As a last resort, look for diz file in the whole build output + # dir. + THIS_DIZ_FILE="$($FIND $THIS -name $DIZ_NAME | $SED 1q)" + fi + fi + if [ -n "$THIS_DIZ_FILE" ]; then + $MKDIR -p $FILE_WORK_DIR/this + (cd $FILE_WORK_DIR/this ; $UNARCHIVE -o $THIS_DIZ_FILE) + export _NT_SYMBOL_PATH="$_NT_SYMBOL_PATH;$FILE_WORK_DIR/this" + fi + fi + + if [ -z "$SKIP_BIN_DIFF" ]; then + if cmp $OTHER_FILE $THIS_FILE > /dev/null; then + # The files were bytewise identical. + if [ -n "$VERBOSE" ]; then + echo " : : : : : $BIN_FILE" + fi + return 0 + fi + BIN_MSG=" diff " + if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then + DIFF_BIN=true + if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then + BIN_MSG="*$BIN_MSG*" + REGRESSIONS=true + else + BIN_MSG=" $BIN_MSG " + fi + else + BIN_MSG="($BIN_MSG)" + DIFF_BIN= + fi + fi + + if [ -n "$STAT" ]; then + THIS_SIZE=$($STAT $STAT_PRINT_SIZE "$THIS_FILE") + OTHER_SIZE=$($STAT $STAT_PRINT_SIZE "$OTHER_FILE") + else + THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }') + OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }') + fi + if [ $THIS_SIZE -ne $OTHER_SIZE ]; then + DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE) + DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE) + SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM) + if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] && [ "$DIFF_SIZE_REL" -lt 102 ]; then + SIZE_MSG="($SIZE_MSG)" + DIFF_SIZE= + elif [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_NUM" = 512 ]; then + # On windows, size of binaries increase in 512 increments. + SIZE_MSG="($SIZE_MSG)" + DIFF_SIZE= + else + if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then + DIFF_SIZE=true + if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then + SIZE_MSG="*$SIZE_MSG*" + REGRESSIONS=true + else + SIZE_MSG=" $SIZE_MSG " + fi + else + SIZE_MSG="($SIZE_MSG)" + DIFF_SIZE= + fi + fi + else + SIZE_MSG=" " + DIFF_SIZE= + if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then + SIZE_MSG=" ! " + fi + fi + + if [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then + SYM_SORT_CMD="sort" + else + SYM_SORT_CMD="cat" + fi + + # Check symbols + if [ "$OPENJDK_TARGET_OS" = "windows" ]; then + # The output from dumpbin on windows differs depending on if the debug symbol + # files are still around at the location the binary is pointing too. Need + # to filter out that extra information. + $DUMPBIN -exports $OTHER_FILE | $GREP -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other + $DUMPBIN -exports $THIS_FILE | $GREP -E '^ +[0-9A-F]+ +[0-9A-F]+ [0-9A-F]+' | sed 's/ = .*//g' | cut -c27- | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this + elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then + # Some symbols get seemingly random 15 character prefixes. Filter them out. + $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other + $NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this + else + $NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other + $NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this + fi + + LANG=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff + if [ -s $WORK_FILE_BASE.symbols.diff ]; then + SYM_MSG=" diff " + if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then + DIFF_SYM=true + if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then + SYM_MSG="*$SYM_MSG*" + REGRESSIONS=true + else + SYM_MSG=" $SYM_MSG " + fi + else + SYM_MSG="($SYM_MSG)" + DIFF_SYM= + fi + else + SYM_MSG=" " + DIFF_SYM= + if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then + SYM_MSG=" ! " + fi + fi + + # Check dependencies + if [ -n "$LDD_CMD" ]; then + (cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq) + (cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq) + (cd $FILE_WORK_DIR && $RM -f $NAME) + + LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff + LANG=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq + + if [ -s $WORK_FILE_BASE.deps.diff ]; then + if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then + DEP_MSG=" diff " + else + DEP_MSG=" redun " + fi + if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then + DIFF_DEP=true + if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then + DEP_MSG="*$DEP_MSG*" + REGRESSIONS=true + else + DEP_MSG=" $DEP_MSG " + fi + else + DEP_MSG="($DEP_MSG)" + DIFF_DEP= + fi + else + DEP_MSG=" " + DIFF_DEP= + if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then + DEP_MSG=" ! " + fi + fi + else + DEP_MSG=" - " + fi + + # Compare fulldump output + if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then + $FULLDUMP_CMD $OTHER_FILE > $WORK_FILE_BASE.fulldump.other 2>&1 + $FULLDUMP_CMD $THIS_FILE > $WORK_FILE_BASE.fulldump.this 2>&1 + LANG=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this > $WORK_FILE_BASE.fulldump.diff + + if [ -s $WORK_FILE_BASE.fulldump.diff ]; then + ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.fulldump.diff | awk '{print $5}') + ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE) + if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then + DIFF_ELF=true + if [[ "$KNOWN_ELF_DIFF" != *"$BIN_FILE"* ]]; then + ELF_MSG="*$ELF_MSG*" + REGRESSIONS=true + else + ELF_MSG=" $ELF_MSG " + fi + else + ELF_MSG="($ELF_MSG)" + DIFF_ELF= + fi + else + ELF_MSG=" " + DIFF_ELF= + if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then + ELF_MSG=" ! " + fi + fi + fi + + # Compare disassemble output + if [ -n "$DIS_CMD" ] && [ -z "$SKIP_DIS_DIFF" ]; then + if [ -z "$DIS_DIFF_FILTER" ]; then + DIS_DIFF_FILTER="$CAT" + fi + $DIS_CMD $OTHER_FILE | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.other 2>&1 + $DIS_CMD $THIS_FILE | $GREP -v $NAME | $DIS_DIFF_FILTER > $WORK_FILE_BASE.dis.this 2>&1 + + LANG=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff + + if [ -s $WORK_FILE_BASE.dis.diff ]; then + DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}') + DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE) + if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then + DIFF_DIS=true + if [[ "$KNOWN_DIS_DIFF" != *"$BIN_FILE"* ]]; then + DIS_MSG="*$DIS_MSG*" + REGRESSIONS=true + else + DIS_MSG=" $DIS_MSG " + fi + else + DIS_MSG="($DIS_MSG)" + DIFF_DIS= + fi + else + DIS_MSG=" " + DIFF_DIS= + if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then + DIS_MSG=" ! " + fi + fi + fi + + + if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_ELF$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then + if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi + if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi + if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi + if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi + if [ -n "$ELF_MSG" ]; then echo -n "$ELF_MSG:"; fi + if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi + echo " $BIN_FILE" + if [ "$SHOW_DIFFS" = "true" ]; then + if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then + echo "Symbols diff:" + $CAT $WORK_FILE_BASE.symbols.diff + fi + if [ -s "$WORK_FILE_BASE.deps.diff" ]; then + echo "Deps diff:" + $CAT $WORK_FILE_BASE.deps.diff + fi + if [ -s "$WORK_FILE_BASE.fulldump.diff" ]; then + echo "Fulldump diff:" + $CAT $WORK_FILE_BASE.fulldump.diff + fi + if [ -s "$WORK_FILE_BASE.dis.diff" ]; then + echo "Disassembly diff:" + $CAT $WORK_FILE_BASE.dis.diff + fi + fi + return 1 + fi + return 0 +} + +########################################################################################## +# Print binary diff header + +print_binary_diff_header() { + if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi + if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi + if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi + if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi + if [ -z "$SKIP_FULLDUMP_DIFF" ]; then echo -n " Fulldump :"; fi + if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi + echo +} + +########################################################################################## +# Compare all libraries + +compare_all_libs() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' \) | $SORT | $FILTER) + + if [ -n "$LIBS" ]; then + echo Libraries... + print_binary_diff_header + for l in $LIBS; do + if [ -f "$OTHER_DIR/$l" ]; then + compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l + if [ "$?" != "0" ]; then + return_value=1 + fi + fi + done + fi + + return $return_value +} + +########################################################################################## +# Compare all executables + +compare_all_execs() { + THIS_DIR=$1 + OTHER_DIR=$2 + WORK_DIR=$3 + + if [ "$OPENJDK_TARGET_OS" = "windows" ]; then + EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER) + else + EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' -o -name '*.jar' -o -name '*.diz' \) | $SORT | $FILTER) + fi + + if [ -n "$EXECS" ]; then + echo Executables... + print_binary_diff_header + for e in $EXECS; do + if [ -f "$OTHER_DIR/$e" ]; then + compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e + if [ "$?" != "0" ]; then + return_value=1 + fi + fi + done + fi + + return $return_value +} + +########################################################################################## +# Initiate configuration + +COMPARE_ROOT=/tmp/cimages.$USER +$MKDIR -p $COMPARE_ROOT +if [ "$OPENJDK_TARGET_OS" = "windows" ]; then + if [ "$(uname -o)" = "Cygwin" ]; then + COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT) + fi +fi + +THIS="$( cd "$( dirname "$0" )" && pwd )" +echo "$THIS" +THIS_SCRIPT="$0" + +if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then + echo "bash ./compare.sh [OPTIONS] [FILTER]" + echo "" + echo "-all Compare all files in all known ways" + echo "-names Compare the file names and directory structure" + echo "-perms Compare the permission bits on all files and directories" + echo "-types Compare the output of the file command on all files" + echo "-general Compare the files not convered by the specialized comparisons" + echo "-zips Compare the contents of all zip files" + echo "-jars Compare the contents of all jar files" + echo "-libs Compare all native libraries" + echo "-execs Compare all executables" + echo "-v Verbose output, does not hide known differences" + echo "-vv More verbose output, shows diff output of all comparisons" + echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory" + echo "" + echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs" + echo "Example:" + echo "bash ./common/bin/compareimages.sh CodePointIM.jar" + exit 10 +fi + +CMP_NAMES=false +CMP_PERMS=false +CMP_TYPES=false +CMP_GENERAL=false +CMP_ZIPS=false +CMP_JARS=false +CMP_LIBS=false +CMP_EXECS=false + +while [ -n "$1" ]; do + case "$1" in + -v) + VERBOSE=true + ;; + -vv) + VERBOSE=true + SHOW_DIFFS=true + ;; + -o) + OTHER="$2" + shift + ;; + -all) + CMP_NAMES=true + if [ "$OPENJDK_TARGET_OS" != "windows" ]; then + CMP_PERMS=true + fi + CMP_TYPES=true + CMP_GENERAL=true + CMP_ZIPS=true + CMP_JARS=true + CMP_LIBS=true + CMP_EXECS=true + ;; + -names) + CMP_NAMES=true + ;; + -perms) + CMP_PERMS=true + ;; + -types) + CMP_TYPES=true + ;; + -general) + CMP_GENERAL=true + ;; + -zips) + CMP_ZIPS=true + ;; + -jars) + CMP_JARS=true + ;; + -libs) + CMP_LIBS=true + ;; + -execs) + CMP_EXECS=true + ;; + *) + CMP_NAMES=false + CMP_PERMS=false + CMP_TYPES=false + CMP_ZIPS=true + CMP_JARS=true + CMP_LIBS=true + CMP_EXECS=true + + if [ -z "$FILTER" ]; then + FILTER="$GREP" + fi + FILTER="$FILTER -e $1" + ;; + esac + shift +done + +if [ "$CMP_NAMES" = "false" ] && [ "$CMP_TYPES" = "false" ] && [ "$CMP_PERMS" = "false" ] && [ "$CMP_GENERAL" = "false" ] && [ "$CMP_ZIPS" = "false" ] && [ "$CMP_JARS" = "false" ] && [ "$CMP_LIBS" = "false" ] && [ "$CMP_EXECS" = "false" ]; then + CMP_NAMES=true + CMP_PERMS=true + CMP_TYPES=true + CMP_GENERAL=true + CMP_ZIPS=true + CMP_JARS=true + CMP_LIBS=true + CMP_EXECS=true +fi + +if [ -z "$FILTER" ]; then + FILTER="$CAT" +fi + +if [ -z "$OTHER" ]; then + OTHER="$THIS/../$LEGACY_BUILD_DIR" + if [ -d "$OTHER" ]; then + OTHER="$( cd "$OTHER" && pwd )" + else + echo "Default old build directory does not exist:" + echo "$OTHER" + exit 1 + fi + echo "Comparing to default old build:" + echo "$OTHER" + echo +else + if [ ! -d "$OTHER" ]; then + echo "Other build directory does not exist:" + echo "$OTHER" + exit 1 + fi + OTHER="$( cd "$OTHER" && pwd )" + echo "Comparing to:" + echo "$OTHER" + echo +fi + + +# Figure out the layout of the this build. Which kinds of images have been produced +if [ -d "$THIS/deploy/j2sdk-image" ]; then + THIS_J2SDK="$THIS/deploy/j2sdk-image" + THIS_J2RE="$THIS/deploy/j2re-image" +elif [ -d "$THIS/images/j2sdk-image" ]; then + THIS_J2SDK="$THIS/images/j2sdk-image" + THIS_J2RE="$THIS/images/j2re-image" +fi +if [ -d "$THIS/images/j2sdk-overlay-image" ]; then + THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image" + THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image" +fi + +if [ -d "$THIS/images/j2sdk-bundle" ]; then + THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle" + THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle" +fi + +# Figure out the layout of the other build (old or new, normal or overlay image) +if [ -d "$OTHER/j2sdk-image" ]; then + if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then + OTHER_J2SDK="$OTHER/j2sdk-image" + OTHER_J2RE="$OTHER/j2re-image" + else + OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image" + OTHER_J2RE_OVERLAY="$OTHER/j2re-image" + fi + +fi + +if [ -d "$OTHER/j2sdk-bundle" ]; then + OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle" + OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle" +elif [ -d "$OTHER/images/j2sdk-bundle" ]; then + OTHER_J2SDK_BUNDLE="$OTHER/images/j2sdk-bundle" + OTHER_J2RE_BUNDLE="$OTHER/images/j2re-bundle" +fi + +if [ -z "$THIS_J2SDK" ] || [ -z "$THIS_J2RE" ]; then + if [ -z "$THIS_J2SDK_OVERLAY" ]; then + echo "Cannot locate images for this build. Are you sure you have run 'make images'?" + exit 1 + fi +fi + +if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then + echo "OTHER build only has an overlay image while this build does not. Nothing to compare!" + exit 1 +fi + +if [ -z "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then + echo "WARNING! OTHER build has bundles built while this build does not." + echo "Skipping bundle compare!" +fi + +########################################################################################## +# Do the work + +if [ "$CMP_NAMES" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + echo -n "J2SDK " + compare_dirs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + echo -n "J2RE " + compare_dirs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re + + echo -n "J2SDK " + compare_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + echo -n "J2RE " + compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re + fi + if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then + echo -n "J2SDK Overlay " + compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay + echo -n "J2RE Overlay " + compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay + + echo -n "J2SDK Overlay " + compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay + echo -n "J2RE Overlay " + compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay + fi + if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then + echo -n "J2SDK Bundle " + compare_dirs $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle + echo -n "J2RE Bundle " + compare_dirs $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle + + echo -n "J2SDK Bundle " + compare_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle + echo -n "J2RE Bundle " + compare_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle + fi +fi + +if [ "$CMP_PERMS" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + echo -n "J2SDK " + compare_permissions $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + echo -n "J2RE " + compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re + fi + if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then + echo -n "J2SDK Overlay " + compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay + echo -n "J2RE Overlay " + compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay + fi + if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then + echo -n "J2SDK Bundle " + compare_permissions $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle + echo -n "J2RE Bundle " + compare_permissions $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle + fi +fi + +if [ "$CMP_TYPES" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + echo -n "J2SDK " + compare_file_types $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + echo -n "J2RE " + compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re + fi + if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then + echo -n "J2SDK Overlay " + compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay + echo -n "J2RE Overlay " + compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay + fi + if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then + echo -n "J2SDK Bundle " + compare_file_types $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle + echo -n "J2RE Bundle " + compare_file_types $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle + fi +fi + +if [ "$CMP_GENERAL" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + echo -n "J2SDK " + compare_general_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + echo -n "J2RE " + compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re + fi + if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then + echo -n "J2SDK Overlay " + compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay + echo -n "J2RE Overlay " + compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay + fi + if [ -n "$THIS_J2SDK_BUNDLE" ] && [ -n "$OTHER_J2SDK_BUNDLE" ]; then + echo -n "J2SDK Bundle " + compare_general_files $THIS_J2SDK_BUNDLE $OTHER_J2SDK_BUNDLE $COMPARE_ROOT/j2sdk-bundle + echo -n "J2RE Bundle " + compare_general_files $THIS_J2RE_BUNDLE $OTHER_J2RE_BUNDLE $COMPARE_ROOT/j2re-bundle + fi +fi + +if [ "$CMP_ZIPS" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + compare_all_zip_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + fi +fi + +if [ "$CMP_JARS" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + compare_all_jar_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + fi +fi + +if [ "$CMP_LIBS" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + compare_all_libs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + fi + if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then + echo -n "Bundle " + compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay + fi +fi + +if [ "$CMP_EXECS" = "true" ]; then + if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then + compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk + fi + if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then + echo -n "Overlay " + compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay + fi +fi + +echo + +if [ -n "$REGRESSIONS" ]; then + echo "REGRESSIONS FOUND!" + echo + exit 1 +else + echo "No regressions found" + echo + exit 0 +fi diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/compare_exceptions.sh.incl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/bin/compare_exceptions.sh.incl Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,935 @@ +#!/bin/bash +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# This script is not to be run as stand-alone, it should be included from +# compare.sh. + +########################################################################################## +# Check that we are run via inclusion from compare.sh and not as stand-alone. +if [ -z "$COMPARE_EXCEPTIONS_INCLUDE" ]; then + echo "Error: This script should not be run as stand-alone. It is included by compare.sh" + exit 1 +fi + +########################################################################################## +# Diff exceptions + +if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86" ]; then + +STRIP_BEFORE_COMPARE=" +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +" + +ACCEPTED_BIN_DIFF=" +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +./jre/lib/i386/client/libjvm.so +./jre/lib/i386/libattach.so +./jre/lib/i386/libdt_socket.so +./jre/lib/i386/libhprof.so +./jre/lib/i386/libinstrument.so +./jre/lib/i386/libjava_crw_demo.so +./jre/lib/i386/libjsdt.so +./jre/lib/i386/libmanagement.so +./jre/lib/i386/libnpt.so +./jre/lib/i386/libverify.so +./jre/lib/i386/server/libjvm.so +./bin/appletviewer +./bin/extcheck +./bin/idlj +./bin/jar +./bin/jarsigner +./bin/java +./bin/javac +./bin/javadoc +./bin/javah +./bin/javap +./bin/jcmd +./bin/jconsole +./bin/jdb +./bin/jhat +./bin/jinfo +./bin/jmap +./bin/jps +./bin/jrunscript +./bin/jsadebugd +./bin/jstack +./bin/jstat +./bin/jstatd +./bin/keytool +./bin/native2ascii +./bin/orbd +./bin/pack200 +./bin/policytool +./bin/rmic +./bin/rmid +./bin/rmiregistry +./bin/schemagen +./bin/serialver +./bin/servertool +./bin/tnameserv +./bin/wsgen +./bin/wsimport +./bin/xjc +./jre/bin/java +./jre/bin/keytool +./jre/bin/orbd +./jre/bin/pack200 +./jre/bin/policytool +./jre/bin/rmid +./jre/bin/rmiregistry +./jre/bin/servertool +./jre/bin/tnameserv +" + +fi + +if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then + +STRIP_BEFORE_COMPARE=" +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +" + +ACCEPTED_BIN_DIFF=" +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +./jre/lib/amd64/libattach.so +./jre/lib/amd64/libdt_socket.so +./jre/lib/amd64/libhprof.so +./jre/lib/amd64/libinstrument.so +./jre/lib/amd64/libjava_crw_demo.so +./jre/lib/amd64/libjsdt.so +./jre/lib/amd64/libjsig.so +./jre/lib/amd64/libmanagement.so +./jre/lib/amd64/libnpt.so +./jre/lib/amd64/libsaproc.so +./jre/lib/amd64/libverify.so +./jre/lib/amd64/server/libjsig.so +./jre/lib/amd64/server/libjvm.so +./bin/appletviewer +./bin/extcheck +./bin/idlj +./bin/jar +./bin/jarsigner +./bin/java +./bin/javac +./bin/javadoc +./bin/javah +./bin/javap +./bin/jcmd +./bin/jconsole +./bin/jdb +./bin/jhat +./bin/jinfo +./bin/jmap +./bin/jps +./bin/jrunscript +./bin/jsadebugd +./bin/jstack +./bin/jstat +./bin/jstatd +./bin/keytool +./bin/native2ascii +./bin/orbd +./bin/pack200 +./bin/policytool +./bin/rmic +./bin/rmid +./bin/rmiregistry +./bin/schemagen +./bin/serialver +./bin/servertool +./bin/tnameserv +./bin/wsgen +./bin/wsimport +./bin/xjc +./jre/bin/java +./jre/bin/keytool +./jre/bin/orbd +./jre/bin/pack200 +./jre/bin/policytool +./jre/bin/rmid +./jre/bin/rmiregistry +./jre/bin/servertool +./jre/bin/tnameserv +" + +fi + +if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86" ]; then + +STRIP_BEFORE_COMPARE=" +./demo/jni/Poller/lib/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +./jre/lib/i386/jexec +" + +SORT_SYMBOLS=" +./jre/lib/i386/client/libjvm.so +./jre/lib/i386/libsaproc.so +./jre/lib/i386/server/libjvm.so +" + +SKIP_BIN_DIFF="true" + +ACCEPTED_SMALL_SIZE_DIFF=" +./demo/jni/Poller/lib/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +./jre/lib/i386/client/libjvm.so +./jre/lib/i386/jli/libjli.so +./jre/lib/i386/libJdbcOdbc.so +./jre/lib/i386/libattach.so +./jre/lib/i386/libawt.so +./jre/lib/i386/libawt_headless.so +./jre/lib/i386/libawt_xawt.so +./jre/lib/i386/libdcpr.so +./jre/lib/i386/libdt_socket.so +./jre/lib/i386/libfontmanager.so +./jre/lib/i386/libhprof.so +./jre/lib/i386/libinstrument.so +./jre/lib/i386/libj2gss.so +./jre/lib/i386/libj2pcsc.so +./jre/lib/i386/libj2pkcs11.so +./jre/lib/i386/libj2ucrypto.so +./jre/lib/i386/libjaas_unix.so +./jre/lib/i386/libjava.so +./jre/lib/i386/libjava_crw_demo.so +./jre/lib/i386/libjawt.so +./jre/lib/i386/libjdwp.so +./jre/lib/i386/libjfr.so +./jre/lib/i386/libjpeg.so +./jre/lib/i386/libjsdt.so +./jre/lib/i386/libjsound.so +./jre/lib/i386/libkcms.so +./jre/lib/i386/liblcms.so +./jre/lib/i386/libmanagement.so +./jre/lib/i386/libmlib_image.so +./jre/lib/i386/libnet.so +./jre/lib/i386/libnio.so +./jre/lib/i386/libnpt.so +./jre/lib/i386/libsctp.so +./jre/lib/i386/libsplashscreen.so +./jre/lib/i386/libsunec.so +./jre/lib/i386/libsunwjdga.so +./jre/lib/i386/libt2k.so +./jre/lib/i386/libunpack.so +./jre/lib/i386/libverify.so +./jre/lib/i386/libzip.so +./jre/lib/i386/server/libjvm.so +./bin/appletviewer +./bin/extcheck +./bin/idlj +./bin/jar +./bin/jarsigner +./bin/java +./bin/javac +./bin/javadoc +./bin/javah +./bin/javap +./bin/jcmd +./bin/jconsole +./bin/jdb +./bin/jhat +./bin/jinfo +./bin/jmap +./bin/jps +./bin/jrunscript +./bin/jsadebugd +./bin/jstack +./bin/jstat +./bin/jstatd +./bin/keytool +./bin/native2ascii +./bin/orbd +./bin/pack200 +./bin/policytool +./bin/rmic +./bin/rmid +./bin/rmiregistry +./bin/schemagen +./bin/serialver +./bin/servertool +./bin/tnameserv +./bin/unpack200 +./bin/wsgen +./bin/wsimport +./bin/xjc +./jre/bin/java +./jre/bin/keytool +./jre/bin/orbd +./jre/bin/pack200 +./jre/bin/policytool +./jre/bin/rmid +./jre/bin/rmiregistry +./jre/bin/servertool +./jre/bin/tnameserv +./jre/bin/unpack200 +./jre/lib/i386/jexec +" + +SKIP_FULLDUMP_DIFF="true" + +# Filter random C++ symbol strings. +DIS_DIFF_FILTER="$SED -e s/\.[a-zA-Z0-9_\$]\{15,15\}//g" + +fi + +if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then + +STRIP_BEFORE_COMPARE=" +./demo/jni/Poller/lib/amd64/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/amd64/libgctest.so +./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so +./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so +./demo/jvmti/hprof/lib/amd64/libhprof.so +./demo/jvmti/minst/lib/amd64/libminst.so +./demo/jvmti/mtrace/lib/amd64/libmtrace.so +./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so +./demo/jvmti/waiters/lib/amd64/libwaiters.so +" + +SORT_SYMBOLS=" +./jre/lib/amd64/server/libjvm.so +./jre/lib/amd64/libsaproc.so +" + +SKIP_BIN_DIFF="true" + +ACCEPTED_SMALL_SIZE_DIFF=" +./demo/jni/Poller/lib/amd64/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/amd64/libgctest.so +./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so +./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so +./demo/jvmti/hprof/lib/amd64/libhprof.so +./demo/jvmti/minst/lib/amd64/libminst.so +./demo/jvmti/mtrace/lib/amd64/libmtrace.so +./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so +./demo/jvmti/waiters/lib/amd64/libwaiters.so +./jre/lib/amd64/jli/libjli.so +./jre/lib/amd64/libJdbcOdbc.so +./jre/lib/amd64/libattach.so +./jre/lib/amd64/libawt.so +./jre/lib/amd64/libawt_headless.so +./jre/lib/amd64/libawt_xawt.so +./jre/lib/amd64/libdcpr.so +./jre/lib/amd64/libdt_socket.so +./jre/lib/amd64/libfontmanager.so +./jre/lib/amd64/libhprof.so +./jre/lib/amd64/libinstrument.so +./jre/lib/amd64/libj2gss.so +./jre/lib/amd64/libj2pcsc.so +./jre/lib/amd64/libj2pkcs11.so +./jre/lib/amd64/libj2ucrypto.so +./jre/lib/amd64/libjaas_unix.so +./jre/lib/amd64/libjava.so +./jre/lib/amd64/libjava_crw_demo.so +./jre/lib/amd64/libjawt.so +./jre/lib/amd64/libjdwp.so +./jre/lib/amd64/libjfr.so +./jre/lib/amd64/libjpeg.so +./jre/lib/amd64/libjsdt.so +./jre/lib/amd64/libjsound.so +./jre/lib/amd64/libkcms.so +./jre/lib/amd64/liblcms.so +./jre/lib/amd64/libmanagement.so +./jre/lib/amd64/libmlib_image.so +./jre/lib/amd64/libnet.so +./jre/lib/amd64/libnio.so +./jre/lib/amd64/libnpt.so +./jre/lib/amd64/libsctp.so +./jre/lib/amd64/libsplashscreen.so +./jre/lib/amd64/libsunec.so +./jre/lib/amd64/libsunwjdga.so +./jre/lib/amd64/libt2k.so +./jre/lib/amd64/libunpack.so +./jre/lib/amd64/libverify.so +./jre/lib/amd64/libzip.so +./jre/lib/amd64/server/64/libjvm_db.so +./jre/lib/amd64/server/64/libjvm_dtrace.so +./bin/amd64/appletviewer +./bin/amd64/extcheck +./bin/amd64/idlj +./bin/amd64/jar +./bin/amd64/jarsigner +./bin/amd64/java +./bin/amd64/javac +./bin/amd64/javadoc +./bin/amd64/javah +./bin/amd64/javap +./bin/amd64/jcmd +./bin/amd64/jconsole +./bin/amd64/jdb +./bin/amd64/jhat +./bin/amd64/jinfo +./bin/amd64/jmap +./bin/amd64/jps +./bin/amd64/jrunscript +./bin/amd64/jsadebugd +./bin/amd64/jstack +./bin/amd64/jstat +./bin/amd64/jstatd +./bin/amd64/keytool +./bin/amd64/native2ascii +./bin/amd64/orbd +./bin/amd64/pack200 +./bin/amd64/policytool +./bin/amd64/rmic +./bin/amd64/rmid +./bin/amd64/rmiregistry +./bin/amd64/schemagen +./bin/amd64/serialver +./bin/amd64/servertool +./bin/amd64/tnameserv +./bin/amd64/unpack200 +./bin/amd64/wsgen +./bin/amd64/wsimport +./bin/amd64/xjc +./jre/bin/amd64/java +./jre/bin/amd64/keytool +./jre/bin/amd64/orbd +./jre/bin/amd64/pack200 +./jre/bin/amd64/policytool +./jre/bin/amd64/rmid +./jre/bin/amd64/rmiregistry +./jre/bin/amd64/servertool +./jre/bin/amd64/tnameserv +./jre/bin/amd64/unpack200 +./jre/lib/amd64/jexec +" + +SKIP_FULLDUMP_DIFF="true" + +# Filter random C++ symbol strings. +DIS_DIFF_FILTER="$SED -e s/\.[a-zA-Z0-9_\$]\{15,15\}//g" + +fi + +if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "sparc" ]; then + +STRIP_BEFORE_COMPARE=" +./demo/jni/Poller/lib/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +./jre/lib/sparc/jexec +" + +SORT_SYMBOLS=" +./demo/jvmti/waiters/lib/libwaiters.so +./jre/lib/sparc/client/64/libjvm_db.so +./jre/lib/sparc/client/64/libjvm_dtrace.so +./jre/lib/sparc/client/libjsig.so +./jre/lib/sparc/client/libjvm.so +./jre/lib/sparc/client/libjvm_db.so +./jre/lib/sparc/client/libjvm_dtrace.so +./jre/lib/sparc/libjsig.so +./jre/lib/sparc/libsaproc.so +./jre/lib/sparc/server/64/libjvm_db.so +./jre/lib/sparc/server/64/libjvm_dtrace.so +./jre/lib/sparc/server/libjsig.so +./jre/lib/sparc/server/libjvm.so +./jre/lib/sparc/server/libjvm_db.so +./jre/lib/sparc/server/libjvm_dtrace.so +" + +SKIP_BIN_DIFF="true" + +ACCEPTED_SMALL_SIZE_DIFF=" +./demo/jni/Poller/lib/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/libgctest.so +./demo/jvmti/heapTracker/lib/libheapTracker.so +./demo/jvmti/heapViewer/lib/libheapViewer.so +./demo/jvmti/hprof/lib/libhprof.so +./demo/jvmti/minst/lib/libminst.so +./demo/jvmti/mtrace/lib/libmtrace.so +./demo/jvmti/versionCheck/lib/libversionCheck.so +./demo/jvmti/waiters/lib/libwaiters.so +./jre/lib/sparc/client/libjvm.so +./jre/lib/sparc/jli/libjli.so +./jre/lib/sparc/libJdbcOdbc.so +./jre/lib/sparc/libattach.so +./jre/lib/sparc/libawt.so +./jre/lib/sparc/libawt_headless.so +./jre/lib/sparc/libawt_xawt.so +./jre/lib/sparc/libdcpr.so +./jre/lib/sparc/libdt_socket.so +./jre/lib/sparc/libfontmanager.so +./jre/lib/sparc/libhprof.so +./jre/lib/sparc/libinstrument.so +./jre/lib/sparc/libj2gss.so +./jre/lib/sparc/libj2pcsc.so +./jre/lib/sparc/libj2pkcs11.so +./jre/lib/sparc/libj2ucrypto.so +./jre/lib/sparc/libjaas_unix.so +./jre/lib/sparc/libjava.so +./jre/lib/sparc/libjava_crw_demo.so +./jre/lib/sparc/libjawt.so +./jre/lib/sparc/libjdwp.so +./jre/lib/sparc/libjfr.so +./jre/lib/sparc/libjpeg.so +./jre/lib/sparc/libjsdt.so +./jre/lib/sparc/libjsound.so +./jre/lib/sparc/libkcms.so +./jre/lib/sparc/liblcms.so +./jre/lib/sparc/libmanagement.so +./jre/lib/sparc/libmlib_image.so +./jre/lib/sparc/libmlib_image_v.so +./jre/lib/sparc/libnet.so +./jre/lib/sparc/libnio.so +./jre/lib/sparc/libnpt.so +./jre/lib/sparc/libsctp.so +./jre/lib/sparc/libsplashscreen.so +./jre/lib/sparc/libsunec.so +./jre/lib/sparc/libsunwjdga.so +./jre/lib/sparc/libt2k.so +./jre/lib/sparc/libunpack.so +./jre/lib/sparc/libverify.so +./jre/lib/sparc/libzip.so +./jre/lib/sparc/server/libjvm.so +./bin/appletviewer +./bin/extcheck +./bin/idlj +./bin/jar +./bin/jarsigner +./bin/java +./bin/javac +./bin/javadoc +./bin/javah +./bin/javap +./bin/jcmd +./bin/jconsole +./bin/jdb +./bin/jhat +./bin/jinfo +./bin/jmap +./bin/jps +./bin/jrunscript +./bin/jsadebugd +./bin/jstack +./bin/jstat +./bin/jstatd +./bin/keytool +./bin/native2ascii +./bin/orbd +./bin/pack200 +./bin/policytool +./bin/rmic +./bin/rmid +./bin/rmiregistry +./bin/schemagen +./bin/serialver +./bin/servertool +./bin/tnameserv +./bin/unpack200 +./bin/wsgen +./bin/wsimport +./bin/xjc +./jre/bin/java +./jre/bin/keytool +./jre/bin/orbd +./jre/bin/pack200 +./jre/bin/policytool +./jre/bin/rmid +./jre/bin/rmiregistry +./jre/bin/servertool +./jre/bin/tnameserv +./jre/bin/unpack200 +./jre/lib/sparc/jexec +" + +# Filter random C++ symbol strings. +# Some numbers differ randomly. +DIS_DIFF_FILTER="$SED -e s/\$[a-zA-Z0-9_\$]\{15,15\}//g -e s/\([0-9a-f][0-9a-f].[0-9a-f][0-9a-f].[0-9a-f][0-9a-f].\)[0-9a-f][0-9a-f]/\1/g -e s/\(%g1,.0x\)[0-9a-f]*\(,.%g1\)/\1\2/g -e s/\(!.\)[0-9a-f]*\(.\2/g" + +# Some xor instructions end up with different args in the lib but not in the object files. +ACCEPTED_DIS_DIFF=" +./demo/jvmti/waiters/lib/libwaiters.so +" + +SKIP_FULLDUMP_DIFF="true" + +fi + +if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "sparcv9" ]; then + +STRIP_BEFORE_COMPARE=" +./demo/jni/Poller/lib/sparcv9/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/sparcv9/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/sparcv9/libgctest.so +./demo/jvmti/heapTracker/lib/sparcv9/libheapTracker.so +./demo/jvmti/heapViewer/lib/sparcv9/libheapViewer.so +./demo/jvmti/hprof/lib/sparcv9/libhprof.so +./demo/jvmti/minst/lib/sparcv9/libminst.so +./demo/jvmti/mtrace/lib/sparcv9/libmtrace.so +./demo/jvmti/versionCheck/lib/sparcv9/libversionCheck.so +./demo/jvmti/waiters/lib/sparcv9/libwaiters.so +" + +SORT_SYMBOLS=" +./demo/jvmti/waiters/lib/sparcv9/libwaiters.so +./jre/lib/sparcv9/libjsig.so +./jre/lib/sparcv9/libsaproc.so +./jre/lib/sparcv9/server/libjvm.so +./jre/lib/sparcv9/server/libjvm_dtrace.so +" + +SKIP_BIN_DIFF="true" + +ACCEPTED_SMALL_SIZE_DIFF=" +./demo/jni/Poller/lib/sparcv9/libPoller.so +./demo/jvmti/compiledMethodLoad/lib/sparcv9/libcompiledMethodLoad.so +./demo/jvmti/gctest/lib/sparcv9/libgctest.so +./demo/jvmti/heapTracker/lib/sparcv9/libheapTracker.so +./demo/jvmti/heapViewer/lib/sparcv9/libheapViewer.so +./demo/jvmti/hprof/lib/sparcv9/libhprof.so +./demo/jvmti/minst/lib/sparcv9/libminst.so +./demo/jvmti/mtrace/lib/sparcv9/libmtrace.so +./demo/jvmti/versionCheck/lib/sparcv9/libversionCheck.so +./demo/jvmti/waiters/lib/sparcv9/libwaiters.so +./jre/lib/sparcv9/client/libjvm.so +./jre/lib/sparcv9/jli/libjli.so +./jre/lib/sparcv9/libJdbcOdbc.so +./jre/lib/sparcv9/libattach.so +./jre/lib/sparcv9/libawt.so +./jre/lib/sparcv9/libawt_headless.so +./jre/lib/sparcv9/libawt_xawt.so +./jre/lib/sparcv9/libdcpr.so +./jre/lib/sparcv9/libdt_socket.so +./jre/lib/sparcv9/libfontmanager.so +./jre/lib/sparcv9/libhprof.so +./jre/lib/sparcv9/libinstrument.so +./jre/lib/sparcv9/libj2gss.so +./jre/lib/sparcv9/libj2pcsc.so +./jre/lib/sparcv9/libj2pkcs11.so +./jre/lib/sparcv9/libj2ucrypto.so +./jre/lib/sparcv9/libjaas_unix.so +./jre/lib/sparcv9/libjava.so +./jre/lib/sparcv9/libjava_crw_demo.so +./jre/lib/sparcv9/libjawt.so +./jre/lib/sparcv9/libjdwp.so +./jre/lib/sparcv9/libjfr.so +./jre/lib/sparcv9/libjpeg.so +./jre/lib/sparcv9/libjsdt.so +./jre/lib/sparcv9/libjsound.so +./jre/lib/sparcv9/libkcms.so +./jre/lib/sparcv9/liblcms.so +./jre/lib/sparcv9/libmanagement.so +./jre/lib/sparcv9/libmlib_image.so +./jre/lib/sparcv9/libmlib_image_v.so +./jre/lib/sparcv9/libnet.so +./jre/lib/sparcv9/libnio.so +./jre/lib/sparcv9/libnpt.so +./jre/lib/sparcv9/libsctp.so +./jre/lib/sparcv9/libsplashscreen.so +./jre/lib/sparcv9/libsunec.so +./jre/lib/sparcv9/libsunwjdga.so +./jre/lib/sparcv9/libt2k.so +./jre/lib/sparcv9/libunpack.so +./jre/lib/sparcv9/libverify.so +./jre/lib/sparcv9/libzip.so +./jre/lib/sparcv9/server/libjvm.so +./bin/sparcv9/appletviewer +./bin/sparcv9/extcheck +./bin/sparcv9/idlj +./bin/sparcv9/jar +./bin/sparcv9/jarsigner +./bin/sparcv9/java +./bin/sparcv9/javac +./bin/sparcv9/javadoc +./bin/sparcv9/javah +./bin/sparcv9/javap +./bin/sparcv9/jcmd +./bin/sparcv9/jconsole +./bin/sparcv9/jdb +./bin/sparcv9/jhat +./bin/sparcv9/jinfo +./bin/sparcv9/jmap +./bin/sparcv9/jps +./bin/sparcv9/jrunscript +./bin/sparcv9/jsadebugd +./bin/sparcv9/jstack +./bin/sparcv9/jstat +./bin/sparcv9/jstatd +./bin/sparcv9/keytool +./bin/sparcv9/native2ascii +./bin/sparcv9/orbd +./bin/sparcv9/pack200 +./bin/sparcv9/policytool +./bin/sparcv9/rmic +./bin/sparcv9/rmid +./bin/sparcv9/rmiregistry +./bin/sparcv9/schemagen +./bin/sparcv9/serialver +./bin/sparcv9/servertool +./bin/sparcv9/tnameserv +./bin/sparcv9/unpack200 +./bin/sparcv9/wsgen +./bin/sparcv9/wsimport +./bin/sparcv9/xjc +./jre/bin/sparcv9/java +./jre/bin/sparcv9/keytool +./jre/bin/sparcv9/orbd +./jre/bin/sparcv9/pack200 +./jre/bin/sparcv9/policytool +./jre/bin/sparcv9/rmid +./jre/bin/sparcv9/rmiregistry +./jre/bin/sparcv9/servertool +./jre/bin/sparcv9/tnameserv +./jre/bin/sparcv9/unpack200 +" + +# Filter random C++ symbol strings. +# Some numbers differ randomly. +DIS_DIFF_FILTER="$SED -e s/\$[a-zA-Z0-9_\$]\{15,15\}//g -e s/[0-9a-f][0-9a-f].[0-9a-f][0-9a-f].[0-9a-f][0-9a-f].[0-9a-f][0-9a-f]//g -e s/\(%g1,.0x\)[0-9a-f]*\(,.%g1\)/\1\2/g -e s/\(!.\)[0-9a-f]*\(.\2/g" + +# Some xor instructions end up with different args in the lib but not in the object files. +ACCEPTED_DIS_DIFF=" +./demo/jvmti/waiters/lib/sparcv9/libwaiters.so +" + +SKIP_FULLDUMP_DIFF="true" + +fi + + +if [ "$OPENJDK_TARGET_OS" = "windows" ]; then + +# Probably should add all libs here +ACCEPTED_SMALL_SIZE_DIFF=" +./demo/jvmti/gctest/lib/gctest.dll +./demo/jvmti/heapTracker/lib/heapTracker.dll +./demo/jvmti/minst/lib/minst.dll +./jre/bin/attach.dll +./jre/bin/java_crw_demo.dll +./jre/bin/jsoundds.dll +./bin/appletviewer.exe +./bin/extcheck.exe +./bin/idlj.exe +./bin/jar.exe +./bin/jarsigner.exe +./bin/java-rmi.exe +./bin/java.exe +./bin/javac.exe +./bin/javadoc.exe +./bin/javah.exe +./bin/javap.exe +./bin/javaw.exe +./bin/jcmd.exe +./bin/jconsole.exe +./bin/jdb.exe +./bin/jhat.exe +./bin/jinfo.exe +./bin/jmap.exe +./bin/jps.exe +./bin/jrunscript.exe +./bin/jsadebugd.exe +./bin/jstack.exe +./bin/jstat.exe +./bin/jstatd.exe +./bin/keytool.exe +./bin/kinit.exe +./bin/klist.exe +./bin/ktab.exe +./bin/native2ascii.exe +./bin/orbd.exe +./bin/pack200.exe +./bin/policytool.exe +./bin/rmic.exe +./bin/rmid.exe +./bin/rmiregistry.exe +./bin/schemagen.exe +./bin/serialver.exe +./bin/servertool.exe +./bin/tnameserv.exe +./bin/unpack200.exe +./bin/wsgen.exe +./bin/wsimport.exe +./bin/xjc.exe +./jre/bin/java-rmi.exe +./jre/bin/java.exe +./jre/bin/javaw.exe +./jre/bin/keytool.exe +./jre/bin/kinit.exe +./jre/bin/klist.exe +./jre/bin/ktab.exe +./jre/bin/orbd.exe +./jre/bin/pack200.exe +./jre/bin/policytool.exe +./jre/bin/rmid.exe +./jre/bin/rmiregistry.exe +./jre/bin/servertool.exe +./jre/bin/tnameserv.exe +./jre/bin/unpack200.exe +" + +# On windows, there are unavoidable allignment issues making +# a perfect disasm diff impossible. Filter out the following: +# * Random parts of C++ symbols (this is a bit greedy, but does the trick) +# @XXXXX +# * Hexadecimal addresses that are sometimes alligned differently. +# * Dates in version strings XXXX_XX_XX. +DIS_DIFF_FILTER="$SED -e s/[@?][A-Z0-9_]\{1,25\}//g -e s/^.\{2,2\}[0-9A-F]\{16,16\}.\{2,2\}//g -e s/[0-9A-F]\{4,16\}h//g -e s/_[0-9]\{4,4\}_[0-9][0-9]_[0-9][0-9]//g" + +SKIP_BIN_DIFF="true" +SKIP_FULLDUMP_DIFF="true" + +fi + + +if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then +ACCEPTED_JARZIP_CONTENTS=" +/META-INF/INDEX.LIST +" + +KNOWN_BIN_DIFF=" +./jre/lib/libJObjC.dylib +" + +ACCEPTED_BIN_DIFF=" +./bin/appletviewer +./bin/extcheck +./bin/idlj +./bin/jar +./bin/jarsigner +./bin/java +./bin/javac +./bin/javadoc +./bin/javah +./bin/javap +./bin/jcmd +./bin/jconsole +./bin/jdb +./bin/jhat +./bin/jinfo +./bin/jmap +./bin/jps +./bin/jrunscript +./bin/jsadebugd +./bin/jstack +./bin/jstat +./bin/jstatd +./bin/keytool +./bin/native2ascii +./bin/orbd +./bin/pack200 +./bin/policytool +./bin/rmic +./bin/rmid +./bin/rmiregistry +./bin/schemagen +./bin/serialver +./bin/servertool +./bin/tnameserv +./bin/wsgen +./bin/wsimport +./bin/xjc +./jre/bin/java +./jre/bin/keytool +./jre/bin/orbd +./jre/bin/pack200 +./jre/bin/policytool +./jre/bin/rmid +./jre/bin/rmiregistry +./jre/bin/servertool +./jre/bin/tnameserv +./jre/lib/libsaproc.dylib +./jre/lib/server/libjvm.dylib +" + +KNOWN_SIZE_DIFF=" +./jre/lib/libJObjC.dylib +" + +SORT_SYMBOLS=" +./jre/lib/libJObjC.dylib +" + +KNOWN_SYM_DIFF=" +./jre/lib/libJObjC.dylib +" + +KNOWN_ELF_DIFF=" +./jre/lib/libJObjC.dylib +" + +KNOWN_DIS_DIFF=" +./jre/lib/libJObjC.dylib +" + +fi diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/compareimage.sh --- a/common/bin/compareimage.sh Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,335 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# MANUAL -# -# ./common/bin/compareimages.sh old_jdk_image new_jdk_image -# -# Compare the directory structure. -# Compare the filenames in the directories. -# Compare the contents of the zip archives -# Compare the contents of the jar archives -# Compare the native libraries -# Compare the native executables -# Compare the remaining files -# -# ./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other] -# -# Compare only the selected subset of the images. -# -# ./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar -# -# Compare only the CodePointIM.jar file -# Can be used to compare zips, libraries and executables. -# - -if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ] || [ "x$1" == "x" ]; then - echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image" - echo "" - echo "Compare the directory structure." - echo "Compare the filenames in the directories." - echo "Compare the contents of the zip archives" - echo "Compare the contents of the jar archives" - echo "Compare the native libraries" - echo "Compare the native executables" - echo "Compare the remaining files" - echo "" - echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other]" - echo "" - echo "Compare only the selected subset of the images." - echo "" - echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar" - echo "" - echo "Compare only the CodePointIM.jar file" - echo "Can be used to compare zips, libraries and executables." - exit 10 -fi - -OLD="$1" -NEW="$2" -CMD="$3" - -DIFF_RESULT=0 - -CMP_ZIPS=false -CMP_JARS=false -CMP_LIBS=false -CMP_EXECS=false -CMP_OTHER=false - -FILTER="cat" - -if [ -n "$CMD" ]; then - case "$CMD" in - zips) - CMP_ZIPS=true - ;; - jars) - CMP_JARS=true - ;; - libs) - CMP_LIBS=true - ;; - execs) - CMP_EXECS=true - ;; - other) - CMP_OTHER=true - ;; - *) - CMP_ZIPS=true - CMP_JARS=true - CMP_LIBS=true - CMP_EXECS=true - CMP_OTHER=true - FILTER="grep $3" - ;; - esac -else - CMP_ZIPS=true - CMP_JARS=true - CMP_LIBS=true - CMP_EXECS=true - CMP_OTHER=true -fi - -DIFFJARZIP="/bin/bash `dirname $0`/diffjarzip.sh" -DIFFLIB="/bin/bash `dirname $0`/difflib.sh" -DIFFEXEC="/bin/bash `dirname $0`/diffexec.sh" -export COMPARE_ROOT=/tmp/cimages.$USER -mkdir -p $COMPARE_ROOT - -# Load the correct exception list. -case "`uname -s`" in - Linux) - . `dirname $0`/exception_list_linux - ;; -esac - -echo -echo Comparing $OLD to $NEW -echo - -(cd $OLD && find . -type d | sort > $COMPARE_ROOT/from_dirs) -(cd $NEW && find . -type d | sort > $COMPARE_ROOT/to_dirs) - -echo -n Directory structure... -if diff $COMPARE_ROOT/from_dirs $COMPARE_ROOT/to_dirs > /dev/null; then - echo Identical! -else - echo Differences found. - DIFF_RESULT=1 - # Differences in directories found. - ONLY_OLD=$(diff $COMPARE_ROOT/from_dirs $COMPARE_ROOT/to_dirs | grep '<') - if [ "$ONLY_OLD" ]; then - echo Only in $OLD - echo $ONLY_OLD | sed 's|< ./|\t|g' | sed 's/ /\n/g' - fi - # Differences in directories found. - ONLY_NEW=$(diff $COMPARE_ROOT/from_dirs $COMPARE_ROOT/to_dirs | grep '>') - if [ "$ONLY_NEW" ]; then - echo Only in $NEW - echo $ONLY_NEW | sed 's|> ./|\t|g' | sed 's/ /\n/g' - fi -fi - -(cd $OLD && find . -type f | sort > $COMPARE_ROOT/from_files) -(cd $NEW && find . -type f | sort > $COMPARE_ROOT/to_files) - -echo -n File names... -if diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files > /dev/null; then - echo Identical! -else - echo Differences found. - DIFF_RESULT=1 - # Differences in directories found. - ONLY_OLD=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '<') - if [ "$ONLY_OLD" ]; then - echo Only in $OLD - echo "$ONLY_OLD" | sed 's|< ./| |g' - fi - # Differences in directories found. - ONLY_NEW=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '>') - if [ "$ONLY_NEW" ]; then - echo Only in $NEW - echo "$ONLY_NEW" | sed 's|> ./| |g' - fi -fi - -echo -n Permissions... -found="" -for f in `cd $OLD && find . -type f` -do - if [ ! -f ${OLD}/$f ]; then continue; fi - if [ ! -f ${NEW}/$f ]; then continue; fi - OP=`ls -l ${OLD}/$f | awk '{printf("%.10s\n", $1);}'` - NP=`ls -l ${NEW}/$f | awk '{printf("%.10s\n", $1);}'` - if [ "$OP" != "$NP" ] - then - if [ -z "$found" ]; then echo ; found="yes"; fi - printf "\told: ${OP} new: ${NP}\t$f\n" - fi - - OF=`cd ${OLD} && file $f` - NF=`cd ${NEW} && file $f` - if [ "$f" = "./src.zip" ] - then - if [ "`echo $OF | grep -ic zip`" -gt 0 -a "`echo $NF | grep -ic zip`" -gt 0 ] - then - # the way we produces zip-files make it so that directories are stored in old file - # but not in new (only files with full-path) - # this makes file-5.09 report them as different - continue; - fi - fi - - if [ "$OF" != "$NF" ] - then - if [ -z "$found" ]; then echo ; found="yes"; fi - printf "\tFILE: old: ${OF} new: ${NF}\t$f\n" - fi -done -if [ -z "$found" ]; then echo ; found="yes"; fi - -GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \ - ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \ - ! -name "ct.sym" ! -name "*.diz" \ - | grep -v "./bin/" | sort | $FILTER) -echo General files... -for f in $GENERAL_FILES -do - if [ -e $NEW/$f ]; then - DIFF_OUT=$(diff $OLD/$f $NEW/$f 2>&1) - if [ -n "$DIFF_OUT" ]; then - echo $f - echo "$DIFF_OUT" - fi - fi -done - - -if [ "x$CMP_ZIPS" == "xtrue" ]; then - ZIPS=$(cd $OLD && find . -type f -name "*.zip" | sort | $FILTER) - - if [ -n "$ZIPS" ]; then - echo Zip files... - - for f in $ZIPS - do - $DIFFJARZIP $OLD/$f $NEW/$f $OLD $NEW - if [ "$?" != "0" ]; then - DIFF_RESULT=1 - fi - done - fi -fi - -if [ "x$CMP_JARS" == "xtrue" ]; then - JARS=$(cd $OLD && find . -type f -name "*.jar" -o -name "ct.sym" | sort | $FILTER) - - if [ -n "$JARS" ]; then - echo Jar files... - - for f in $JARS - do - DIFFJAR_OUTPUT=`$DIFFJARZIP $OLD/$f $NEW/$f $OLD $NEW` - DIFFJAR_RESULT=$? - if [ "$DIFFJAR_RESULT" != "0" ]; then - for diff in $LIST_DIFF_JAR; do - DIFFJAR_OUTPUT=`echo "$DIFFJAR_OUTPUT" | grep -v "$diff"` - done - if [ "`echo "$DIFFJAR_OUTPUT" | grep -v "Differing files in"`" != "" ]; then - DIFF_RESULT=1 - echo "$DIFFJAR_OUTPUT" - fi - fi - done - fi -fi - -if [ "x$FILTER" != "xcat" ]; then - VIEW=view -else - VIEW= -fi - -if [ "x$CMP_LIBS" == "xtrue" ]; then - LIBS=$(cd $OLD && find . -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' | sort | $FILTER) - - if [ -n "$LIBS" ]; then - echo Libraries... - for f in $LIBS - do - DIFFLIB_OUTPUT=`$DIFFLIB $OLD/$f $NEW/$f $OLD $NEW $VIEW` - DIFFLIB_RESULT=$? - if [ "$DIFFLIB_RESULT" = "0" ]; then - : - #echo "OK: $DIFFLIB_OUTPUT" - elif [ "$DIFFLIB_RESULT" = "2" ] && [[ "$LIST_DIFF_SIZE $LIST_DIFF_BYTE" == *"${f:2}"* ]]; then - : - #echo "OK: $DIFFLIB_OUTPUT" - elif [ "$DIFFLIB_RESULT" = "1" ] && [[ "$LIST_DIFF_BYTE" == *"${f:2}"* ]]; then - : - #echo "OK: $DIFFLIB_OUTPUT" - else - echo "$DIFFLIB_OUTPUT" - DIFF_RESULT=1 - fi - done - fi -fi - -if [ "x$CMP_EXECS" == "xtrue" ]; then - if [ $OSTYPE == "cygwin" ]; then - EXECS=$(cd $OLD && find . -type f -name '*.exe' | sort | $FILTER) - else - EXECS=$(cd $OLD && find . -type f -perm -100 \! \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' \) | sort | $FILTER) - fi - - - if [ -n "$EXECS" ]; then - echo Executables... - - for f in $EXECS - do - DIFFEXEC_OUTPUT=`$DIFFEXEC $OLD/$f $NEW/$f $OLD $NEW $VIEW` - DIFFEXEC_RESULT=$? - if [ "$DIFFEXEC_RESULT" = "0" ]; then - : - #echo "OK: $DIFFEXEC_OUTPUT" - elif [ "$DIFFEXEC_RESULT" = "2" ] && [[ "$LIST_DIFF_SIZE $LIST_DIFF_BYTE" == *"${f:2}"* ]]; then - : - #echo "OK: $DIFFEXEC_OUTPUT" - elif [ "$DIFFEXEC_RESULT" = "1" ] && [[ "$LIST_DIFF_BYTE" == *"${f:2}"* ]]; then - : - #echo "OK: $DIFFEXEC_OUTPUT" - else - echo "$DIFFEXEC_OUTPUT" - DIFF_RESULT=1 - fi - done - fi -fi - -exit $DIFF_RESULT diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/diffexec.sh --- a/common/bin/diffexec.sh Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -if [ $# -lt 2 ] -then - echo "Diff two executables. Return codes:" - echo "0 - no diff" - echo "1 - Identical symbols AND size, BUT not bytewise identical" - echo "2 - Identical symbols BUT NEW size" - echo "3 - Differences, content BUT SAME size" - echo "4 - Differences, content AND size" - echo "10 - Could not perform diff" - echo "Use 'quiet' to disable any output." - echo "Syntax: $0 file1 file2 [quiet]" - exit 10 -fi - -if [ ! -f $1 ] -then - echo $1 does not exist - exit 10 -fi - -if [ ! -f $2 ] -then - echo $2 does not exist - exit 10 -fi - -if [ "`uname`" == "SunOS" ]; then - if [ -f "`which nm`" ]; then - NM=nm - elif [ -f "`which gnm`" ]; then - NM=gnm - else - echo "No nm command found" - exit 10 - fi - LDD=ldd -elif [ $OSTYPE == "cygwin" ]; then - NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe" - NM_ARGS=/exports - LDD= -elif [ "`uname`" == "Darwin" ]; then - NM=nm - LDD="otool -L" -else - NM=nm - LDD=ldd -fi - -# Should the differences be viewed? -VIEW= -# You can do export DIFF=meld to view -# any differences using meld instead. -if [ -n "$DIFF" ]; then - DIFF="$DIFF" -else - DIFF=diff -fi -OLD=$(cd $(dirname $1) && pwd)/$(basename $1) -NEW=$(cd $(dirname $2) && pwd)/$(basename $2) - -OLD_SIZE=$(ls -l "$OLD" | awk '{ print $5 }') -NEW_SIZE=$(ls -l "$NEW" | awk '{ print $5 }') - -if [ $# -gt 3 ] -then - ROOT1=$(cd $3 && pwd) - ROOT2=$(cd $4 && pwd) - OLD_NAME=$(echo $OLD | sed "s|$ROOT1/||") - NEW_NAME=$(echo $NEW | sed "s|$ROOT2/||") - if [ "x$5" == "xview" ]; then VIEW=view; fi -else - ROOT1=$(dirname $OLD)/ - ROOT2=$(dirname $NEW)/ - OLD_NAME=$OLD - NEW_NAME=$NEW - if [ "x$3" == "xview" ]; then VIEW=view; fi -fi - -if cmp $OLD $NEW > /dev/null -then - # The files were bytewise identical. - echo Identical: $OLD_NAME - exit 0 -fi - -OLD_SYMBOLS=$COMPARE_ROOT/$OLD_NAME.old -NEW_SYMBOLS=$COMPARE_ROOT/$NEW_NAME.new - -mkdir -p $(dirname $OLD_SYMBOLS) -mkdir -p $(dirname $NEW_SYMBOLS) - -if [ $OSTYPE == "cygwin" ]; then - "$NM" $NM_ARGS $OLD | grep " = " > $OLD_SYMBOLS - "$NM" $NM_ARGS $NEW | grep " = " > $NEW_SYMBOLS - "$NM" $NM_ARGS $OLD > $OLD_SYMBOLS.full - "$NM" $NM_ARGS $NEW > $NEW_SYMBOLS.full -else - # Strip the addresses, just compare the ordering of the symbols. - $NM $OLD | cut -f 2- -d ' ' > $OLD_SYMBOLS - $NM $NEW | cut -f 2- -d ' ' > $NEW_SYMBOLS - # But store the full information for easy diff access. - $NM $OLD > $OLD_SYMBOLS.full - $NM $NEW > $NEW_SYMBOLS.full -fi - -DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS) - -if [ "${LDD}" ] -then - NAME=`basename $OLD` - TMP=$COMPARE_ROOT/ldd/ldd.${NAME} - rm -rf "${TMP}" - mkdir -p "${TMP}" - - (cd "${TMP}" && cp $OLD . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.old | uniq > dep.uniq.old) - (cd "${TMP}" && cp $NEW . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.new | uniq > dep.uniq.new) - (cd "${TMP}" && rm -f ${NAME}) - - DIFFS_DEP=$(LANG=C diff "${TMP}/dep.old" "${TMP}/dep.new") - DIFFS_UNIQ_DEP=$(LANG=C diff "${TMP}/dep.uniq.old" "${TMP}/dep.uniq.new") - - DEP_MSG= - if [ -z "${DIFFS_UNIQ_DEP}" -a -z "${DIFFS_DEP}" ]; then - DEP_MSG="Identical dependencies" - elif [ -z "${DIFFS_UNIQ_DEP}" ]; then - DEP_MSG="Redundant duplicate dependencies added" - RES=1 - else - DEP_MSG="DIFFERENT dependencies" - RES=1 - fi -fi - -RESULT=0 - -if [ -n "$DIFFS" ]; then - if [ $OLD_SIZE -ne $NEW_SIZE ] - then - echo Differences, content AND size : $DEP_MSG : $OLD_NAME - RESULT=4 - else - echo Differences, content BUT SAME size: $DEP_MSG : $OLD_NAME - RESULT=3 - fi - if [ "x$VIEW" == "xview" ]; then - LANG=C $DIFF $OLD_SYMBOLS $NEW_SYMBOLS - fi -else - if [ $OLD_SIZE -ne $NEW_SIZE ] - then - echo Identical symbols BUT NEW size : $DEP_MSG : $OLD_NAME - RESULT=2 - else - echo Identical symbols AND size, BUT not bytewise identical: $DEP_MSG : $OLD_NAME - RESULT=1 - fi -fi - -exit $RESULT - - - diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/diffjarzip.sh --- a/common/bin/diffjarzip.sh Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# Simple tool to diff two jar or zip files. It unpacks the jar/zip files and -# reports if files differs and if files are new or missing. -# Assumes gnu diff. - -# There are a few source files that have DOS line endings in the -# jaxp/jaxws source drops, when the sources were added to the repository -# the source files were converted to UNIX line endings. -# For now we ignore these differences. -DIFF_FLAGS="--strip-trailing-cr" -#set -x - -if [ $# -lt 2 ] -then - echo "Diff two jar/zip files. Return codes: 0 - no diff, 1 - diff, 2 - couldn't perform diff" - echo "Syntax: $0 old_archive new_archive [old_root new_root]" - exit 2 -fi - -if [ ! -f $1 ] -then - echo $1 does not exist - exit 2 -fi - -if [ ! -f $2 ] -then - echo $2 does not exist - exit 2 -fi - -IGNORES="cat" -OLD=$(cd $(dirname $1) && pwd)/$(basename $1) -NEW=$(cd $(dirname $2) && pwd)/$(basename $2) - -if [ $# -gt 3 ] -then - ROOT1=$(cd $3 && pwd) - ROOT2=$(cd $4 && pwd) - OLD_NAME=$(echo $OLD | sed "s|$ROOT1/||") - NEW_NAME=$(echo $NEW | sed "s|$ROOT2/||") - if [ $# == 5 ]; then IGNORES="$5"; fi -else - ROOT1=$(dirname $OLD)/ - ROOT2=$(dirname $NEW)/ - OLD_NAME=$OLD - NEW_NAME=$NEW - if [ $# == 3 ]; then IGNORES="$3"; fi -fi - -if [ "`uname`" == "SunOS" ]; then - if [ -f "`which gdiff`" ]; then - DIFF=gdiff - else - DIFF=diff - fi -else - DIFF=diff -fi - -OLD_SUFFIX="${OLD##*.}" -NEW_SUFFIX="${NEW##*.}" -if [ "$OLD_SUFFIX" != "$NEW_SUFFIX" ]; then - echo The files do not have the same suffix type! - exit 2 -fi - -if [ "$OLD_SUFFIX" != "zip" ] && [ "$OLD_SUFFIX" != "jar" ] && [ "$OLD_SUFFIX" != "sym" ]; then - echo The files have to be zip, jar or sym! They are $OLD_SUFFIX - exit 2 -fi - -UNARCHIVE="unzip -q" - -TYPE="$OLD_SUFFIX" - -if cmp $OLD $NEW > /dev/null -then - # The files were bytewise identical. - exit 0 -fi - -# Not quite identical, the might still contain the same data. -# Unpack the jar/zip files in temp dirs -if test "x$COMPARE_ROOT" == "x"; then - COMPARE_ROOT=/tmp/compare_root.$$ - REMOVE_COMPARE_ROOT=true -fi -OLD_TEMPDIR=$COMPARE_ROOT/$OLD_NAME.old -NEW_TEMPDIR=$COMPARE_ROOT/$NEW_NAME.new -mkdir -p $OLD_TEMPDIR -mkdir -p $NEW_TEMPDIR -(cd $OLD_TEMPDIR && rm -rf * ; $UNARCHIVE $OLD) -(cd $NEW_TEMPDIR && rm -rf * ; $UNARCHIVE $NEW) - -ONLY1=$(LANG=C $DIFF -rq $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $OLD_TEMPDIR") - -if [ -n "$ONLY1" ]; then - echo " Only the OLD $OLD_NAME contains:" - LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $OLD_TEMPDIR" \ - | sed "s|Only in $OLD_TEMPDIR| |"g | sed 's|: |/|g' -fi - -ONLY2=$(LANG=C $DIFF -rq $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $NEW_TEMPDIR") - -if [ -n "$ONLY2" ]; then - echo " Only the NEW $NEW_NAME contains:" - LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep "^Only in $NEW_TEMPDIR" \ - | sed "s|Only in $NEW_TEMPDIR| |"g | sed 's|: |/|g' -fi - -DIFFTEXT="/bin/bash `dirname $0`/difftext.sh" - -LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep differ | cut -f 2,4 -d ' ' | \ - awk "{ print \"$DIFFTEXT \"\$1\" \"\$2 }" > $COMPARE_ROOT/diffing - -/bin/bash $COMPARE_ROOT/diffing > $COMPARE_ROOT/diffs - -if [ -s "$COMPARE_ROOT/diffs" ]; then - echo " Differing files in $OLD_NAME" - cat $COMPARE_ROOT/diffs | grep differ | $IGNORES | cut -f 2 -d ' ' | \ - sed "s|$OLD_TEMPDIR| |g" -fi - -# Clean up - -if [ "x$REMOVE_COMPARE_ROOT" == xtrue ]; then - rm -rf $REMOVE_COMPARE_ROOT -fi - -exit 1 - diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/difflib.sh --- a/common/bin/difflib.sh Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# Simple tool to diff two shared libraries. -# Criterias: two shared libraries are considered equal if: -# the file sizes are the same AND the symbols outputs from the nm command are equal - -if [ $# -lt 2 ] -then - echo "Diff two shared libs. Return codes:" - echo "0 - no diff" - echo "1 - Identical symbols AND size, BUT not bytewise identical" - echo "2 - Identical symbols BUT NEW size" - echo "3 - Differences, content BUT SAME size" - echo "4 - Differences, content AND size" - echo "10 - Could not perform diff" - echo "Use 'quiet' to disable any output." - echo "Syntax: $0 file1 file2 [quiet]" - exit 10 -fi - -if [ ! -f $1 ] -then - echo $1 does not exist - exit 10 -fi - -if [ ! -f $2 ] -then - echo $2 does not exist - exit 10 -fi - -if [ "`uname`" == "SunOS" ]; then - if [ -f "`which gnm`" ]; then - NM=gnm -# Jonas 2012-05-29: solaris native nm produces radically different output than gnm -# so if using that...we need different filter than "cut -f 2-" -# - elif [ -f "`which nm`" ]; then - NM=nm - else - echo "No nm command found" - exit 10 - fi - LDD=ldd -elif [ $OSTYPE == "cygwin" ]; then - NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe" - NM_ARGS=/exports - LDD= -elif [ "`uname`" == "Darwin" ]; then - NM=nm - LDD="otool -L" -else - NM=nm - LDD=ldd -fi - -# Should the differences be viewed? -VIEW= -# You can do export DIFF=meld to view -# any differences using meld instead. -if [ -n "$DIFF" ]; then - DIFF="$DIFF" -else - DIFF=diff -fi -OLD=$(cd $(dirname $1) && pwd)/$(basename $1) -NEW=$(cd $(dirname $2) && pwd)/$(basename $2) - -OLD_SIZE=$(ls -l "$OLD" | awk '{ print $5 }') -NEW_SIZE=$(ls -l "$NEW" | awk '{ print $5 }') - -if [ $# -gt 3 ] -then - ROOT1=$(cd $3 && pwd) - ROOT2=$(cd $4 && pwd) - OLD_NAME=$(echo $OLD | sed "s|$ROOT1/||") - NEW_NAME=$(echo $NEW | sed "s|$ROOT2/||") - if [ "x$5" == "xview" ]; then VIEW=view; fi -else - ROOT1=$(dirname $OLD)/ - ROOT2=$(dirname $NEW)/ - OLD_NAME=$OLD - NEW_NAME=$NEW - if [ "x$3" == "xview" ]; then VIEW=view; fi -fi - -OLD_SUFFIX="${OLD##*.}" -NEW_SUFFIX="${NEW##*.}" -if [ "$OLD_SUFFIX" != "$NEW_SUFFIX" ]; then - echo The files do not have the same suffix type! - exit 10 -fi - -if [ "$OLD_SUFFIX" != "so" ] && [ "$OLD_SUFFIX" != "dylib" ] && [ "$OLD_SUFFIX" != "dll" ]; then - echo The files have to be .so, .dylib or .dll! They are $OLD_SUFFIX - exit 10 -fi - -TYPE="$OLD_SUFFIX" - -if cmp $OLD $NEW > /dev/null -then - # The files were bytewise identical. - echo Identical: $OLD_NAME - exit 0 -fi - -OLD_SYMBOLS=$COMPARE_ROOT/nm.$OLD_NAME.old -NEW_SYMBOLS=$COMPARE_ROOT/nm.$NEW_NAME.new - -mkdir -p $(dirname $OLD_SYMBOLS) -mkdir -p $(dirname $NEW_SYMBOLS) - -if [ $OSTYPE == "cygwin" ]; then - "$NM" $NM_ARGS $OLD | grep " = " > $OLD_SYMBOLS - "$NM" $NM_ARGS $NEW | grep " = " > $NEW_SYMBOLS - "$NM" $NM_ARGS $OLD > $OLD_SYMBOLS.full - "$NM" $NM_ARGS $NEW > $NEW_SYMBOLS.full -else - # Strip the addresses, just compare the ordering of the symbols. - $NM $OLD | cut -f 2- -d ' ' > $OLD_SYMBOLS - $NM $NEW | cut -f 2- -d ' ' > $NEW_SYMBOLS - # But store the full information for easy diff access. - $NM $OLD > $OLD_SYMBOLS.full - $NM $NEW > $NEW_SYMBOLS.full -fi - -DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS) - -RESULT=0 - -if [ "${LDD}" ] -then - NAME=`basename $OLD` - TMP=$COMPARE_ROOT/ldd/ldd.${NAME} - rm -rf "${TMP}" - mkdir -p "${TMP}" - - (cd "${TMP}" && cp $OLD . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.old | uniq > dep.uniq.old) - (cd "${TMP}" && cp $NEW . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.new | uniq > dep.uniq.new) - (cd "${TMP}" && rm -f ${NAME}) - - DIFFS_DEP=$(LANG=C diff "${TMP}/dep.old" "${TMP}/dep.new") - DIFFS_UNIQ_DEP=$(LANG=C diff "${TMP}/dep.uniq.old" "${TMP}/dep.uniq.new") - - DEP_MSG= - if [ -z "${DIFFS_UNIQ_DEP}" -a -z "${DIFFS_DEP}" ]; then - DEP_MSG="Identical dependencies" - elif [ -z "${DIFFS_UNIQ_DEP}" ]; then - DEP_MSG="Redundant duplicate dependencies added" - RES=1 - else - DEP_MSG="DIFFERENT dependencies" - RES=1 - fi -fi - -if [ -n "$DIFFS" ]; then - if [ $OLD_SIZE -ne $NEW_SIZE ] - then - echo Differences, content AND size : $DEP_MSG : $OLD_NAME - RESULT=4 - else - echo Differences, content BUT SAME size: $DEP_MSG : $OLD_NAME - RESULT=3 - fi - if [ "x$VIEW" == "xview" ]; then - LANG=C $DIFF $OLD_SYMBOLS $NEW_SYMBOLS - fi -else - if [ $OLD_SIZE -ne $NEW_SIZE ] - then - echo Identical symbols BUT NEW size : $DEP_MSG : $OLD_NAME - RESULT=2 - else - echo Identical symbols AND size, BUT not bytewise identical: $DEP_MSG : $OLD_NAME - RESULT=1 - fi -fi - -exit $RESULT - - - diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/difftext.sh --- a/common/bin/difftext.sh Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# The difftext.sh knows how to compare text files and -# ignore some specific differences. -# When difftext.sh is called, we already know that the -# files differ. But if the tests below trigger, then -# we ignore differences caused by: -# -# Timestamps in Java sources generated by idl2java -# Sorting order and cleanup style in .properties files. - -OLD="$1" -NEW="$2" -SUF="${OLD##*.}" -TMP=1 -if test "x$SUF" == "xjava"; then - TMP=$(LANG=C diff $OLD $NEW | \ - grep '^[<>]' | \ - sed '/[<>] \* from.*\.idl/d' | \ - sed '/[<>] \*.*201[12].*/d' | \ - sed '/\/\/ Generated from input file.*/d' | \ - sed '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' | \ - sed '/\/\/ java GenerateCharacter.*/d') -fi -if test "x$SUF" == "xproperties"; then - cat $OLD | sed -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ --e 's/\\u0020/\x20/g' \ --e 's/\\u003A/\x3A/g' \ --e 's/\\u006B/\x6B/g' \ --e 's/\\u0075/\x75/g' \ --e 's/\\u00A0/\xA0/g' \ --e 's/\\u00A3/\xA3/g' \ --e 's/\\u00B0/\xB0/g' \ --e 's/\\u00B7/\xB7/g' \ --e 's/\\u00BA/\xBA/g' \ --e 's/\\u00BF/\xBF/g' \ --e 's/\\u00C0/\xC0/g' \ --e 's/\\u00C1/\xC1/g' \ --e 's/\\u00C2/\xC2/g' \ --e 's/\\u00C4/\xC4/g' \ --e 's/\\u00C5/\xC5/g' \ --e 's/\\u00C8/\xC8/g' \ --e 's/\\u00C9/\xC9/g' \ --e 's/\\u00CA/\xCA/g' \ --e 's/\\u00CD/\xCD/g' \ --e 's/\\u00CE/\xCE/g' \ --e 's/\\u00D3/\xD3/g' \ --e 's/\\u00D4/\xD4/g' \ --e 's/\\u00D6/\xD6/g' \ --e 's/\\u00DA/\xDA/g' \ --e 's/\\u00DC/\xDC/g' \ --e 's/\\u00DD/\xDD/g' \ --e 's/\\u00DF/\xDF/g' \ --e 's/\\u00E0/\xE0/g' \ --e 's/\\u00E1/\xE1/g' \ --e 's/\\u00E2/\xE2/g' \ --e 's/\\u00E3/\xE3/g' \ --e 's/\\u00E4/\xE4/g' \ --e 's/\\u00E5/\xE5/g' \ --e 's/\\u00E6/\xE6/g' \ --e 's/\\u00E7/\xE7/g' \ --e 's/\\u00E8/\xE8/g' \ --e 's/\\u00E9/\xE9/g' \ --e 's/\\u00EA/\xEA/g' \ --e 's/\\u00EB/\xEB/g' \ --e 's/\\u00EC/\xEC/g' \ --e 's/\\u00ED/\xED/g' \ --e 's/\\u00EE/\xEE/g' \ --e 's/\\u00EF/\xEF/g' \ --e 's/\\u00F1/\xF1/g' \ --e 's/\\u00F2/\xF2/g' \ --e 's/\\u00F3/\xF3/g' \ --e 's/\\u00F4/\xF4/g' \ --e 's/\\u00F5/\xF5/g' \ --e 's/\\u00F6/\xF6/g' \ --e 's/\\u00F9/\xF9/g' \ --e 's/\\u00FA/\xFA/g' \ --e 's/\\u00FC/\xFC/g' \ --e 's/\\u0020/\x20/g' \ --e 's/\\u003f/\x3f/g' \ --e 's/\\u006f/\x6f/g' \ --e 's/\\u0075/\x75/g' \ --e 's/\\u00a0/\xa0/g' \ --e 's/\\u00a3/\xa3/g' \ --e 's/\\u00b0/\xb0/g' \ --e 's/\\u00ba/\xba/g' \ --e 's/\\u00bf/\xbf/g' \ --e 's/\\u00c1/\xc1/g' \ --e 's/\\u00c4/\xc4/g' \ --e 's/\\u00c5/\xc5/g' \ --e 's/\\u00c8/\xc8/g' \ --e 's/\\u00c9/\xc9/g' \ --e 's/\\u00ca/\xca/g' \ --e 's/\\u00cd/\xcd/g' \ --e 's/\\u00d6/\xd6/g' \ --e 's/\\u00dc/\xdc/g' \ --e 's/\\u00dd/\xdd/g' \ --e 's/\\u00df/\xdf/g' \ --e 's/\\u00e0/\xe0/g' \ --e 's/\\u00e1/\xe1/g' \ --e 's/\\u00e2/\xe2/g' \ --e 's/\\u00e3/\xe3/g' \ --e 's/\\u00e4/\xe4/g' \ --e 's/\\u00e5/\xe5/g' \ --e 's/\\u00e7/\xe7/g' \ --e 's/\\u00e8/\xe8/g' \ --e 's/\\u00e9/\xe9/g' \ --e 's/\\u00ea/\xea/g' \ --e 's/\\u00eb/\xeb/g' \ --e 's/\\u00ec/\xec/g' \ --e 's/\\u00ed/\xed/g' \ --e 's/\\u00ee/\xee/g' \ --e 's/\\u00ef/\xef/g' \ --e 's/\\u00f0/\xf0/g' \ --e 's/\\u00f1/\xf1/g' \ --e 's/\\u00f2/\xf2/g' \ --e 's/\\u00f3/\xf3/g' \ --e 's/\\u00f4/\xf4/g' \ --e 's/\\u00f5/\xf5/g' \ --e 's/\\u00f6/\xf6/g' \ --e 's/\\u00f7/\xf7/g' \ --e 's/\\u00f8/\xf8/g' \ --e 's/\\u00f9/\xf9/g' \ --e 's/\\u00fa/\xfa/g' \ --e 's/\\u00fc/\xfc/g' \ --e 's/\\u00ff/\xff/g' \ - | sed -e '/^#/d' -e '/^$/d' \ - -e :a -e '/\\$/N; s/\\\n//; ta' \ - -e 's/^[ \t]*//;s/[ \t]*$//' \ - -e 's/\\=/=/' | LANG=C sort > $OLD.cleaned - TMP=$(LANG=C diff $OLD.cleaned $NEW) -fi -if test -n "$TMP"; then - echo Files $OLD and $NEW differ -fi diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/exception_list_linux --- a/common/bin/exception_list_linux Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# List of files inside jar archives that are ok if they differ. -LIST_DIFF_JAR=" -/sun/misc/Version.class -/sun/tools/jconsole/Version.class -/com/sun/tools/javac/resources/version.class -/com/sun/tools/javah/resources/version.class -/com/sun/tools/javap/resources/version.class -" - -# List of binaries that only need to match symbols -LIST_DIFF_SIZE=" -jre/lib/amd64/libfontmanager.so -jre/lib/amd64/libjdwp.so -jre/lib/amd64/libt2k.so -bin/unpack200 -jre/bin/unpack200 -jre/lib/amd64/libjsig.debuginfo -jre/lib/amd64/libsaproc.debuginfo -jre/lib/amd64/server/libjvm.debuginfo -" - -# List of binares that need to match both symbols and size -LIST_DIFF_BYTE=" -jre/lib/amd64/libdt_socket.so -jre/lib/amd64/libattach.so -jre/lib/amd64/libjaas_unix.so -jre/lib/amd64/libjawt.so -jre/lib/amd64/libjpeg.so -jre/lib/amd64/libjsdt.so -jre/lib/amd64/libjsig.so -jre/lib/amd64/libsaproc.so -jre/lib/amd64/libsctp.so -jre/lib/amd64/libsunec.so -jre/lib/amd64/libunpack.so -jre/lib/amd64/libverify.so -jre/lib/amd64/libzip.so -jre/lib/amd64/server/libjsig.so -jre/lib/amd64/server/libjvm.so -jre/lib/amd64/liblcms.so -demo/jvmti/heapTracker/lib/libheapTracker.so -demo/jvmti/hprof/lib/libhprof.so -demo/jvmti/minst/lib/libminst.so -demo/jvmti/mtrace/lib/libmtrace.so -demo/jvmti/waiters/lib/libwaiters.so -bin/appletviewer -bin/extcheck -bin/idlj -bin/jar -bin/jarsigner -bin/java -bin/javac -bin/javadoc -bin/javah -bin/javap -bin/jcmd -bin/jconsole -bin/jdb -bin/jhat -bin/jinfo -bin/jmap -bin/jps -bin/jrunscript -bin/jsadebugd -bin/jstack -bin/jstat -bin/jstatd -bin/keytool -bin/native2ascii -bin/orbd -bin/pack200 -bin/policytool -bin/rmic -bin/rmid -bin/rmiregistry -bin/schemagen -bin/serialver -bin/servertool -bin/tnameserv -bin/wsgen -bin/wsimport -bin/xjc -jre/bin/java -jre/bin/keytool -jre/bin/orbd -jre/bin/pack200 -jre/bin/policytool -jre/bin/rmid -jre/bin/rmiregistry -jre/bin/servertool -jre/bin/tnameserv -" diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/extractvcvars.sh --- a/common/bin/extractvcvars.sh Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# Must be bash, but that is ok since we are running from cygwin. -# The first argument is the vcvarsall.bat file to run. -# The second argument is the arch arg to give to vcvars. -VCVARSALL="$1" -ARCH_ARG="$2" - -# Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment) -# but calculate the difference in Cygwin environment before/after running it and then -# apply the diff. -_vs10varsall=`cygpath -a -m -s "$VCVARSALL"` -_dosvs10varsall=`cygpath -a -w -s $_vs10varsall` -_dosbash=`cygpath -a -w -s \`which bash\`.*` - -# generate the set of exported vars before/after the vs10 setup -echo "@echo off" > localdevenvtmp.bat -echo "$_dosbash -c \"export -p\" > localdevenvtmp.export0" >> localdevenvtmp.bat -echo "call $_dosvs10varsall $ARCH_ARG" >> localdevenvtmp.bat -echo "$_dosbash -c \"export -p\" > localdevenvtmp.export1" >> localdevenvtmp.bat -cmd /c localdevenvtmp.bat - -# apply the diff (less some non-vs10 vars named by "!") -sort localdevenvtmp.export0 |grep -v "!" > localdevenvtmp.export0.sort -sort localdevenvtmp.export1 |grep -v "!" > localdevenvtmp.export1.sort -comm -1 -3 localdevenvtmp.export0.sort localdevenvtmp.export1.sort > localdevenv.sh -cat localdevenv.sh | sed 's/declare -x /export /g' | sed 's/="/:="/g' | sed 's/\\\\/\\/g' | sed 's/"//g' | \ - sed 's/#/\$\(HASH\)/g' > localdevenv.gmk - -# cleanup -rm -f localdevenvtmp* diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/hide_important_warnings_from_javac.sh --- a/common/bin/hide_important_warnings_from_javac.sh Wed Jul 05 18:26:51 2017 +0200 +++ b/common/bin/hide_important_warnings_from_javac.sh Fri Oct 26 14:29:57 2012 -0700 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/logger.sh --- a/common/bin/logger.sh Wed Jul 05 18:26:51 2017 +0200 +++ b/common/bin/logger.sh Fri Oct 26 14:29:57 2012 -0700 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/shell-tracer.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/bin/shell-tracer.sh Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,47 @@ +#!/bin/bash +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# Usage: sh shell-tracer.sh +# +# This shell script is supposed to be set as a replacement for SHELL in make, +# causing it to be called whenever make wants to execute shell commands. +# The is suitable for passing on to the old shell, +# typically beginning with -c. +# +# This script will make sure the shell command line is executed with +# OLD_SHELL -x, and it will also store a simple log of the the time it takes to +# execute the command in the OUTPUT_FILE, using the "time" utility as pointed +# to by TIME_CMD. If TIME_CMD is "-", no timestamp will be stored. + +TIME_CMD="$1" +OUTPUT_FILE="$2" +OLD_SHELL="$3" +shift +shift +shift +if [ "$TIME_CMD" != "-" ]; then +"$TIME_CMD" -f "[TIME:%E] $*" -a -o "$OUTPUT_FILE" "$OLD_SHELL" -x "$@" +else +"$OLD_SHELL" -x "$@" +fi diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/bin/unicode2x.sed --- a/common/bin/unicode2x.sed Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -s/\\u0020/\x20/g -s/\\u003A/\x3A/g -s/\\u006B/\x6B/g -s/\\u0075/\x75/g -s/\\u00A0/\xA0/g -s/\\u00A3/\xA3/g -s/\\u00B0/\xB0/g -s/\\u00B7/\xB7/g -s/\\u00BA/\xBA/g -s/\\u00BF/\xBF/g -s/\\u00C0/\xC0/g -s/\\u00C1/\xC1/g -s/\\u00C2/\xC2/g -s/\\u00C4/\xC4/g -s/\\u00C5/\xC5/g -s/\\u00C8/\xC8/g -s/\\u00C9/\xC9/g -s/\\u00CA/\xCA/g -s/\\u00CD/\xCD/g -s/\\u00CE/\xCE/g -s/\\u00D3/\xD3/g -s/\\u00D4/\xD4/g -s/\\u00D6/\xD6/g -s/\\u00DA/\xDA/g -s/\\u00DC/\xDC/g -s/\\u00DD/\xDD/g -s/\\u00DF/\xDF/g -s/\\u00E0/\xE0/g -s/\\u00E1/\xE1/g -s/\\u00E2/\xE2/g -s/\\u00E3/\xE3/g -s/\\u00E4/\xE4/g -s/\\u00E5/\xE5/g -s/\\u00E6/\xE6/g -s/\\u00E7/\xE7/g -s/\\u00E8/\xE8/g -s/\\u00E9/\xE9/g -s/\\u00EA/\xEA/g -s/\\u00EB/\xEB/g -s/\\u00EC/\xEC/g -s/\\u00ED/\xED/g -s/\\u00EE/\xEE/g -s/\\u00EF/\xEF/g -s/\\u00F1/\xF1/g -s/\\u00F2/\xF2/g -s/\\u00F3/\xF3/g -s/\\u00F4/\xF4/g -s/\\u00F5/\xF5/g -s/\\u00F6/\xF6/g -s/\\u00F9/\xF9/g -s/\\u00FA/\xFA/g -s/\\u00FC/\xFC/g -s/\\u0020/\x20/g -s/\\u003f/\x3f/g -s/\\u006f/\x6f/g -s/\\u0075/\x75/g -s/\\u00a0/\xa0/g -s/\\u00a3/\xa3/g -s/\\u00b0/\xb0/g -s/\\u00ba/\xba/g -s/\\u00bf/\xbf/g -s/\\u00c1/\xc1/g -s/\\u00c4/\xc4/g -s/\\u00c5/\xc5/g -s/\\u00c8/\xc8/g -s/\\u00c9/\xc9/g -s/\\u00ca/\xca/g -s/\\u00cd/\xcd/g -s/\\u00d6/\xd6/g -s/\\u00dc/\xdc/g -s/\\u00dd/\xdd/g -s/\\u00df/\xdf/g -s/\\u00e0/\xe0/g -s/\\u00e1/\xe1/g -s/\\u00e2/\xe2/g -s/\\u00e3/\xe3/g -s/\\u00e4/\xe4/g -s/\\u00e5/\xe5/g -s/\\u00e7/\xe7/g -s/\\u00e8/\xe8/g -s/\\u00e9/\xe9/g -s/\\u00ea/\xea/g -s/\\u00eb/\xeb/g -s/\\u00ec/\xec/g -s/\\u00ed/\xed/g -s/\\u00ee/\xee/g -s/\\u00ef/\xef/g -s/\\u00f0/\xf0/g -s/\\u00f1/\xf1/g -s/\\u00f2/\xf2/g -s/\\u00f3/\xf3/g -s/\\u00f4/\xf4/g -s/\\u00f5/\xf5/g -s/\\u00f6/\xf6/g -s/\\u00f7/\xf7/g -s/\\u00f8/\xf8/g -s/\\u00f9/\xf9/g -s/\\u00fa/\xfa/g -s/\\u00fc/\xfc/g -s/\\u00ff/\xff/g diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/HotspotWrapper.gmk --- a/common/makefiles/HotspotWrapper.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/HotspotWrapper.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -36,9 +36,12 @@ default: all # Get all files except .hg in the hotspot directory. -HOTSPOT_FILES := $(shell $(FIND) $(HOTSPOT_TOPDIR) -name ".hg" -prune -o -print) +HOTSPOT_FILES := $(shell $(FIND) -L $(HOTSPOT_TOPDIR) -name ".hg" -prune -o -print) +# The old build creates hotspot output dir before calling hotspot and +# not doing it breaks builds on msys. $(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp: $(HOTSPOT_FILES) + @$(MKDIR) -p $(HOTSPOT_OUTPUTDIR) @($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) SPEC=$(HOTSPOT_SPEC) BASE_SPEC=$(BASE_SPEC)) $(TOUCH) $@ diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/IdlCompilation.gmk --- a/common/makefiles/IdlCompilation.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/IdlCompilation.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -59,7 +59,7 @@ $(MKDIR) -p $3/$$($4_TMPDIR) $(RM) -rf $3/$$($4_TMPDIR) $(MKDIR) -p $(dir $5) - $(ECHO) Compiling IDL $(patsubst $2/%,%,$4) + $(ECHO) $(LOG_INFO) Compiling IDL $(patsubst $2/%,%,$4) $8 -td $3/$$($4_TMPDIR) \ -i $2/org/omg/CORBA \ -i $2/org/omg/PortableInterceptor \ @@ -79,15 +79,9 @@ # param 1 is for example BUILD_IDLS # param 2,3,4,5,6,7,8 are named args. # IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES -$(if $2,$1_$(strip $2)) -$(if $3,$1_$(strip $3)) -$(if $4,$1_$(strip $4)) -$(if $5,$1_$(strip $5)) -$(if $6,$1_$(strip $6)) -$(if $7,$1_$(strip $7)) -$(if $8,$1_$(strip $8)) -$(if $9,$1_$(strip $9)) -$(if $(10),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk)) +$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) +$(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) +$(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk)) # Remove any relative addressing in the paths. $1_SRC := $$(abspath $$($1_SRC)) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/JavaCompilation.gmk --- a/common/makefiles/JavaCompilation.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/JavaCompilation.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -50,27 +50,17 @@ # FLAGS:=Flags to be supplied to javac # SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here # SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. - $(if $2,$1_$(strip $2)) - $(if $3,$1_$(strip $3)) - $(if $4,$1_$(strip $4)) - $(if $5,$1_$(strip $5)) - $(if $6,$1_$(strip $6)) - $(if $7,$1_$(strip $7)) - $(if $8,$1_$(strip $8)) - $(if $9,$1_$(strip $9)) - $(if $(10),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk)) + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk)) - ifeq ($$(ENABLE_SJAVAC),yes) - # The port file contains the tcp/ip on which the server listens - # and the cookie necessary to talk to the server. - $1_JAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port - # You can use a different JVM to run the background javac server. - ifeq ($$($1_SERVER_JVM),) - # It defaults to the same JVM that is used to start the javac command. - $1_SERVER_JVM:=$$($1_JVM) - endif - # Set the $1_REMOTE to spawn a background javac server. - $1_REMOTE:=-XDserver:portfile=$$($1_JAVAC_PORTFILE),poolsize=$(SJAVAC_SERVER_CORES),id=$1,javac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_JAVAC)))) + # The port file contains the tcp/ip on which the server listens + # and the cookie necessary to talk to the server. + $1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port + # You can use a different JVM to run the background javac server. + ifeq ($$($1_SERVER_JVM),) + # It defaults to the same JVM that is used to start the javac command. + $1_SERVER_JVM:=$$($1_JVM) endif endef @@ -92,19 +82,11 @@ # added to the archive. # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable - $(if $3,$1_$(strip $3)) - $(if $4,$1_$(strip $4)) - $(if $5,$1_$(strip $5)) - $(if $6,$1_$(strip $6)) - $(if $7,$1_$(strip $7)) - $(if $8,$1_$(strip $8)) - $(if $9,$1_$(strip $9)) - $(if $(10),$1_$(strip $(10))) - $(if $(11),$1_$(strip $(11))) - $(if $(12),$1_$(strip $(12))) - $(if $(13),$1_$(strip $(13))) - $(if $(14),$1_$(strip $(14))) - $(if $(15),$1_$(strip $(15))) + + # NOTE: $2 is dependencies, not a named argument! + $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupArchive($1),,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(findstring $(LOG),debug trace), $(info *[2] = $(strip $2))) $(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk)) $1_JARMAIN:=$(strip $$($1_JARMAIN)) @@ -125,16 +107,28 @@ ifneq (,$$($1_INCLUDES)) $1_GREP_INCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),\ $$(addprefix $$(src)/,$$($1_INCLUDES))) - $$(eval $$(call ListPathsSafelyNow,$1_GREP_INCLUDE_PATTERNS,\n, \ + # If there are a lot of include patterns, output to file to shorten command lines + ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),) + $1_GREP_INCLUDES:=| $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) + else + $$(shell $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include) + $$(eval $$(call ListPathsSafelyNow,$1_GREP_INCLUDE_PATTERNS,\n, \ >> $$($1_BIN)/_the.$$($1_JARNAME)_include)) - $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include + $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include + endif endif ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES)) $1_GREP_EXCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,\ $$($1_EXCLUDES) $$($1_EXCLUDE_FILES))) - $$(eval $$(call ListPathsSafelyNow,$1_GREP_EXCLUDE_PATTERNS,\n, \ + # If there are a lot of include patterns, output to file to shorten command lines + ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),) + $1_GREP_EXCLUDES:=| $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) + else + $$(shell $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude) + $$(eval $$(call ListPathsSafelyNow,$1_GREP_EXCLUDE_PATTERNS,\n, \ >> $$($1_BIN)/_the.$$($1_JARNAME)_exclude)) - $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude + $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude + endif endif # Check if this jar needs to have its index generated. @@ -149,11 +143,13 @@ ifneq (,$2) $1_DEPS:=$2 else - $1_DEPS:=$$(foreach src,$$($1_SRCS),$$(shell ($(FIND) $$(src) -type f \ - -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ - $$($1_GREP_EXCLUDES) && $(ECHO) $$(addprefix $$(src)/,$$($1_EXTRA_FILES))))) + # The subst of \ is needed because $ has to be escaped with \ in EXTRA_FILES for the command + # lines, but not here for use in make dependencies. + $1_DEPS:=$$(shell $(FIND) $$($1_SRCS) -type f -a \( $$($1_FIND_PATTERNS) \) \ + $$($1_GREP_INCLUDES) $$($1_GREP_EXCLUDES)) \ + $$(subst \,,$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,$$($1_EXTRA_FILES)))) ifeq (,$$($1_SKIP_METAINF)) - $1_DEPS+=$$(foreach src,$$($1_SRCS),$$(shell $(FIND) $$(src)/META-INF -type f 2> /dev/null)) + $1_DEPS+=$$(shell $(FIND) $$(addsuffix /META-INF,$$($1_SRCS)) -type f 2> /dev/null)) endif endif @@ -161,34 +157,39 @@ # The capture contents macro finds all files (matching the patterns, typically # .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar. - $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),(($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) $$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)) | $(SED) 's|$$(src)/||g' > $$(src)/_the.$$($1_JARNAME)_contents) && ) + $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\ + (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \ + $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' &&\ + $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES))) > \ + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) # The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file. ifeq (,$$($1_SKIP_METAINF)) - $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) && ) + $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE)) endif # The capture deletes macro finds all deleted files and concatenates them. The resulting file # tells us what to remove from the jar-file. - $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) &&) + $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE)) # The update contents macro updates the jar file with the previously capture contents. $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ (cd $$(src) && \ if [ -s _the.$$($1_JARNAME)_contents ]; then \ $(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \ - fi) &&) + fi) $$(NEWLINE)) # The s-variants of the above macros are used when the jar is created from scratch. $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\ (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ - $$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)) | $(SED) 's|$$(src)/||g' > \ - $$(src)/_the.$$($1_JARNAME)_contents) && ) + $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' &&\ + $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES))) > \ + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) ifeq (,$$($1_SKIP_METAINF)) $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS),\ ($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> \ - $$(src)/_the.$$($1_JARNAME)_contents) && ) + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) endif $1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ - (cd $$(src) && $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$(src)/_the.$$($1_JARNAME)_contents) &&) + (cd $$(src) && $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) # Use a slightly shorter name for logging, but with enough path to identify this jar. $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR)) @@ -208,38 +209,32 @@ # Here is the rule that creates/updates the jar file. $$($1_JAR) : $$($1_DEPS) $(MKDIR) -p $$($1_BIN) - if [ -n "$$($1_MANIFEST)" ]; then \ + $$(if $$($1_MANIFEST),\ $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ - -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE); \ - else \ - $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE); \ - fi - if [ -n "$$(strip $$($1_JARMAIN))" ]; then \ - $(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE); \ - fi - if [ -n "$$($1_EXTRA_MANIFEST_ATTR)" ]; then \ - $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE); \ - fi - +if [ -s $$@ ]; then \ - $(ECHO) Modifying $$($1_NAME) && \ + -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $$($1_MANIFEST) > $$($1_MANIFEST_FILE) \ + ,\ + $(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE)) + $$(if $$($1_JARMAIN),$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE)) + $$(if $$($1_EXTRA_MANIFEST_ATTR),$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE)) + $$(if $$(wildcard $$@),\ + $(ECHO) Modifying $$($1_NAME) $$(NEWLINE)\ $$($1_CAPTURE_CONTENTS) \ $$($1_CAPTURE_METAINF) \ - $(RM) $$($1_DELETES_FILE) && \ + $(RM) $$($1_DELETES_FILE) $$(NEWLINE)\ $$($1_CAPTURE_DELETES) \ - $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) && \ + $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) $$(NEWLINE)\ if [ -s $$($1_DELETESS_FILE) ]; then \ $(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \ $(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \ - fi && \ - $$($1_UPDATE_CONTENTS) true && \ - $$($1_JARINDEX) && true ; \ - else \ - $(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) && \ + fi $$(NEWLINE) \ + $$($1_UPDATE_CONTENTS) true $$(NEWLINE) \ + $$($1_JARINDEX) && true \ + ,\ + $(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) $$(NEWLINE) \ $$($1_SCAPTURE_CONTENTS) \ $$($1_SCAPTURE_METAINF) \ $$($1_SUPDATE_CONTENTS) \ - $$($1_JARINDEX) && true ; \ - fi; + $$($1_JARINDEX) && true ) endef @@ -247,15 +242,9 @@ # param 1 is for example ZIP_MYSOURCE # param 2,3,4,5,6,7,8,9 are named args. # SRC,ZIP,INCLUDES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS - $(if $2,$1_$(strip $2)) - $(if $3,$1_$(strip $3)) - $(if $4,$1_$(strip $4)) - $(if $5,$1_$(strip $5)) - $(if $6,$1_$(strip $6)) - $(if $7,$1_$(strip $7)) - $(if $8,$1_$(strip $8)) - $(if $9,$1_$(strip $9)) - $(if $(10),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk)) + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupZipArchive($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk)) # Find all files in the source tree. $1_SUFFIX_FILTER := $$(patsubst %,-o -name $(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES)) @@ -274,7 +263,7 @@ ifneq ($$($1_EXCLUDES),) $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES))) - $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRC)) + $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS)) endif # Use a slightly shorter name for logging, but with enough path to identify this zip. @@ -288,7 +277,7 @@ $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS) $(MKDIR) -p $$(@D) $(ECHO) Updating $$($1_NAME) - $$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* $$(addprefix -x$(SPACE),$$(patsubst $$i/%,%,$$($1_EXCLUDE_FILES)))) ;) true + $$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* $$(addprefix -x$(SPACE),$$(patsubst $$i/%,%,$$($1_EXCLUDE_FILES))))$$(NEWLINE)) true $(TOUCH) $$@ endef @@ -324,7 +313,7 @@ $$($1_BIN)$$($2_TARGET) : $2 $(MKDIR) -p $$(@D) $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ - | $(SED) -f "$(SRC_ROOT)/common/bin/unicode2x.sed" \ + | $(SED) -f "$(SRC_ROOT)/common/makefiles/support/unicode2x.sed" \ | $(SED) -e '/^#/d' -e '/^$$$$/d' \ -e :a -e '/\\$$$$/N; s/\\\n//; ta' \ -e 's/^[ \t]*//;s/[ \t]*$$$$//' \ @@ -364,36 +353,27 @@ # Its only here until we cleanup some nasty source code pasta in the jdk. # HEADERS:=path to directory where all generated c-headers are written. # DEPENDS:=Extra dependecy - $(if $2,$1_$(strip $2)) - $(if $3,$1_$(strip $3)) - $(if $4,$1_$(strip $4)) - $(if $5,$1_$(strip $5)) - $(if $6,$1_$(strip $6)) - $(if $7,$1_$(strip $7)) - $(if $8,$1_$(strip $8)) - $(if $9,$1_$(strip $9)) - $(if $(10),$1_$(strip $(10))) - $(if $(11),$1_$(strip $(11))) - $(if $(12),$1_$(strip $(12))) - $(if $(13),$1_$(strip $(13))) - $(if $(14),$1_$(strip $(14))) - $(if $(15),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk)) + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk)) # Extract the info from the java compiler setup. - $1_REMOTE := $$($$($1_SETUP)_REMOTE) $1_JVM := $$($$($1_SETUP)_JVM) $1_JAVAC := $$($$($1_SETUP)_JAVAC) $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS) ifeq ($$($1_JAVAC),) $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) endif + $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) + $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) # Handle addons and overrides. $1_SRC:=$$(call ADD_SRCS,$$($1_SRC)) # Make sure the dirs exist. - $$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN)) + $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d))) + $$(eval $$(call MakeDir,$$($1_BIN))) # Find all files in the source trees. - $1_ALL_SRCS := $$(filter-out $(OVR_SRCS),$$(foreach i,$$($1_SRC),$$(shell $(FIND) $$i -type f))) + $1_ALL_SRCS := $$(filter-out $(OVR_SRCS),$$(shell $(FIND) $$($1_SRC) -type f)) # Extract the java files. ifneq ($$($1_EXCLUDE_FILES),) $1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES)) @@ -428,7 +408,7 @@ # Rewrite list of patterns into a find statement. $1_COPY_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_COPY)) # Search for all files to be copied. - $1_ALL_COPIES := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_COPY_PATTERN) \) -a -type f)) + $1_ALL_COPIES := $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS)) # Copy these explicitly $1_ALL_COPIES += $$($1_COPY_FILES) # Copy must also respect filters. @@ -442,7 +422,7 @@ $1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES)) endif # All files below META-INF are always copied. - $1_ALL_COPIES += $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i/META-INF -type f 2> /dev/null)) + $1_ALL_COPIES += $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) ifneq (,$$($1_ALL_COPIES)) # Yep, there are files to be copied! $1_ALL_COPY_TARGETS:= @@ -456,7 +436,7 @@ # Rewrite list of patterns into a find statement. $1_CLEAN_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_CLEAN)) # Search for all files to be copied. - $1_ALL_CLEANS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_CLEAN_PATTERN) \) -a -type f)) + $1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS)) # Copy and clean must also respect filters. ifneq (,$$($1_INCLUDES)) $1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS)) @@ -482,30 +462,59 @@ $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC))) endif - ifneq (,$$($1_HEADERS)) - $1_HEADERS_ARG := -h $$($1_HEADERS) - endif - # Create a sed expression to remove the source roots and to replace / with . # and remove .java at the end. $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) + ifneq (,$$($1_HEADERS)) + $1_HEADERS_ARG := -h $$($1_HEADERS) + endif + # Using sjavac to compile. $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state + # Create SJAVAC variable, + # expects $1_JAVAC to be "bootclasspathprepend -jar ...javac.jar" + # and it is rewritten into "bootclasspathprepend com.sun.tools.sjavac.Main" + $1_SJAVAC:=$$(word 1,$$($1_JAVAC)) -cp $$(word 3,$$($1_JAVAC)) com.sun.tools.sjavac.Main + + # Set the $1_REMOTE to spawn a background javac server. + $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),poolsize=$(SJAVAC_SERVER_CORES),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) + $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS) $(MKDIR) -p $$(@D) $$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp) $(ECHO) Compiling $1 - $$($1_JVM) $$(word 1,$$($1_JAVAC)) com.sun.tools.sjavac.Main \ - $$($1_REMOTE) $$($1_SJAVAC_ARGS) --permit-unidentified-artifacts -mfl $$($1_BIN)/_the.batch.tmp \ + $$($1_JVM) $$($1_SJAVAC) \ + $$($1_REMOTE) $$($1_SJAVAC_ARGS) \ + --permit-unidentified-artifacts \ + --permit-sources-without-package \ + --compare-found-sources $$($1_BIN)/_the.batch.tmp \ $$($1_FLAGS) \ -implicit:none -d $$($1_BIN) $$($1_HEADERS_ARG) else # Using plain javac to batch compile everything. $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch + # When buliding in batch, put headers in a temp dir to filter out those that actually + # changed before copying them to the real header dir. + ifneq (,$$($1_HEADERS)) + $1_HEADERS_ARG := -h $$($1_HEADERS).tmp + + $$($1_HEADERS)/_the.headers: $$($1_BIN)/_the.batch + $(MKDIR) -p $$(@D) + for f in `ls $$($1_HEADERS).tmp`; do \ + if [ ! -f "$$($1_HEADERS)/$$$$f" ] || [ "`$(DIFF) $$($1_HEADERS)/$$$$f $$($1_HEADERS).tmp/$$$$f`" != "" ]; then \ + $(CP) -f $$($1_HEADERS).tmp/$$$$f $$($1_HEADERS)/$$$$f; \ + fi; \ + done + $(RM) -r $$($1_HEADERS).tmp + $(TOUCH) $$@ + + $1 += $$($1_HEADERS)/_the.headers + endif + # When not using sjavac, pass along all sources to javac using an @file. $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS) $(MKDIR) -p $$(@D) @@ -516,6 +525,7 @@ -implicit:none -sourcepath "$$($1_SRCROOTSC)" \ -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \ $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch) + endif # Check if a jar file was specified, then setup the rules for the jar. diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/Main.gmk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/makefiles/Main.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,208 @@ +# +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file. + +# Now load the spec +include $(SPEC) + +# Load the vital tools for all the makefiles. +include $(SRC_ROOT)/common/makefiles/MakeBase.gmk + +# Include the corresponding custom file, if present. +-include $(CUSTOM_MAKE_DIR)/Main.gmk + +### Clean up from previous run + +# Remove any build.log from a previous run, if they exist +ifneq (,$(BUILD_LOG)) + ifneq (,$(BUILD_LOG_PREVIOUS)) + # Rotate old log + $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null) + $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null) + else + $(shell $(RM) $(BUILD_LOG) 2> /dev/null) + endif + $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null) +endif +# Remove any javac server logs and port files. This +# prevents a new make run to reuse the previous servers. +ifneq (,$(SJAVAC_SERVER_DIR)) + $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*) +endif + +# Reset the build timers. +$(eval $(call ResetAllTimers)) + +# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line, +# hence this workaround. +ifeq ($(JOBS),) + JOBS=$(NUM_CORES) +endif +MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS) + +### Main targets + +all: jdk + +start-make: + @$(call AtMakeStart) + +langtools: langtools-only +langtools-only: start-make + @$(call TargetEnter) + @($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildLangtools.gmk) + @$(call TargetExit) + +corba: langtools corba-only +corba-only: start-make + @$(call TargetEnter) + @($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildCorba.gmk) + @$(call TargetExit) + +jaxp: langtools jaxp-only +jaxp-only: start-make + @$(call TargetEnter) + @($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxp.gmk) + @$(call TargetExit) + +jaxws: langtools jaxp jaxws-only +jaxws-only: start-make + @$(call TargetEnter) + @($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk) + @$(call TargetExit) + +hotspot: hotspot-only +hotspot-only: start-make + @$(call TargetEnter) + @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk) + @$(call TargetExit) + +jdk: langtools hotspot corba jaxp jaxws jdk-only +jdk-only: start-make + @$(call TargetEnter) + @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET)) + @$(call TargetExit) + +demos: jdk demos-only +demos-only: start-make + @$(call TargetEnter) + @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos) + @$(call TargetExit) + +images: source-tips demos images-only +images-only: start-make + @$(call TargetEnter) + @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images) + @$(call TargetExit) + +overlay-images: source-tips demos overlay-images-only +overlay-images-only: start-make + @$(call TargetEnter) + @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images) + @$(call TargetExit) + +bundles: images bundles-only +bundles-only: start-make + @$(call TargetEnter) + @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk bundles) + @$(call TargetExit) + +install: images install-only +install-only: start-make + @$(call TargetEnter) + @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk install) + @$(call TargetExit) + +docs: jdk docs-only +docs-only: start-make + @$(call TargetEnter) + @($(CD) $(SRC_ROOT)/common/makefiles/javadoc && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) + @$(call TargetExit) + +bootcycle-images: + @$(ECHO) Boot cycle build step 1: Building the JDK image normally + @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(SPEC) images) + @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image + @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images) + +test: start-make + @$(call TargetEnter) + @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) MAKEFLAGS= -j1 PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true + @$(call TargetExit) + +# Stores the tips for each repository. This file is be used when constructing the jdk image and can be +# used to track the exact sources used to build that image. +source-tips: $(OUTPUT_ROOT)/source_tips +$(OUTPUT_ROOT)/source_tips: FRC + @$(MKDIR) -p $(@D) + @$(RM) $@ + @$(if $(HG),$(call GetSourceTips),$(ECHO) "hg not installed" > $@) + + +# Remove everything, except the output from configure. +clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build + @($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*) + @$(ECHO) Cleaned all build artifacts. + +# Remove everything, including configure configuration. +# If the output directory was created by configure and now becomes empty, remove it as well. +# FIXME: tmp should not be here, fix ResetTimers instead. And remove spec.sh! +dist-clean: clean + @($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments Makefile compare.sh spec.sh tmp) + @$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \ + if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \ + $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ;\ + else \ + ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" && $(RM) -r $(OUTPUT_ROOT)) \ + fi \ + ) + @$(ECHO) Cleaned everything, you will have to re-run configure. + +clean-langtools: + $(call CleanComponent,langtools) +clean-corba: + $(call CleanComponent,corba) +clean-jaxp: + $(call CleanComponent,jaxp) +clean-jaxws: + $(call CleanComponent,jaxws) +clean-hotspot: + $(call CleanComponent,hotspot) +clean-jdk: + $(call CleanComponent,jdk) +clean-images: + $(call CleanComponent,images) +clean-overlay-images: + $(call CleanComponent,overlay-images) +clean-bootcycle-build: + $(call CleanComponent,bootcycle-build) + +.PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install +.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only +.PHONY: all test clean dist-clean bootcycle-images start-make +.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-overlay-images clean-bootcycle-build + +FRC: # Force target diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/MakeBase.gmk --- a/common/makefiles/MakeBase.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/MakeBase.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -33,129 +33,13 @@ ifndef _MAKEBASE_GMK _MAKEBASE_GMK := 1 -ifeq (,$(findstring 3.81,$(MAKE_VERSION))) - ifeq (,$(findstring 3.82,$(MAKE_VERSION))) - $(error This version of GNU Make is too low ($(MAKE_VERSION)). Please upgrade to 3.81 or newer.) - endif -endif - -ifneq (,$(CYGPATH)) - # Cygwin styff, if needed but most is going to be - # done in configure! - ifeq (yes,$(CHECK_FOR_VCINSTALLDIR)) - ifeq (,$(VCINSTALLDIR)) - $(info Could not find compiler paths!) - $(info You probably configured the build from within a) - $(info VS command prompt, but you are not using such a) - $(info prompt right now.) - $(info If you instead run configure from a plain cygwin shell, it) - $(info will attempt to setup VS for you! Please try that.) - $(error Giving up for now.) - endif - endif -endif - -# The build times report is turned off by setting REPORT_BUILD_TIMES to nothing. -# This is necessary for the target clean which will erase the -# directories where the buildtimes are stored. -REPORT_BUILD_TIMES=1 -# Store the build times in this directory. -BUILDTIMESDIR=$(OUTPUT_ROOT)/tmp/buildtimes - -# Record starting time for build of a sub repository. -define RecordStartTime -$(MKDIR) -p $(BUILDTIMESDIR) -$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1 -$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable -endef - -# Indicate that we started to build a sub repository and record starting time. -define MakeStart -$(call RecordStartTime,$1) -$(BUILD_LOG_WRAPPER) $(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n\n" \ -"########################################################################" \ -"########################################################################" \ -"Entering $1 for target(s) $2" \ -"########################################################################" -endef - -# Record ending time and calculate the difference and store it in a -# easy to read format. Handles builds that cross midnight. Expects -# that a build will never take 24 hours or more. -define RecordEndTime -$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1 -$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable -$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \ - $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \ - M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \ - > $(BUILDTIMESDIR)/build_time_diff_$1 -endef - -# Check if the current target is the final target, as specified by -# the user on the command line. If so, call PrintEndMessage. -define CheckIfFinished -$(if $(filter $@,$(MAKECMDGOALS)),$(call PrintEndMessage)) -# If no taget is given, "all" is default. Check for that, too. -# At most one of the tests can be true. -$(if $(MAKECMDGOALS),,$(if $(filter $@,all),$(call PrintEndMessage))) -endef - -# Indicate that we are done. -# Record ending time and print out the total time it took to build. -define MakeFinish -$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,$1),) -$(BUILD_LOG_WRAPPER) $(PRINTF) "%s\n##### %-60.60s #####\n%s\n##### %-60.60s #####\n%s\n\n" \ -"########################################################################" \ -"Leaving $1 for target(s) $2" \ -"########################################################################" \ -$(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \ -"########################################################################" -$(call CheckIfFinished) -endef - -# Find all build_time_* files and print their contents in a list sorted -# on the name of the sub repository. -define ReportBuildTimes -$(BUILD_LOG_WRAPPER) $(PRINTF) -- "-- Build times ----------\nTarget %s\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \ -"$1" \ -"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \ -"`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \ -"`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \ -"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" -endef - -define ResetTimers -$$(shell $(MKDIR) -p $(BUILDTIMESDIR) && $(RM) $(BUILDTIMESDIR)/build_time_*) -endef - -define StartTimer - $(call RecordStartTime,TOTAL) -endef - -define StopTimer - $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),) -endef - -# Hook to be called as the very first thing when running a normal build -define AtRootMakeStart - $(if $(findstring --jobserver,$(MAKEFLAGS)), $(error make -j is not supported, use make JOBS=n)) - $(call PrintStartMessage) - $(call StartTimer) -endef - -# Hook to be called as the very last thing for targets that are "top level" targets -define AtRootMakeEnd - $(call StopTimer) - $(call CheckIfFinished) -endef - # If the variable that you want to send to stdout for piping into a file or otherwise, # is potentially long, for example the a list of file paths, eg a list of all package directories. # Then you need to use ListPathsSafely, which optimistically splits the output into several shell # calls as well as use compression on recurrent file paths segments, to get around the potential # command line length problem that exists in cygwin and other shells. -compress_pre:=$(strip $(shell cat $(SRC_ROOT)/common/makefiles/compress.pre)) -compress_post:=$(strip $(shell cat $(SRC_ROOT)/common/makefiles/compress.post)) +compress_pre:=$(strip $(shell $(CAT) $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-pre-compress.incl)) +compress_post:=$(strip $(shell $(CAT) $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-post-compress.incl)) compress_paths=$(compress_pre)\ $(subst $(SRC_ROOT),X97,\ $(subst $(OUTPUT_ROOT),X98,\ @@ -163,7 +47,7 @@ $(subst $(SPACE),\n,$(strip $1)))))\ $(compress_post) -decompress_paths=sed -f $(SRC_ROOT)/common/makefiles/uncompress.sed -e 's|X99|\\n|g' \ +decompress_paths=$(SED) -f $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-uncompress.sed -e 's|X99|\\n|g' \ -e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \ -e 's|X00|X|g' | tr '\n' '$2' @@ -384,14 +268,67 @@ endef define SetupLogging - ifneq ($(findstring $(LOG),debug trace),) + ifeq ($$(LOG), trace) # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make + # For each target executed, will print + # Building (from ) ( newer) + # but with a limit of 20 on , to avoid cluttering logs too much (and causing a crash on Cygwin). OLD_SHELL:=$$(SHELL) - SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x + WRAPPER_SHELL:=$$(OLD_SHELL) $$(SRC_ROOT)/common/bin/shell-tracer.sh $$(if $$(TIME),$$(TIME),-) $$(OUTPUT_ROOT)/build-trace-time.log $$(OLD_SHELL) + SHELL=$$(warning $$(if $$@,Building $$@,Running shell command) $$(if $$<, (from $$<))$$(if $$?, ($$(wordlist 1, 20, $$?) $$(if $$(wordlist 21, 22, $$?), ... [in total $$(words $$?) files]) newer)))$$(WRAPPER_SHELL) + endif + # Never remove warning messages; this is just for completeness + LOG_WARN= + ifneq ($$(findstring $$(LOG),info debug trace),) + LOG_INFO= + else + LOG_INFO=> /dev/null + endif + ifneq ($$(findstring $$(LOG),debug trace),) + LOG_DEBUG= + else + LOG_DEBUG=> /dev/null + endif + ifneq ($$(findstring $$(LOG),trace),) + LOG_TRACE= + else + LOG_TRACE=> /dev/null endif endef # Make sure logging is setup for everyone that includes MakeBase.gmk. $(eval $(call SetupLogging)) +# This is to be called by all SetupFoo macros +define LogSetupMacroEntry + $(if $(26),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk)) + $(if $(findstring $(LOG),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)))))) +endef + +# Make directory without forking mkdir if not needed +define MakeDir + ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)) + $$(shell $(MKDIR) -p $1 $2 $3 $4 $5 $6 $7 $8 $9) + endif +endef + +ifeq ($(OPENJDK_TARGET_OS),solaris) +# On Solaris, if the target is a symlink and exists, cp won't overwrite. +define install-file + $(MKDIR) -p $(@D) + $(RM) '$@' + $(CP) -f -r -P '$<' '$(@D)' +endef +else ifeq ($(OPENJDK_TARGET_OS),macosx) +define install-file + $(MKDIR) -p $(@D) + $(CP) -fpRP '$<' '$@' +endef +else +define install-file + $(MKDIR) -p $(@D) + $(CP) -fP '$<' '$@' +endef +endif + endif # _MAKEBASE_GMK diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/MakeHelpers.gmk --- a/common/makefiles/MakeHelpers.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/MakeHelpers.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -45,13 +45,130 @@ list_alt_overrides_with_origins=$(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var))))) list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins))) +# Store the build times in this directory. +BUILDTIMESDIR=$(OUTPUT_ROOT)/tmp/buildtimes + +# Global targets are possible to run either with or without a SPEC. The prototypical +# global target is "help". +global_targets=help configure + ############################## # Functions ############################## -define fatal-error +define CheckEnvironment + # Find all environment or command line variables that begin with ALT. + $(if $(list_alt_overrides), + @$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n" + @$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n" + @$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n\n" + ) +endef + +### Functions for timers + +# Record starting time for build of a sub repository. +define RecordStartTime + $(MKDIR) -p $(BUILDTIMESDIR) + $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1 + $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable +endef + +# Record ending time and calculate the difference and store it in a +# easy to read format. Handles builds that cross midnight. Expects +# that a build will never take 24 hours or more. +define RecordEndTime + $(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1 + $(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable + $(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \ + $(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \ + M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \ + > $(BUILDTIMESDIR)/build_time_diff_$1 +endef + +# Find all build_time_* files and print their contents in a list sorted +# on the name of the sub repository. +define ReportBuildTimes + $(BUILD_LOG_WRAPPER) $(PRINTF) -- "----- Build times -------\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \ + "`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`" +endef + +define ResetAllTimers + $$(shell $(MKDIR) -p $(BUILDTIMESDIR) && $(RM) $(BUILDTIMESDIR)/build_time_*) +endef + +define StartGlobalTimer + $(call RecordStartTime,TOTAL) +endef + +define StopGlobalTimer + $(call RecordEndTime,TOTAL) +endef + +### Functions for managing makefile structure (start/end of makefile and individual targets) + +# Do not indent this function, this will add whitespace at the start which the caller won't handle +define GetRealTarget +$(strip $(if $(MAKECMDGOALS),$(MAKECMDGOALS),all)) +endef + +# Do not indent this function, this will add whitespace at the start which the caller won't handle +define LastGoal +$(strip $(lastword $(call GetRealTarget))) +endef + +# Check if the current target is the final target, as specified by +# the user on the command line. If so, call AtRootMakeEnd. +define CheckIfMakeAtEnd + # Check if the current target is the last goal + $(if $(filter $@,$(call LastGoal)),$(call AtMakeEnd)) + # If the target is 'foo-only', check if our goal was stated as 'foo' + $(if $(filter $(patsubst %-only,%,$@),$(call LastGoal)),$(call AtMakeEnd)) + # If no goal is given, 'all' is default, but the last target executed for all is 'jdk-only'. Check for that, too. + # At most one of the tests can be true. + $(if $(subst all,,$(call LastGoal)),,$(if $(filter $@,jdk-only),$(call AtMakeEnd))) +endef + +# Hook to be called when starting to execute a top-level target +define TargetEnter + $(BUILD_LOG_WRAPPER) $(PRINTF) "## Starting $(patsubst %-only,%,$@)\n" + $(call RecordStartTime,$(patsubst %-only,%,$@)) +endef + +# Hook to be called when finish executing a top-level target +define TargetExit + $(call RecordEndTime,$(patsubst %-only,%,$@)) + $(BUILD_LOG_WRAPPER) $(PRINTF) "## Finished $(patsubst %-only,%,$@) (build time %s)\n\n" \ + "`$(CAT) $(BUILDTIMESDIR)/build_time_diff_$(patsubst %-only,%,$@) | $(CUT) -f 1 -d " "`" + $(call CheckIfMakeAtEnd) +endef + +# Hook to be called as the very first thing when running a normal build +define AtMakeStart + $(if $(findstring --jobserver,$(MAKEFLAGS)),$(error make -j is not supported, use make JOBS=n)) + $(call CheckEnvironment) + @$(PRINTF) $(LOG_INFO) "Running make as '$(MAKE) $(MFLAGS) $(MAKE_ARGS)'\n" + @$(PRINTF) "Building $(PRODUCT_NAME) for target '$(call GetRealTarget)' in configuration '$(CONF_NAME)'\n\n" + $(call StartGlobalTimer) +endef + +# Hook to be called as the very last thing for targets that are "top level" targets +define AtMakeEnd + $(if $(SJAVAC_SERVER_DIR),@$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port) + $(call StopGlobalTimer) + $(call ReportBuildTimes) + @$(PRINTF) "Finished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n" + $(call CheckEnvironment) +endef + +### Functions for parsing and setting up make options from command-line + +define FatalError # If the user specificed a "global" target (e.g. 'help'), do not exit but continue running - $$(if $$(findstring help,$$(MAKECMDGOALS)),,$$(error Cannot continue)) + $$(if $$(filter-out $(global_targets),$$(call GetRealTarget)),$$(error Cannot continue)) endef define ParseLogLevel @@ -80,14 +197,14 @@ ifeq ($$(LOG),warn) VERBOSE=-s else ifeq ($$(LOG),info) - VERBOSE= + VERBOSE=-s else ifeq ($$(LOG),debug) VERBOSE= else ifeq ($$(LOG),trace) - VERBOSE=-d -p + VERBOSE= else $$(info Error: LOG must be one of: warn, info, debug or trace.) - $$(eval $$(call fatal-error)) + $$(eval $$(call FatalError)) endif else ifneq ($$(LOG),) @@ -95,108 +212,84 @@ # but complain if this is the top-level make call. ifeq ($$(MAKELEVEL),0) $$(info Cannot use LOG=$$(LOG) and VERBOSE=$$(VERBOSE) at the same time. Choose one.) - $$(eval $$(call fatal-error)) + $$(eval $$(call FatalError)) endif endif endif endef -# TODO: Fix duplication in MakeBase.gmk -define SetupLogging - ifneq ($(findstring $(LOG),debug trace),) - # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make - OLD_SHELL:=$$(SHELL) - SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x - endif -endef - define ParseConfAndSpec - ifneq ($$(origin SPEC),undefined) - # We have been given a SPEC, check that it works out properly - ifeq ($$(wildcard $$(SPEC)),) - $$(info Cannot locate spec.gmk, given by SPEC=$$(SPEC)) - $$(eval $$(call fatal-error)) - endif - ifneq ($$(origin CONF),undefined) - # We also have a CONF argument. This is OK only if this is a repeated call by ourselves, - # but complain if this is the top-level make call. - ifeq ($$(MAKELEVEL),0) - $$(info Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.) - $$(eval $$(call fatal-error)) + ifneq ($$(filter-out $(global_targets),$$(call GetRealTarget)),) + # If we only have global targets, no need to bother with SPEC or CONF + ifneq ($$(origin SPEC),undefined) + # We have been given a SPEC, check that it works out properly + ifeq ($$(wildcard $$(SPEC)),) + $$(info Cannot locate spec.gmk, given by SPEC=$$(SPEC)) + $$(eval $$(call FatalError)) endif - endif - # ... OK, we're satisfied, we'll use this SPEC later on - else - # Find all spec.gmk files in the build output directory - output_dir=$$(root_dir)/build - all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk) - ifeq ($$(all_spec_files),) - $$(info No configurations found for $$(root_dir)! Please run configure to create a configuration.) - $$(eval $$(call fatal-error)) - endif - # Extract the configuration names from the path - all_confs=$$(patsubst %/spec.gmk,%,$$(patsubst $$(output_dir)/%,%,$$(all_spec_files))) - - ifneq ($$(origin CONF),undefined) - # User have given a CONF= argument. - ifeq ($$(CONF),) - # If given CONF=, match all configurations - matching_confs=$$(strip $$(all_confs)) - else - # Otherwise select those that contain the given CONF string - matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var)))) - endif - ifeq ($$(matching_confs),) - $$(info No configurations found matching CONF=$$(CONF)) - $$(info Available configurations:) - $$(foreach var,$$(all_confs),$$(info * $$(var))) - $$(eval $$(call fatal-error)) - else - ifeq ($$(words $$(matching_confs)),1) - $$(info Building '$$(matching_confs)' (matching CONF=$$(CONF))) - else - $$(info Building the following configurations (matching CONF=$$(CONF)):) - $$(foreach var,$$(matching_confs),$$(info * $$(var))) + ifneq ($$(origin CONF),undefined) + # We also have a CONF argument. This is OK only if this is a repeated call by ourselves, + # but complain if this is the top-level make call. + ifeq ($$(MAKELEVEL),0) + $$(info Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.) + $$(eval $$(call FatalError)) endif endif - - # Create a SPEC definition. This will contain the path to one or more spec.gmk files. - SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs))) + # ... OK, we're satisfied, we'll use this SPEC later on else - # No CONF or SPEC given, check the available configurations - ifneq ($$(words $$(all_spec_files)),1) - $$(info No CONF or SPEC given, but more than one spec.gmk found in $$(output_dir).) - $$(info Available configurations:) - $$(foreach var,$$(all_confs),$$(info * $$(var))) - $$(info Please retry building with CONF= or SPEC=) - $$(eval $$(call fatal-error)) + # Find all spec.gmk files in the build output directory + output_dir=$$(root_dir)/build + all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk) + ifeq ($$(all_spec_files),) + $$(info No configurations found for $$(root_dir)! Please run configure to create a configuration.) + $$(eval $$(call FatalError)) endif + # Extract the configuration names from the path + all_confs=$$(patsubst %/spec.gmk,%,$$(patsubst $$(output_dir)/%,%,$$(all_spec_files))) - # We found exactly one configuration, use it - SPEC=$$(strip $$(all_spec_files)) + ifneq ($$(origin CONF),undefined) + # User have given a CONF= argument. + ifeq ($$(CONF),) + # If given CONF=, match all configurations + matching_confs=$$(strip $$(all_confs)) + else + # Otherwise select those that contain the given CONF string + matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var)))) + endif + ifeq ($$(matching_confs),) + $$(info No configurations found matching CONF=$$(CONF)) + $$(info Available configurations:) + $$(foreach var,$$(all_confs),$$(info * $$(var))) + $$(eval $$(call FatalError)) + else + ifeq ($$(words $$(matching_confs)),1) + $$(info Building '$$(matching_confs)' (matching CONF=$$(CONF))) + else + $$(info Building target '$(call GetRealTarget)' in the following configurations (matching CONF=$$(CONF)):) + $$(foreach var,$$(matching_confs),$$(info * $$(var))) + endif + endif + + # Create a SPEC definition. This will contain the path to one or more spec.gmk files. + SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs))) + else + # No CONF or SPEC given, check the available configurations + ifneq ($$(words $$(all_spec_files)),1) + $$(info No CONF given, but more than one configuration found in $$(output_dir).) + $$(info Available configurations:) + $$(foreach var,$$(all_confs),$$(info * $$(var))) + $$(info Please retry building with CONF= (or SPEC=)) + $$(eval $$(call FatalError)) + endif + + # We found exactly one configuration, use it + SPEC=$$(strip $$(all_spec_files)) + endif endif endif endef -define CheckEnvironment - # Find all environment or command line variables that begin with ALT. - $(if $(list_alt_overrides), - @$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n" - @$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n" - @$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n\n" - ) -endef - -define PrintStartMessage - $(if $(VERBOSE),,@$(ECHO) Running make as $(MAKE) $(MFLAGS) $(MAKE_ARGS)) - $(call CheckEnvironment) - @$(ECHO) "Building OpenJDK for target $(if $(MAKECMDGOALS),'$(MAKECMDGOALS)','all') in configuration '$(CONF_NAME)'" -endef - -define PrintEndMessage - @$(ECHO) "Finished building OpenJDK for target '$@'" - $(call CheckEnvironment) -endef +### Convenience functions from Main.gmk # Cleans the component given as $1 define CleanComponent diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/Makefile --- a/common/makefiles/Makefile Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/Makefile Fri Oct 26 14:29:57 2012 -0700 @@ -24,13 +24,24 @@ # # This must be the first rule -default: all +all: # Inclusion of this pseudo-target will cause make to execute this file # serially, regardless of -j. Recursively called makefiles will not be # affected, however. This is required for correct dependency management. .NOTPARALLEL: +# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make. +# /usr/ccs/bin/make lacks basically every other flow control mechanism. +TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1 + +# Assume we have GNU make, but check version. +ifeq (,$(findstring 3.81,$(MAKE_VERSION))) + ifeq (,$(findstring 3.82,$(MAKE_VERSION))) + $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.) + endif +endif + # Locate this Makefile ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) @@ -43,202 +54,32 @@ include $(dir $(makefile_path))/MakeHelpers.gmk $(eval $(call ParseLogLevel)) -$(eval $(call SetupLogging)) $(eval $(call ParseConfAndSpec)) -ifneq ($(words $(SPEC)),1) -### We have multiple configurations to build, call make repeatedly -all clean dist-clean: -langtools corba jaxp jaxws hotspot jdk images overlay-images install: -langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only: -clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images: +# Now determine if we have zero, one or several configurations to build. +ifeq ($(SPEC),) + # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing. +else + ifeq ($(words $(SPEC)),1) + # We are building a single configuration. This is the normal case. Execute the Main.gmk file. + include $(dir $(makefile_path))/Main.gmk + else + # We are building multiple configurations. + # First, find out the valid targets + # Run the makefile with an arbitraty SPEC using -p -q (quiet dry-run and dump rules) to find + # available PHONY targets. Use this list as valid targets to pass on to the repeated calls. + all_phony_targets=$(filter-out $(global_targets), $(strip $(shell \ + $(MAKE) -p -q -f $(makefile_path) SPEC=$(firstword $(SPEC)) | \ + grep ^.PHONY: | head -n 1 | cut -d " " -f 2-))) + +$(all_phony_targets): @$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@) &&) true -.PHONY: all clean dist-clean -.PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install -.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only -.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images - -else -### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file. - -# Now load the spec -include $(SPEC) - -# Load the vital tools for all the makefiles. -include $(SRC_ROOT)/common/makefiles/MakeBase.gmk - -### Clean up from previous run - -# Remove any build.log from a previous run, if they exist -ifneq (,$(BUILD_LOG)) - ifneq (,$(BUILD_LOG_PREVIOUS)) - # Rotate old log - $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null) - $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null) - else - $(shell $(RM) $(BUILD_LOG) 2> /dev/null) endif endif -# Remove any javac server logs and port files. This -# prevents a new make run to reuse the previous servers. -ifneq (,$(SJAVAC_SERVER_DIR)) - $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*) -endif -# Clean out any notifications from the previous build. -$(shell $(FIND) $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE)) - -# Reset the build timers. -$(eval $(call ResetTimers)) - -# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line, -# hence this workaround. -ifeq ($(JOBS),) - JOBS=$(NUM_CORES) -endif -MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS) - -### Main targets - -all: jdk - @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port) - @$(call AtRootMakeEnd) -.PHONY: all - -langtools: start-make langtools-only -langtools-only: - @$(call MakeStart,langtools,all) - @($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS)) - @$(call MakeFinish,langtools,all) - -corba: langtools corba-only -corba-only: - @$(call MakeStart,corba,all) - @($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS)) - @$(call MakeFinish,corba,all) - -jaxp: langtools jaxp-only -jaxp-only: - @$(call MakeStart,jaxp,all) - @($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS)) - @$(call MakeFinish,jaxp,all) - -jaxws: langtools jaxp jaxws-only -jaxws-only: - @$(call MakeStart,jaxws,all) - @($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS)) - @$(call MakeFinish,jaxws,all) - -hotspot: langtools hotspot-only -hotspot-only: - @$(call MakeStart,hotspot,all) - @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk) - @$(call MakeFinish,hotspot,all) - -jdk: langtools corba jaxp jaxws hotspot jdk-only -jdk-only: - @$(call MakeStart,jdk,all) - @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) $(JDK_TARGET)) - @$(call MakeFinish,jdk,all) - -images: source-tips start-make jdk langtools corba jaxp jaxws hotspot images-only -images-only: - @$(call MakeStart,jdk-images,$@) - @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) images) - @$(call MakeFinish,jdk-images,$@) - @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port) - @$(call AtRootMakeEnd) - -overlay-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot overlay-images-only -overlay-images-only: - @$(call MakeStart,jdk-overlay-images,$@) - @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) overlay-images) - @$(call MakeFinish,jdk-overlay-images,$@) - @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port) - @$(call AtRootMakeEnd) - -install: source-tips start-make jdk langtools corba jaxp jaxws hotspot install-only -install-only: - @$(call MakeStart,jdk-images,$@) - @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) install) - @$(call MakeFinish,jdk-images,$@) - @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port) - @$(call AtRootMakeEnd) - -docs: start-make jdk docs-only -docs-only: - @$(call MakeStart,docs,$@) - @($(CD) $(SRC_ROOT)/common/makefiles/javadoc && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) - @$(call MakeFinish,docs,$@) - @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port) - @$(call AtRootMakeEnd) - - -.PHONY: langtools corba jaxp jaxws hotspot jdk images install -.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only install-only - -start-make: - @$(call AtRootMakeStart) -.PHONY: start-make - -bootcycle-images: - @$(ECHO) Boot cycle build step 1: Building the JDK image normally - @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(SPEC) images) - @$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image - @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images) - -test: start-make - @$(call MakeStart,test,$(if $(TEST),$(TEST),all)) - @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) MAKEFLAGS= -j1 PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true - @$(call MakeFinish,test,$(if $(TEST),$(TEST),all)) - @$(call AtRootMakeEnd) -.PHONY: test - - -# Stores the tips for each repository. This file is be used when constructing the jdk image and can be -# used to track the exact sources used to build that image. -source-tips: $(OUTPUT_ROOT)/source_tips -$(OUTPUT_ROOT)/source_tips: FRC - @$(MKDIR) -p $(@D) - @$(RM) $@ - @$(call GetSourceTips) - - -# Remove everything, except the output from configure. -clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-bootcycle-build - @($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log*) - @$(ECHO) Cleaned everything except the build configuration. -.PHONY: clean - -# Remove everything, you have to rerun configure. -dist-clean: - @$(RM) -r $(OUTPUT_ROOT) - @$(ECHO) Cleaned everything, you will have to re-run configure. -.PHONY: dist-clean - -clean-langtools: - $(call CleanComponent,langtools) -clean-corba: - $(call CleanComponent,corba) -clean-jaxp: - $(call CleanComponent,jaxp) -clean-jaxws: - $(call CleanComponent,jaxws) -clean-hotspot: - $(call CleanComponent,hotspot) -clean-jdk: - $(call CleanComponent,jdk) -clean-images: - $(call CleanComponent,images) -clean-bootcycle-build: - $(call CleanComponent,bootcycle-build) - -.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images - -endif # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration. -# If you addd more global targets, please update the fatal-error macro. +# If you addd more global targets, please update the variable global_targets in MakeHelpers. help: $(info ) @@ -258,7 +99,7 @@ $(info . make test # Run tests, default is all tests (see TEST below)) $(info ) $(info Targets for specific components) - $(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk or images)) + $(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, images or overlay-images)) $(info . make # Build and everything it depends on. ) $(info . make -only # Build only, without dependencies. This) $(info . # is faster but can result in incorrect build results!) @@ -272,7 +113,7 @@ $(info . make LOG= # Change the log level from warn to ) $(info . # Available log levels are:) $(info . # 'warn' (default), 'info', 'debug' and 'trace') - $(info . # To see executed command lines, use LOG=info) + $(info . # To see executed command lines, use LOG=debug) $(info ) $(info . make JOBS= # Run parallel make jobs) $(info . # Note that -jN does not work as expected!) @@ -280,5 +121,11 @@ $(info . make test TEST= # Only run the given test or tests, e.g.) $(info . # make test TEST="jdk_lang jdk_net") $(info ) -.PHONY: help -FRC: # Force target + +configure: + @$(SHELL) $(root_dir)/configure $(CONFIGURE_ARGS) + @echo ==================================================== + @echo "Note: This is a non-recommended way of running configure." + @echo "Instead, run 'sh configure' in the top-level directory" + +.PHONY: help configure diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/NativeCompilation.gmk --- a/common/makefiles/NativeCompilation.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/NativeCompilation.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -32,10 +32,10 @@ endif ifeq ($(COMPILER_TYPE),CC) - COMPILING_MSG=echo Compiling $1 - LINKING_MSG=echo Linking $1 - LINKING_EXE_MSG=echo Linking executable $1 - ARCHIVING_MSG=echo Archiving $1 + COMPILING_MSG=echo $(LOG_INFO) "Compiling $(notdir $1) (for $(notdir $2))" + LINKING_MSG=echo $(LOG_INFO) "Linking $1" + LINKING_EXE_MSG=echo $(LOG_INFO) "Linking executable $1" + ARCHIVING_MSG=echo $(LOG_INFO) "Archiving $1" else COMPILING_MSG= LINKING_MSG= @@ -94,7 +94,7 @@ $$($1_$2_OBJ) : $2 ifeq ($(COMPILER_TYPE),CC) - $$(call COMPILING_MSG,$$(notdir $2)) + $$(call COMPILING_MSG,$2,$$($1_TARGET)) $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 endif ifeq ($(COMPILER_TYPE),CL) @@ -129,30 +129,8 @@ # CC the compiler to use, default is $(CC) # LDEXE the linker to use for linking executables, default is $(LDEXE) # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST - $(if $2,$1_$(strip $2)) - $(if $3,$1_$(strip $3)) - $(if $4,$1_$(strip $4)) - $(if $5,$1_$(strip $5)) - $(if $6,$1_$(strip $6)) - $(if $7,$1_$(strip $7)) - $(if $8,$1_$(strip $8)) - $(if $9,$1_$(strip $9)) - $(if $(10),$1_$(strip $(10))) - $(if $(11),$1_$(strip $(11))) - $(if $(12),$1_$(strip $(12))) - $(if $(13),$1_$(strip $(13))) - $(if $(14),$1_$(strip $(14))) - $(if $(15),$1_$(strip $(15))) - $(if $(16),$1_$(strip $(16))) - $(if $(17),$1_$(strip $(17))) - $(if $(18),$1_$(strip $(18))) - $(if $(19),$1_$(strip $(19))) - $(if $(20),$1_$(strip $(20))) - $(if $(21),$1_$(strip $(21))) - $(if $(22),$1_$(strip $(22))) - $(if $(23),$1_$(strip $(23))) - $(if $(24),$1_$(strip $(24))) - $(if $(25),$1_$(strip $(25))) + $(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)) + $(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)) $(if $(26),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) ifneq (,$$($1_BIN)) @@ -236,9 +214,9 @@ $$(error You have to specify LANG for native compilation $1) endif ifeq (C,$$($1_LANG)) - ifeq ($$($1_LDEXE),) + ifeq ($$($1_LDEXE),) $1_LDEXE:=$(LDEXE) - endif + endif $1_LD:=$(LD) else ifeq (C++,$$($1_LANG)) @@ -254,9 +232,11 @@ endif # Make sure the dirs exist. - $$(shell $(MKDIR) -p $$($1_SRC) $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR)) + $$(eval $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))) + $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d))) + # Find all files in the source trees. Sort to remove duplicates. - $1_ALL_SRCS := $$(sort $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f))) + $1_ALL_SRCS := $$(sort $$(shell $(FIND) $$($1_SRC) -type f)) # Extract the C/C++ files. $1_EXCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_EXCLUDE_FILES))) $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES))) @@ -291,7 +271,9 @@ # Are there too many object files on disk? Perhaps because some source file was removed? $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS))) # Clean out the superfluous object files. - $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS)) + ifneq ($$($1_SUPERFLUOUS_OBJS),) + $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS)) + endif # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CFLAGS. $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) @@ -358,11 +340,6 @@ $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION)) endif - # Now create a list of the packages that are about to compile. Used when sending source - # in a batch to the compiler. - $$(shell $(RM) $$($1_OBJECT_DIR)/_the.list_of_sources) - $$(eval $$(call ListPathsSafelyNow,$1_SRCS,\n, >> $$($1_OBJECT_DIR)/_the.list_of_sources)) - # Now call add_native_source for each source file we are going to compile. $$(foreach p,$$($1_SRCS),\ $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR),\ @@ -385,8 +362,6 @@ endif # mapfile doesnt seem to be implemented on macosx (yet??) - ifneq ($(OPENJDK_TARGET_CPU),ppc) - ifneq ($(OPENJDK_TARGET_CPU),arm) ifneq ($(OPENJDK_TARGET_OS),macosx) ifneq ($(OPENJDK_TARGET_OS),windows) $1_REAL_MAPFILE:=$$($1_MAPFILE) @@ -401,8 +376,6 @@ endif endif endif - endif - endif # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables # for LDFLAGS and LDFLAGS_SUFFIX @@ -445,9 +418,9 @@ $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $$< + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $$(@F) $$< + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< else # not solaris $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) $(RM) $$@ @@ -523,9 +496,9 @@ $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $$< + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $$(@F) $$< + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< else # not solaris $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) $(RM) $$@ @@ -564,7 +537,7 @@ $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \ $$($1_EXTRA_LDFLAGS_SUFFIX) ifneq (,$$($1_GEN_MANIFEST)) - $(MT) -nologo /manifest $$($1_GEN_MANIFEST) /outputresource:$$@;#1 + $(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1 endif endif diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/RMICompilation.gmk --- a/common/makefiles/RMICompilation.gmk Wed Jul 05 18:26:51 2017 +0200 +++ b/common/makefiles/RMICompilation.gmk Fri Oct 26 14:29:57 2012 -0700 @@ -34,16 +34,9 @@ # RUN_IIOP:=Set to run rmic with -iiop # RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage # KEEP_GENERATED:=Set to keep generated sources around - $(if $2,$1_$(strip $2)) - $(if $3,$1_$(strip $3)) - $(if $4,$1_$(strip $4)) - $(if $5,$1_$(strip $5)) - $(if $6,$1_$(strip $6)) - $(if $7,$1_$(strip $7)) - $(if $8,$1_$(strip $8)) - $(if $9,$1_$(strip $9)) - $(if $(10),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk)) - + $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) + $(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) + $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk)) $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/$1_rmic @@ -86,12 +79,12 @@ $$($1_DEP_FILE): $$($1_CLASS_FILES) $(MKDIR) -p $$($1_STUB_CLASSES_DIR) if [ "x$$($1_ARGS)" != "x" ]; then \ - $(ECHO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) &&\ + $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) &&\ $(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \ -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\ fi; if [ "x$$($1_ARGS2)" != "x" ]; then \ - $(ECHO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) &&\ + $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) &&\ $(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \ -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\ fi; diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/compress.post --- a/common/makefiles/compress.post Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ No newline at end of file diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/compress.pre --- a/common/makefiles/compress.pre Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -$(subst com,X01,$(subst org,X02,$(subst sun,X03,$(subst java,X04,$(subst javax,X05,$(subst sun/io,X06,$(subst com/sun,X07,$(subst java/io,X08,$(subst org/omg,X09,$(subst org/w3c,X10,$(subst org/xml,X11,$(subst sun/awt,X12,$(subst sun/net,X13,$(subst sun/nio,X14,$(subst sun/rmi,X15,$(subst java/awt,X16,$(subst java/net,X17,$(subst java/nio,X18,$(subst java/rmi,X19,$(subst META-INF,X20,$(subst sun/font,X21,$(subst sun/misc,X22,$(subst sun/text,X23,$(subst sun/util,X24,$(subst java/lang,X25,$(subst java/math,X26,$(subst java/text,X27,$(subst java/util,X28,$(subst javax/jws,X29,$(subst javax/net,X30,$(subst javax/rmi,X31,$(subst javax/xml,X32,$(subst sun/corba,X33,$(subst sun/print,X34,$(subst sun/swing,X35,$(subst java/beans,X36,$(subst javax/lang,X37,$(subst sun/applet,X38,$(subst sun/java2d,X39,$(subst java/applet,X40,$(subst javax/print,X41,$(subst javax/sound,X42,$(subst javax/swing,X43,$(subst javax/tools,X44,$(subst jdk/classes,X45,$(subst org/relaxng,X46,$(subst sun/reflect,X47,$(subst javax/crypto,X48,$(subst javax/naming,X49,$(subst jaxp/classes,X50,$(subst sun/security,X51,$(subst corba/classes,X52,$(subst java/security,X53,$(subst javax/imageio,X54,$(subst jdk/btclasses,X55,$(subst javax/activity,X56,$(subst javax/security,X57,$(subst jdk/newclasses,X58,$(subst sun/instrument,X59,$(subst sun/management,X60,$(subst corba/btclasses,X61,$(subst jdk/democlasses,X62,$(subst javax/activation,X63,$(subst javax/annotation,X64,$(subst javax/management,X65,$(subst javax/transaction,X66,$(subst jaxws/jaf_classes,X67,$(subst langtools/classes,X68,$(subst META-INF/services,X69,$(subst jdk/newdemoclasses,X70,$(subst javax/accessibility,X71,$(subst jaxws/jaxws_classes,X72, \ No newline at end of file diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/support/ListPathsSafely-post-compress.incl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/makefiles/support/ListPathsSafely-post-compress.incl Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,1 @@ +)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/support/ListPathsSafely-pre-compress.incl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/makefiles/support/ListPathsSafely-pre-compress.incl Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,1 @@ +$(subst com,X01,$(subst org,X02,$(subst sun,X03,$(subst java,X04,$(subst javax,X05,$(subst sun/io,X06,$(subst com/sun,X07,$(subst java/io,X08,$(subst org/omg,X09,$(subst org/w3c,X10,$(subst org/xml,X11,$(subst sun/awt,X12,$(subst sun/net,X13,$(subst sun/nio,X14,$(subst sun/rmi,X15,$(subst java/awt,X16,$(subst java/net,X17,$(subst java/nio,X18,$(subst java/rmi,X19,$(subst META-INF,X20,$(subst sun/font,X21,$(subst sun/misc,X22,$(subst sun/text,X23,$(subst sun/util,X24,$(subst java/lang,X25,$(subst java/math,X26,$(subst java/text,X27,$(subst java/util,X28,$(subst javax/jws,X29,$(subst javax/net,X30,$(subst javax/rmi,X31,$(subst javax/xml,X32,$(subst sun/corba,X33,$(subst sun/print,X34,$(subst sun/swing,X35,$(subst java/beans,X36,$(subst javax/lang,X37,$(subst sun/applet,X38,$(subst sun/java2d,X39,$(subst java/applet,X40,$(subst javax/print,X41,$(subst javax/sound,X42,$(subst javax/swing,X43,$(subst javax/tools,X44,$(subst jdk/classes,X45,$(subst org/relaxng,X46,$(subst sun/reflect,X47,$(subst javax/crypto,X48,$(subst javax/naming,X49,$(subst jaxp/classes,X50,$(subst sun/security,X51,$(subst corba/classes,X52,$(subst java/security,X53,$(subst javax/imageio,X54,$(subst jdk/btclasses,X55,$(subst javax/activity,X56,$(subst javax/security,X57,$(subst jdk/newclasses,X58,$(subst sun/instrument,X59,$(subst sun/management,X60,$(subst corba/btclasses,X61,$(subst jdk/democlasses,X62,$(subst javax/activation,X63,$(subst javax/annotation,X64,$(subst javax/management,X65,$(subst javax/transaction,X66,$(subst jaxws/jaf_classes,X67,$(subst langtools/classes,X68,$(subst META-INF/services,X69,$(subst jdk/newdemoclasses,X70,$(subst javax/accessibility,X71,$(subst jaxws/jaxws_classes,X72, diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/support/ListPathsSafely-uncompress.sed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/makefiles/support/ListPathsSafely-uncompress.sed Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,72 @@ +s|X01|com|g +s|X02|org|g +s|X03|sun|g +s|X04|java|g +s|X05|javax|g +s|X06|sun/io|g +s|X07|com/sun|g +s|X08|java/io|g +s|X09|org/omg|g +s|X10|org/w3c|g +s|X11|org/xml|g +s|X12|sun/awt|g +s|X13|sun/net|g +s|X14|sun/nio|g +s|X15|sun/rmi|g +s|X16|java/awt|g +s|X17|java/net|g +s|X18|java/nio|g +s|X19|java/rmi|g +s|X20|META-INF|g +s|X21|sun/font|g +s|X22|sun/misc|g +s|X23|sun/text|g +s|X24|sun/util|g +s|X25|java/lang|g +s|X26|java/math|g +s|X27|java/text|g +s|X28|java/util|g +s|X29|javax/jws|g +s|X30|javax/net|g +s|X31|javax/rmi|g +s|X32|javax/xml|g +s|X33|sun/corba|g +s|X34|sun/print|g +s|X35|sun/swing|g +s|X36|java/beans|g +s|X37|javax/lang|g +s|X38|sun/applet|g +s|X39|sun/java2d|g +s|X40|java/applet|g +s|X41|javax/print|g +s|X42|javax/sound|g +s|X43|javax/swing|g +s|X44|javax/tools|g +s|X45|jdk/classes|g +s|X46|org/relaxng|g +s|X47|sun/reflect|g +s|X48|javax/crypto|g +s|X49|javax/naming|g +s|X50|jaxp/classes|g +s|X51|sun/security|g +s|X52|corba/classes|g +s|X53|java/security|g +s|X54|javax/imageio|g +s|X55|jdk/btclasses|g +s|X56|javax/activity|g +s|X57|javax/security|g +s|X58|jdk/newclasses|g +s|X59|sun/instrument|g +s|X60|sun/management|g +s|X61|corba/btclasses|g +s|X62|jdk/democlasses|g +s|X63|javax/activation|g +s|X64|javax/annotation|g +s|X65|javax/management|g +s|X66|javax/transaction|g +s|X67|jaxws/jaf_classes|g +s|X68|langtools/classes|g +s|X69|META-INF/services|g +s|X70|jdk/newdemoclasses|g +s|X71|javax/accessibility|g +s|X72|jaxws/jaxws_classes|g diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/support/unicode2x.sed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/makefiles/support/unicode2x.sed Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,100 @@ +s/\\u0020/\x20/g +s/\\u003A/\x3A/g +s/\\u006B/\x6B/g +s/\\u0075/\x75/g +s/\\u00A0/\xA0/g +s/\\u00A3/\xA3/g +s/\\u00B0/\xB0/g +s/\\u00B7/\xB7/g +s/\\u00BA/\xBA/g +s/\\u00BF/\xBF/g +s/\\u00C0/\xC0/g +s/\\u00C1/\xC1/g +s/\\u00C2/\xC2/g +s/\\u00C4/\xC4/g +s/\\u00C5/\xC5/g +s/\\u00C8/\xC8/g +s/\\u00C9/\xC9/g +s/\\u00CA/\xCA/g +s/\\u00CD/\xCD/g +s/\\u00CE/\xCE/g +s/\\u00D3/\xD3/g +s/\\u00D4/\xD4/g +s/\\u00D6/\xD6/g +s/\\u00DA/\xDA/g +s/\\u00DC/\xDC/g +s/\\u00DD/\xDD/g +s/\\u00DF/\xDF/g +s/\\u00E0/\xE0/g +s/\\u00E1/\xE1/g +s/\\u00E2/\xE2/g +s/\\u00E3/\xE3/g +s/\\u00E4/\xE4/g +s/\\u00E5/\xE5/g +s/\\u00E6/\xE6/g +s/\\u00E7/\xE7/g +s/\\u00E8/\xE8/g +s/\\u00E9/\xE9/g +s/\\u00EA/\xEA/g +s/\\u00EB/\xEB/g +s/\\u00EC/\xEC/g +s/\\u00ED/\xED/g +s/\\u00EE/\xEE/g +s/\\u00EF/\xEF/g +s/\\u00F1/\xF1/g +s/\\u00F2/\xF2/g +s/\\u00F3/\xF3/g +s/\\u00F4/\xF4/g +s/\\u00F5/\xF5/g +s/\\u00F6/\xF6/g +s/\\u00F9/\xF9/g +s/\\u00FA/\xFA/g +s/\\u00FC/\xFC/g +s/\\u0020/\x20/g +s/\\u003f/\x3f/g +s/\\u006f/\x6f/g +s/\\u0075/\x75/g +s/\\u00a0/\xa0/g +s/\\u00a3/\xa3/g +s/\\u00b0/\xb0/g +s/\\u00ba/\xba/g +s/\\u00bf/\xbf/g +s/\\u00c1/\xc1/g +s/\\u00c4/\xc4/g +s/\\u00c5/\xc5/g +s/\\u00c8/\xc8/g +s/\\u00c9/\xc9/g +s/\\u00ca/\xca/g +s/\\u00cd/\xcd/g +s/\\u00d6/\xd6/g +s/\\u00dc/\xdc/g +s/\\u00dd/\xdd/g +s/\\u00df/\xdf/g +s/\\u00e0/\xe0/g +s/\\u00e1/\xe1/g +s/\\u00e2/\xe2/g +s/\\u00e3/\xe3/g +s/\\u00e4/\xe4/g +s/\\u00e5/\xe5/g +s/\\u00e7/\xe7/g +s/\\u00e8/\xe8/g +s/\\u00e9/\xe9/g +s/\\u00ea/\xea/g +s/\\u00eb/\xeb/g +s/\\u00ec/\xec/g +s/\\u00ed/\xed/g +s/\\u00ee/\xee/g +s/\\u00ef/\xef/g +s/\\u00f0/\xf0/g +s/\\u00f1/\xf1/g +s/\\u00f2/\xf2/g +s/\\u00f3/\xf3/g +s/\\u00f4/\xf4/g +s/\\u00f5/\xf5/g +s/\\u00f6/\xf6/g +s/\\u00f7/\xf7/g +s/\\u00f8/\xf8/g +s/\\u00f9/\xf9/g +s/\\u00fa/\xfa/g +s/\\u00fc/\xfc/g +s/\\u00ff/\xff/g diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/makefiles/uncompress.sed --- a/common/makefiles/uncompress.sed Wed Jul 05 18:26:51 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -s|X01|com|g -s|X02|org|g -s|X03|sun|g -s|X04|java|g -s|X05|javax|g -s|X06|sun/io|g -s|X07|com/sun|g -s|X08|java/io|g -s|X09|org/omg|g -s|X10|org/w3c|g -s|X11|org/xml|g -s|X12|sun/awt|g -s|X13|sun/net|g -s|X14|sun/nio|g -s|X15|sun/rmi|g -s|X16|java/awt|g -s|X17|java/net|g -s|X18|java/nio|g -s|X19|java/rmi|g -s|X20|META-INF|g -s|X21|sun/font|g -s|X22|sun/misc|g -s|X23|sun/text|g -s|X24|sun/util|g -s|X25|java/lang|g -s|X26|java/math|g -s|X27|java/text|g -s|X28|java/util|g -s|X29|javax/jws|g -s|X30|javax/net|g -s|X31|javax/rmi|g -s|X32|javax/xml|g -s|X33|sun/corba|g -s|X34|sun/print|g -s|X35|sun/swing|g -s|X36|java/beans|g -s|X37|javax/lang|g -s|X38|sun/applet|g -s|X39|sun/java2d|g -s|X40|java/applet|g -s|X41|javax/print|g -s|X42|javax/sound|g -s|X43|javax/swing|g -s|X44|javax/tools|g -s|X45|jdk/classes|g -s|X46|org/relaxng|g -s|X47|sun/reflect|g -s|X48|javax/crypto|g -s|X49|javax/naming|g -s|X50|jaxp/classes|g -s|X51|sun/security|g -s|X52|corba/classes|g -s|X53|java/security|g -s|X54|javax/imageio|g -s|X55|jdk/btclasses|g -s|X56|javax/activity|g -s|X57|javax/security|g -s|X58|jdk/newclasses|g -s|X59|sun/instrument|g -s|X60|sun/management|g -s|X61|corba/btclasses|g -s|X62|jdk/democlasses|g -s|X63|javax/activation|g -s|X64|javax/annotation|g -s|X65|javax/management|g -s|X66|javax/transaction|g -s|X67|jaxws/jaf_classes|g -s|X68|langtools/classes|g -s|X69|META-INF/services|g -s|X70|jdk/newdemoclasses|g -s|X71|javax/accessibility|g -s|X72|jaxws/jaxws_classes|g diff -r 8d9d430b4244 -r 2a82ecb35fc7 common/src/fixpath.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/src/fixpath.c Fri Oct 26 14:29:57 2012 -0700 @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include +#include +#include +#include + +/* + * Test if pos points to /cygdrive/_/ where _ can + * be any character. + */ +int is_cygdrive_here(int pos, char *in, int len) +{ + // Length of /cygdrive/c/ is 12 + if (pos+12 > len) return 0; + if (in[pos+11]=='/' && + in[pos+9]=='/' && + in[pos+8]=='e' && + in[pos+7]=='v' && + in[pos+6]=='i' && + in[pos+5]=='r' && + in[pos+4]=='d' && + in[pos+3]=='g' && + in[pos+2]=='y' && + in[pos+1]=='c' && + in[pos+0]=='/') { + return 1; + } + return 0; +} + +/* + * Replace /cygdrive/_/ with _:/ + * Works in place since drive letter is always + * shorter than /cygdrive/ + */ +char *replace_cygdrive_cygwin(char *in) +{ + int len = strlen(in); + char *out = malloc(len+1); + int i,j; + + if (len < 12) { + strcpy(out, in); + return out; + } + for (i = 0, j = 0; i *bl) { + *bl *= 2; + *b = realloc(*b, *bl); + } + memcpy(*b+*u, add, addlen); + *u += addlen; +} + +/* + * Creates a new string from in where the first occurance of sub is + * replaced by rep. + */ +char *replace_substring(char *in, char *sub, char *rep) +{ + int in_len = strlen(in); + int sub_len = strlen(sub); + int rep_len = strlen(rep); + char *out = malloc(in_len - sub_len + rep_len + 1); + char *p; + + if (!(p = strstr(in, sub))) { + // If sub isn't a substring of in, just return in. + return in; + } + + // Copy characters from beginning of in to start of sub. + strncpy(out, in, p - in); + out[p - in] = '\0'; + + sprintf(out + (p - in), "%s%s", rep, p + sub_len); + + return out; +} + +char* msys_path_list; // @-separated list of paths prefix to look for +char* msys_path_list_end; // Points to last \0 in msys_path_list. + +void setup_msys_path_list(char* argument) +{ + char* p; + char* drive_letter_pos; + + msys_path_list = strdup(&argument[2]); + msys_path_list_end = &msys_path_list[strlen(msys_path_list)]; + + // Convert all at-sign (@) in path list to \0. + // @ was chosen as separator to minimize risk of other tools messing around with it + p = msys_path_list; + do { + if (p[1] == ':') { + // msys has mangled our path list, restore it from c:/... to /c/... + drive_letter_pos = p+1; + *drive_letter_pos = *p; + *p = '/'; + } + + // Look for an @ in the list + p = strchr(p, '@'); + if (p != NULL) { + *p = '\0'; + p++; + } + } while (p != NULL); +} + +char *replace_cygdrive_msys(char *in) +{ + char* str; + char* prefix; + char* p; + + str = strdup(in); + + // For each prefix in the path list, search for it and replace /c/... with c:/... + for (prefix = msys_path_list; prefix < msys_path_list_end && prefix != NULL; prefix += strlen(prefix)+1) { + p=str; + while ((p = strstr(p, prefix))) { + char* drive_letter = p+1; + *p = *drive_letter; + *drive_letter = ':'; + p++; + } + } + + return str; +} + +char*(*replace_cygdrive)(char *in) = NULL; + +char *files_to_delete[1024]; +int num_files_to_delete = 0; + +char *fix_at_file(char *in) +{ + char *tmpdir; + char name[2048]; + char *atname; + char *buffer; + size_t buflen=65536; + size_t used=0; + size_t len; + int rc; + FILE *atout; + FILE *atin; + char block[2048]; + size_t blocklen; + char *fixed; + + atin = fopen(in+1, "r"); + if (atin == NULL) { + fprintf(stderr, "Could not read at file %s\n", in+1); + exit(-1); + } + + tmpdir = getenv("TMP"); + if (tmpdir == NULL) { + tmpdir = "c:/cygwin/tmp"; + } + _snprintf(name, sizeof(name), "%s\\atfile_XXXXXX", tmpdir); + + rc = _mktemp_s(name, strlen(name)+1); + if (rc) { + fprintf(stderr, "Could not create temporary file name for at file!\n"); + exit(-1); + } + + atout = fopen(name, "w"); + if (atout == NULL) { + fprintf(stderr, "Could not open temporary file for writing! %s\n", name); + exit(-1); + } + + buffer = malloc(buflen); + while((blocklen = fread(block,1,sizeof(block),atin)) > 0) { + append(&buffer, &buflen, &used, block, blocklen); + } + buffer[used] = 0; + if (getenv("DEBUG_FIXPATH") != NULL) { + fprintf(stderr, "fixpath input from @-file %s: %s\n", &in[1], buffer); + } + fixed = replace_cygdrive(buffer); + if (getenv("DEBUG_FIXPATH") != NULL) { + fprintf(stderr, "fixpath converted to @-file %s is: %s\n", name, fixed); + } + fwrite(fixed, strlen(fixed), 1, atout); + fclose(atin); + fclose(atout); + free(fixed); + free(buffer); + files_to_delete[num_files_to_delete] = malloc(strlen(name)+1); + strcpy(files_to_delete[num_files_to_delete], name); + num_files_to_delete++; + atname = malloc(strlen(name)+2); + atname[0] = '@'; + strcpy(atname+1, name); + return atname; +} + +int main(int argc, char **argv) +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + unsigned short rc; + + char *new_at_file; + char *old_at_file; + char *line; + int i; + DWORD exitCode; + + if (argc<3 || argv[1][0] != '-' || (argv[1][1] != 'c' && argv[1][1] != 'm')) { + fprintf(stderr, "Usage: fixpath -c|m /cygdrive/c/WINDOWS/notepad.exe /cygdrive/c/x/test.txt"); + exit(0); + } + + if (getenv("DEBUG_FIXPATH") != NULL) { + fprintf(stderr, "fixpath input line >%s<\n", strstr(GetCommandLine(), argv[1])); + } + + if (argv[1][1] == 'c' && argv[1][2] == '\0') { + if (getenv("DEBUG_FIXPATH") != NULL) { + fprintf(stderr, "using cygwin mode\n"); + } + replace_cygdrive = replace_cygdrive_cygwin; + } else if (argv[1][1] == 'm') { + if (getenv("DEBUG_FIXPATH") != NULL) { + fprintf(stderr, "using msys mode, with path list: %s\n", &argv[1][2]); + } + setup_msys_path_list(argv[1]); + replace_cygdrive = replace_cygdrive_msys; + } else { + fprintf(stderr, "Unknown mode: %s\n", argv[1]); + exit(-1); + } + line = replace_cygdrive(strstr(GetCommandLine(), argv[2])); + + for (i=1; i%s<\n", line); + } + + ZeroMemory(&si,sizeof(si)); + si.cb=sizeof(si); + ZeroMemory(&pi,sizeof(pi)); + + rc = CreateProcess(NULL, + line, + 0, + 0, + TRUE, + 0, + 0, + 0, + &si, + &pi); + if(!rc) + { + //Could not start process; + fprintf(stderr, "Could not start process!\n"); + exit(-1); + } + + WaitForSingleObject(pi.hProcess,INFINITE); + GetExitCodeProcess(pi.hProcess,&exitCode); + + if (getenv("DEBUG_FIXPATH") != NULL) { + for (i=0; i -#include -#include -#include -#include - -/* - * Test if pos points to /cygdrive/_/ where _ can - * be any character. - */ -int is_cygdrive_here(int pos, char *in, int len) -{ - // Length of /cygdrive/c/ is 12 - if (pos+12 > len) return 0; - if (in[pos+11]=='/' && - in[pos+9]=='/' && - in[pos+8]=='e' && - in[pos+7]=='v' && - in[pos+6]=='i' && - in[pos+5]=='r' && - in[pos+4]=='d' && - in[pos+3]=='g' && - in[pos+2]=='y' && - in[pos+1]=='c' && - in[pos+0]=='/') { - return 1; - } - return 0; -} - -/* - * Replace /cygdrive/_/ with _:/ - * Works in place since drive letter is always - * shorter than /cygdrive/ - */ -char *replace_cygdrive(char *in) -{ - int len = strlen(in); - char *out = malloc(len+1); - int i,j; - - if (len < 12) { - strcpy(out, in); - return out; - } - for (i = 0, j = 0; i *bl) { - *bl *= 2; - *b = realloc(*b, *bl); - } - memcpy(*b+*u, add, addlen); - *u += addlen; -} - -/* - * Creates a new string from in where the first occurance of sub is - * replaced by rep. - */ -char *replace_substring(char *in, char *sub, char *rep) -{ - int in_len = strlen(in); - int sub_len = strlen(sub); - int rep_len = strlen(rep); - char *out = malloc(in_len - sub_len + rep_len + 1); - char *p; - - if (!(p = strstr(in, sub))) { - // If sub isn't a substring of in, just return in. - return in; - } - - // Copy characters from beginning of in to start of sub. - strncpy(out, in, p - in); - out[p - in] = '\0'; - - sprintf(out + (p - in), "%s%s", rep, p + sub_len); - - return out; -} - -char *files_to_delete[1024]; -int num_files_to_delete = 0; - -char *fix_at_file(char *in) -{ - char *tmpdir; - char name[2048]; - char *atname; - char *buffer; - size_t buflen=65536; - size_t used=0; - size_t len; - int rc; - FILE *atout; - FILE *atin; - char block[2048]; - size_t blocklen; - char *fixed; - - atin = fopen(in+1, "r"); - if (atin == NULL) { - fprintf(stderr, "Could not read at file %s\n", in+1); - exit(-1); - } - - tmpdir = getenv("TMP"); - if (tmpdir == NULL) { - tmpdir = "c:/cygwin/tmp"; - } - _snprintf(name, sizeof(name), "%s\\atfile_XXXXXX", tmpdir); - - rc = _mktemp_s(name, strlen(name)+1); - if (rc) { - fprintf(stderr, "Could not create temporary file name for at file!\n"); - exit(-1); - } - - atout = fopen(name, "w"); - if (atout == NULL) { - fprintf(stderr, "Could open temporary file for writing! %s\n", name); - exit(-1); - } - - buffer = malloc(buflen); - while((blocklen = fread(block,1,sizeof(block),atin)) > 0) { - append(&buffer, &buflen, &used, block, blocklen); - } - buffer[used] = 0; - fixed = replace_cygdrive(buffer); - fwrite(fixed, strlen(fixed), 1, atout); - fclose(atin); - fclose(atout); - free(fixed); - free(buffer); - files_to_delete[num_files_to_delete] = malloc(strlen(name)+1); - strcpy(files_to_delete[num_files_to_delete], name); - num_files_to_delete++; - atname = malloc(strlen(name)+2); - atname[0] = '@'; - strcpy(atname+1, name); - return atname; -} - -int main(int argc, char **argv) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - unsigned short rc; - - char *new_at_file; - char *old_at_file; - char *line; - int i; - DWORD exitCode; - - if (argc<2) { - fprintf(stderr, "Usage: uncygdrive.exe /cygdrive/c/WINDOWS/notepad.exe /cygdrive/c/x/test.txt"); - exit(0); - } - - line = replace_cygdrive(strstr(GetCommandLine(), argv[1])); - - for (i=1; i%s<\n", line); - } - - ZeroMemory(&si,sizeof(si)); - si.cb=sizeof(si); - ZeroMemory(&pi,sizeof(pi)); - - rc = CreateProcess(NULL, - line, - 0, - 0, - TRUE, - 0, - 0, - 0, - &si, - &pi); - if(!rc) - { - //Could not start process; - fprintf(stderr, "Could not start process!\n"); - exit(-1); - } - - WaitForSingleObject(pi.hProcess,INFINITE); - GetExitCodeProcess(pi.hProcess,&exitCode); - - if (getenv("DEBUG_UNCYGDRIVE") != NULL) { - for (i=0; i