8015510: (s) Improve JTReg location detection and provide location to test/Makefile

Tue, 04 Jun 2013 10:36:00 +0200

author
mduigou
date
Tue, 04 Jun 2013 10:36:00 +0200
changeset 728
db3144e1f89b
parent 727
44259699e0b5
child 729
9b8e8098172c

8015510: (s) Improve JTReg location detection and provide location to test/Makefile
Reviewed-by: erikj

common/autoconf/generated-configure.sh file | annotate | diff | comparison | revisions
common/autoconf/toolchain.m4 file | annotate | diff | comparison | revisions
common/makefiles/Main.gmk file | annotate | diff | comparison | revisions
     1.1 --- a/common/autoconf/generated-configure.sh	Tue Jun 04 10:23:37 2013 +0200
     1.2 +++ b/common/autoconf/generated-configure.sh	Tue Jun 04 10:36:00 2013 +0200
     1.3 @@ -681,8 +681,8 @@
     1.4  SHARED_LIBRARY
     1.5  OBJ_SUFFIX
     1.6  COMPILER_NAME
     1.7 +JT_HOME
     1.8  JTREGEXE
     1.9 -JT_HOME
    1.10  LIPO
    1.11  ac_ct_OBJDUMP
    1.12  OBJDUMP
    1.13 @@ -3782,7 +3782,7 @@
    1.14  #CUSTOM_AUTOCONF_INCLUDE
    1.15  
    1.16  # Do not change or remove the following line, it is needed for consistency checks:
    1.17 -DATE_WHEN_GENERATED=1370333982
    1.18 +DATE_WHEN_GENERATED=1370334570
    1.19  
    1.20  ###############################################################################
    1.21  #
    1.22 @@ -16177,14 +16177,28 @@
    1.23  # Check whether --with-jtreg was given.
    1.24  if test "${with_jtreg+set}" = set; then :
    1.25    withval=$with_jtreg;
    1.26 -fi
    1.27 -
    1.28 -
    1.29 -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTReg Regression Test Harness" >&5
    1.30 -$as_echo_n "checking for JTReg Regression Test Harness... " >&6; }
    1.31 -
    1.32 -  if test "x$with_jtreg" != x; then
    1.33 -    JT_HOME="$with_jtreg"
    1.34 +else
    1.35 +  with_jtreg=no
    1.36 +fi
    1.37 +
    1.38 +
    1.39 +  if test "x$with_jtreg" = xno; then
    1.40 +    # jtreg disabled
    1.41 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5
    1.42 +$as_echo_n "checking for jtreg... " >&6; }
    1.43 +    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    1.44 +$as_echo "no" >&6; }
    1.45 +  else
    1.46 +    if test "x$with_jtreg" != xyes; then
    1.47 +      # with path specified.
    1.48 +      JT_HOME="$with_jtreg"
    1.49 +    fi
    1.50 +
    1.51 +    if test "x$JT_HOME" != x; then
    1.52 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5
    1.53 +$as_echo_n "checking for jtreg... " >&6; }
    1.54 +
    1.55 +      # use JT_HOME enviroment var.
    1.56  
    1.57    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    1.58  
    1.59 @@ -16307,17 +16321,79 @@
    1.60      JT_HOME="`cd "$path"; $THEPWDCMD -L`"
    1.61    fi
    1.62  
    1.63 -    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5
    1.64 -$as_echo "$JT_HOME" >&6; }
    1.65 -
    1.66 -    # jtreg win32 script works for everybody
    1.67 -    JTREGEXE="$JT_HOME/win32/bin/jtreg"
    1.68 -    if test ! -f "$JTREGEXE"; then
    1.69 -      as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
    1.70 -    fi
    1.71 -  else
    1.72 -    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    1.73 -$as_echo "no" >&6; }
    1.74 +
    1.75 +      # jtreg win32 script works for everybody
    1.76 +      JTREGEXE="$JT_HOME/win32/bin/jtreg"
    1.77 +
    1.78 +      if test ! -f "$JTREGEXE"; then
    1.79 +        as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
    1.80 +      fi
    1.81 +
    1.82 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5
    1.83 +$as_echo "$JTREGEXE" >&6; }
    1.84 +    else
    1.85 +      # try to find jtreg on path
    1.86 +
    1.87 +    for ac_prog in jtreg
    1.88 +do
    1.89 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
    1.90 +set dummy $ac_prog; ac_word=$2
    1.91 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
    1.92 +$as_echo_n "checking for $ac_word... " >&6; }
    1.93 +if test "${ac_cv_path_JTREGEXE+set}" = set; then :
    1.94 +  $as_echo_n "(cached) " >&6
    1.95 +else
    1.96 +  case $JTREGEXE in
    1.97 +  [\\/]* | ?:[\\/]*)
    1.98 +  ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path.
    1.99 +  ;;
   1.100 +  *)
   1.101 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1.102 +for as_dir in $PATH
   1.103 +do
   1.104 +  IFS=$as_save_IFS
   1.105 +  test -z "$as_dir" && as_dir=.
   1.106 +    for ac_exec_ext in '' $ac_executable_extensions; do
   1.107 +  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
   1.108 +    ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext"
   1.109 +    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
   1.110 +    break 2
   1.111 +  fi
   1.112 +done
   1.113 +  done
   1.114 +IFS=$as_save_IFS
   1.115 +
   1.116 +  ;;
   1.117 +esac
   1.118 +fi
   1.119 +JTREGEXE=$ac_cv_path_JTREGEXE
   1.120 +if test -n "$JTREGEXE"; then
   1.121 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5
   1.122 +$as_echo "$JTREGEXE" >&6; }
   1.123 +else
   1.124 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   1.125 +$as_echo "no" >&6; }
   1.126 +fi
   1.127 +
   1.128 +
   1.129 +  test -n "$JTREGEXE" && break
   1.130 +done
   1.131 +
   1.132 +
   1.133 +    if test "x$JTREGEXE" = x; then
   1.134 +        if test "xjtreg" = x; then
   1.135 +          PROG_NAME=jtregexe
   1.136 +        else
   1.137 +          PROG_NAME=jtreg
   1.138 +        fi
   1.139 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
   1.140 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
   1.141 +        as_fn_error $? "Cannot continue" "$LINENO" 5
   1.142 +    fi
   1.143 +
   1.144 +
   1.145 +      JT_HOME="`$DIRNAME $JTREGEXE`"
   1.146 +    fi
   1.147    fi
   1.148  
   1.149  
     2.1 --- a/common/autoconf/toolchain.m4	Tue Jun 04 10:23:37 2013 +0200
     2.2 +++ b/common/autoconf/toolchain.m4	Tue Jun 04 10:36:00 2013 +0200
     2.3 @@ -36,7 +36,7 @@
     2.4      $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
     2.5      if test $? -ne 0; then
     2.6        GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
     2.7 -      
     2.8 +
     2.9        AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler.])
    2.10        AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_TEST" and with --version: "$GCC_VERSION_TEST"])
    2.11        AC_MSG_ERROR([Sun Studio compiler is required. Try setting --with-tools-dir.])
    2.12 @@ -69,7 +69,7 @@
    2.13        AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"])
    2.14        AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.])
    2.15      fi
    2.16 -    
    2.17 +
    2.18      # First line typically looks something like:
    2.19      # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
    2.20      COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/p"`
    2.21 @@ -142,7 +142,7 @@
    2.22    BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER)
    2.23    AC_MSG_RESULT([$TEST_COMPILER])
    2.24    AC_MSG_CHECKING([if $1 is disguised ccache])
    2.25 -  
    2.26 +
    2.27    COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
    2.28    if test "x$COMPILER_BASENAME" = "xccache"; then
    2.29      AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler])
    2.30 @@ -226,11 +226,11 @@
    2.31                      ],
    2.32                      [])
    2.33  
    2.34 -if test "x$SYS_ROOT" != "x/" ; then                    
    2.35 +if test "x$SYS_ROOT" != "x/" ; then
    2.36      CFLAGS="--sysroot=$SYS_ROOT $CFLAGS"
    2.37      CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS"
    2.38 -    OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" 
    2.39 -    OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS" 
    2.40 +    OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
    2.41 +    OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
    2.42      CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS"
    2.43      LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS"
    2.44  fi
    2.45 @@ -330,7 +330,7 @@
    2.46  COMPILER_NAME=gcc
    2.47  COMPILER_TYPE=CC
    2.48  AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [
    2.49 -    # For now, assume that we are always compiling using cl.exe. 
    2.50 +    # For now, assume that we are always compiling using cl.exe.
    2.51      CC_OUT_OPTION=-Fo
    2.52      EXE_OUT_OPTION=-out:
    2.53      LD_OUT_OPTION=-out:
    2.54 @@ -491,7 +491,7 @@
    2.55  
    2.56  ###############################################################################
    2.57  #
    2.58 -# How to compile shared libraries. 
    2.59 +# How to compile shared libraries.
    2.60  #
    2.61  
    2.62  if test "x$GCC" = xyes; then
    2.63 @@ -525,7 +525,7 @@
    2.64          SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
    2.65          SHARED_LIBRARY_SUFFIX='.dylib'
    2.66          EXE_SUFFIX=''
    2.67 -        SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' 
    2.68 +        SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
    2.69          SET_SHARED_LIBRARY_MAPFILE=''
    2.70          SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
    2.71          SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
    2.72 @@ -676,7 +676,7 @@
    2.73          # Use single precision floating point with 'float'
    2.74          CC_HIGHEST="$CC_HIGHEST -fsingle"
    2.75          # Assume memory references via basic pointer types do not alias
    2.76 -        #   (Source with excessing pointer casting and data access with mixed 
    2.77 +        #   (Source with excessing pointer casting and data access with mixed
    2.78          #    pointer types are not recommended)
    2.79          CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
    2.80          # Use intrinsic or inline versions for math/std functions
    2.81 @@ -892,7 +892,7 @@
    2.82  fi
    2.83  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
    2.84      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
    2.85 -    # Setting these parameters makes it an error to link to macosx APIs that are 
    2.86 +    # Setting these parameters makes it an error to link to macosx APIs that are
    2.87      # newer than the given OS version and makes the linked binaries compatible even
    2.88      # if built on a newer version of the OS.
    2.89      # The expected format is X.Y.Z
    2.90 @@ -940,12 +940,12 @@
    2.91  # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
    2.92  # is identical for client and server? Yes. Which is picked at runtime (client or server)?
    2.93  # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
    2.94 -# libraries will link to whatever is in memory. Yuck. 
    2.95 +# libraries will link to whatever is in memory. Yuck.
    2.96  #
    2.97  # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
    2.98  if test "x$COMPILER_NAME" = xcl; then
    2.99      LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
   2.100 -    if test "x$OPENJDK_TARGET_CPU" = xx86; then 
   2.101 +    if test "x$OPENJDK_TARGET_CPU" = xx86; then
   2.102          LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
   2.103      fi
   2.104      # TODO: make -debug optional "--disable-full-debug-symbols"
   2.105 @@ -965,7 +965,7 @@
   2.106          if test -n "$HAS_GNU_HASH"; then
   2.107              LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
   2.108          fi
   2.109 -        if test "x$OPENJDK_TARGET_OS" = xlinux; then 
   2.110 +        if test "x$OPENJDK_TARGET_OS" = xlinux; then
   2.111            # And since we now know that the linker is gnu, then add -z defs, to forbid
   2.112            # undefined symbols in object files.
   2.113            LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
   2.114 @@ -1006,7 +1006,7 @@
   2.115  
   2.116  # Adjust flags according to debug level.
   2.117  case $DEBUG_LEVEL in
   2.118 -      fastdebug ) 
   2.119 +      fastdebug )
   2.120                CFLAGS="$CFLAGS $D_FLAG"
   2.121                JAVAC_FLAGS="$JAVAC_FLAGS -g"
   2.122                ;;
   2.123 @@ -1018,9 +1018,9 @@
   2.124  	      CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
   2.125                JAVAC_FLAGS="$JAVAC_FLAGS -g"
   2.126                ;;
   2.127 -esac              
   2.128 +esac
   2.129  
   2.130 -                
   2.131 +
   2.132  AC_SUBST(CFLAGS_JDKLIB)
   2.133  AC_SUBST(CFLAGS_JDKEXE)
   2.134  
   2.135 @@ -1092,28 +1092,45 @@
   2.136    AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
   2.137  ])
   2.138  
   2.139 -# Setup the JTREG paths 
   2.140 -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], 
   2.141 -[ 
   2.142 -  AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], 
   2.143 -  [Regression Test Harness @<:@probed@:>@])]) 
   2.144 - 
   2.145 -  AC_MSG_CHECKING([for JTReg Regression Test Harness]) 
   2.146 - 
   2.147 -  if test "x$with_jtreg" != x; then 
   2.148 -    JT_HOME="$with_jtreg"
   2.149 -    BASIC_FIXUP_PATH([JT_HOME])
   2.150 -    AC_MSG_RESULT($JT_HOME)
   2.151 - 
   2.152 -    # jtreg win32 script works for everybody 
   2.153 -    JTREGEXE="$JT_HOME/win32/bin/jtreg"
   2.154 -    if test ! -f "$JTREGEXE"; then
   2.155 -      AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
   2.156 +# Setup the JTREG paths
   2.157 +AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
   2.158 +[
   2.159 +  AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
   2.160 +  [Regression Test Harness @<:@probed@:>@])],
   2.161 +  [],
   2.162 +  [with_jtreg=no])
   2.163 +
   2.164 +  if test "x$with_jtreg" = xno; then
   2.165 +    # jtreg disabled
   2.166 +    AC_MSG_CHECKING([for jtreg])
   2.167 +    AC_MSG_RESULT(no)
   2.168 +  else
   2.169 +    if test "x$with_jtreg" != xyes; then
   2.170 +      # with path specified.
   2.171 +      JT_HOME="$with_jtreg"
   2.172      fi
   2.173 -  else 
   2.174 -    AC_MSG_RESULT(no)
   2.175 -  fi 
   2.176 - 
   2.177 -  AC_SUBST(JT_HOME) 
   2.178 -  AC_SUBST(JTREGEXE) 
   2.179 +
   2.180 +    if test "x$JT_HOME" != x; then
   2.181 +      AC_MSG_CHECKING([for jtreg])
   2.182 +
   2.183 +      # use JT_HOME enviroment var.
   2.184 +      BASIC_FIXUP_PATH([JT_HOME])
   2.185 +
   2.186 +      # jtreg win32 script works for everybody
   2.187 +      JTREGEXE="$JT_HOME/win32/bin/jtreg"
   2.188 +
   2.189 +      if test ! -f "$JTREGEXE"; then
   2.190 +        AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
   2.191 +      fi
   2.192 +
   2.193 +      AC_MSG_RESULT($JTREGEXE)
   2.194 +    else
   2.195 +      # try to find jtreg on path
   2.196 +      BASIC_REQUIRE_PROG(JTREGEXE, jtreg)
   2.197 +      JT_HOME="`$DIRNAME $JTREGEXE`"
   2.198 +    fi
   2.199 +  fi
   2.200 +
   2.201 +  AC_SUBST(JT_HOME)
   2.202 +  AC_SUBST(JTREGEXE)
   2.203  ])
     3.1 --- a/common/makefiles/Main.gmk	Tue Jun 04 10:23:37 2013 +0200
     3.2 +++ b/common/makefiles/Main.gmk	Tue Jun 04 10:36:00 2013 +0200
     3.3 @@ -183,7 +183,7 @@
     3.4  test: images test-only
     3.5  test-only: start-make
     3.6  	@$(call TargetEnter)
     3.7 -	@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
     3.8 +	@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k JT_HOME=$(JT_HOME) MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
     3.9  	@$(call TargetExit)
    3.10  
    3.11  # Stores the tips for each repository. This file is be used when constructing the jdk image and can be

mercurial