Merge jdk8-b43

Wed, 13 Jun 2012 16:53:05 -0700

author
katleman
date
Wed, 13 Jun 2012 16:53:05 -0700
changeset 448
661c9aae602b
parent 444
6aea9b1a3840
parent 447
c61921f9b965
child 449
02c6c67c1bb7
child 450
8fb4cd2f05a1

Merge

     1.1 --- a/README-builds.html	Fri Jun 08 12:01:05 2012 -0700
     1.2 +++ b/README-builds.html	Wed Jun 13 16:53:05 2012 -0700
     1.3 @@ -108,6 +108,7 @@
     1.4                  <li><a href="#testing">Testing the Build</a> </li>
     1.5                  <li><a href="#variables">Environment/Make Variables</a></li>
     1.6                  <li><a href="#troubleshooting">Troubleshooting</a></li>
     1.7 +                <li><a href="#newbuild">The New Build</a></li>
     1.8              </ul>
     1.9          </blockquote>
    1.10  
    1.11 @@ -2120,6 +2121,16 @@
    1.12                  </li>
    1.13              </ul>
    1.14          </blockquote>
    1.15 +        <!-- ------------------------------------------------------ -->
    1.16 +        <hr>
    1.17 +        <h2><a name="newbuild">The New Build</a></h2>
    1.18 +        <blockquote>
    1.19 +            The <a href="http://openjdk.java.net/projects/build-infra/">
    1.20 +            Build Infrastructure project</a> is working on a new 
    1.21 +            build. For information on how to try it out, please see the
    1.22 +            <a href="http://openjdk.java.net/projects/build-infra/guide.html">
    1.23 +            Build Infra User Guide</a> 
    1.24 +        </blockquote>
    1.25          <hr>
    1.26      </body>
    1.27  </html>
     2.1 --- a/common/autoconf/autogen.sh	Fri Jun 08 12:01:05 2012 -0700
     2.2 +++ b/common/autoconf/autogen.sh	Wed Jun 13 16:53:05 2012 -0700
     2.3 @@ -22,5 +22,5 @@
     2.4  # questions.
     2.5  #
     2.6  
     2.7 -autoconf configure.ac > configure
     2.8 +autoconf -W all configure.ac > configure
     2.9  rm -rf config.status config.log autom4te.cache
     3.1 --- a/common/autoconf/builddeps.m4	Fri Jun 08 12:01:05 2012 -0700
     3.2 +++ b/common/autoconf/builddeps.m4	Wed Jun 13 16:53:05 2012 -0700
     3.3 @@ -34,7 +34,7 @@
     3.4                  . $builddepsfile
     3.5                  AC_MSG_RESULT([loaded!])
     3.6              else
     3.7 -               AC_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!])
     3.8 +               AC_MSG_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!])
     3.9             fi
    3.10          else
    3.11              AC_MSG_CHECKING([for builddeps.conf files in sources...])
    3.12 @@ -47,7 +47,7 @@
    3.13                  . $builddepsfile
    3.14                  AC_MSG_RESULT([found at least one!])
    3.15              else
    3.16 -               AC_ERROR([Could not find any builddeps.conf at all!])
    3.17 +               AC_MSG_ERROR([Could not find any builddeps.conf at all!])
    3.18             fi
    3.19          fi
    3.20          # Create build and host names that use _ instead of "-" and ".".
    3.21 @@ -117,7 +117,7 @@
    3.22          ) | ftp -in $FTPSERVER
    3.23      fi
    3.24      if test "x$VALID_TOOL" != xyes; then
    3.25 -       AC_ERROR([I do not know how to use the tool: $BDEPS_FTP])
    3.26 +       AC_MSG_ERROR([I do not know how to use the tool: $BDEPS_FTP])
    3.27      fi
    3.28  ])
    3.29  
    3.30 @@ -159,7 +159,7 @@
    3.31              thecflags=${builddep_$2_CFLAGS}
    3.32              thelibs=${builddep_$2_LIBS}
    3.33              if test "x$depdir" = x; then
    3.34 -                AC_ERROR([Could not download build dependency $2])
    3.35 +                AC_MSG_ERROR([Could not download build dependency $2])
    3.36              fi
    3.37              $1=$depdir
    3.38              if test "x$theroot" != x; then
    3.39 @@ -198,17 +198,17 @@
    3.40              mkdir -p $installdir
    3.41          fi
    3.42          if test ! -d $installdir; then
    3.43 -            AC_ERROR([Could not create directory $installdir])
    3.44 +            AC_MSG_ERROR([Could not create directory $installdir])
    3.45          fi
    3.46          tmpfile=`mktemp $installdir/$1.XXXXXXXXX`
    3.47          touch $tmpfile    
    3.48          if test ! -f $tmpfile; then
    3.49 -            AC_ERROR([Could not create files in directory $installdir])
    3.50 +            AC_MSG_ERROR([Could not create files in directory $installdir])
    3.51          fi
    3.52          BDEPS_FTPGET([$3/$2] , [$tmpfile])
    3.53          mv $tmpfile $installdir/$filename
    3.54          if test ! -s $installdir/$filename; then 
    3.55 -            AC_ERROR([Could not download $3/$2])
    3.56 +            AC_MSG_ERROR([Could not download $3/$2])
    3.57          fi
    3.58          case "$extension" in
    3.59              zip)  echo "Unzipping $installdir/$filename..."
    3.60 @@ -220,7 +220,7 @@
    3.61              tgz) echo "Untaring $installdir/$filename..."
    3.62                 (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
    3.63              ;;
    3.64 -            *) AC_ERROR([Cannot handle build depency archive with extension $extension])
    3.65 +            *) AC_MSG_ERROR([Cannot handle build depency archive with extension $extension])
    3.66              ;;
    3.67          esac
    3.68      fi
    3.69 @@ -228,4 +228,3 @@
    3.70          $5=$installdir
    3.71      fi
    3.72  ])
    3.73 -
     4.1 --- a/common/autoconf/configure	Fri Jun 08 12:01:05 2012 -0700
     4.2 +++ b/common/autoconf/configure	Wed Jun 13 16:53:05 2012 -0700
     4.3 @@ -595,7 +595,12 @@
     4.4  
     4.5  ac_subst_vars='LTLIBOBJS
     4.6  LIBOBJS
     4.7 +CACERTS_FILE
     4.8  TEST_IN_BUILD
     4.9 +SALIB_NAME
    4.10 +OS_VERSION_MICRO
    4.11 +OS_VERSION_MINOR
    4.12 +OS_VERSION_MAJOR
    4.13  LIBCXX
    4.14  LDFLAGS_JDKEXE_SUFFIX
    4.15  LDFLAGS_JDKLIB_SUFFIX
    4.16 @@ -625,15 +630,20 @@
    4.17  LANGTOOLS_MAKE_ARGS
    4.18  LANGTOOLS_DIST
    4.19  LANGTOOLS_OUTPUTDIR
    4.20 +CXX_FLAG_DEPS
    4.21 +C_FLAG_DEPS
    4.22  CXX_O_FLAG_NONE
    4.23  CXX_O_FLAG_NORM
    4.24  CXX_O_FLAG_HI
    4.25 +CXX_O_FLAG_HIGHEST
    4.26  C_O_FLAG_NONE
    4.27  C_O_FLAG_NORM
    4.28  C_O_FLAG_HI
    4.29 +C_O_FLAG_HIGHEST
    4.30  DISABLE_NIMBUS
    4.31  GENERATE_DOCS
    4.32  ENABLE_DOCS
    4.33 +LIBDL
    4.34  LIBM
    4.35  USE_EXTERNAL_LIBZ
    4.36  USE_EXTERNAL_LIBGIF
    4.37 @@ -665,6 +675,7 @@
    4.38  BOOT_JDK_JVMARGS
    4.39  OVERRIDE_SRC_ROOT
    4.40  ADD_SRC_ROOT
    4.41 +NATIVE2ASCII
    4.42  RMIC
    4.43  JAR
    4.44  JAVAH
    4.45 @@ -678,7 +689,11 @@
    4.46  JAVA_CHECK
    4.47  JAVAC_CHECK
    4.48  ENDIAN
    4.49 +POST_MCS_CMD
    4.50 +POST_STRIP_CMD
    4.51  SET_SHARED_LIBRARY_ORIGIN
    4.52 +CXX_FLAG_REORDER
    4.53 +C_FLAG_REORDER
    4.54  SET_SHARED_LIBRARY_MAPFILE
    4.55  SET_SHARED_LIBRARY_NAME
    4.56  SHARED_LIBRARY_FLAGS
    4.57 @@ -749,6 +764,7 @@
    4.58  CORBA_TOPDIR
    4.59  LANGTOOLS_TOPDIR
    4.60  OUTPUT_ROOT
    4.61 +CONF_NAME
    4.62  SPEC
    4.63  MSVCR100DLL
    4.64  CHECK_FOR_VCINSTALLDIR
    4.65 @@ -797,6 +813,8 @@
    4.66  CONCURRENT_BUILD_JOBS
    4.67  NUM_CORES
    4.68  DATE_WHEN_CONFIGURED
    4.69 +REQUIRED_OS_VERSION
    4.70 +REQUIRED_OS_NAME
    4.71  LEGACY_BUILD_CPU3
    4.72  LEGACY_BUILD_CPU2
    4.73  LEGACY_BUILD_CPU1
    4.74 @@ -829,6 +847,7 @@
    4.75  build_vendor
    4.76  build_cpu
    4.77  build
    4.78 +HG
    4.79  FILE
    4.80  EXPR
    4.81  READELF
    4.82 @@ -918,7 +937,7 @@
    4.83  with_data_model
    4.84  with_num_cores
    4.85  with_memory_size
    4.86 -enable_openjdk
    4.87 +enable_openjdk_only
    4.88  enable_jigsaw
    4.89  with_jdk_variant
    4.90  enable_headful
    4.91 @@ -967,6 +986,7 @@
    4.92  enable_nimbus
    4.93  enable_static_link_stdc__
    4.94  enable_hotspot_test_in_build
    4.95 +with_cacerts_file
    4.96  '
    4.97        ac_precious_vars='build_alias
    4.98  host_alias
    4.99 @@ -1610,7 +1630,7 @@
   4.100    --disable-option-checking  ignore unrecognized --enable/--with options
   4.101    --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   4.102    --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   4.103 -  --enable-openjdk        build OpenJDK regardless of the presence of closed
   4.104 +  --enable-openjdk-only   build OpenJDK regardless of the presence of closed
   4.105                            repositories [disabled]
   4.106    --enable-jigsaw         build Jigsaw images (not yet available) [disabled]
   4.107    --disable-headful       build headful support (graphical UI support)
   4.108 @@ -1718,6 +1738,7 @@
   4.109                            headers under PATH/include)
   4.110    --with-pulse-include    specify directory for the pulseaudio include files
   4.111    --with-pulse-lib        specify directory for the pulseaudio library
   4.112 +  --with-cacerts-file     specify alternative cacerts file
   4.113  
   4.114  Some influential environment variables:
   4.115    PKG_CONFIG  path to pkg-config utility
   4.116 @@ -3036,7 +3057,6 @@
   4.117  
   4.118  
   4.119  
   4.120 -
   4.121  #
   4.122  # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
   4.123  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4.124 @@ -3095,6 +3115,8 @@
   4.125  # Fixes paths on windows hosts to be mixed mode short.
   4.126  
   4.127  
   4.128 +
   4.129 +
   4.130  #
   4.131  # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
   4.132  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4.133 @@ -3149,59 +3171,61 @@
   4.134  # questions.
   4.135  #
   4.136  
   4.137 +function prepare_help_system {
   4.138 +    for ac_prog in apt-get yum port pkgutil pkgadd
   4.139 +do
   4.140 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
   4.141 +set dummy $ac_prog; ac_word=$2
   4.142 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
   4.143 +$as_echo_n "checking for $ac_word... " >&6; }
   4.144 +if test "${ac_cv_prog_PKGHANDLER+set}" = set; then :
   4.145 +  $as_echo_n "(cached) " >&6
   4.146 +else
   4.147 +  if test -n "$PKGHANDLER"; then
   4.148 +  ac_cv_prog_PKGHANDLER="$PKGHANDLER" # Let the user override the test.
   4.149 +else
   4.150 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   4.151 +for as_dir in $PATH
   4.152 +do
   4.153 +  IFS=$as_save_IFS
   4.154 +  test -z "$as_dir" && as_dir=.
   4.155 +    for ac_exec_ext in '' $ac_executable_extensions; do
   4.156 +  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
   4.157 +    ac_cv_prog_PKGHANDLER="$ac_prog"
   4.158 +    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
   4.159 +    break 2
   4.160 +  fi
   4.161 +done
   4.162 +  done
   4.163 +IFS=$as_save_IFS
   4.164 +
   4.165 +fi
   4.166 +fi
   4.167 +PKGHANDLER=$ac_cv_prog_PKGHANDLER
   4.168 +if test -n "$PKGHANDLER"; then
   4.169 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGHANDLER" >&5
   4.170 +$as_echo "$PKGHANDLER" >&6; }
   4.171 +else
   4.172 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   4.173 +$as_echo "no" >&6; }
   4.174 +fi
   4.175 +
   4.176 +
   4.177 +  test -n "$PKGHANDLER" && break
   4.178 +done
   4.179 +
   4.180 +}
   4.181 +
   4.182  function help_on_build_dependency {
   4.183      # Print a helpful message on how to acquire the necessary build dependency.
   4.184      # $1 is the help tag: freetyp2, cups, pulse, alsa etc
   4.185      MISSING_DEPENDENCY=$1
   4.186      PKGHANDLER_COMMAND=
   4.187  
   4.188 -    for ac_prog in apt-get yum port pkgutil pkgadd
   4.189 -do
   4.190 -  # Extract the first word of "$ac_prog", so it can be a program name with args.
   4.191 -set dummy $ac_prog; ac_word=$2
   4.192 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
   4.193 -$as_echo_n "checking for $ac_word... " >&6; }
   4.194 -if test "${ac_cv_prog_PKGHANDLER+set}" = set; then :
   4.195 -  $as_echo_n "(cached) " >&6
   4.196 -else
   4.197 -  if test -n "$PKGHANDLER"; then
   4.198 -  ac_cv_prog_PKGHANDLER="$PKGHANDLER" # Let the user override the test.
   4.199 -else
   4.200 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   4.201 -for as_dir in $PATH
   4.202 -do
   4.203 -  IFS=$as_save_IFS
   4.204 -  test -z "$as_dir" && as_dir=.
   4.205 -    for ac_exec_ext in '' $ac_executable_extensions; do
   4.206 -  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
   4.207 -    ac_cv_prog_PKGHANDLER="$ac_prog"
   4.208 -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
   4.209 -    break 2
   4.210 -  fi
   4.211 -done
   4.212 -  done
   4.213 -IFS=$as_save_IFS
   4.214 -
   4.215 -fi
   4.216 -fi
   4.217 -PKGHANDLER=$ac_cv_prog_PKGHANDLER
   4.218 -if test -n "$PKGHANDLER"; then
   4.219 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGHANDLER" >&5
   4.220 -$as_echo "$PKGHANDLER" >&6; }
   4.221 -else
   4.222 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   4.223 -$as_echo "no" >&6; }
   4.224 -fi
   4.225 -
   4.226 -
   4.227 -  test -n "$PKGHANDLER" && break
   4.228 -done
   4.229 -
   4.230 -
   4.231      case $PKGHANDLER in
   4.232  	apt-get)
   4.233                  apt_help     $MISSING_DEPENDENCY ;;
   4.234 -        yum)
   4.235 +    yum)
   4.236                  yum_help     $MISSING_DEPENDENCY ;;
   4.237  	port)
   4.238                  port_help    $MISSING_DEPENDENCY ;;
   4.239 @@ -3214,7 +3238,7 @@
   4.240      esac
   4.241  
   4.242      if test "x$PKGHANDLER_COMMAND" != x; then
   4.243 -        HELP_MSG="Try running '$PKGHANDLER_COMMAND'."
   4.244 +        HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
   4.245      fi
   4.246  }
   4.247  
   4.248 @@ -5384,6 +5408,47 @@
   4.249      # Test that variable FILE is not empty.
   4.250      if test "" = "$FILE"; then as_fn_error $? "Could not find file !" "$LINENO" 5 ; fi
   4.251  
   4.252 +# Extract the first word of "hg", so it can be a program name with args.
   4.253 +set dummy hg; ac_word=$2
   4.254 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
   4.255 +$as_echo_n "checking for $ac_word... " >&6; }
   4.256 +if test "${ac_cv_path_HG+set}" = set; then :
   4.257 +  $as_echo_n "(cached) " >&6
   4.258 +else
   4.259 +  case $HG in
   4.260 +  [\\/]* | ?:[\\/]*)
   4.261 +  ac_cv_path_HG="$HG" # Let the user override the test with a path.
   4.262 +  ;;
   4.263 +  *)
   4.264 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   4.265 +for as_dir in $PATH
   4.266 +do
   4.267 +  IFS=$as_save_IFS
   4.268 +  test -z "$as_dir" && as_dir=.
   4.269 +    for ac_exec_ext in '' $ac_executable_extensions; do
   4.270 +  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
   4.271 +    ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext"
   4.272 +    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
   4.273 +    break 2
   4.274 +  fi
   4.275 +done
   4.276 +  done
   4.277 +IFS=$as_save_IFS
   4.278 +
   4.279 +  ;;
   4.280 +esac
   4.281 +fi
   4.282 +HG=$ac_cv_path_HG
   4.283 +if test -n "$HG"; then
   4.284 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5
   4.285 +$as_echo "$HG" >&6; }
   4.286 +else
   4.287 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   4.288 +$as_echo "no" >&6; }
   4.289 +fi
   4.290 +
   4.291 +
   4.292 +
   4.293  # Figure out the build and host system.
   4.294  # Make sure we can run config.sub.
   4.295  $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
   4.296 @@ -5491,7 +5556,7 @@
   4.297      # The same values are setup for BUILD_...
   4.298      #
   4.299      # And the legacy variables, for controlling the old makefiles.
   4.300 -    # LEGACY_HOST_CPU1=i586,amd64,sparc,sparcv9,arm,arm64...
   4.301 +    # LEGACY_HOST_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64...
   4.302      # LEGACY_HOST_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
   4.303      # LEGACY_HOST_CPU3=sparcv9,amd64 (but only on solaris)
   4.304      # LEGACY_HOST_OS_API=solaris,windows
   4.305 @@ -5918,6 +5983,33 @@
   4.306          LEGACY_BUILD_CPU3=""
   4.307      fi
   4.308  
   4.309 +    # On MacOSX and MacOSX only, we have a different name for the x64 CPU in ARCH (LEGACY_HOST_CPU1) ...
   4.310 +    if test "x$HOST_OS" = xmacosx && test "x$HOST_CPU" = xx64; then
   4.311 +        LEGACY_HOST_CPU1="x86_64"
   4.312 +    fi
   4.313 +
   4.314 +
   4.315 +    if test "x$HOST_OS" = "xsolaris"; then
   4.316 +       REQUIRED_OS_NAME=SunOS
   4.317 +       REQUIRED_OS_VERSION=5.10
   4.318 +    fi
   4.319 +    if test "x$HOST_OS" = "xlinux"; then
   4.320 +       REQUIRED_OS_NAME=Linux
   4.321 +       REQUIRED_OS_VERSION=2.6
   4.322 +    fi
   4.323 +    if test "x$HOST_OS" = "xwindows"; then
   4.324 +        REQUIRED_OS_NAME=Windows
   4.325 +        REQUIRED_OS_VERSION=5.1
   4.326 +    fi
   4.327 +    if test "x$HOST_OS" = "xmacosx"; then
   4.328 +        REQUIRED_OS_NAME=Darwin
   4.329 +        REQUIRED_OS_VERSION=11.2
   4.330 +    fi
   4.331 +
   4.332 +
   4.333 +
   4.334 +
   4.335 +
   4.336  # Now the following vars are defined.
   4.337  # HOST_OS=aix,bsd,hpux,linux,macosx,solaris,windows
   4.338  # HOST_OS_FAMILY=bsd,gnu,sysv,win32,wince
   4.339 @@ -6143,15 +6235,15 @@
   4.340  #
   4.341  # OpenJDK or closed
   4.342  #
   4.343 -# Check whether --enable-openjdk was given.
   4.344 -if test "${enable_openjdk+set}" = set; then :
   4.345 -  enableval=$enable_openjdk;
   4.346 -fi
   4.347 -
   4.348 -
   4.349 -if test "x$enable_openjdk" = "xyes"; then
   4.350 +# Check whether --enable-openjdk-only was given.
   4.351 +if test "${enable_openjdk_only+set}" = set; then :
   4.352 +  enableval=$enable_openjdk_only;
   4.353 +fi
   4.354 +
   4.355 +
   4.356 +if test "x$enable_openjdk_only" = "xyes"; then
   4.357      OPENJDK=true
   4.358 -elif test "x$enable_openjdk" = "xno"; then
   4.359 +elif test "x$enable_openjdk_only" = "xno"; then
   4.360      OPENJDK=false
   4.361  elif test -d "$SRC_ROOT/jdk/src/closed"; then
   4.362      OPENJDK=false
   4.363 @@ -6458,7 +6550,8 @@
   4.364  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
   4.365      # We are running configure from the src root.
   4.366      # Create a default ./build/host-variant-debuglevel output root.
   4.367 -    OUTPUT_ROOT="$SRC_ROOT/build/${HOST_OS}-${HOST_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
   4.368 +    CONF_NAME="${HOST_OS}-${HOST_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
   4.369 +    OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}"
   4.370      mkdir -p "$OUTPUT_ROOT"
   4.371      if test ! -d "$OUTPUT_ROOT"; then
   4.372          as_fn_error $? "Could not create build directory $OUTPUT_ROOT" "$LINENO" 5
   4.373 @@ -6466,6 +6559,9 @@
   4.374  else
   4.375      # We are running configure from outside of the src dir.
   4.376      # Then use the current directory as output dir!
   4.377 +    # If configuration is situated in normal build directory, just use the build
   4.378 +    # directory name as configuration name, otherwise use the complete path.
   4.379 +    CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
   4.380      OUTPUT_ROOT="$CURDIR"
   4.381  fi
   4.382  
   4.383 @@ -6531,7 +6627,7 @@
   4.384          esac
   4.385          # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
   4.386          cd $OUTPUT_ROOT
   4.387 -        $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH"
   4.388 +        bash $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH"
   4.389  	cd $CURDIR
   4.390  	if test ! -s $OUTPUT_ROOT/localdevenv.sh || test ! -s $OUTPUT_ROOT/localdevenv.gmk; then
   4.391              { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can extract the needed env variables" >&5
   4.392 @@ -6618,6 +6714,8 @@
   4.393  
   4.394  SPEC=$OUTPUT_ROOT/spec.gmk
   4.395  
   4.396 +CONF_NAME=$CONF_NAME
   4.397 +
   4.398  OUTPUT_ROOT=$OUTPUT_ROOT
   4.399  
   4.400  
   4.401 @@ -7362,6 +7460,8 @@
   4.402  ORG_CXXFLAGS="$CXXFLAGS"
   4.403  ORG_OBJCFLAGS="$OBJCFLAGS"
   4.404  
   4.405 +prepare_help_system
   4.406 +
   4.407  # gcc is almost always present, but on Windows we
   4.408  # prefer cl.exe and on Solaris we prefer CC.
   4.409  # Thus test for them in this order.
   4.410 @@ -8769,9 +8869,10 @@
   4.411          LD="$car"
   4.412      fi
   4.413  
   4.414 -LDEXE="$LD"
   4.415 -LDCXX="$LD"
   4.416 -LDEXECXX="$LD"
   4.417 +LD="$CC"
   4.418 +LDEXE="$CC"
   4.419 +LDCXX="$CXX"
   4.420 +LDEXECXX="$CXX"
   4.421  # LDEXE is the linker to use, when creating executables.
   4.422  
   4.423  # Linking C++ libraries.
   4.424 @@ -8926,7 +9027,7 @@
   4.425  
   4.426      # For now, assume that we are always compiling using cl.exe.
   4.427      CC_OUT_OPTION=-Fo
   4.428 -    EXE_OUT_OPTION=-Fe
   4.429 +    EXE_OUT_OPTION=-out:
   4.430      LD_OUT_OPTION=-out:
   4.431      AR_OUT_OPTION=-out:
   4.432      # On Windows, reject /usr/bin/link, which is a cygwin
   4.433 @@ -9008,10 +9109,9 @@
   4.434      WINLD="$tmp"
   4.435  
   4.436      LD="$WINLD"
   4.437 -    # However creating executables can only be done with cl.exe.
   4.438 -    LDEXE="$CC"
   4.439 +    LDEXE="$WINLD"
   4.440      LDCXX="$WINLD"
   4.441 -    LDEXECXX="$CC"
   4.442 +    LDEXECXX="$WINLD"
   4.443  
   4.444      # Extract the first word of "mt", so it can be a program name with args.
   4.445  set dummy mt; ac_word=$2
   4.446 @@ -9163,7 +9263,7 @@
   4.447      RC="$tmp"
   4.448  
   4.449  
   4.450 -    RC_FLAGS="/l 0x409 /r"
   4.451 +    RC_FLAGS="-nologo /l 0x409 /r"
   4.452      if test "x$VARIANT" = xOPT; then :
   4.453  
   4.454          RC_FLAGS="$RC_FLAGS -d NDEBUG"
   4.455 @@ -9303,14 +9403,13 @@
   4.456  
   4.457  
   4.458      COMPILER_TYPE=CL
   4.459 -    CFLAGS="$CFLAGS -nologo"
   4.460 -    LDFLAGS="$LDFLAGS -nologo -dll -opt:ref -incremental:no "
   4.461 +    CCXXFLAGS="$CCXXFLAGS -nologo"
   4.462 +    LDFLAGS="$LDFLAGS -nologo -opt:ref -incremental:no"
   4.463      if test "x$LEGACY_HOST_CPU1" = xi586; then
   4.464          LDFLAGS="$LDFLAGS -safeseh"
   4.465      fi
   4.466 -    if test "x$DEBUG_LEVEL" != xrelease; then
   4.467 -        LDFLAGS="$LDFLAGS -debug"
   4.468 -    fi
   4.469 +    # TODO: make -debug optional "--disable-full-debug-symbols"
   4.470 +    LDFLAGS="$LDFLAGS -debug"
   4.471  
   4.472  fi
   4.473  
   4.474 @@ -9764,7 +9863,7 @@
   4.475  
   4.476  
   4.477  
   4.478 -if test "x$HOST_CPU_BITS" = x32 && test "x$HOST_OS" = macosx; then
   4.479 +if test "x$HOST_CPU_BITS" = x32 && test "x$HOST_OS" = xmacosx; then
   4.480      # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
   4.481      # While waiting for a better solution, the current workaround is to use -mstackrealign.
   4.482      CFLAGS="$CFLAGS -mstackrealign"
   4.483 @@ -10499,6 +10598,16 @@
   4.484  # (The JVM can use 32 or 64 bit Java pointers but that decision
   4.485  # is made at runtime.)
   4.486  #
   4.487 +ac_ext=cpp
   4.488 +ac_cpp='$CXXCPP $CPPFLAGS'
   4.489 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
   4.490 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
   4.491 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   4.492 +
   4.493 +OLD_CXXFLAGS="$CXXFLAGS"
   4.494 +if test "x$HOST_OS" = xsolaris && test "x$with_data_model" != x; then
   4.495 +	CXXFLAGS="-m{$with_data_model} $CXXFLAGS"
   4.496 +fi
   4.497  
   4.498  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
   4.499  $as_echo_n "checking for ANSI C header files... " >&6; }
   4.500 @@ -10662,6 +10771,14 @@
   4.501  _ACEOF
   4.502  
   4.503  
   4.504 +CXXFLAGS="$OLD_CXXFLAGS"
   4.505 +ac_ext=cpp
   4.506 +ac_cpp='$CXXCPP $CPPFLAGS'
   4.507 +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
   4.508 +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
   4.509 +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   4.510 +
   4.511 +
   4.512  if test "x$ac_cv_sizeof_int_p" = x0; then
   4.513      # The test failed, lets pick the assumed value.
   4.514      ARCH_DATA_MODEL=$HOST_CPU_BITS
   4.515 @@ -10741,12 +10858,16 @@
   4.516      OBJ_SUFFIX='.o'
   4.517      EXE_SUFFIX=''
   4.518      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
   4.519 -    SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$(JDK_TOPDIR)/$1'
   4.520 +    SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
   4.521 +    C_FLAG_REORDER=''
   4.522 +    CXX_FLAG_REORDER=''
   4.523      SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN/$1'
   4.524      LD="$CC"
   4.525      LDEXE="$CC"
   4.526      LDCXX="$CXX"
   4.527      LDEXECXX="$CXX"
   4.528 +    # TODO: for embedded set --strip-unneeded
   4.529 +    POST_STRIP_CMD="$STRIP -g"
   4.530  
   4.531      # Linking is different on MacOSX
   4.532      if test "x$BUILD_OS" = xmacosx; then
   4.533 @@ -10759,6 +10880,7 @@
   4.534          SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1'
   4.535          SET_SHARED_LIBRARY_MAPFILE=''
   4.536          SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
   4.537 +        POST_STRIP_CMD="$STRIP -S"
   4.538      fi
   4.539  else
   4.540      if test "x$BUILD_OS" = xsolaris; then
   4.541 @@ -10774,9 +10896,13 @@
   4.542          OBJ_SUFFIX='.o'
   4.543          EXE_SUFFIX=''
   4.544          SET_SHARED_LIBRARY_NAME=''
   4.545 -        SET_SHARED_LIBRARY_MAPFILE='-M $(JDK_TOPDIR)/$1'
   4.546 +        SET_SHARED_LIBRARY_MAPFILE='-M $1'
   4.547 +	C_FLAG_REORDER='-xF'
   4.548 +	CXX_FLAG_REORDER='-xF'
   4.549          SET_SHARED_LIBRARY_ORIGIN='-R \$$$$ORIGIN/$1'
   4.550          CFLAGS_JDKLIB_EXTRA='-xstrconst -D__solaris__'
   4.551 +        POST_STRIP_CMD="$STRIP -x"
   4.552 +        POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
   4.553      fi
   4.554      if test "x$BUILD_OS" = xwindows; then
   4.555          # If it is not gcc, then assume it is the MS Visual Studio compiler
   4.556 @@ -10808,6 +10934,10 @@
   4.557  
   4.558  
   4.559  
   4.560 +
   4.561 +
   4.562 +
   4.563 +
   4.564  # The (cross) compiler is now configured, we can now test capabilities
   4.565  # of the host platform.
   4.566  
   4.567 @@ -11072,30 +11202,30 @@
   4.568          # Source the builddeps file again, to make sure it uses the latest variables!
   4.569          . $builddepsfile
   4.570          # Look for a host and build machine specific resource!
   4.571 -        eval resource=\${builddep_bootjdk_BUILD_${rewritten_build_var}_HOST_${rewritten_host_var}}
   4.572 +        eval resource=\${builddep_boot-jdk_BUILD_${rewritten_build_var}_HOST_${rewritten_host_var}}
   4.573          if test "x$resource" = x; then
   4.574              # Ok, lets instead look for a host specific resource
   4.575 -            eval resource=\${builddep_bootjdk_HOST_${rewritten_host_var}}
   4.576 +            eval resource=\${builddep_boot-jdk_HOST_${rewritten_host_var}}
   4.577          fi
   4.578          if test "x$resource" = x; then
   4.579              # Ok, lets instead look for a build specific resource
   4.580 -            eval resource=\${builddep_bootjdk_BUILD_${rewritten_build_var}}
   4.581 +            eval resource=\${builddep_boot-jdk_BUILD_${rewritten_build_var}}
   4.582          fi
   4.583          if test "x$resource" = x; then
   4.584              # Ok, lets instead look for a generic resource
   4.585 -            # (The bootjdk comes from M4 and not the shell, thus no need for eval here.)
   4.586 -            resource=${builddep_bootjdk}
   4.587 +            # (The boot-jdk comes from M4 and not the shell, thus no need for eval here.)
   4.588 +            resource=${builddep_boot-jdk}
   4.589          fi
   4.590          if test "x$resource" != x; then
   4.591 -            { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for bootjdk" >&5
   4.592 -$as_echo "$as_me: Using builddeps $resource for bootjdk" >&6;}
   4.593 +            { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for boot-jdk" >&5
   4.594 +$as_echo "$as_me: Using builddeps $resource for boot-jdk" >&6;}
   4.595  	    # If the resource in the builddeps.conf file is an existing directory,
   4.596  	    # for example /java/linux/cups
   4.597  	    if test -d ${resource}; then
   4.598  	       depdir=${resource}
   4.599  	    else
   4.600  
   4.601 -# bootjdk is for example mymodule
   4.602 +# boot-jdk is for example mymodule
   4.603  # $resource is for example libs/general/libmymod_1_2_3.zip
   4.604  # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps
   4.605  # $with_builddeps_dir is for example /localhome/builddeps
   4.606 @@ -11108,15 +11238,15 @@
   4.607      extension=${filename#*.}
   4.608      installdir=$with_builddeps_dir/$filebase
   4.609      if test ! -f $installdir/$filename.unpacked; then
   4.610 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&5
   4.611 -$as_echo "$as_me: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&6;}
   4.612 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency boot-jdk from $with_builddeps_server/$resource and installing into $installdir" >&5
   4.613 +$as_echo "$as_me: Downloading build dependency boot-jdk from $with_builddeps_server/$resource and installing into $installdir" >&6;}
   4.614          if test ! -d $installdir; then
   4.615              mkdir -p $installdir
   4.616          fi
   4.617          if test ! -d $installdir; then
   4.618              as_fn_error $? "Could not create directory $installdir" "$LINENO" 5
   4.619          fi
   4.620 -        tmpfile=`mktemp $installdir/bootjdk.XXXXXXXXX`
   4.621 +        tmpfile=`mktemp $installdir/boot-jdk.XXXXXXXXX`
   4.622          touch $tmpfile
   4.623          if test ! -f $tmpfile; then
   4.624              as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5
   4.625 @@ -11187,11 +11317,11 @@
   4.626              # was updated to point at the current build dependency install directory.
   4.627              . $builddepsfile
   4.628              # Now extract variables from the builddeps.conf files.
   4.629 -            theroot=${builddep_bootjdk_ROOT}
   4.630 -            thecflags=${builddep_bootjdk_CFLAGS}
   4.631 -            thelibs=${builddep_bootjdk_LIBS}
   4.632 +            theroot=${builddep_boot-jdk_ROOT}
   4.633 +            thecflags=${builddep_boot-jdk_CFLAGS}
   4.634 +            thelibs=${builddep_boot-jdk_LIBS}
   4.635              if test "x$depdir" = x; then
   4.636 -                as_fn_error $? "Could not download build dependency bootjdk" "$LINENO" 5
   4.637 +                as_fn_error $? "Could not download build dependency boot-jdk" "$LINENO" 5
   4.638              fi
   4.639              BOOT_JDK=$depdir
   4.640              if test "x$theroot" != x; then
   4.641 @@ -11220,15 +11350,15 @@
   4.642          fi
   4.643          # Aha, the user has set a JAVA_HOME
   4.644          # let us use that as the Boot JDK.
   4.645 -        BOOT_JDK=$JAVA_HOME
   4.646 +        BOOT_JDK="$JAVA_HOME"
   4.647          BOOT_JDK_FOUND=yes
   4.648          # To be on the safe side, lets check that it is a JDK.
   4.649 -        if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
   4.650 -            JAVAC=$BOOT_JDK/bin/javac
   4.651 -            JAVA=$BOOT_JDK/bin/java
   4.652 +        if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
   4.653 +            JAVAC="$BOOT_JDK/bin/javac"
   4.654 +            JAVA="$BOOT_JDK/bin/java"
   4.655              BOOT_JDK_FOUND=yes
   4.656          else
   4.657 -            as_fn_error $? "Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK." "$LINENO" 5
   4.658 +            as_fn_error $? "Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK. JAVA_HOME=$JAVA_HOME" "$LINENO" 5
   4.659          fi
   4.660      fi
   4.661  fi
   4.662 @@ -11634,7 +11764,7 @@
   4.663  FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
   4.664  if test "x$FOUND_VERSION_78" = x; then
   4.665      help_on_build_dependency openjdk
   4.666 -    as_fn_error $? "Your bootjdk must be version 7 or 8. $HELP_MSG" "$LINENO" 5
   4.667 +    as_fn_error $? "Your boot-jdk must be version 7 or 8. $HELP_MSG" "$LINENO" 5
   4.668  fi
   4.669  
   4.670  # When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
   4.671 @@ -11653,7 +11783,7 @@
   4.672  
   4.673  
   4.674  
   4.675 -# Use the javac tool from the Boot JDK.
   4.676 +# Use the javah tool from the Boot JDK.
   4.677  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javah in Boot JDK" >&5
   4.678  $as_echo_n "checking for javah in Boot JDK... " >&6; }
   4.679  JAVAH=$BOOT_JDK/bin/javah
   4.680 @@ -11686,6 +11816,17 @@
   4.681  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
   4.682  $as_echo "yes" >&6; }
   4.683  
   4.684 +# Use the native2ascii tool from the Boot JDK.
   4.685 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for native2ascii in Boot JDK" >&5
   4.686 +$as_echo_n "checking for native2ascii in Boot JDK... " >&6; }
   4.687 +NATIVE2ASCII=$BOOT_JDK/bin/native2ascii
   4.688 +if test ! -x $NATIVE2ASCII; then
   4.689 +    as_fn_error $? "Could not find a working native2ascii" "$LINENO" 5
   4.690 +fi
   4.691 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
   4.692 +$as_echo "yes" >&6; }
   4.693 +
   4.694 +
   4.695  ###############################################################################
   4.696  #
   4.697  # Pickup additional source for a component from outside of the source root
   4.698 @@ -13135,9 +13276,6 @@
   4.699      as_fn_error $? "Could not find X11 libraries. $HELP_MSG" "$LINENO" 5
   4.700  fi
   4.701  
   4.702 -
   4.703 -
   4.704 -
   4.705  # Some of the old makefiles require a setting of OPENWIN_HOME
   4.706  # Since the X11R6 directory has disappeared on later Linuxes,
   4.707  # we need to probe for it.
   4.708 @@ -13154,6 +13292,18 @@
   4.709  fi
   4.710  
   4.711  
   4.712 +
   4.713 +#
   4.714 +# Weird Sol10 something check...TODO change to try compile
   4.715 +#
   4.716 +if test "x${HOST_OS}" = xsolaris; then
   4.717 +  if test "`uname -r`" = "5.10"; then
   4.718 +     if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then
   4.719 +     	X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS"
   4.720 +     fi
   4.721 +  fi
   4.722 +fi
   4.723 +
   4.724  ac_ext=c
   4.725  ac_cpp='$CPP $CPPFLAGS'
   4.726  ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
   4.727 @@ -13192,6 +13342,9 @@
   4.728      as_fn_error $? "Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG" "$LINENO" 5
   4.729  fi
   4.730  
   4.731 +
   4.732 +
   4.733 +
   4.734  ###############################################################################
   4.735  #
   4.736  # The common unix printing system cups is used to print from java.
   4.737 @@ -13216,7 +13369,7 @@
   4.738  
   4.739  
   4.740  if test "x$CUPS_NOT_NEEDED" = xyes; then
   4.741 -	if test "x$with_cups" != x || test "x$with_cups-include" != x || test "x$with_cups-lib" != x; then
   4.742 +	if test "x${with_cups}" != x || test "x${with_cups_include}" != x || test "x${with_cups_lib}" != x; then
   4.743  		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cups not used, so --with-cups is ignored" >&5
   4.744  $as_echo "$as_me: WARNING: cups not used, so --with-cups is ignored" >&2;}
   4.745  	fi
   4.746 @@ -13225,21 +13378,21 @@
   4.747  else
   4.748  	CUPS_FOUND=no
   4.749  
   4.750 -	if test "x$with_cups" = xno || test "x$with_cups-include" = xno || test "x$with_cups-lib" = xno; then
   4.751 +	if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno || test "x${with_cups_lib}" = xno; then
   4.752  	    as_fn_error $? "It is not possible to disable the use of cups. Remove the --without-cups option." "$LINENO" 5
   4.753  	fi
   4.754  
   4.755 -	if test "x$with_cups" != x; then
   4.756 -	    CUPS_LIBS="-L$with_cups/lib -lcups"
   4.757 -	    CUPS_CFLAGS="-I$with_cups/include"
   4.758 +	if test "x${with_cups}" != x; then
   4.759 +	    CUPS_LIBS="-L${with_cups}/lib -lcups"
   4.760 +	    CUPS_CFLAGS="-I${with_cups}/include"
   4.761  	    CUPS_FOUND=yes
   4.762  	fi
   4.763 -	if test "x$with_cups-include" != x; then
   4.764 -	    CUPS_CFLAGS="-I$with_cups-include"
   4.765 +	if test "x${with_cups_include}" != x; then
   4.766 +	    CUPS_CFLAGS="-I${with_cups_include}"
   4.767  	    CUPS_FOUND=yes
   4.768  	fi
   4.769 -	if test "x$with_cups-lib" != x; then
   4.770 -	    CUPS_LIBS="-L$with_cups-lib -lcups"
   4.771 +	if test "x${with_cups_lib}" != x; then
   4.772 +	    CUPS_LIBS="-L${with_cups_lib} -lcups"
   4.773  	    CUPS_FOUND=yes
   4.774  	fi
   4.775  	if test "x$CUPS_FOUND" = xno; then
   4.776 @@ -13796,7 +13949,7 @@
   4.777  
   4.778  
   4.779  if test "x$ALSA_NOT_NEEDED" = xyes; then
   4.780 -	if test "x$with_alsa" != x || test "x$with_alsa-include" != x || test "x$with_alsa-lib" != x; then
   4.781 +	if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then
   4.782  		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: alsa not used, so --with-alsa is ignored" >&5
   4.783  $as_echo "$as_me: WARNING: alsa not used, so --with-alsa is ignored" >&2;}
   4.784  	fi
   4.785 @@ -13805,21 +13958,21 @@
   4.786  else
   4.787  	ALSA_FOUND=no
   4.788  
   4.789 -	if test "x$with_alsa" = xno || test "x$with_alsa-include" = xno || test "x$with_alsa-lib" = xno; then
   4.790 +	if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
   4.791  	    as_fn_error $? "It is not possible to disable the use of alsa. Remove the --without-alsa option." "$LINENO" 5
   4.792  	fi
   4.793  
   4.794 -	if test "x$with_alsa" != x; then
   4.795 -	    ALSA_LIBS="-L$with_alsa/lib -lalsa"
   4.796 -	    ALSA_CFLAGS="-I$with_alsa/include"
   4.797 +	if test "x${with_alsa}" != x; then
   4.798 +	    ALSA_LIBS="-L${with_alsa}/lib -lalsa"
   4.799 +	    ALSA_CFLAGS="-I${with_alsa}/include"
   4.800  	    ALSA_FOUND=yes
   4.801  	fi
   4.802 -	if test "x$with_alsa-include" != x; then
   4.803 -	    ALSA_CFLAGS="-I$with_alsa/include"
   4.804 +	if test "x${with_alsa_include}" != x; then
   4.805 +	    ALSA_CFLAGS="-I${with_alsa_include}"
   4.806  	    ALSA_FOUND=yes
   4.807  	fi
   4.808 -	if test "x$with_alsa-lib" != x; then
   4.809 -	    ALSA_LIBS="-L$with_alsa/lib -lalsa"
   4.810 +	if test "x${with_alsa_lib}" != x; then
   4.811 +	    ALSA_LIBS="-L${with_alsa_lib} -lalsa"
   4.812  	    ALSA_FOUND=yes
   4.813  	fi
   4.814  	if test "x$ALSA_FOUND" = xno; then
   4.815 @@ -14090,17 +14243,17 @@
   4.816  fi
   4.817  
   4.818  
   4.819 -if test "x$with_pulse" != x; then
   4.820 -    PULSE_LIBS="-L$with_pulse/lib -lfreetype"
   4.821 -    PULSE_CFLAGS="-I$with_pulse/include"
   4.822 +if test "x${with_pulse}" != x; then
   4.823 +    PULSE_LIBS="-L${with_pulse}/lib -lfreetype"
   4.824 +    PULSE_CFLAGS="-I${with_pulse}/include"
   4.825      PULSE_FOUND=yes
   4.826  fi
   4.827 -if test "x$with_pulse-include" != x; then
   4.828 -    PULSE_CFLAGS="-I$with_pulse/include"
   4.829 +if test "x${with_pulse_include}" != x; then
   4.830 +    PULSE_CFLAGS="-I${with_pulse_include}"
   4.831      PULSE_FOUND=yes
   4.832  fi
   4.833 -if test "x$with_pulse-lib" != x; then
   4.834 -    PULSE_LIBS="-L$with_pulse/lib -lfreetype"
   4.835 +if test "x${with_pulse_lib}" != x; then
   4.836 +    PULSE_LIBS="-L${with_pulse_lib} -lpulse"
   4.837      PULSE_FOUND=yes
   4.838  fi
   4.839  if test "x$PULSE_FOUND" = xno; then
   4.840 @@ -14537,9 +14690,9 @@
   4.841  # Check the maths library
   4.842  #
   4.843  
   4.844 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
   4.845 -$as_echo_n "checking for main in -lm... " >&6; }
   4.846 -if test "${ac_cv_lib_m_main+set}" = set; then :
   4.847 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
   4.848 +$as_echo_n "checking for cos in -lm... " >&6; }
   4.849 +if test "${ac_cv_lib_m_cos+set}" = set; then :
   4.850    $as_echo_n "(cached) " >&6
   4.851  else
   4.852    ac_check_lib_save_LIBS=$LIBS
   4.853 @@ -14547,27 +14700,33 @@
   4.854  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   4.855  /* end confdefs.h.  */
   4.856  
   4.857 -
   4.858 +/* Override any GCC internal prototype to avoid an error.
   4.859 +   Use char because int might match the return type of a GCC
   4.860 +   builtin and then its argument prototype would still apply.  */
   4.861 +#ifdef __cplusplus
   4.862 +extern "C"
   4.863 +#endif
   4.864 +char cos ();
   4.865  int
   4.866  main ()
   4.867  {
   4.868 -return main ();
   4.869 +return cos ();
   4.870    ;
   4.871    return 0;
   4.872  }
   4.873  _ACEOF
   4.874  if ac_fn_cxx_try_link "$LINENO"; then :
   4.875 -  ac_cv_lib_m_main=yes
   4.876 -else
   4.877 -  ac_cv_lib_m_main=no
   4.878 +  ac_cv_lib_m_cos=yes
   4.879 +else
   4.880 +  ac_cv_lib_m_cos=no
   4.881  fi
   4.882  rm -f core conftest.err conftest.$ac_objext \
   4.883      conftest$ac_exeext conftest.$ac_ext
   4.884  LIBS=$ac_check_lib_save_LIBS
   4.885  fi
   4.886 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5
   4.887 -$as_echo "$ac_cv_lib_m_main" >&6; }
   4.888 -if test "x$ac_cv_lib_m_main" = x""yes; then :
   4.889 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
   4.890 +$as_echo "$ac_cv_lib_m_cos" >&6; }
   4.891 +if test "x$ac_cv_lib_m_cos" = x""yes; then :
   4.892    cat >>confdefs.h <<_ACEOF
   4.893  #define HAVE_LIBM 1
   4.894  _ACEOF
   4.895 @@ -14585,6 +14744,61 @@
   4.896  
   4.897  ###############################################################################
   4.898  #
   4.899 +# Check for libdl.so
   4.900 +
   4.901 +save_LIBS="$LIBS"
   4.902 +LIBS=""
   4.903 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
   4.904 +$as_echo_n "checking for dlopen in -ldl... " >&6; }
   4.905 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
   4.906 +  $as_echo_n "(cached) " >&6
   4.907 +else
   4.908 +  ac_check_lib_save_LIBS=$LIBS
   4.909 +LIBS="-ldl  $LIBS"
   4.910 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
   4.911 +/* end confdefs.h.  */
   4.912 +
   4.913 +/* Override any GCC internal prototype to avoid an error.
   4.914 +   Use char because int might match the return type of a GCC
   4.915 +   builtin and then its argument prototype would still apply.  */
   4.916 +#ifdef __cplusplus
   4.917 +extern "C"
   4.918 +#endif
   4.919 +char dlopen ();
   4.920 +int
   4.921 +main ()
   4.922 +{
   4.923 +return dlopen ();
   4.924 +  ;
   4.925 +  return 0;
   4.926 +}
   4.927 +_ACEOF
   4.928 +if ac_fn_cxx_try_link "$LINENO"; then :
   4.929 +  ac_cv_lib_dl_dlopen=yes
   4.930 +else
   4.931 +  ac_cv_lib_dl_dlopen=no
   4.932 +fi
   4.933 +rm -f core conftest.err conftest.$ac_objext \
   4.934 +    conftest$ac_exeext conftest.$ac_ext
   4.935 +LIBS=$ac_check_lib_save_LIBS
   4.936 +fi
   4.937 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
   4.938 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
   4.939 +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
   4.940 +  cat >>confdefs.h <<_ACEOF
   4.941 +#define HAVE_LIBDL 1
   4.942 +_ACEOF
   4.943 +
   4.944 +  LIBS="-ldl $LIBS"
   4.945 +
   4.946 +fi
   4.947 +
   4.948 +LIBDL="$LIBS"
   4.949 +
   4.950 +LIBS="$save_LIBS"
   4.951 +
   4.952 +###############################################################################
   4.953 +#
   4.954  # Should we run the painfully slow javadoc tool?
   4.955  #
   4.956  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5
   4.957 @@ -14632,6 +14846,9 @@
   4.958  # Setup the opt flags for different compilers
   4.959  # and different operating systems.
   4.960  #
   4.961 +C_FLAG_DEPS="-MMD -MF"
   4.962 +CXX_FLAG_DEPS="-MMD -MF"
   4.963 +
   4.964  case $COMPILER_TYPE in
   4.965    CC )
   4.966      D_FLAG="-g"
   4.967 @@ -14641,9 +14858,9 @@
   4.968  	  macosx )
   4.969  	    # On MacOSX we optimize for size, something
   4.970  	    # we should do for all platforms?
   4.971 -	    C_O_FLAG_HI="-O3"
   4.972 +	    C_O_FLAG_HI="-Os"
   4.973  	    C_O_FLAG_NORM="-Os"
   4.974 -	    C_O_FLAG_NONE="-O0"
   4.975 +	    C_O_FLAG_NONE=""
   4.976  	    ;;
   4.977  	  *)
   4.978  	    C_O_FLAG_HI="-O3"
   4.979 @@ -14656,19 +14873,61 @@
   4.980          CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
   4.981          ;;
   4.982        ossc )
   4.983 +        #
   4.984 +        # Forte has different names for this with their C++ compiler...
   4.985 +        #
   4.986 +	CXX_FLAG_DEPS="-xMMD -xMF"
   4.987 +
   4.988 +# Extra options used with HIGHEST
   4.989 +#
   4.990 +# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
   4.991 +#          done with care, there are some assumptions below that need to
   4.992 +#          be understood about the use of pointers, and IEEE behavior.
   4.993 +#
   4.994 +# Use non-standard floating point mode (not IEEE 754)
   4.995 +CC_HIGHEST="$CC_HIGHEST -fns"
   4.996 +# Do some simplification of floating point arithmetic (not IEEE 754)
   4.997 +CC_HIGHEST="$CC_HIGHEST -fsimple"
   4.998 +# Use single precision floating point with 'float'
   4.999 +CC_HIGHEST="$CC_HIGHEST -fsingle"
  4.1000 +# Assume memory references via basic pointer types do not alias
  4.1001 +#   (Source with excessing pointer casting and data access with mixed
  4.1002 +#    pointer types are not recommended)
  4.1003 +CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
  4.1004 +# Use intrinsic or inline versions for math/std functions
  4.1005 +#   (If you expect perfect errno behavior, do not use this)
  4.1006 +CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all"
  4.1007 +# Loop data dependency optimizations (need -xO3 or higher)
  4.1008 +CC_HIGHEST="$CC_HIGHEST -xdepend"
  4.1009 +# Pointer parameters to functions do not overlap
  4.1010 +#   (Similar to -xalias_level=basic usage, but less obvious sometimes.
  4.1011 +#    If you pass in multiple pointers to the same data, do not use this)
  4.1012 +CC_HIGHEST="$CC_HIGHEST -xrestrict"
  4.1013 +# Inline some library routines
  4.1014 +#   (If you expect perfect errno behavior, do not use this)
  4.1015 +CC_HIGHEST="$CC_HIGHEST -xlibmil"
  4.1016 +# Use optimized math routines
  4.1017 +#   (If you expect perfect errno behavior, do not use this)
  4.1018 +#  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
  4.1019 +#CC_HIGHEST="$CC_HIGHEST -xlibmopt"
  4.1020 +
  4.1021          case $LEGACY_HOST_CPU1 in
  4.1022            i586)
  4.1023 +            C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xchip=pentium"
  4.1024              C_O_FLAG_HI="-xO4 -Wu,-O4~yz"
  4.1025              C_O_FLAG_NORM="-xO2 -Wu,-O2~yz"
  4.1026              C_O_FLAG_NONE=""
  4.1027 +            CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xchip=pentium"
  4.1028              CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz"
  4.1029              CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz"
  4.1030              CXX_O_FLAG_NONE=""
  4.1031              ;;
  4.1032            sparc)
  4.1033 +            C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
  4.1034              C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
  4.1035              C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
  4.1036              C_O_FLAG_NONE=""
  4.1037 +            CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
  4.1038              CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
  4.1039              CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
  4.1040              CXX_O_FLAG_NONE=""
  4.1041 @@ -14687,6 +14946,18 @@
  4.1042      ;;
  4.1043  esac
  4.1044  
  4.1045 +if test -z "$C_O_FLAG_HIGHEST"; then
  4.1046 +   C_O_FLAG_HIGHEST="$C_O_FLAG_HI"
  4.1047 +fi
  4.1048 +
  4.1049 +if test -z "$CXX_O_FLAG_HIGHEST"; then
  4.1050 +   CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI"
  4.1051 +fi
  4.1052 +
  4.1053 +
  4.1054 +
  4.1055 +
  4.1056 +
  4.1057  
  4.1058  
  4.1059  
  4.1060 @@ -14810,16 +15081,17 @@
  4.1061  #
  4.1062  case $COMPILER_NAME in
  4.1063        gcc )
  4.1064 -      	  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \
  4.1065 +      	  CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
  4.1066 +                          -pipe -fno-omit-frame-pointer \
  4.1067                            -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
  4.1068            CFLAGS_JDK="$CFLAGS_JDK -fno-strict-aliasing"
  4.1069            ;;
  4.1070        ossc )
  4.1071 -      	  CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa REQUIRED -v -mt -norunpath -xnolib"
  4.1072 -      	  CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt REQUIRED -features=no%except -DCC_NOEX"
  4.1073 +      	  CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -norunpath -xnolib"
  4.1074 +      	  CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX"
  4.1075            ;;
  4.1076        cl )
  4.1077 -          CCXXFLAGS_JDK="$CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
  4.1078 +          CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
  4.1079                 -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
  4.1080  	       -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
  4.1081  	       -DWIN32 -DIAL"
  4.1082 @@ -14898,14 +15170,14 @@
  4.1083  #
  4.1084  # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
  4.1085  if test "x$COMPILER_TYPE" = xCL; then
  4.1086 -    LDFLAGS_JDKLIB="$LDFLAGS -libpath:${JDK_OUTPUTDIR}/lib jvm.lib java.lib"
  4.1087 +    LDFLAGS_JDKLIB="$LDFLAGS -dll -libpath:${JDK_OUTPUTDIR}/lib -libpath:${JDK_OUTPUTDIR}/objs"
  4.1088      LDFLAGS_JDKLIB_SUFFIX=""
  4.1089 -    if test "x$HOST_CPU_BITS" = "x64"; then
  4.1090 -        LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj64/jli.lib"
  4.1091 +    if test "$HOST_CPU_BITS" == "64"; then
  4.1092 +        LDFLAGS_STACK_SIZE=1048576
  4.1093      else
  4.1094 -        LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj/jli.lib"
  4.1095 -    fi
  4.1096 -    LDFLAGS_JDKEXE_SUFFIX=""
  4.1097 +        LDFLAGS_STACK_SIZE=327680
  4.1098 +    fi
  4.1099 +    LDFLAGS_JDKEXE="$LDFLAGS /STACK:$LDFLAGS_STACK_SIZE"
  4.1100  else
  4.1101      # If this is a --hash-style=gnu system, use --hash-style=both, why?
  4.1102      HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
  4.1103 @@ -14920,7 +15192,9 @@
  4.1104          fi
  4.1105      fi
  4.1106  
  4.1107 -    LDFLAGS_JDKLIB="$LDFLAGS $SHARED_LIBRARY_FLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \
  4.1108 +    LDFLAGS_JDKLIB="$LDFLAGS $SHARED_LIBRARY_FLAGS \
  4.1109 +                    -L${JDK_OUTPUTDIR}/objs \
  4.1110 +                    -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \
  4.1111                      -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}client \
  4.1112    	            -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}"
  4.1113      LDFLAGS_JDKLIB_SUFFIX="-ljvm -ljava"
  4.1114 @@ -14930,8 +15204,10 @@
  4.1115  
  4.1116      # Only the jli library is explicitly linked when the launchers are built.
  4.1117      # The libjvm is then dynamically loaded/linked by the launcher.
  4.1118 -    LDFLAGS_JDKEXE="$LDFLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli"
  4.1119 -    LDFLAGS_JDKEXE_SUFFIX="-ljli"
  4.1120 +    if test "x$HOST_OS" != "xmacosx"; then
  4.1121 +       LDFLAGS_JDKEXE="$LDFLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli"
  4.1122 +       LDFLAGS_JDKEXE_SUFFIX="-ljli"
  4.1123 +    fi
  4.1124  fi
  4.1125  
  4.1126  
  4.1127 @@ -15081,17 +15357,39 @@
  4.1128  # Could someone enlighten this configure script with a comment about libCrun?
  4.1129  # The LEGACY_HOST_CPU3 is the setting for ISA_DIR.
  4.1130  #
  4.1131 -if test "x$HOST_OS" = xsolaris; then
  4.1132 -    LIBCXX="$LIBCXX /usr/lib${LEGACY_HOST_CPU3}/libCrun.so.1"
  4.1133 +if test "x$HOST_OS" = xsolaris && test "x$LIBCXX" = x; then
  4.1134 +    LIBCXX="/usr/lib${LEGACY_HOST_CPU3}/libCrun.so.1"
  4.1135 +fi
  4.1136 +
  4.1137 +# TODO better (platform agnostic) test
  4.1138 +if test "x$HOST_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
  4.1139 +    LIBCXX="-lstdc++"
  4.1140  fi
  4.1141  
  4.1142  
  4.1143  
  4.1144  ###############################################################################
  4.1145 +
  4.1146 +OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`"
  4.1147 +OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`"
  4.1148 +OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`"
  4.1149 +OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`"
  4.1150 +
  4.1151 +
  4.1152 +
  4.1153 +
  4.1154 +###############################################################################
  4.1155  #
  4.1156  # Misc
  4.1157  #
  4.1158  
  4.1159 +# The name of the Service Agent jar.
  4.1160 +SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
  4.1161 +if test "x$HOST_OS" = "xwindows"; then
  4.1162 +    SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
  4.1163 +fi
  4.1164 +
  4.1165 +
  4.1166  # Control wether Hotspot runs Queens test after build.
  4.1167  # Check whether --enable-hotspot-test-in-build was given.
  4.1168  if test "${enable_hotspot_test_in_build+set}" = set; then :
  4.1169 @@ -15109,19 +15407,48 @@
  4.1170  
  4.1171  ###############################################################################
  4.1172  #
  4.1173 -# A helpful message at the end of the configure run.
  4.1174 -#
  4.1175 -if test "x$CCACHE_FOUND" = x && test "x$GCC" = xyes; then
  4.1176 -    help_on_build_dependency ccache
  4.1177 -
  4.1178 -    printf "\nTip of the day:\nYou should really install ccache version 3.1.4 or newer.\n"
  4.1179 -    printf "It gives a tremendous speedup for C++ recompilations with precompiled headers!\n"
  4.1180 -fi
  4.1181 -
  4.1182 -if test "x$CCACHE_FOUND" != x && test "x$HAS_GOOD_CCACHE" = x; then
  4.1183 -    printf "You have a ccache installed, but it is a version prior to 3.1.4. Try upgrading.\n"
  4.1184 -fi
  4.1185 -
  4.1186 +# Choose cacerts source file
  4.1187 +#
  4.1188 +
  4.1189 +# Check whether --with-cacerts-file was given.
  4.1190 +if test "${with_cacerts_file+set}" = set; then :
  4.1191 +  withval=$with_cacerts_file;
  4.1192 +fi
  4.1193 +
  4.1194 +if test "x$with_cacerts_file" != x; then
  4.1195 +    CACERTS_FILE=$with_cacerts_file
  4.1196 +else
  4.1197 +    if test "x$OPENJDK" = "xtrue"; then
  4.1198 +        CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
  4.1199 +    else
  4.1200 +        CACERTS_FILE=${SRC_ROOT}/jdk/src/closed/share/lib/security/cacerts.internal
  4.1201 +    fi
  4.1202 +fi
  4.1203 +
  4.1204 +
  4.1205 +# Check if build directory is on local disk.
  4.1206 +# return 0 if it is on local disk, non-0 if on remote disk or failure
  4.1207 +function is_directory_on_local_disk {
  4.1208 +	# df -l lists only local disks; if the given directory is not found then
  4.1209 +	# a non-zero exit code is given
  4.1210 +	$DF -l $1 > /dev/null 2>&1
  4.1211 +}
  4.1212 +
  4.1213 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if build directory is on local disk" >&5
  4.1214 +$as_echo_n "checking if build directory is on local disk... " >&6; }
  4.1215 +if is_directory_on_local_disk $OUTPUT_ROOT; then
  4.1216 +	OUTPUT_DIR_IS_LOCAL="yes"
  4.1217 +else
  4.1218 +	OUTPUT_DIR_IS_LOCAL="no"
  4.1219 +fi
  4.1220 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OUTPUT_DIR_IS_LOCAL" >&5
  4.1221 +$as_echo "$OUTPUT_DIR_IS_LOCAL" >&6; }
  4.1222 +
  4.1223 +# We're messing a bit with internal autoconf variables to put the config.status in the
  4.1224 +# output directory instead of the current directory.
  4.1225 +CONFIG_STATUS=$OUTPUT_ROOT/config.status
  4.1226 +
  4.1227 +# Now create the actual output files, after this, the main work of configure is done
  4.1228  cat >confcache <<\_ACEOF
  4.1229  # This file is a shell script that caches the results of configure
  4.1230  # tests run on this system so they can be shared between configure
  4.1231 @@ -16393,3 +16720,62 @@
  4.1232  $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
  4.1233  fi
  4.1234  
  4.1235 +
  4.1236 +# Finally output some useful information to the user
  4.1237 +
  4.1238 +if test "x$CCACHE_FOUND" != x; then
  4.1239 +	if  test "x$HAS_GOOD_CCACHE" = x; then
  4.1240 +		CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
  4.1241 +		CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
  4.1242 +	else
  4.1243 +		CCACHE_STATUS="installed and in use"
  4.1244 +	fi
  4.1245 +else
  4.1246 +	if test "x$GCC" = xyes; then
  4.1247 +		CCACHE_STATUS="not installed (consider installing)"
  4.1248 +		CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
  4.1249 +	else
  4.1250 +		CCACHE_STATUS="not available for your system"
  4.1251 +	fi
  4.1252 +fi
  4.1253 +
  4.1254 +printf "\n"
  4.1255 +printf "====================================================\n"
  4.1256 +printf "A new configuration has been successfully created in\n"
  4.1257 +printf "$OUTPUT_ROOT\n"
  4.1258 +if test "x$CONFIGURE_COMMAND_LINE" != x; then
  4.1259 +	printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
  4.1260 +else
  4.1261 +	printf "using default settings.\n"
  4.1262 +fi
  4.1263 +
  4.1264 +printf "\n"
  4.1265 +printf "Configuration summary:\n"
  4.1266 +printf "* Debug level:  $DEBUG_LEVEL\n"
  4.1267 +printf "* JDK variant:  $JDK_VARIANT\n"
  4.1268 +printf "* JVM variants: $with_jvm_variants\n"
  4.1269 +printf "* Host info:    OS: $HOST_OS, CPU architecture: $HOST_CPU_ARCH, address length: $HOST_CPU_BITS\n"
  4.1270 +printf "* Boot JDK:     $BOOT_JDK\n"
  4.1271 +
  4.1272 +printf "\n"
  4.1273 +printf "Build performance summary:\n"
  4.1274 +printf "* Cores to use:  $NUM_CORES\n"
  4.1275 +printf "* Memory limit:  $MEMORY_SIZE MB\n"
  4.1276 +printf "* ccache status: $CCACHE_STATUS\n"
  4.1277 +
  4.1278 +if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
  4.1279 +	printf "\n"
  4.1280 +	printf "WARNING: Your build output directory is not on a local disk.\n"
  4.1281 +	printf "This will severely degrade build performance!\n"
  4.1282 +	printf "It is recommended that you create an output directory on a local disk,\n"
  4.1283 +	printf "and run the configure script again from that directory.\n"
  4.1284 +fi
  4.1285 +
  4.1286 +if test "x$CCACHE_HELP_MSG" != x; then
  4.1287 +	printf "\n"
  4.1288 +	printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
  4.1289 +	printf "$CCACHE_HELP_MSG\n"
  4.1290 +
  4.1291 +    help_on_build_dependency ccache
  4.1292 +    printf "$HELP_MSG\n"
  4.1293 +fi
     5.1 --- a/common/autoconf/configure.ac	Fri Jun 08 12:01:05 2012 -0700
     5.2 +++ b/common/autoconf/configure.ac	Wed Jun 13 16:53:05 2012 -0700
     5.3 @@ -93,7 +93,7 @@
     5.4  CHECK_NONEMPTY(MAKE)
     5.5  MAKE_VERSION=`$MAKE --version | head -n 1 | grep '3.8[[12346789]]'`
     5.6  if test "x$MAKE_VERSION" = x; then
     5.7 -    AC_ERROR([You must use GNU make 3.81 or newer! Please put it in the path.])
     5.8 +    AC_MSG_ERROR([You must use GNU make 3.81 or newer! Please put it in the path.])
     5.9  fi
    5.10  AC_PATH_PROG(MKDIR, mkdir)
    5.11  CHECK_NONEMPTY(MKDIR)
    5.12 @@ -147,6 +147,8 @@
    5.13  CHECK_NONEMPTY(EXPR)
    5.14  AC_PATH_PROG(FILE, file)
    5.15  CHECK_NONEMPTY(FILE)
    5.16 +AC_PATH_PROG(HG, hg)
    5.17 +
    5.18  # Figure out the build and host system.
    5.19  AC_CANONICAL_BUILD
    5.20  AC_CANONICAL_HOST
    5.21 @@ -157,7 +159,7 @@
    5.22  if test "x$with_data_model" != x && \
    5.23     test "x$with_data_model" != x32 && \
    5.24     test "x$with_data_model" != x64 ; then
    5.25 -    AC_ERROR([The data model can only be 32 or 64!])
    5.26 +    AC_MSG_ERROR([The data model can only be 32 or 64!])
    5.27  fi
    5.28  # Translate the standard cpu-vendor-kernel-os quadruplets into
    5.29  # the new HOST_.... and BUILD_... and the legacy names used by
    5.30 @@ -221,7 +223,7 @@
    5.31  PATH_SEP=":"
    5.32  if test "x$BUILD_OS" = "xwindows"; then
    5.33      if test "x$CYGPATH" = x; then
    5.34 -        AC_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
    5.35 +        AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
    5.36      fi
    5.37      PATH_SEP=";"
    5.38  fi
    5.39 @@ -239,12 +241,12 @@
    5.40  #
    5.41  # OpenJDK or closed
    5.42  #
    5.43 -AC_ARG_ENABLE([openjdk], [AS_HELP_STRING([--enable-openjdk],
    5.44 +AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
    5.45      [build OpenJDK regardless of the presence of closed repositories @<:@disabled@:>@])],,)
    5.46  
    5.47 -if test "x$enable_openjdk" = "xyes"; then
    5.48 +if test "x$enable_openjdk_only" = "xyes"; then
    5.49      OPENJDK=true
    5.50 -elif test "x$enable_openjdk" = "xno"; then
    5.51 +elif test "x$enable_openjdk_only" = "xno"; then
    5.52      OPENJDK=false
    5.53  elif test -d "$SRC_ROOT/jdk/src/closed"; then
    5.54      OPENJDK=false
    5.55 @@ -298,7 +300,7 @@
    5.56      MINIMIZE_RAM_USAGE="MINIMIZE_RAM_USAGE:=true"
    5.57      JDK_VARIANT="embedded"
    5.58  else
    5.59 -    AC_ERROR([The available JDK variants are: normal, embedded])
    5.60 +    AC_MSG_ERROR([The available JDK variants are: normal, embedded])
    5.61  fi
    5.62                                
    5.63  AC_SUBST(JAVASE_EMBEDDED)
    5.64 @@ -370,7 +372,7 @@
    5.65  TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
    5.66  
    5.67  if test "x$TEST_VARIANTS" != "x,"; then
    5.68 -   AC_ERROR([The available JVM variants are: server, client, kernel, zero, zeroshark])
    5.69 +   AC_MSG_ERROR([The available JVM variants are: server, client, kernel, zero, zeroshark])
    5.70  fi   
    5.71  AC_MSG_RESULT([$with_jvm_variants])
    5.72  
    5.73 @@ -382,12 +384,12 @@
    5.74  
    5.75  if test "x$JVM_VARIANT_CLIENT" = xtrue; then
    5.76      if test "x$HOST_CPU_BITS" = x64; then
    5.77 -        AC_ERROR([You cannot build a client JVM for a 64-bit machine.])
    5.78 +        AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
    5.79      fi
    5.80  fi
    5.81  if test "x$JVM_VARIANT_KERNEL" = xtrue; then
    5.82      if test "x$HOST_CPU_BITS" = x64; then
    5.83 -        AC_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
    5.84 +        AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
    5.85      fi
    5.86  fi
    5.87  
    5.88 @@ -426,7 +428,7 @@
    5.89  	[
    5.90          DEBUG_LEVEL="${withval}"
    5.91          if test "x$ENABLE_DEBUG" = xyes; then
    5.92 -			AC_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
    5.93 +			AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
    5.94          fi
    5.95      ])
    5.96  AC_MSG_RESULT([$DEBUG_LEVEL])
    5.97 @@ -434,7 +436,7 @@
    5.98  if test "x$DEBUG_LEVEL" != xrelease && \
    5.99     test "x$DEBUG_LEVEL" != xfastdebug && \
   5.100     test "x$DEBUG_LEVEL" != xslowdebug; then
   5.101 -   AC_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
   5.102 +   AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
   5.103  fi
   5.104  
   5.105  case $DEBUG_LEVEL in
   5.106 @@ -520,14 +522,18 @@
   5.107  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
   5.108      # We are running configure from the src root.
   5.109      # Create a default ./build/host-variant-debuglevel output root.
   5.110 -    OUTPUT_ROOT="$SRC_ROOT/build/${HOST_OS}-${HOST_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
   5.111 +    CONF_NAME="${HOST_OS}-${HOST_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
   5.112 +    OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}"
   5.113      mkdir -p "$OUTPUT_ROOT"
   5.114      if test ! -d "$OUTPUT_ROOT"; then
   5.115 -        AC_ERROR([Could not create build directory $OUTPUT_ROOT])
   5.116 +        AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT])
   5.117      fi
   5.118  else
   5.119      # We are running configure from outside of the src dir.
   5.120      # Then use the current directory as output dir!
   5.121 +    # If configuration is situated in normal build directory, just use the build
   5.122 +    # directory name as configuration name, otherwise use the complete path.
   5.123 +    CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
   5.124      OUTPUT_ROOT="$CURDIR"
   5.125  fi
   5.126  
   5.127 @@ -565,7 +571,7 @@
   5.128  	if test "x$VARSBAT" = x || test ! -d "$VCPATH"; then
   5.129              AC_MSG_CHECKING([if we can find the VS installation])
   5.130              AC_MSG_RESULT([no])
   5.131 -            AC_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.])
   5.132 +            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.])
   5.133          fi
   5.134          case "$LEGACY_HOST_CPU1" in
   5.135            i?86)
   5.136 @@ -577,12 +583,12 @@
   5.137          esac
   5.138          # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
   5.139          cd $OUTPUT_ROOT
   5.140 -        $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH"
   5.141 +        bash $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH"
   5.142  	cd $CURDIR
   5.143  	if test ! -s $OUTPUT_ROOT/localdevenv.sh || test ! -s $OUTPUT_ROOT/localdevenv.gmk; then
   5.144              AC_MSG_CHECKING([if we can extract the needed env variables])
   5.145              AC_MSG_RESULT([no])
   5.146 -            AC_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.])
   5.147 +            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.])
   5.148          fi 
   5.149          # Now set all paths and other env variables. This will allow the rest of 
   5.150          # the configure script to find and run the compiler in the proper way.
   5.151 @@ -592,7 +598,7 @@
   5.152              AC_MSG_RESULT([$VCINSTALLDIR])
   5.153          else 
   5.154              AC_MSG_RESULT([no])
   5.155 -            AC_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.])
   5.156 +            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.])
   5.157          fi
   5.158          CHECK_FOR_VCINSTALLDIR=no
   5.159  	SETUPDEVENV="include $OUTPUT_ROOT/localdevenv.gmk"
   5.160 @@ -614,7 +620,7 @@
   5.161          fi
   5.162  	if test "x$MSVCR100DLL" = x; then
   5.163             AC_MSG_RESULT([no])
   5.164 -	   AC_ERROR([Could not find msvcr100.dll !])
   5.165 +	   AC_MSG_ERROR([Could not find msvcr100.dll !])
   5.166          fi
   5.167          AC_MSG_RESULT([$MSVCR100DLL])
   5.168  	SPACESAFE(MSVCR100DLL,[the path to msvcr100.dll])
   5.169 @@ -636,6 +642,7 @@
   5.170  AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
   5.171  
   5.172  AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk)
   5.173 +AC_SUBST(CONF_NAME, $CONF_NAME)
   5.174  AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
   5.175  
   5.176  # Where are the sources. Any of these can be overridden
   5.177 @@ -783,13 +790,15 @@
   5.178  ORG_CXXFLAGS="$CXXFLAGS"
   5.179  ORG_OBJCFLAGS="$OBJCFLAGS"
   5.180  
   5.181 +prepare_help_system
   5.182 +
   5.183  # gcc is almost always present, but on Windows we
   5.184  # prefer cl.exe and on Solaris we prefer CC.
   5.185  # Thus test for them in this order.
   5.186  AC_PROG_CC([cl cc gcc])
   5.187  if test "x$CC" = x; then
   5.188      help_on_build_dependency devkit
   5.189 -    AC_ERROR([Could not find a compiler. $HELP_MSG])
   5.190 +    AC_MSG_ERROR([Could not find a compiler. $HELP_MSG])
   5.191  fi
   5.192  if test "x$CC" = xcc && test "x$BUILD_OS" = xmacosx; then
   5.193      # Do not use cc on MacOSX use gcc instead.
   5.194 @@ -807,7 +816,7 @@
   5.195  
   5.196  if test "x$CXX" = x || test "x$CC" = x; then
   5.197      help_on_build_dependency devkit
   5.198 -    AC_ERROR([Could not find the needed compilers! $HELP_MSG ])
   5.199 +    AC_MSG_ERROR([Could not find the needed compilers! $HELP_MSG ])
   5.200  fi
   5.201  
   5.202  if test "x$BUILD_OS" != xwindows; then
   5.203 @@ -832,9 +841,10 @@
   5.204  
   5.205  AC_CHECK_TOOL(LD, ld)
   5.206  WHICHCMD(LD)
   5.207 -LDEXE="$LD"
   5.208 -LDCXX="$LD"
   5.209 -LDEXECXX="$LD"
   5.210 +LD="$CC"
   5.211 +LDEXE="$CC"
   5.212 +LDCXX="$CXX"
   5.213 +LDEXECXX="$CXX"
   5.214  # LDEXE is the linker to use, when creating executables.
   5.215  AC_SUBST(LDEXE)
   5.216  # Linking C++ libraries.
   5.217 @@ -856,7 +866,7 @@
   5.218  AS_IF([test "x$BUILD_OS" = xwindows], [
   5.219      # For now, assume that we are always compiling using cl.exe. 
   5.220      CC_OUT_OPTION=-Fo
   5.221 -    EXE_OUT_OPTION=-Fe
   5.222 +    EXE_OUT_OPTION=-out:
   5.223      LD_OUT_OPTION=-out:
   5.224      AR_OUT_OPTION=-out:
   5.225      # On Windows, reject /usr/bin/link, which is a cygwin
   5.226 @@ -866,10 +876,9 @@
   5.227      # the full path to the link.exe program.
   5.228      WHICHCMD_SPACESAFE([WINLD])
   5.229      LD="$WINLD"
   5.230 -    # However creating executables can only be done with cl.exe. 
   5.231 -    LDEXE="$CC"
   5.232 +    LDEXE="$WINLD"
   5.233      LDCXX="$WINLD"
   5.234 -    LDEXECXX="$CC"
   5.235 +    LDEXECXX="$WINLD"
   5.236  
   5.237      AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt])
   5.238      WHICHCMD_SPACESAFE([MT])
   5.239 @@ -877,7 +886,7 @@
   5.240      AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc])
   5.241      WHICHCMD_SPACESAFE([RC])
   5.242  
   5.243 -    RC_FLAGS="/l 0x409 /r"
   5.244 +    RC_FLAGS="-nologo /l 0x409 /r"
   5.245      AS_IF([test "x$VARIANT" = xOPT], [
   5.246          RC_FLAGS="$RC_FLAGS -d NDEBUG"
   5.247      ])
   5.248 @@ -903,14 +912,13 @@
   5.249      WHICHCMD_SPACESAFE([DUMPBIN])
   5.250  
   5.251      COMPILER_TYPE=CL
   5.252 -    CFLAGS="$CFLAGS -nologo"
   5.253 -    LDFLAGS="$LDFLAGS -nologo -dll -opt:ref -incremental:no "
   5.254 +    CCXXFLAGS="$CCXXFLAGS -nologo"
   5.255 +    LDFLAGS="$LDFLAGS -nologo -opt:ref -incremental:no"
   5.256      if test "x$LEGACY_HOST_CPU1" = xi586; then 
   5.257          LDFLAGS="$LDFLAGS -safeseh"
   5.258      fi
   5.259 -    if test "x$DEBUG_LEVEL" != xrelease; then
   5.260 -        LDFLAGS="$LDFLAGS -debug"
   5.261 -    fi
   5.262 +    # TODO: make -debug optional "--disable-full-debug-symbols"
   5.263 +    LDFLAGS="$LDFLAGS -debug"
   5.264  ])
   5.265  AC_SUBST(RC_FLAGS)
   5.266  AC_SUBST(COMPILER_TYPE)
   5.267 @@ -933,7 +941,7 @@
   5.268  AC_SUBST(AS)
   5.269  AC_SUBST(ASFLAGS)
   5.270  
   5.271 -if test "x$HOST_CPU_BITS" = x32 && test "x$HOST_OS" = macosx; then
   5.272 +if test "x$HOST_CPU_BITS" = x32 && test "x$HOST_OS" = xmacosx; then
   5.273      # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
   5.274      # While waiting for a better solution, the current workaround is to use -mstackrealign.
   5.275      CFLAGS="$CFLAGS -mstackrealign"
   5.276 @@ -944,7 +952,7 @@
   5.277                     ],
   5.278  	           [
   5.279  		        AC_MSG_RESULT([no])
   5.280 -	                AC_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
   5.281 +	                AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
   5.282  	           ])
   5.283  fi
   5.284  
   5.285 @@ -979,7 +987,7 @@
   5.286      if test ! -x $OUTPUT_ROOT/uncygdrive.exe; then 
   5.287          AC_MSG_RESULT([no])
   5.288          cat $OUTPUT_ROOT/uncygdrive1.log
   5.289 -        AC_ERROR([Could not create $OUTPUT_ROOT/uncygdrive.exe])
   5.290 +        AC_MSG_ERROR([Could not create $OUTPUT_ROOT/uncygdrive.exe])
   5.291      fi
   5.292      AC_MSG_RESULT([$UNCYGDRIVE])
   5.293      AC_MSG_CHECKING([if uncygdrive.exe works])
   5.294 @@ -989,7 +997,7 @@
   5.295      if test ! -x $OUTPUT_ROOT/uncygdrive2.exe; then 
   5.296          AC_MSG_RESULT([no])
   5.297          cat $OUTPUT_ROOT/uncygdrive2.log
   5.298 -        AC_ERROR([Uncygdrive did not work!])
   5.299 +        AC_MSG_ERROR([Uncygdrive did not work!])
   5.300      fi
   5.301      AC_MSG_RESULT([yes])
   5.302      rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj
   5.303 @@ -1014,7 +1022,15 @@
   5.304  # (The JVM can use 32 or 64 bit Java pointers but that decision
   5.305  # is made at runtime.)
   5.306  #
   5.307 +AC_LANG_PUSH(C++)
   5.308 +OLD_CXXFLAGS="$CXXFLAGS"
   5.309 +if test "x$HOST_OS" = xsolaris && test "x$with_data_model" != x; then
   5.310 +	CXXFLAGS="-m{$with_data_model} $CXXFLAGS"
   5.311 +fi
   5.312  AC_CHECK_SIZEOF([int *], [1111])
   5.313 +CXXFLAGS="$OLD_CXXFLAGS"
   5.314 +AC_LANG_POP(C++)
   5.315 +
   5.316  if test "x$ac_cv_sizeof_int_p" = x0; then 
   5.317      # The test failed, lets pick the assumed value.
   5.318      ARCH_DATA_MODEL=$HOST_CPU_BITS
   5.319 @@ -1032,7 +1048,7 @@
   5.320  AC_SUBST(ARCH_DATA_MODEL)
   5.321  
   5.322  if test "x$ARCH_DATA_MODEL" != "x$HOST_CPU_BITS"; then
   5.323 -    AC_ERROR([The tested number of bits in the host ($ARCH_DATA_MODEL) differs from the number of bits expected to be found in the host ($HOST_CPU_BITS)])
   5.324 +    AC_MSG_ERROR([The tested number of bits in the host ($ARCH_DATA_MODEL) differs from the number of bits expected to be found in the host ($HOST_CPU_BITS)])
   5.325  fi
   5.326  
   5.327  ###############################################################################
   5.328 @@ -1084,12 +1100,16 @@
   5.329      OBJ_SUFFIX='.o'
   5.330      EXE_SUFFIX=''
   5.331      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1'
   5.332 -    SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$(JDK_TOPDIR)/$1'
   5.333 +    SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1'
   5.334 +    C_FLAG_REORDER=''
   5.335 +    CXX_FLAG_REORDER=''
   5.336      SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN/$1'
   5.337      LD="$CC"
   5.338      LDEXE="$CC"
   5.339      LDCXX="$CXX"
   5.340      LDEXECXX="$CXX"
   5.341 +    # TODO: for embedded set --strip-unneeded
   5.342 +    POST_STRIP_CMD="$STRIP -g"
   5.343  
   5.344      # Linking is different on MacOSX
   5.345      if test "x$BUILD_OS" = xmacosx; then
   5.346 @@ -1102,6 +1122,7 @@
   5.347          SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1' 
   5.348          SET_SHARED_LIBRARY_MAPFILE=''
   5.349          SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
   5.350 +        POST_STRIP_CMD="$STRIP -S"
   5.351      fi
   5.352  else
   5.353      if test "x$BUILD_OS" = xsolaris; then
   5.354 @@ -1117,9 +1138,13 @@
   5.355          OBJ_SUFFIX='.o'
   5.356          EXE_SUFFIX=''
   5.357          SET_SHARED_LIBRARY_NAME=''
   5.358 -        SET_SHARED_LIBRARY_MAPFILE='-M $(JDK_TOPDIR)/$1'
   5.359 +        SET_SHARED_LIBRARY_MAPFILE='-M $1'
   5.360 +	C_FLAG_REORDER='-xF'
   5.361 +	CXX_FLAG_REORDER='-xF'
   5.362          SET_SHARED_LIBRARY_ORIGIN='-R \$$$$ORIGIN/$1'
   5.363          CFLAGS_JDKLIB_EXTRA='-xstrconst -D__solaris__'
   5.364 +        POST_STRIP_CMD="$STRIP -x"
   5.365 +        POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
   5.366      fi
   5.367      if test "x$BUILD_OS" = xwindows; then
   5.368          # If it is not gcc, then assume it is the MS Visual Studio compiler
   5.369 @@ -1149,7 +1174,11 @@
   5.370  AC_SUBST(SHARED_LIBRARY_FLAGS)
   5.371  AC_SUBST(SET_SHARED_LIBRARY_NAME)
   5.372  AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
   5.373 +AC_SUBST(C_FLAG_REORDER)
   5.374 +AC_SUBST(CXX_FLAG_REORDER)
   5.375  AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
   5.376 +AC_SUBST(POST_STRIP_CMD)
   5.377 +AC_SUBST(POST_MCS_CMD)
   5.378  
   5.379  # The (cross) compiler is now configured, we can now test capabilities
   5.380  # of the host platform.
   5.381 @@ -1161,13 +1190,13 @@
   5.382  AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal"])
   5.383  
   5.384  if test "x$ENDIAN" = xuniversal; then
   5.385 -    AC_ERROR([It seems like someone needs to decide how we are to deal with universal binaries on the MacOSX?])
   5.386 +    AC_MSG_ERROR([It seems like someone needs to decide how we are to deal with universal binaries on the MacOSX?])
   5.387  fi
   5.388  if test "x$ENDIAN" = xunknown; then
   5.389      ENDIAN="$HOST_CPU_ENDIAN"
   5.390  fi
   5.391  if test "x$ENDIAN" != "x$HOST_CPU_ENDIAN"; then
   5.392 -    AC_WARN([The tested endian in the host ($ENDIAN) differs from the endian expected to be found in the host ($HOST_CPU_ENDIAN)])
   5.393 +    AC_MSG_WARN([The tested endian in the host ($ENDIAN) differs from the endian expected to be found in the host ($HOST_CPU_ENDIAN)])
   5.394      ENDIAN="$HOST_CPU_ENDIAN"
   5.395  fi
   5.396  AC_SUBST(ENDIAN)
   5.397 @@ -1185,25 +1214,25 @@
   5.398      BOOT_JDK_FOUND=yes
   5.399  fi
   5.400  if test "x$BOOT_JDK_FOUND" = xno; then
   5.401 -    BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=yes], [BOOT_JDK_FOUND=no])
   5.402 +    BDEPS_CHECK_MODULE(BOOT_JDK, boot-jdk, xxx, [BOOT_JDK_FOUND=yes], [BOOT_JDK_FOUND=no])
   5.403  fi
   5.404  
   5.405  if test "x$BOOT_JDK_FOUND" = xno; then
   5.406      if test "x$JAVA_HOME" != x; then
   5.407          if test ! -d "$JAVA_HOME"; then
   5.408 -            AC_ERROR([Your JAVA_HOME points to a non-existing directory!])
   5.409 +            AC_MSG_ERROR([Your JAVA_HOME points to a non-existing directory!])
   5.410          fi
   5.411          # Aha, the user has set a JAVA_HOME
   5.412          # let us use that as the Boot JDK.
   5.413 -        BOOT_JDK=$JAVA_HOME
   5.414 +        BOOT_JDK="$JAVA_HOME"
   5.415          BOOT_JDK_FOUND=yes
   5.416          # To be on the safe side, lets check that it is a JDK.
   5.417 -        if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
   5.418 -            JAVAC=$BOOT_JDK/bin/javac
   5.419 -            JAVA=$BOOT_JDK/bin/java
   5.420 +        if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
   5.421 +            JAVAC="$BOOT_JDK/bin/javac"
   5.422 +            JAVA="$BOOT_JDK/bin/java"
   5.423              BOOT_JDK_FOUND=yes
   5.424          else
   5.425 -            AC_ERROR([Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK.])
   5.426 +            AC_MSG_ERROR([Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK. JAVA_HOME=[$]JAVA_HOME])
   5.427          fi            
   5.428      fi
   5.429  fi
   5.430 @@ -1260,11 +1289,11 @@
   5.431          fi
   5.432          if test "x$BOOT_JDK_FOUND" = xno; then
   5.433              help_on_build_dependency openjdk
   5.434 -            AC_ERROR([Found a JRE, not not a JDK! Please remove the JRE from your path and put a JDK there instead. $HELP_MSG])
   5.435 +            AC_MSG_ERROR([Found a JRE, not not a JDK! Please remove the JRE from your path and put a JDK there instead. $HELP_MSG])
   5.436          fi
   5.437      else
   5.438          help_on_build_dependency openjdk
   5.439 -        AC_ERROR([Could not find a JDK. $HELP_MSG])
   5.440 +        AC_MSG_ERROR([Could not find a JDK. $HELP_MSG])
   5.441      fi
   5.442  fi
   5.443  
   5.444 @@ -1281,7 +1310,7 @@
   5.445      # On MacOSX it is called classes.jar
   5.446      BOOT_RTJAR=$BOOT_JDK/../Classes/classes.jar
   5.447      if test ! -f $BOOT_RTJAR; then
   5.448 -        AC_ERROR([Cannot find the rt.jar or its equivalent!])
   5.449 +        AC_MSG_ERROR([Cannot find the rt.jar or its equivalent!])
   5.450      fi
   5.451      # Remove the .. 
   5.452      BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
   5.453 @@ -1303,7 +1332,7 @@
   5.454  AC_MSG_CHECKING([for java in Boot JDK])
   5.455  JAVA=$BOOT_JDK/bin/java
   5.456  if test ! -x $JAVA; then
   5.457 -    AC_ERROR([Could not find a working java])
   5.458 +    AC_MSG_ERROR([Could not find a working java])
   5.459  fi
   5.460  BOOT_JDK_VERSION=`$JAVA -version 2>&1 | head -n 1`
   5.461  AC_MSG_RESULT([yes $BOOT_JDK_VERSION])
   5.462 @@ -1313,7 +1342,7 @@
   5.463  [FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`]
   5.464  if test "x$FOUND_VERSION_78" = x; then
   5.465      help_on_build_dependency openjdk
   5.466 -    AC_ERROR([Your bootjdk must be version 7 or 8. $HELP_MSG])
   5.467 +    AC_MSG_ERROR([Your boot-jdk must be version 7 or 8. $HELP_MSG])
   5.468  fi
   5.469  
   5.470  # When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
   5.471 @@ -1324,17 +1353,17 @@
   5.472  AC_MSG_CHECKING([for javac in Boot JDK])
   5.473  JAVAC=$BOOT_JDK/bin/javac
   5.474  if test ! -x $JAVAC; then
   5.475 -    AC_ERROR([Could not find a working javac])
   5.476 +    AC_MSG_ERROR([Could not find a working javac])
   5.477  fi
   5.478  AC_MSG_RESULT(yes)
   5.479  AC_SUBST(JAVAC)
   5.480  AC_SUBST(JAVAC_FLAGS)
   5.481  
   5.482 -# Use the javac tool from the Boot JDK.
   5.483 +# Use the javah tool from the Boot JDK.
   5.484  AC_MSG_CHECKING([for javah in Boot JDK])
   5.485  JAVAH=$BOOT_JDK/bin/javah
   5.486  if test ! -x $JAVAH; then
   5.487 -    AC_ERROR([Could not find a working javah])
   5.488 +    AC_MSG_ERROR([Could not find a working javah])
   5.489  fi
   5.490  AC_MSG_RESULT(yes)
   5.491  AC_SUBST(JAVAH)
   5.492 @@ -1343,7 +1372,7 @@
   5.493  AC_MSG_CHECKING([for jar in Boot JDK])
   5.494  JAR=$BOOT_JDK/bin/jar
   5.495  if test ! -x $JAR; then
   5.496 -    AC_ERROR([Could not find a working jar])
   5.497 +    AC_MSG_ERROR([Could not find a working jar])
   5.498  fi
   5.499  AC_SUBST(JAR)
   5.500  AC_MSG_RESULT(yes)
   5.501 @@ -1352,11 +1381,20 @@
   5.502  AC_MSG_CHECKING([for rmic in Boot JDK])
   5.503  RMIC=$BOOT_JDK/bin/rmic
   5.504  if test ! -x $RMIC; then
   5.505 -    AC_ERROR([Could not find a working rmic])
   5.506 +    AC_MSG_ERROR([Could not find a working rmic])
   5.507  fi
   5.508  AC_SUBST(RMIC)
   5.509  AC_MSG_RESULT(yes)
   5.510  
   5.511 +# Use the native2ascii tool from the Boot JDK.
   5.512 +AC_MSG_CHECKING([for native2ascii in Boot JDK])
   5.513 +NATIVE2ASCII=$BOOT_JDK/bin/native2ascii
   5.514 +if test ! -x $NATIVE2ASCII; then
   5.515 +    AC_MSG_ERROR([Could not find a working native2ascii])
   5.516 +fi
   5.517 +AC_MSG_RESULT(yes)
   5.518 +AC_SUBST(NATIVE2ASCII)
   5.519 +
   5.520  ###############################################################################
   5.521  #
   5.522  # Pickup additional source for a component from outside of the source root
   5.523 @@ -1382,7 +1420,7 @@
   5.524  
   5.525  if test "x$with_add_source_root" != x; then
   5.526      if ! test -d $with_add_source_root; then
   5.527 -       AC_ERROR([Trying to use a non-existant add-source-root $with_add_source_root])
   5.528 +       AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root])
   5.529      fi
   5.530      CURDIR="$PWD"
   5.531      cd "$with_add_source_root"
   5.532 @@ -1392,34 +1430,34 @@
   5.533      # If it does, then it is usually an error, prevent this.
   5.534      if test -f $with_add_source_root/langtools/makefiles/Makefile || \
   5.535         test -f $with_add_source_root/langtools/make/Makefile; then
   5.536 -        AC_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.])
   5.537 +        AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.])
   5.538      fi
   5.539      if test -f $with_add_source_root/corba/makefiles/Makefile || \
   5.540         test -f $with_add_source_root/corba/make/Makefile; then
   5.541 -        AC_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.])
   5.542 +        AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.])
   5.543      fi
   5.544      if test -f $with_add_source_root/jaxp/makefiles/Makefile || \
   5.545         test -f $with_add_source_root/jaxp/make/Makefile; then
   5.546 -        AC_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.])
   5.547 +        AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.])
   5.548      fi
   5.549      if test -f $with_add_source_root/jaxws/makefiles/Makefile || \
   5.550         test -f $with_add_source_root/jaxws/make/Makefile; then
   5.551 -        AC_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.])
   5.552 +        AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.])
   5.553      fi
   5.554      if test -f $with_add_source_root/hotspot/makefiles/Makefile || \
   5.555         test -f $with_add_source_root/hotspot/make/Makefile; then
   5.556 -        AC_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.])
   5.557 +        AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.])
   5.558      fi
   5.559      if test -f $with_add_source_root/jdk/makefiles/Makefile || \
   5.560         test -f $with_add_source_root/jdk/make/Makefile; then
   5.561 -        AC_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.])
   5.562 +        AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.])
   5.563      fi
   5.564  fi
   5.565  AC_SUBST(ADD_SRC_ROOT)
   5.566  
   5.567  if test "x$with_override_source_root" != x; then
   5.568      if ! test -d $with_override_source_root; then
   5.569 -       AC_ERROR([Trying to use a non-existant override-source-root $with_override_source_root])
   5.570 +       AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root])
   5.571      fi
   5.572      CURDIR="$PWD"
   5.573      cd "$with_override_source_root"
   5.574 @@ -1427,27 +1465,27 @@
   5.575      cd "$CURDIR"
   5.576      if test -f $with_override_source_root/langtools/makefiles/Makefile || \
   5.577         test -f $with_override_source_root/langtools/make/Makefile; then
   5.578 -        AC_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.])
   5.579 +        AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.])
   5.580      fi
   5.581      if test -f $with_override_source_root/corba/makefiles/Makefile || \
   5.582         test -f $with_override_source_root/corba/make/Makefile; then
   5.583 -        AC_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.])
   5.584 +        AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.])
   5.585      fi
   5.586      if test -f $with_override_source_root/jaxp/makefiles/Makefile || \
   5.587         test -f $with_override_source_root/jaxp/make/Makefile; then
   5.588 -        AC_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.])
   5.589 +        AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.])
   5.590      fi
   5.591      if test -f $with_override_source_root/jaxws/makefiles/Makefile || \
   5.592         test -f $with_override_source_root/jaxws/make/Makefile; then
   5.593 -        AC_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.])
   5.594 +        AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.])
   5.595      fi
   5.596      if test -f $with_override_source_root/hotspot/makefiles/Makefile || \
   5.597         test -f $with_override_source_root/hotspot/make/Makefile; then
   5.598 -        AC_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.])
   5.599 +        AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.])
   5.600      fi
   5.601      if test -f $with_override_source_root/jdk/makefiles/Makefile || \
   5.602         test -f $with_override_source_root/jdk/make/Makefile; then
   5.603 -        AC_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.])
   5.604 +        AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.])
   5.605      fi
   5.606  fi
   5.607  AC_SUBST(OVERRIDE_SRC_ROOT)
   5.608 @@ -1495,7 +1533,7 @@
   5.609      LANGTOOLS_TOPDIR="`pwd`"
   5.610      cd "$CURDIR"
   5.611      if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then
   5.612 -        AC_ERROR([You have to override langtools with a full langtools repo!])
   5.613 +        AC_MSG_ERROR([You have to override langtools with a full langtools repo!])
   5.614      fi
   5.615      AC_MSG_CHECKING([if langtools should be overridden])
   5.616      AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR])
   5.617 @@ -1506,7 +1544,7 @@
   5.618      CORBA_TOPDIR="`pwd`"
   5.619      cd "$CURDIR"
   5.620      if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then
   5.621 -        AC_ERROR([You have to override corba with a full corba repo!])
   5.622 +        AC_MSG_ERROR([You have to override corba with a full corba repo!])
   5.623      fi
   5.624      AC_MSG_CHECKING([if corba should be overridden])
   5.625      AC_MSG_RESULT([yes with $CORBA_TOPDIR])
   5.626 @@ -1517,7 +1555,7 @@
   5.627      JAXP_TOPDIR="`pwd`"
   5.628      cd "$CURDIR"
   5.629      if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then
   5.630 -        AC_ERROR([You have to override jaxp with a full jaxp repo!])
   5.631 +        AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!])
   5.632      fi
   5.633      AC_MSG_CHECKING([if jaxp should be overridden])
   5.634      AC_MSG_RESULT([yes with $JAXP_TOPDIR])
   5.635 @@ -1528,7 +1566,7 @@
   5.636      JAXWS_TOPDIR="`pwd`"
   5.637      cd "$CURDIR"
   5.638      if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then
   5.639 -        AC_ERROR([You have to override jaxws with a full jaxws repo!])
   5.640 +        AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!])
   5.641      fi
   5.642      AC_MSG_CHECKING([if jaxws should be overridden])
   5.643      AC_MSG_RESULT([yes with $JAXWS_TOPDIR])
   5.644 @@ -1540,7 +1578,7 @@
   5.645      cd "$CURDIR"
   5.646      if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \
   5.647         ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then
   5.648 -        AC_ERROR([You have to override hotspot with a full hotspot repo!])
   5.649 +        AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!])
   5.650      fi
   5.651      AC_MSG_CHECKING([if hotspot should be overridden])
   5.652      AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
   5.653 @@ -1551,7 +1589,7 @@
   5.654      JDK_TOPDIR="`pwd`"
   5.655      cd "$CURDIR"
   5.656      if ! test -f $JDK_TOPDIR/makefiles/Makefile; then
   5.657 -        AC_ERROR([You have to override JDK with a full JDK repo!])
   5.658 +        AC_MSG_ERROR([You have to override JDK with a full JDK repo!])
   5.659      fi
   5.660      AC_MSG_CHECKING([if JDK should be overridden])
   5.661      AC_MSG_RESULT([yes with $JDK_TOPDIR])
   5.662 @@ -1605,7 +1643,7 @@
   5.663      SERVER_JAVA="$with_server_java"
   5.664      FOUND_VERSION=`$SERVER_JAVA -version 2>&1 | grep " version \""`
   5.665      if test "x$FOUND_VERSION" = x; then
   5.666 -        AC_ERROR([Could not execute server java: $SERVER_JAVA])
   5.667 +        AC_MSG_ERROR([Could not execute server java: $SERVER_JAVA])
   5.668      fi
   5.669  else
   5.670      SERVER_JAVA=""
   5.671 @@ -1806,12 +1844,9 @@
   5.672  
   5.673  if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then 
   5.674      help_on_build_dependency x11
   5.675 -    AC_ERROR([Could not find X11 libraries. $HELP_MSG])
   5.676 +    AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
   5.677  fi
   5.678  
   5.679 -AC_SUBST(X_CFLAGS)
   5.680 -AC_SUBST(X_LIBS)
   5.681 -
   5.682  # Some of the old makefiles require a setting of OPENWIN_HOME
   5.683  # Since the X11R6 directory has disappeared on later Linuxes,
   5.684  # we need to probe for it.
   5.685 @@ -1828,6 +1863,18 @@
   5.686  fi
   5.687  AC_SUBST(OPENWIN_HOME)
   5.688  
   5.689 +
   5.690 +#
   5.691 +# Weird Sol10 something check...TODO change to try compile
   5.692 +#
   5.693 +if test "x${HOST_OS}" = xsolaris; then
   5.694 +  if test "`uname -r`" = "5.10"; then
   5.695 +     if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then
   5.696 +     	X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS"
   5.697 +     fi
   5.698 +  fi
   5.699 +fi
   5.700 +
   5.701  AC_LANG_PUSH(C)
   5.702  OLD_CFLAGS="$CFLAGS"
   5.703  CFLAGS="$CFLAGS $X_CFLAGS"
   5.704 @@ -1839,9 +1886,12 @@
   5.705  
   5.706  if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then 
   5.707      help_on_build_dependency x11
   5.708 -    AC_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG])
   5.709 +    AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG])
   5.710  fi
   5.711  
   5.712 +AC_SUBST(X_CFLAGS)
   5.713 +AC_SUBST(X_LIBS)
   5.714 +
   5.715  ###############################################################################
   5.716  #
   5.717  # The common unix printing system cups is used to print from java.
   5.718 @@ -1855,7 +1905,7 @@
   5.719  	[specify directory for the cups library])])
   5.720  
   5.721  if test "x$CUPS_NOT_NEEDED" = xyes; then
   5.722 -	if test "x$with_cups" != x || test "x$with_cups-include" != x || test "x$with_cups-lib" != x; then
   5.723 +	if test "x${with_cups}" != x || test "x${with_cups_include}" != x || test "x${with_cups_lib}" != x; then
   5.724  		AC_MSG_WARN([cups not used, so --with-cups is ignored])
   5.725  	fi
   5.726  	CUPS_CFLAGS=
   5.727 @@ -1863,21 +1913,21 @@
   5.728  else
   5.729  	CUPS_FOUND=no
   5.730  
   5.731 -	if test "x$with_cups" = xno || test "x$with_cups-include" = xno || test "x$with_cups-lib" = xno; then
   5.732 -	    AC_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
   5.733 +	if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno || test "x${with_cups_lib}" = xno; then
   5.734 +	    AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
   5.735  	fi
   5.736  
   5.737 -	if test "x$with_cups" != x; then
   5.738 -	    CUPS_LIBS="-L$with_cups/lib -lcups"
   5.739 -	    CUPS_CFLAGS="-I$with_cups/include"
   5.740 +	if test "x${with_cups}" != x; then
   5.741 +	    CUPS_LIBS="-L${with_cups}/lib -lcups"
   5.742 +	    CUPS_CFLAGS="-I${with_cups}/include"
   5.743  	    CUPS_FOUND=yes
   5.744  	fi
   5.745 -	if test "x$with_cups-include" != x; then
   5.746 -	    CUPS_CFLAGS="-I$with_cups-include"
   5.747 +	if test "x${with_cups_include}" != x; then
   5.748 +	    CUPS_CFLAGS="-I${with_cups_include}"
   5.749  	    CUPS_FOUND=yes
   5.750  	fi
   5.751 -	if test "x$with_cups-lib" != x; then
   5.752 -	    CUPS_LIBS="-L$with_cups-lib -lcups"
   5.753 +	if test "x${with_cups_lib}" != x; then
   5.754 +	    CUPS_LIBS="-L${with_cups_lib} -lcups"
   5.755  	    CUPS_FOUND=yes
   5.756  	fi
   5.757  	if test "x$CUPS_FOUND" = xno; then
   5.758 @@ -1910,7 +1960,7 @@
   5.759  	fi
   5.760  	if test "x$CUPS_FOUND" = xno; then 
   5.761  	    help_on_build_dependency cups
   5.762 -	    AC_ERROR([Could not find cups! $HELP_MSG ])
   5.763 +	    AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
   5.764  	fi
   5.765  fi
   5.766  
   5.767 @@ -1953,16 +2003,16 @@
   5.768     	    if test "x$FREETYPE2_FOUND" = xyes; then
   5.769  	        # Verify that the directories exist 
   5.770                  if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then
   5.771 -		   AC_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include])
   5.772 +		   AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include])
   5.773  		fi
   5.774  	        # List the contents of the lib.
   5.775  		FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null`
   5.776                  if test "x$FREETYPELIB" = x; then
   5.777 -		   AC_ERROR([Could not find libfreetype.se nor freetype.dll in $with_freetype/lib])
   5.778 +		   AC_MSG_ERROR([Could not find libfreetype.se nor freetype.dll in $with_freetype/lib])
   5.779  		fi
   5.780  	        # Check one h-file
   5.781                  if ! test -s "$with_freetype/include/ft2build.h"; then
   5.782 -		   AC_ERROR([Could not find $with_freetype/include/ft2build.h])
   5.783 +		   AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h])
   5.784  		fi
   5.785              fi
   5.786          fi
   5.787 @@ -2010,7 +2060,7 @@
   5.788  	fi
   5.789  	if test "x$FREETYPE2_FOUND" = xno; then
   5.790  		help_on_build_dependency freetype2
   5.791 -		AC_ERROR([Could not find freetype2! $HELP_MSG ])
   5.792 +		AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])
   5.793  	fi    
   5.794  fi
   5.795  
   5.796 @@ -2032,7 +2082,7 @@
   5.797  	[specify directory for the alsa library])])
   5.798  
   5.799  if test "x$ALSA_NOT_NEEDED" = xyes; then
   5.800 -	if test "x$with_alsa" != x || test "x$with_alsa-include" != x || test "x$with_alsa-lib" != x; then
   5.801 +	if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then
   5.802  		AC_MSG_WARN([alsa not used, so --with-alsa is ignored])
   5.803  	fi
   5.804  	ALSA_CFLAGS=
   5.805 @@ -2040,21 +2090,21 @@
   5.806  else
   5.807  	ALSA_FOUND=no
   5.808  
   5.809 -	if test "x$with_alsa" = xno || test "x$with_alsa-include" = xno || test "x$with_alsa-lib" = xno; then
   5.810 -	    AC_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
   5.811 +	if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
   5.812 +	    AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
   5.813  	fi
   5.814  
   5.815 -	if test "x$with_alsa" != x; then
   5.816 -	    ALSA_LIBS="-L$with_alsa/lib -lalsa"
   5.817 -	    ALSA_CFLAGS="-I$with_alsa/include"
   5.818 +	if test "x${with_alsa}" != x; then
   5.819 +	    ALSA_LIBS="-L${with_alsa}/lib -lalsa"
   5.820 +	    ALSA_CFLAGS="-I${with_alsa}/include"
   5.821  	    ALSA_FOUND=yes
   5.822  	fi
   5.823 -	if test "x$with_alsa-include" != x; then
   5.824 -	    ALSA_CFLAGS="-I$with_alsa/include"
   5.825 +	if test "x${with_alsa_include}" != x; then
   5.826 +	    ALSA_CFLAGS="-I${with_alsa_include}"
   5.827  	    ALSA_FOUND=yes
   5.828  	fi
   5.829 -	if test "x$with_alsa-lib" != x; then
   5.830 -	    ALSA_LIBS="-L$with_alsa/lib -lalsa"
   5.831 +	if test "x${with_alsa_lib}" != x; then
   5.832 +	    ALSA_LIBS="-L${with_alsa_lib} -lalsa"
   5.833  	    ALSA_FOUND=yes
   5.834  	fi
   5.835  	if test "x$ALSA_FOUND" = xno; then
   5.836 @@ -2073,7 +2123,7 @@
   5.837  	fi
   5.838  	if test "x$ALSA_FOUND" = xno; then 
   5.839  	    help_on_build_dependency alsa
   5.840 -	    AC_ERROR([Could not find alsa! $HELP_MSG ])
   5.841 +	    AC_MSG_ERROR([Could not find alsa! $HELP_MSG ])
   5.842  	fi    
   5.843  fi
   5.844  
   5.845 @@ -2093,17 +2143,17 @@
   5.846  AC_ARG_WITH(pulse-lib, [AS_HELP_STRING([--with-pulse-lib],
   5.847  	[specify directory for the pulseaudio library])])
   5.848  
   5.849 -if test "x$with_pulse" != x; then
   5.850 -    PULSE_LIBS="-L$with_pulse/lib -lfreetype"
   5.851 -    PULSE_CFLAGS="-I$with_pulse/include"
   5.852 +if test "x${with_pulse}" != x; then
   5.853 +    PULSE_LIBS="-L${with_pulse}/lib -lfreetype"
   5.854 +    PULSE_CFLAGS="-I${with_pulse}/include"
   5.855      PULSE_FOUND=yes
   5.856  fi
   5.857 -if test "x$with_pulse-include" != x; then
   5.858 -    PULSE_CFLAGS="-I$with_pulse/include"
   5.859 +if test "x${with_pulse_include}" != x; then
   5.860 +    PULSE_CFLAGS="-I${with_pulse_include}"
   5.861      PULSE_FOUND=yes
   5.862  fi
   5.863 -if test "x$with_pulse-lib" != x; then
   5.864 -    PULSE_LIBS="-L$with_pulse/lib -lfreetype"
   5.865 +if test "x${with_pulse_lib}" != x; then
   5.866 +    PULSE_LIBS="-L${with_pulse_lib} -lpulse"
   5.867      PULSE_FOUND=yes
   5.868  fi
   5.869  if test "x$PULSE_FOUND" = xno; then
   5.870 @@ -2123,7 +2173,7 @@
   5.871  
   5.872  if test "x$PULSE_FOUND" = xno && test "x$PULSE_NOT_NEEDED" != xyes; then 
   5.873      help_on_build_dependency pulse
   5.874 -    AC_ERROR([Could not find pulse audio libraries. $HELP_MSG ])
   5.875 +    AC_MSG_ERROR([Could not find pulse audio libraries. $HELP_MSG ])
   5.876  fi    
   5.877  
   5.878  AC_SUBST(PULSE_CFLAGS)
   5.879 @@ -2170,9 +2220,9 @@
   5.880  # Check if altzone exists in time.h
   5.881  #
   5.882  
   5.883 -AC_TRY_LINK([#include <time.h>], [return (int)altzone;],
   5.884 -            has_altzone=yes,
   5.885 -            has_altzone=no)
   5.886 +AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])],
   5.887 +            [has_altzone=yes],
   5.888 +            [has_altzone=no])
   5.889  if test "x$has_altzone" = xyes; then
   5.890      AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h])
   5.891  fi
   5.892 @@ -2182,7 +2232,7 @@
   5.893  # Check the maths library
   5.894  #
   5.895  
   5.896 -AC_CHECK_LIB(m, main, [],
   5.897 +AC_CHECK_LIB(m, cos, [],
   5.898               [ 
   5.899                    AC_MSG_NOTICE([Maths library was not found])
   5.900               ])
   5.901 @@ -2190,6 +2240,17 @@
   5.902  
   5.903  ###############################################################################
   5.904  #
   5.905 +# Check for libdl.so
   5.906 +
   5.907 +save_LIBS="$LIBS"
   5.908 +LIBS=""
   5.909 +AC_CHECK_LIB(dl,dlopen)
   5.910 +LIBDL="$LIBS"
   5.911 +AC_SUBST(LIBDL)
   5.912 +LIBS="$save_LIBS"
   5.913 +
   5.914 +###############################################################################
   5.915 +#
   5.916  # Should we run the painfully slow javadoc tool?
   5.917  #
   5.918  AC_MSG_CHECKING([whether to build documentation])
   5.919 @@ -2225,6 +2286,9 @@
   5.920  # Setup the opt flags for different compilers
   5.921  # and different operating systems.
   5.922  #
   5.923 +C_FLAG_DEPS="-MMD -MF"
   5.924 +CXX_FLAG_DEPS="-MMD -MF"
   5.925 +
   5.926  case $COMPILER_TYPE in
   5.927    CC )
   5.928      D_FLAG="-g"
   5.929 @@ -2234,9 +2298,9 @@
   5.930  	  macosx )
   5.931  	    # On MacOSX we optimize for size, something
   5.932  	    # we should do for all platforms?
   5.933 -	    C_O_FLAG_HI="-O3"
   5.934 +	    C_O_FLAG_HI="-Os"
   5.935  	    C_O_FLAG_NORM="-Os"
   5.936 -	    C_O_FLAG_NONE="-O0"
   5.937 +	    C_O_FLAG_NONE=""
   5.938  	    ;;
   5.939  	  *)
   5.940  	    C_O_FLAG_HI="-O3"
   5.941 @@ -2249,19 +2313,61 @@
   5.942          CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
   5.943          ;;
   5.944        ossc )
   5.945 +        #
   5.946 +        # Forte has different names for this with their C++ compiler...
   5.947 +        #
   5.948 +	CXX_FLAG_DEPS="-xMMD -xMF"
   5.949 +
   5.950 +# Extra options used with HIGHEST
   5.951 +#
   5.952 +# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
   5.953 +#          done with care, there are some assumptions below that need to
   5.954 +#          be understood about the use of pointers, and IEEE behavior.
   5.955 +#
   5.956 +# Use non-standard floating point mode (not IEEE 754)
   5.957 +CC_HIGHEST="$CC_HIGHEST -fns"
   5.958 +# Do some simplification of floating point arithmetic (not IEEE 754)
   5.959 +CC_HIGHEST="$CC_HIGHEST -fsimple"
   5.960 +# Use single precision floating point with 'float'
   5.961 +CC_HIGHEST="$CC_HIGHEST -fsingle"
   5.962 +# Assume memory references via basic pointer types do not alias
   5.963 +#   (Source with excessing pointer casting and data access with mixed 
   5.964 +#    pointer types are not recommended)
   5.965 +CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
   5.966 +# Use intrinsic or inline versions for math/std functions
   5.967 +#   (If you expect perfect errno behavior, do not use this)
   5.968 +CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all"
   5.969 +# Loop data dependency optimizations (need -xO3 or higher)
   5.970 +CC_HIGHEST="$CC_HIGHEST -xdepend"
   5.971 +# Pointer parameters to functions do not overlap
   5.972 +#   (Similar to -xalias_level=basic usage, but less obvious sometimes.
   5.973 +#    If you pass in multiple pointers to the same data, do not use this)
   5.974 +CC_HIGHEST="$CC_HIGHEST -xrestrict"
   5.975 +# Inline some library routines
   5.976 +#   (If you expect perfect errno behavior, do not use this)
   5.977 +CC_HIGHEST="$CC_HIGHEST -xlibmil"
   5.978 +# Use optimized math routines
   5.979 +#   (If you expect perfect errno behavior, do not use this)
   5.980 +#  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
   5.981 +#CC_HIGHEST="$CC_HIGHEST -xlibmopt"
   5.982 +
   5.983          case $LEGACY_HOST_CPU1 in
   5.984            i586)
   5.985 +            C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xchip=pentium"
   5.986              C_O_FLAG_HI="-xO4 -Wu,-O4~yz"
   5.987              C_O_FLAG_NORM="-xO2 -Wu,-O2~yz"
   5.988              C_O_FLAG_NONE=""
   5.989 +            CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xchip=pentium"
   5.990              CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz"
   5.991              CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz"
   5.992              CXX_O_FLAG_NONE=""
   5.993              ;;
   5.994            sparc)
   5.995 +            C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
   5.996              C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
   5.997              C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
   5.998              C_O_FLAG_NONE=""
   5.999 +            CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
  5.1000              CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
  5.1001              CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
  5.1002              CXX_O_FLAG_NONE=""
  5.1003 @@ -2280,12 +2386,24 @@
  5.1004      ;;
  5.1005  esac
  5.1006  
  5.1007 +if test -z "$C_O_FLAG_HIGHEST"; then
  5.1008 +   C_O_FLAG_HIGHEST="$C_O_FLAG_HI"
  5.1009 +fi
  5.1010 +
  5.1011 +if test -z "$CXX_O_FLAG_HIGHEST"; then
  5.1012 +   CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI"
  5.1013 +fi
  5.1014 +
  5.1015 +AC_SUBST(C_O_FLAG_HIGHEST)
  5.1016  AC_SUBST(C_O_FLAG_HI)
  5.1017  AC_SUBST(C_O_FLAG_NORM)
  5.1018  AC_SUBST(C_O_FLAG_NONE)
  5.1019 +AC_SUBST(CXX_O_FLAG_HIGHEST)
  5.1020  AC_SUBST(CXX_O_FLAG_HI)
  5.1021  AC_SUBST(CXX_O_FLAG_NORM)
  5.1022  AC_SUBST(CXX_O_FLAG_NONE)
  5.1023 +AC_SUBST(C_FLAG_DEPS)
  5.1024 +AC_SUBST(CXX_FLAG_DEPS)
  5.1025  
  5.1026  ###############################################################################
  5.1027  #
  5.1028 @@ -2403,16 +2521,17 @@
  5.1029  #
  5.1030  case $COMPILER_NAME in
  5.1031        gcc )
  5.1032 -      	  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer \
  5.1033 +      	  CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
  5.1034 +                          -pipe -fno-omit-frame-pointer \
  5.1035                            -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
  5.1036            CFLAGS_JDK="$CFLAGS_JDK -fno-strict-aliasing"
  5.1037            ;;
  5.1038        ossc )
  5.1039 -      	  CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa REQUIRED -v -mt -norunpath -xnolib"
  5.1040 -      	  CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt REQUIRED -features=no%except -DCC_NOEX"
  5.1041 +      	  CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -norunpath -xnolib"
  5.1042 +      	  CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX"
  5.1043            ;;
  5.1044        cl )
  5.1045 -          CCXXFLAGS_JDK="$CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
  5.1046 +          CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
  5.1047                 -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
  5.1048  	       -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
  5.1049  	       -DWIN32 -DIAL"
  5.1050 @@ -2491,14 +2610,14 @@
  5.1051  #
  5.1052  # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
  5.1053  if test "x$COMPILER_TYPE" = xCL; then
  5.1054 -    LDFLAGS_JDKLIB="$LDFLAGS -libpath:${JDK_OUTPUTDIR}/lib jvm.lib java.lib"
  5.1055 +    LDFLAGS_JDKLIB="$LDFLAGS -dll -libpath:${JDK_OUTPUTDIR}/lib -libpath:${JDK_OUTPUTDIR}/objs"
  5.1056      LDFLAGS_JDKLIB_SUFFIX=""
  5.1057 -    if test "x$HOST_CPU_BITS" = "x64"; then
  5.1058 -        LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj64/jli.lib"
  5.1059 +    if test "$HOST_CPU_BITS" == "64"; then
  5.1060 +        LDFLAGS_STACK_SIZE=1048576
  5.1061      else
  5.1062 -        LDFLAGS_JDKEXE="$CFLAGS ${JDK_OUTPUTDIR}/tmp/java/jli/obj/jli.lib"
  5.1063 +        LDFLAGS_STACK_SIZE=327680
  5.1064      fi
  5.1065 -    LDFLAGS_JDKEXE_SUFFIX=""
  5.1066 +    LDFLAGS_JDKEXE="$LDFLAGS /STACK:$LDFLAGS_STACK_SIZE"
  5.1067  else
  5.1068      # If this is a --hash-style=gnu system, use --hash-style=both, why?
  5.1069      HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
  5.1070 @@ -2513,9 +2632,11 @@
  5.1071          fi
  5.1072      fi
  5.1073  
  5.1074 -    LDFLAGS_JDKLIB="$LDFLAGS $SHARED_LIBRARY_FLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \
  5.1075 +    LDFLAGS_JDKLIB="$LDFLAGS $SHARED_LIBRARY_FLAGS \
  5.1076 +                    -L${JDK_OUTPUTDIR}/objs \
  5.1077 +                    -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \
  5.1078                      -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}client \
  5.1079 -  	            -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}" 
  5.1080 +  	            -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}"
  5.1081      LDFLAGS_JDKLIB_SUFFIX="-ljvm -ljava"
  5.1082      if test "x$COMPILER_NAME" = xossc; then
  5.1083          LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
  5.1084 @@ -2523,8 +2644,10 @@
  5.1085  
  5.1086      # Only the jli library is explicitly linked when the launchers are built.
  5.1087      # The libjvm is then dynamically loaded/linked by the launcher.
  5.1088 -    LDFLAGS_JDKEXE="$LDFLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli"
  5.1089 -    LDFLAGS_JDKEXE_SUFFIX="-ljli"
  5.1090 +    if test "x$HOST_OS" != "xmacosx"; then
  5.1091 +       LDFLAGS_JDKEXE="$LDFLAGS -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli"
  5.1092 +       LDFLAGS_JDKEXE_SUFFIX="-ljli"
  5.1093 +    fi
  5.1094  fi
  5.1095  
  5.1096                  
  5.1097 @@ -2557,9 +2680,9 @@
  5.1098      AC_LANG_PUSH(C++)
  5.1099      OLD_CXXFLAGS="$CXXFLAGS"
  5.1100      CXXFLAGS="$CXXFLAGS -lstdc++"
  5.1101 -    AC_TRY_LINK([], [return 0;],
  5.1102 -            has_dynamic_libstdcxx=yes,
  5.1103 -            has_dynamic_libstdcxx=no)
  5.1104 +    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
  5.1105 +            [has_dynamic_libstdcxx=yes],
  5.1106 +            [has_dynamic_libstdcxx=no])
  5.1107      CXXFLAGS="$OLD_CXXFLAGS"
  5.1108      AC_LANG_POP(C++)
  5.1109      AC_MSG_RESULT([$has_dynamic_libstdcxx])
  5.1110 @@ -2572,16 +2695,16 @@
  5.1111      OLD_CXX="$CXX"
  5.1112      LIBS="$STATIC_STDCXX_FLAGS"
  5.1113      CXX="$CC"                       
  5.1114 -    AC_TRY_LINK([], [return 0;],
  5.1115 -            has_static_libstdcxx=yes,
  5.1116 -            has_static_libstdcxx=no)
  5.1117 +    AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
  5.1118 +            [has_static_libstdcxx=yes],
  5.1119 +            [has_static_libstdcxx=no])
  5.1120      LIBS="$OLD_LIBS"
  5.1121      CXX="$OLD_CXX"
  5.1122      AC_LANG_POP(C++)
  5.1123      AC_MSG_RESULT([$has_static_libstdcxx])
  5.1124  
  5.1125      if test "x$has_static_libcxx" = xno && test "x$has_dynamic_libcxx" = xno; then
  5.1126 -        AC_ERROR([I cannot link to stdc++! Neither dynamically nor statically.])
  5.1127 +        AC_MSG_ERROR([I cannot link to stdc++! Neither dynamically nor statically.])
  5.1128      fi
  5.1129  
  5.1130      if test "x$enable_static_link_stdc__" = xyes && test "x$has_static_libstdcxx" = xno; then
  5.1131 @@ -2611,17 +2734,39 @@
  5.1132  # Could someone enlighten this configure script with a comment about libCrun?
  5.1133  # The LEGACY_HOST_CPU3 is the setting for ISA_DIR.
  5.1134  #
  5.1135 -if test "x$HOST_OS" = xsolaris; then
  5.1136 -    LIBCXX="$LIBCXX /usr/lib${LEGACY_HOST_CPU3}/libCrun.so.1"
  5.1137 +if test "x$HOST_OS" = xsolaris && test "x$LIBCXX" = x; then
  5.1138 +    LIBCXX="/usr/lib${LEGACY_HOST_CPU3}/libCrun.so.1"
  5.1139 +fi
  5.1140 +
  5.1141 +# TODO better (platform agnostic) test
  5.1142 +if test "x$HOST_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
  5.1143 +    LIBCXX="-lstdc++"
  5.1144  fi
  5.1145  
  5.1146  AC_SUBST(LIBCXX)
  5.1147  
  5.1148  ###############################################################################
  5.1149 +
  5.1150 +OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`"
  5.1151 +OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`"
  5.1152 +OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`"
  5.1153 +OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`"
  5.1154 +AC_SUBST(OS_VERSION_MAJOR)
  5.1155 +AC_SUBST(OS_VERSION_MINOR)
  5.1156 +AC_SUBST(OS_VERSION_MICRO)
  5.1157 +
  5.1158 +###############################################################################
  5.1159  #
  5.1160  # Misc
  5.1161  #
  5.1162  
  5.1163 +# The name of the Service Agent jar.
  5.1164 +SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
  5.1165 +if test "x$HOST_OS" = "xwindows"; then
  5.1166 +    SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
  5.1167 +fi
  5.1168 +AC_SUBST(SALIB_NAME)
  5.1169 +
  5.1170  # Control wether Hotspot runs Queens test after build.
  5.1171  AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
  5.1172  	[enable running of Queens test after Hotspot build (not yet available) @<:@disabled@:>@])],,
  5.1173 @@ -2635,17 +2780,99 @@
  5.1174  
  5.1175  ###############################################################################
  5.1176  #
  5.1177 -# A helpful message at the end of the configure run.
  5.1178 +# Choose cacerts source file
  5.1179  #
  5.1180 -if test "x$CCACHE_FOUND" = x && test "x$GCC" = xyes; then
  5.1181 -    help_on_build_dependency ccache
  5.1182 -    
  5.1183 -    printf "\nTip of the day:\nYou should really install ccache version 3.1.4 or newer.\n"
  5.1184 -    printf "It gives a tremendous speedup for C++ recompilations with precompiled headers!\n"
  5.1185 -fi    
  5.1186 +AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
  5.1187 +    [specify alternative cacerts file])])
  5.1188 +if test "x$with_cacerts_file" != x; then
  5.1189 +    CACERTS_FILE=$with_cacerts_file
  5.1190 +else
  5.1191 +    if test "x$OPENJDK" = "xtrue"; then
  5.1192 +        CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
  5.1193 +    else
  5.1194 +        CACERTS_FILE=${SRC_ROOT}/jdk/src/closed/share/lib/security/cacerts.internal
  5.1195 +    fi
  5.1196 +fi
  5.1197 +AC_SUBST(CACERTS_FILE)
  5.1198  
  5.1199 -if test "x$CCACHE_FOUND" != x && test "x$HAS_GOOD_CCACHE" = x; then
  5.1200 -    printf "You have a ccache installed, but it is a version prior to 3.1.4. Try upgrading.\n"
  5.1201 +# Check if build directory is on local disk.
  5.1202 +# return 0 if it is on local disk, non-0 if on remote disk or failure
  5.1203 +function is_directory_on_local_disk {
  5.1204 +	# df -l lists only local disks; if the given directory is not found then
  5.1205 +	# a non-zero exit code is given
  5.1206 +	$DF -l $1 > /dev/null 2>&1
  5.1207 +}
  5.1208 +
  5.1209 +AC_MSG_CHECKING([if build directory is on local disk])
  5.1210 +if is_directory_on_local_disk $OUTPUT_ROOT; then
  5.1211 +	OUTPUT_DIR_IS_LOCAL="yes"
  5.1212 +else
  5.1213 +	OUTPUT_DIR_IS_LOCAL="no"
  5.1214 +fi
  5.1215 +AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
  5.1216 +
  5.1217 +# We're messing a bit with internal autoconf variables to put the config.status in the
  5.1218 +# output directory instead of the current directory.
  5.1219 +CONFIG_STATUS=$OUTPUT_ROOT/config.status
  5.1220 +
  5.1221 +# Now create the actual output files, after this, the main work of configure is done
  5.1222 +AC_OUTPUT
  5.1223 +
  5.1224 +# Finally output some useful information to the user
  5.1225 +
  5.1226 +if test "x$CCACHE_FOUND" != x; then
  5.1227 +	if  test "x$HAS_GOOD_CCACHE" = x; then
  5.1228 +		CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
  5.1229 +		CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
  5.1230 +	else
  5.1231 +		CCACHE_STATUS="installed and in use"
  5.1232 +	fi
  5.1233 +else
  5.1234 +	if test "x$GCC" = xyes; then
  5.1235 +		CCACHE_STATUS="not installed (consider installing)"
  5.1236 +		CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
  5.1237 +	else
  5.1238 +		CCACHE_STATUS="not available for your system"
  5.1239 +	fi
  5.1240  fi
  5.1241  
  5.1242 -AC_OUTPUT
  5.1243 +printf "\n"
  5.1244 +printf "====================================================\n"
  5.1245 +printf "A new configuration has been successfully created in\n"
  5.1246 +printf "$OUTPUT_ROOT\n"
  5.1247 +if test "x$CONFIGURE_COMMAND_LINE" != x; then
  5.1248 +	printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
  5.1249 +else
  5.1250 +	printf "using default settings.\n"
  5.1251 +fi
  5.1252 +
  5.1253 +printf "\n"
  5.1254 +printf "Configuration summary:\n"
  5.1255 +printf "* Debug level:  $DEBUG_LEVEL\n"
  5.1256 +printf "* JDK variant:  $JDK_VARIANT\n"
  5.1257 +printf "* JVM variants: $with_jvm_variants\n"
  5.1258 +printf "* Host info:    OS: $HOST_OS, CPU architecture: $HOST_CPU_ARCH, address length: $HOST_CPU_BITS\n"
  5.1259 +printf "* Boot JDK:     $BOOT_JDK\n"
  5.1260 +
  5.1261 +printf "\n"
  5.1262 +printf "Build performance summary:\n"
  5.1263 +printf "* Cores to use:  $NUM_CORES\n"
  5.1264 +printf "* Memory limit:  $MEMORY_SIZE MB\n"
  5.1265 +printf "* ccache status: $CCACHE_STATUS\n"
  5.1266 +
  5.1267 +if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
  5.1268 +	printf "\n"
  5.1269 +	printf "WARNING: Your build output directory is not on a local disk.\n"
  5.1270 +	printf "This will severely degrade build performance!\n"
  5.1271 +	printf "It is recommended that you create an output directory on a local disk,\n"
  5.1272 +	printf "and run the configure script again from that directory.\n"
  5.1273 +fi
  5.1274 +
  5.1275 +if test "x$CCACHE_HELP_MSG" != x; then
  5.1276 +	printf "\n"
  5.1277 +	printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
  5.1278 +	printf "$CCACHE_HELP_MSG\n"
  5.1279 +
  5.1280 +    help_on_build_dependency ccache
  5.1281 +    printf "$HELP_MSG\n"
  5.1282 +fi
     6.1 --- a/common/autoconf/help.m4	Fri Jun 08 12:01:05 2012 -0700
     6.2 +++ b/common/autoconf/help.m4	Wed Jun 13 16:53:05 2012 -0700
     6.3 @@ -23,18 +23,20 @@
     6.4  # questions.
     6.5  #
     6.6  
     6.7 +function prepare_help_system {
     6.8 +    AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
     6.9 +}
    6.10 +	
    6.11  function help_on_build_dependency {
    6.12      # Print a helpful message on how to acquire the necessary build dependency.
    6.13      # $1 is the help tag: freetyp2, cups, pulse, alsa etc
    6.14      MISSING_DEPENDENCY=$1
    6.15      PKGHANDLER_COMMAND=
    6.16  
    6.17 -    AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
    6.18 -
    6.19      case $PKGHANDLER in
    6.20  	apt-get)
    6.21                  apt_help     $MISSING_DEPENDENCY ;;
    6.22 -        yum)
    6.23 +    yum)
    6.24                  yum_help     $MISSING_DEPENDENCY ;;
    6.25  	port)
    6.26                  port_help    $MISSING_DEPENDENCY ;;
    6.27 @@ -47,7 +49,7 @@
    6.28      esac
    6.29  
    6.30      if test "x$PKGHANDLER_COMMAND" != x; then
    6.31 -        HELP_MSG="Try running '$PKGHANDLER_COMMAND'."
    6.32 +        HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
    6.33      fi
    6.34  }
    6.35  
     7.1 --- a/common/autoconf/platform.m4	Fri Jun 08 12:01:05 2012 -0700
     7.2 +++ b/common/autoconf/platform.m4	Wed Jun 13 16:53:05 2012 -0700
     7.3 @@ -48,7 +48,7 @@
     7.4  AC_DEFUN([CHECK_NONEMPTY],
     7.5  [
     7.6      # Test that variable $1 is not empty.
     7.7 -    if test "" = "[$]$1"; then AC_ERROR(Could not find translit($1,A-Z,a-z) !); fi
     7.8 +    if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
     7.9  ])
    7.10  
    7.11  AC_DEFUN([ADD_JVM_ARG_IF_OK],
    7.12 @@ -97,7 +97,7 @@
    7.13              $1=`$CYGPATH -s -m -a "[$]$1"`
    7.14              $1=`$CYGPATH -u "[$]$1"`            
    7.15          else
    7.16 -            AC_ERROR([You cannot have spaces in $2! "[$]$1"])
    7.17 +            AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
    7.18          fi
    7.19      fi
    7.20  ])
    7.21 @@ -215,7 +215,7 @@
    7.22              AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
    7.23              PUSHED_FLAGS="$CXXFLAGS"
    7.24              CXXFLAGS="-fpch-preprocess $CXXFLAGS"
    7.25 -            AC_TRY_COMPILE([], [], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
    7.26 +            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
    7.27              CXXFLAGS="$PUSHED_FLAGS"
    7.28              if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
    7.29                  AC_MSG_RESULT([yes])
    7.30 @@ -257,7 +257,7 @@
    7.31      # The same values are setup for BUILD_...
    7.32      # 
    7.33      # And the legacy variables, for controlling the old makefiles.
    7.34 -    # LEGACY_HOST_CPU1=i586,amd64,sparc,sparcv9,arm,arm64...
    7.35 +    # LEGACY_HOST_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64...
    7.36      # LEGACY_HOST_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
    7.37      # LEGACY_HOST_CPU3=sparcv9,amd64 (but only on solaris)
    7.38      # LEGACY_HOST_OS_API=solaris,windows
    7.39 @@ -276,7 +276,14 @@
    7.40      if test "x$HOST_OS" != xsolaris; then
    7.41          LEGACY_HOST_CPU3=""
    7.42          LEGACY_BUILD_CPU3=""
    7.43 -    fi   
    7.44 +    fi
    7.45 +
    7.46 +    # On MacOSX and MacOSX only, we have a different name for the x64 CPU in ARCH (LEGACY_HOST_CPU1) ...
    7.47 +    if test "x$HOST_OS" = xmacosx && test "x$HOST_CPU" = xx64; then
    7.48 +        LEGACY_HOST_CPU1="x86_64"
    7.49 +    fi
    7.50 +
    7.51 +    SET_RELEASE_FILE_OS_VALUES()
    7.52  ])
    7.53  
    7.54  AC_DEFUN([EXTRACT_VARS_FROM_OS_TO],
    7.55 @@ -427,7 +434,7 @@
    7.56        VAR_LEGACY_CPU=s390x
    7.57         ;;
    7.58      *)
    7.59 -      AC_ERROR([unsupported cpu $1])
    7.60 +      AC_MSG_ERROR([unsupported cpu $1])
    7.61        ;;
    7.62    esac
    7.63  
    7.64 @@ -515,3 +522,26 @@
    7.65          $1="$tmp"
    7.66      fi
    7.67  ])
    7.68 +
    7.69 +AC_DEFUN([SET_RELEASE_FILE_OS_VALUES],
    7.70 +[
    7.71 +    if test "x$HOST_OS" = "xsolaris"; then
    7.72 +       REQUIRED_OS_NAME=SunOS
    7.73 +       REQUIRED_OS_VERSION=5.10
    7.74 +    fi
    7.75 +    if test "x$HOST_OS" = "xlinux"; then
    7.76 +       REQUIRED_OS_NAME=Linux
    7.77 +       REQUIRED_OS_VERSION=2.6
    7.78 +    fi
    7.79 +    if test "x$HOST_OS" = "xwindows"; then
    7.80 +        REQUIRED_OS_NAME=Windows
    7.81 +        REQUIRED_OS_VERSION=5.1
    7.82 +    fi
    7.83 +    if test "x$HOST_OS" = "xmacosx"; then
    7.84 +        REQUIRED_OS_NAME=Darwin
    7.85 +        REQUIRED_OS_VERSION=11.2
    7.86 +    fi
    7.87 +
    7.88 +    AC_SUBST(REQUIRED_OS_NAME)
    7.89 +    AC_SUBST(REQUIRED_OS_VERSION)
    7.90 +])
     8.1 --- a/common/autoconf/spec.gmk.in	Fri Jun 08 12:01:05 2012 -0700
     8.2 +++ b/common/autoconf/spec.gmk.in	Wed Jun 13 16:53:05 2012 -0700
     8.3 @@ -64,6 +64,9 @@
     8.4  # A self-referential reference to this file.
     8.5  SPEC:=@SPEC@
     8.6  
     8.7 +# The "human readable" name of this configuration
     8.8 +CONF_NAME:=@CONF_NAME@
     8.9 +
    8.10  # The built jdk will run in this host system.
    8.11  HOST:=@HOST@
    8.12  HOST_OS:=@HOST_OS@
    8.13 @@ -87,6 +90,10 @@
    8.14  BUILD_CPU_BITS:=@BUILD_CPU_BITS@
    8.15  BUILD_CPU_ENDIAN:=@BUILD_CPU_ENDIAN@
    8.16  
    8.17 +# Legacy OS values for use in release file.
    8.18 +REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
    8.19 +REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@
    8.20 +
    8.21  # Old name for HOST_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
    8.22  PLATFORM:=@HOST_OS@
    8.23  # Old name for HOST_CPU, uses i586 and amd64, instead of ia32 and x64.
    8.24 @@ -105,6 +112,7 @@
    8.25  @SET_OPENJDK@
    8.26  JIGSAW:=@JIGSAW@
    8.27  LIBM:=-lm
    8.28 +LIBDL:=@LIBDL@
    8.29  
    8.30  # colon or semicolon
    8.31  PATH_SEP:=@PATH_SEP@
    8.32 @@ -287,8 +295,8 @@
    8.33  
    8.34  PACKAGE_PATH=@PACKAGE_PATH@
    8.35  
    8.36 -CACERTS_FILE:=$(SRC_ROOT)/jdk/src/share/lib/security/cacerts
    8.37 -#CACERTS_INT=$(CLOSED_SHARE_SRC)/lib/security/cacerts.internal
    8.38 +# Source file for cacerts
    8.39 +CACERTS_FILE=@CACERTS_FILE@
    8.40  
    8.41  #MOZILLA_HEADERS_PATH:=
    8.42  
    8.43 @@ -308,13 +316,18 @@
    8.44  AR_OUT_OPTION:=@AR_OUT_OPTION@
    8.45  
    8.46  # Flags used for overriding the default opt setting for a C/C++ source file.
    8.47 +C_O_FLAG_HIGHEST:=@C_O_FLAG_HIGHEST@
    8.48  C_O_FLAG_HI:=@C_O_FLAG_HI@
    8.49  C_O_FLAG_NORM:=@C_O_FLAG_NORM@
    8.50  C_O_FLAG_NONE:=@C_O_FLAG_NONE@
    8.51 +CXX_O_FLAG_HIGHEST:=@CXX_O_FLAG_HIGHEST@
    8.52  CXX_O_FLAG_HI:=@CXX_O_FLAG_HI@
    8.53  CXX_O_FLAG_NORM:=@CXX_O_FLAG_NORM@
    8.54  CXX_O_FLAG_NONE:=@CXX_O_FLAG_NONE@
    8.55  
    8.56 +C_FLAG_DEPS:=@C_FLAG_DEPS@
    8.57 +CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
    8.58 +
    8.59  # Tools that potentially need to be cross compilation aware.
    8.60  CC:=@UNCYGDRIVE@ @CCACHE@ @CC@
    8.61  
    8.62 @@ -386,6 +399,11 @@
    8.63  # (Note absence of := assignment, because we do not want to evaluate the macro body here)
    8.64  SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
    8.65  
    8.66 +# Options for C/CXX compiler to be used if linking is performed
    8.67 +#   using reorder file
    8.68 +C_FLAG_REORDER:=@C_FLAG_REORDER@
    8.69 +CXX_FLAG_REORDER:=@CXX_FLAG_REORDER@
    8.70 +
    8.71  # Options to linker to specify the library name.
    8.72  # (Note absence of := assignment, because we do not want to evaluate the macro body here)
    8.73  SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@
    8.74 @@ -406,6 +424,9 @@
    8.75  EXE_SUFFIX:=@EXE_SUFFIX@
    8.76  OBJ_SUFFIX:=@OBJ_SUFFIX@
    8.77  
    8.78 +POST_STRIP_CMD:=@POST_STRIP_CMD@
    8.79 +POST_MCS_CMD:=@POST_MCS_CMD@
    8.80 +
    8.81  JAVA_FLAGS:=@BOOT_JDK_JVMARGS@
    8.82  
    8.83  JAVA=@UNCYGDRIVE@ @JAVA@ $(JAVA_FLAGS)
    8.84 @@ -419,6 +440,8 @@
    8.85  
    8.86  RMIC:=@UNCYGDRIVE@ @RMIC@
    8.87  
    8.88 +NATIVE2ASCII:=@UNCYGDRIVE@ @NATIVE2ASCII@
    8.89 +
    8.90  BOOT_JAR_CMD:=@UNCYGDRIVE@ @JAR@
    8.91  BOOT_JAR_JFLAGS:=
    8.92  
    8.93 @@ -483,6 +506,7 @@
    8.94  READELF:=@READELF@
    8.95  EXPR:=@EXPR@
    8.96  FILE:=@FILE@
    8.97 +HG:=@HG@
    8.98  
    8.99  UNCYGDRIVE:=@UNCYGDRIVE@
   8.100  
   8.101 @@ -584,5 +608,13 @@
   8.102  # Misc
   8.103  #
   8.104  
   8.105 +# Name of Service Agent library
   8.106 +SALIB_NAME=@SALIB_NAME@
   8.107 +
   8.108  # Control wether Hotspot runs Queens test after building
   8.109  TEST_IN_BUILD=@TEST_IN_BUILD@
   8.110 +
   8.111 +OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
   8.112 +OS_VERSION_MINOR:=@OS_VERSION_MINOR@
   8.113 +OS_VERSION_MICRO:=@OS_VERSION_MICRO@
   8.114 +
     9.1 --- a/common/bin/compareimage.sh	Fri Jun 08 12:01:05 2012 -0700
     9.2 +++ b/common/bin/compareimage.sh	Wed Jun 13 16:53:05 2012 -0700
     9.3 @@ -45,7 +45,7 @@
     9.4  #
     9.5  
     9.6  if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ] || [ "x$1" == "x" ]; then
     9.7 -    echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image"
     9.8 +    echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image"
     9.9      echo ""
    9.10      echo "Compare the directory structure."
    9.11      echo "Compare the filenames in the directories."
    9.12 @@ -55,11 +55,11 @@
    9.13      echo "Compare the native executables"
    9.14      echo "Compare the remaining files"
    9.15      echo ""
    9.16 -    echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other]"
    9.17 +    echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other]"
    9.18      echo ""
    9.19      echo "Compare only the selected subset of the images."
    9.20      echo ""
    9.21 -    echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar"
    9.22 +    echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar"
    9.23      echo ""
    9.24      echo "Compare only the CodePointIM.jar file"
    9.25      echo "Can be used to compare zips, libraries and executables."
    9.26 @@ -114,10 +114,10 @@
    9.27      CMP_OTHER=true
    9.28  fi
    9.29  
    9.30 -DIFFJARZIP=`dirname $0`/diffjarzip.sh
    9.31 -DIFFLIB=`dirname $0`/difflib.sh
    9.32 -DIFFEXEC=`dirname $0`/diffexec.sh
    9.33 -export COMPARE_ROOT=/tmp/cimages
    9.34 +DIFFJARZIP="/bin/bash `dirname $0`/diffjarzip.sh"
    9.35 +DIFFLIB="/bin/bash `dirname $0`/difflib.sh"
    9.36 +DIFFEXEC="/bin/bash `dirname $0`/diffexec.sh"
    9.37 +export COMPARE_ROOT=/tmp/cimages.$USER
    9.38  mkdir -p $COMPARE_ROOT
    9.39  
    9.40  # Load the correct exception list.
    9.41 @@ -167,16 +167,64 @@
    9.42      ONLY_OLD=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '<')
    9.43      if [ "$ONLY_OLD" ]; then
    9.44          echo Only in $OLD
    9.45 -        echo $ONLY_OLD | sed 's|< ./|\t|g' | sed 's/ /\n/g'
    9.46 +        echo "$ONLY_OLD" | sed 's|< ./|    |g'
    9.47      fi
    9.48      # Differences in directories found.
    9.49      ONLY_NEW=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '>')
    9.50      if [ "$ONLY_NEW" ]; then
    9.51          echo Only in $NEW
    9.52 -        echo $ONLY_NEW | sed 's|> ./|\t|g' | sed 's/ /\n/g'
    9.53 +        echo "$ONLY_NEW" | sed 's|> ./|    |g'
    9.54      fi
    9.55  fi
    9.56  
    9.57 +if [ "`uname`" == "SunOS" ]; then
    9.58 +    PERM="gstat -c%a"
    9.59 +elif [ $OSTYPE == "cygwin" ]; then
    9.60 +    PERM=
    9.61 +elif [ "`uname`" == "Darwin" ]; then
    9.62 +    PERM="stat -f%p"
    9.63 +elif [ "`uname`" == "Linux" ]; then
    9.64 +    PERM="stat -c%A"
    9.65 +else
    9.66 +    PERM="stat -c%a"
    9.67 +fi
    9.68 +
    9.69 +if [ "${PERM}" ]
    9.70 +then
    9.71 +    echo -n Permissions...
    9.72 +    found=""
    9.73 +    for f in `cd $OLD && find . -type f`
    9.74 +    do
    9.75 +	if [ ! -f ${OLD}/$f ]; then continue; fi
    9.76 +	if [ ! -f ${NEW}/$f ]; then continue; fi
    9.77 +	OP=`${PERM} ${OLD}/$f`
    9.78 +	NP=`${PERM} ${NEW}/$f`
    9.79 +	if [ "$OP" != "$NP" ]
    9.80 +	then
    9.81 +	    if [ -z "$found" ]; then echo ; found="yes"; fi
    9.82 +	    printf "\told: ${OP} new: ${NP}\t$f\n"
    9.83 +	fi
    9.84 +    done
    9.85 +    if [ -z "$found" ]; then echo ; found="yes"; fi
    9.86 +fi
    9.87 +
    9.88 +GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
    9.89 +                                  ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
    9.90 +                                  ! -name "ct.sym" \
    9.91 +                              | grep -v "./bin/"  | sort | $FILTER)
    9.92 +echo General files...
    9.93 +for f in $GENERAL_FILES
    9.94 +do
    9.95 +    if [ -e $NEW/$f ]; then
    9.96 +        DIFF_OUT=$(diff $OLD/$f $NEW/$f 2>&1)
    9.97 +        if [ -n "$DIFF_OUT" ]; then
    9.98 +            echo $f
    9.99 +            echo "$DIFF_OUT"
   9.100 +        fi
   9.101 +    fi
   9.102 +done
   9.103 +
   9.104 +
   9.105  if [ "x$CMP_ZIPS" == "xtrue" ]; then
   9.106      ZIPS=$(cd $OLD && find . -type f -name "*.zip" | sort | $FILTER)
   9.107  
   9.108 @@ -194,7 +242,7 @@
   9.109  fi    
   9.110  
   9.111  if [ "x$CMP_JARS" == "xtrue" ]; then
   9.112 -    JARS=$(cd $OLD && find . -type f -name "*.jar" | sort | $FILTER)
   9.113 +    JARS=$(cd $OLD && find . -type f -name "*.jar" -o -name "ct.sym" | sort | $FILTER)
   9.114  
   9.115      if [ -n "$JARS" ]; then
   9.116          echo Jar files...
    10.1 --- a/common/bin/diffexec.sh	Fri Jun 08 12:01:05 2012 -0700
    10.2 +++ b/common/bin/diffexec.sh	Wed Jun 13 16:53:05 2012 -0700
    10.3 @@ -50,14 +50,21 @@
    10.4  
    10.5  if [ "`uname`" == "SunOS" ]; then
    10.6      NM=gnm
    10.7 -    STAT=gstat
    10.8 +    STAT="gstat -c%s"
    10.9 +    LDD=ldd
   10.10  elif [ $OSTYPE == "cygwin" ]; then
   10.11      NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
   10.12      NM_ARGS=/exports
   10.13 -    STAT=stat
   10.14 +    STAT="stat -c%s"
   10.15 +    LDD=
   10.16 +elif [ "`uname`" == "Darwin" ]; then
   10.17 +    NM=nm
   10.18 +    STAT="stat -f%z"
   10.19 +    LDD="otool -L"
   10.20  else
   10.21      NM=nm
   10.22 -    STAT=stat
   10.23 +    STAT="stat -c%s"
   10.24 +    LDD=ldd
   10.25  fi
   10.26  
   10.27  # Should the differences be viewed?
   10.28 @@ -72,8 +79,8 @@
   10.29  OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
   10.30  NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
   10.31  
   10.32 -OLD_SIZE=$($STAT -c%s "$OLD")
   10.33 -NEW_SIZE=$($STAT -c%s "$NEW")
   10.34 +OLD_SIZE=$($STAT "$OLD")
   10.35 +NEW_SIZE=$($STAT "$NEW")
   10.36  
   10.37  if [ $# -gt 3 ]
   10.38  then
   10.39 @@ -119,15 +126,41 @@
   10.40  
   10.41  DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS)
   10.42  
   10.43 +if [ "${LDD}" ]
   10.44 +then
   10.45 +    NAME=`basename $OLD`
   10.46 +    TMP=$COMPARE_ROOT/ldd/ldd.${NAME}
   10.47 +    rm -rf "${TMP}"
   10.48 +    mkdir -p "${TMP}"
   10.49 +
   10.50 +    (cd "${TMP}" && cp $OLD . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.old | uniq > dep.uniq.old)
   10.51 +    (cd "${TMP}" && cp $NEW . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.new | uniq > dep.uniq.new)
   10.52 +    (cd "${TMP}" && rm -f ${NAME})
   10.53 +    
   10.54 +    DIFFS_DEP=$(LANG=C diff "${TMP}/dep.old" "${TMP}/dep.new")
   10.55 +    DIFFS_UNIQ_DEP=$(LANG=C diff "${TMP}/dep.uniq.old" "${TMP}/dep.uniq.new")
   10.56 +    
   10.57 +    DEP_MSG=
   10.58 +    if [ -z "${DIFFS_UNIQ_DEP}" -a -z "${DIFFS_DEP}" ]; then
   10.59 +       DEP_MSG="Identical dependencies"
   10.60 +    elif [ -z "${DIFFS_UNIQ_DEP}" ]; then
   10.61 +       DEP_MSG="Redundant duplicate dependencies added"
   10.62 +       RES=1
   10.63 +    else
   10.64 +       DEP_MSG="DIFFERENT dependencies"
   10.65 +       RES=1
   10.66 +    fi
   10.67 +fi
   10.68 +
   10.69  RESULT=0
   10.70  
   10.71  if [ -n "$DIFFS" ]; then
   10.72     if [ $OLD_SIZE -ne $NEW_SIZE ]
   10.73     then
   10.74 -       echo Differences, content AND size     : $OLD_NAME 
   10.75 +       echo Differences, content AND size     : $DEP_MSG : $OLD_NAME 
   10.76         RESULT=4
   10.77     else
   10.78 -       echo Differences, content BUT SAME size: $OLD_NAME 
   10.79 +       echo Differences, content BUT SAME size: $DEP_MSG : $OLD_NAME 
   10.80         RESULT=3
   10.81     fi
   10.82     if [ "x$VIEW" == "xview" ]; then
   10.83 @@ -136,10 +169,10 @@
   10.84  else
   10.85     if [ $OLD_SIZE -ne $NEW_SIZE ]
   10.86     then
   10.87 -       echo Identical symbols BUT NEW size    : $OLD_NAME 
   10.88 +       echo Identical symbols BUT NEW size    : $DEP_MSG : $OLD_NAME 
   10.89         RESULT=2
   10.90     else
   10.91 -       echo Identical symbols AND size, BUT not bytewise identical: $OLD_NAME 
   10.92 +       echo Identical symbols AND size, BUT not bytewise identical: $DEP_MSG : $OLD_NAME 
   10.93         RESULT=1
   10.94     fi
   10.95  fi
    11.1 --- a/common/bin/diffjarzip.sh	Fri Jun 08 12:01:05 2012 -0700
    11.2 +++ b/common/bin/diffjarzip.sh	Wed Jun 13 16:53:05 2012 -0700
    11.3 @@ -84,8 +84,8 @@
    11.4      exit 2
    11.5  fi
    11.6  
    11.7 -if [ "$OLD_SUFFIX" != "zip" ] && [ "$OLD_SUFFIX" != "jar" ]; then
    11.8 -    echo The files have to be zip or jar! They are $OLD_SUFFIX
    11.9 +if [ "$OLD_SUFFIX" != "zip" ] && [ "$OLD_SUFFIX" != "jar" ] && [ "$OLD_SUFFIX" != "sym" ]; then
   11.10 +    echo The files have to be zip, jar or sym! They are $OLD_SUFFIX
   11.11      exit 2
   11.12  fi
   11.13  
   11.14 @@ -128,7 +128,7 @@
   11.15          | sed "s|Only in $NEW_TEMPDIR|            |"g | sed 's|: |/|g'
   11.16  fi
   11.17  
   11.18 -DIFFTEXT=`dirname $0`/difftext.sh
   11.19 +DIFFTEXT="/bin/bash `dirname $0`/difftext.sh"
   11.20  
   11.21  LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep differ | cut -f 2,4 -d ' ' | \
   11.22     awk "{ print \"$DIFFTEXT \"\$1\" \"\$2 }" > $COMPARE_ROOT/diffing
    12.1 --- a/common/bin/difflib.sh	Fri Jun 08 12:01:05 2012 -0700
    12.2 +++ b/common/bin/difflib.sh	Wed Jun 13 16:53:05 2012 -0700
    12.3 @@ -54,14 +54,21 @@
    12.4  
    12.5  if [ "`uname`" == "SunOS" ]; then
    12.6      NM=gnm
    12.7 -    STAT=gstat
    12.8 +    STAT="gstat -c%s"
    12.9 +    LDD=ldd
   12.10  elif [ $OSTYPE == "cygwin" ]; then
   12.11      NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
   12.12      NM_ARGS=/exports
   12.13 -    STAT=stat
   12.14 +    STAT="stat -c%s"
   12.15 +    LDD=
   12.16 +elif [ "`uname`" == "Darwin" ]; then
   12.17 +    NM=nm
   12.18 +    STAT="stat -f%z"
   12.19 +    LDD="otool -L"
   12.20  else
   12.21      NM=nm
   12.22 -    STAT=stat
   12.23 +    STAT="stat -c%s"
   12.24 +    LDD=ldd
   12.25  fi
   12.26  
   12.27  # Should the differences be viewed?
   12.28 @@ -76,8 +83,8 @@
   12.29  OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
   12.30  NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
   12.31  
   12.32 -OLD_SIZE=$($STAT -c%s "$OLD")
   12.33 -NEW_SIZE=$($STAT -c%s "$NEW")
   12.34 +OLD_SIZE=$($STAT "$OLD")
   12.35 +NEW_SIZE=$($STAT "$NEW")
   12.36  
   12.37  if [ $# -gt 3 ]
   12.38  then
   12.39 @@ -139,13 +146,39 @@
   12.40  
   12.41  RESULT=0
   12.42  
   12.43 +if [ "${LDD}" ]
   12.44 +then
   12.45 +    NAME=`basename $OLD`
   12.46 +    TMP=$COMPARE_ROOT/ldd/ldd.${NAME}
   12.47 +    rm -rf "${TMP}"
   12.48 +    mkdir -p "${TMP}"
   12.49 +    
   12.50 +    (cd "${TMP}" && cp $OLD . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.old | uniq > dep.uniq.old)
   12.51 +    (cd "${TMP}" && cp $NEW . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.new | uniq > dep.uniq.new)
   12.52 +    (cd "${TMP}" && rm -f ${NAME})
   12.53 +    
   12.54 +    DIFFS_DEP=$(LANG=C diff "${TMP}/dep.old" "${TMP}/dep.new")
   12.55 +    DIFFS_UNIQ_DEP=$(LANG=C diff "${TMP}/dep.uniq.old" "${TMP}/dep.uniq.new")
   12.56 +    
   12.57 +    DEP_MSG=
   12.58 +    if [ -z "${DIFFS_UNIQ_DEP}" -a -z "${DIFFS_DEP}" ]; then
   12.59 +       DEP_MSG="Identical dependencies"
   12.60 +    elif [ -z "${DIFFS_UNIQ_DEP}" ]; then
   12.61 +       DEP_MSG="Redundant duplicate dependencies added"
   12.62 +       RES=1
   12.63 +    else
   12.64 +       DEP_MSG="DIFFERENT dependencies"
   12.65 +       RES=1
   12.66 +    fi
   12.67 +fi
   12.68 +
   12.69  if [ -n "$DIFFS" ]; then
   12.70     if [ $OLD_SIZE -ne $NEW_SIZE ]
   12.71     then
   12.72 -       echo Differences, content AND size     : $OLD_NAME 
   12.73 +       echo Differences, content AND size     : $DEP_MSG : $OLD_NAME 
   12.74         RESULT=4
   12.75     else
   12.76 -       echo Differences, content BUT SAME size: $OLD_NAME 
   12.77 +       echo Differences, content BUT SAME size: $DEP_MSG : $OLD_NAME 
   12.78         RESULT=3
   12.79     fi
   12.80     if [ "x$VIEW" == "xview" ]; then
   12.81 @@ -154,10 +187,10 @@
   12.82  else
   12.83     if [ $OLD_SIZE -ne $NEW_SIZE ]
   12.84     then
   12.85 -       echo Identical symbols BUT NEW size    : $OLD_NAME 
   12.86 +       echo Identical symbols BUT NEW size    : $DEP_MSG : $OLD_NAME 
   12.87         RESULT=2
   12.88     else
   12.89 -       echo Identical symbols AND size, BUT not bytewise identical: $OLD_NAME 
   12.90 +       echo Identical symbols AND size, BUT not bytewise identical: $DEP_MSG : $OLD_NAME 
   12.91         RESULT=1
   12.92     fi
   12.93  fi
    13.1 --- a/common/bin/logger.sh	Fri Jun 08 12:01:05 2012 -0700
    13.2 +++ b/common/bin/logger.sh	Wed Jun 13 16:53:05 2012 -0700
    13.3 @@ -37,10 +37,9 @@
    13.4  
    13.5  # Create a temporary directory to store the result code from
    13.6  # the wrapped command.
    13.7 -RCDIR=`mktemp -d tmp.XXXXXX` || exit $?
    13.8 -trap "rm -rf '$RCDIR'" EXIT
    13.9 +RCDIR=`mktemp -dt jdk-build-logger.tmp.XXXXXX` || exit $?
   13.10 +trap "rm -rf \"$RCDIR\"" EXIT
   13.11  LOGFILE=$1
   13.12  shift
   13.13 -(exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > $RCDIR/rc) | tee -a $LOGFILE 1>&2 ; exec 3>&-) | tee -a $LOGFILE
   13.14 -exit `cat $RCDIR/rc`
   13.15 -
   13.16 +(exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > "$RCDIR/rc") | tee -a $LOGFILE 1>&2 ; exec 3>&-) | tee -a $LOGFILE
   13.17 +exit `cat "$RCDIR/rc"`
    14.1 --- a/common/makefiles/JavaCompilation.gmk	Fri Jun 08 12:01:05 2012 -0700
    14.2 +++ b/common/makefiles/JavaCompilation.gmk	Wed Jun 13 16:53:05 2012 -0700
    14.3 @@ -126,8 +126,7 @@
    14.4      #    JAR:=Jar file to create
    14.5      #    MANIFEST:=Optional manifest file template.
    14.6      #    JARMAIN:=Optional main class to add to manifest
    14.7 -    #    SETUP:=The Java(h) compiler setup, needed to run javah.
    14.8 -    #    HEADERS:=Directory to put headers in
    14.9 +    #    JARINDEX := 
   14.10      #    SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically 
   14.11      #                  added to the archive.
   14.12      #    EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
   14.13 @@ -143,9 +142,8 @@
   14.14      $(if $(12),$1_$(strip $(12)))
   14.15      $(if $(13),$1_$(strip $(13)))
   14.16      $(if $(14),$1_$(strip $(14)))
   14.17 +    $(if $(15),$1_$(strip $(15)))
   14.18  
   14.19 -    $1_JVM   := $$($$($1_SETUP)_JVM)
   14.20 -    $1_JAVAH := $$($$($1_SETUP)_JAVAH)
   14.21      $1_JARMAIN:=$(strip $$($1_JARMAIN))
   14.22      $1_JARNAME:=$$(notdir $$($1_JAR))
   14.23      $1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest
   14.24 @@ -155,19 +153,46 @@
   14.25      $1_NATIVEAPI_NOTIFICATIONS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native_notifications
   14.26      $1_NATIVEAPI_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native
   14.27      $1_BIN:=$$(dir $$($1_JAR))
   14.28 +
   14.29      ifeq (,$$($1_SUFFIXES))
   14.30          # No suffix was set, default to classes.
   14.31          $1_SUFFIXES:=.class
   14.32      endif
   14.33      # Convert suffixes to a find expression
   14.34      $1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
   14.35 +    # On windows, a lot of includes/excludes risk making the command line too long, so 
   14.36 +    # writing the grep patterns to files.
   14.37      ifneq (,$$($1_INCLUDES))
   14.38 -        $1_GREP_INCLUDES:=| $(GREP) $$(foreach src,$$($1_SRCS),$$(addprefix -e$(SPACE)$$(src)/,$$($1_INCLUDES)))
   14.39 +        $1_GREP_INCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),\
   14.40 +					$$(addprefix $$(src)/,$$($1_INCLUDES)))
   14.41 +        $$(eval $$(call ListPathsSafelyNow,$1_GREP_INCLUDE_PATTERNS,\n, \
   14.42 +			>> $$($1_BIN)/_the.$$($1_JARNAME)_include))
   14.43 +        $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include
   14.44      endif
   14.45      ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES))
   14.46 -        $1_GREP_EXCLUDES:=| $(GREP) -v $$(foreach src,$$($1_SRCS),$$(addprefix -e$(SPACE)$$(src)/,$$($1_EXCLUDES) $$($1_EXCLUDE_FILES)))
   14.47 +        $1_GREP_EXCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,\
   14.48 +		$$($1_EXCLUDES) $$($1_EXCLUDE_FILES)))
   14.49 +        $$(eval $$(call ListPathsSafelyNow,$1_GREP_EXCLUDE_PATTERNS,\n, \
   14.50 +			>> $$($1_BIN)/_the.$$($1_JARNAME)_exclude))
   14.51 +        $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude
   14.52      endif
   14.53  
   14.54 +    ifneq (,$$($1_JARINDEX))
   14.55 +      $1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@))
   14.56 +    else
   14.57 +      $1_JARINDEX = true
   14.58 +    endif
   14.59 +    # When this macro is run in the same makefile as the java compilation, dependencies are transfered
   14.60 +    # in make variables. When the macro is run in a different makefile than the java compilation, the 
   14.61 +    # dependencies need to be found in the filesystem.
   14.62 +    $1_ALL_SRCS:=$$(foreach src,$$($1_SRCS),$$(shell ($(FIND) $$(src) -type f \
   14.63 +			-a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
   14.64 +			$$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES))))
   14.65 +    ifeq (,$$($1_SKIP_METAINF))
   14.66 +        $1_ALL_SRCS+=$$(foreach src,$$($1_SRCS),$$(shell $(FIND) $$(src)/META-INF -type f 2> /dev/null))
   14.67 +    endif
   14.68 +
   14.69 +
   14.70      # Utility macros, to make the shell script receipt somewhat easier to dechipher.
   14.71  
   14.72      # The capture contents macro finds all files (matching the patterns, typically
   14.73 @@ -187,15 +212,6 @@
   14.74                      (cd $$(src) && \
   14.75                      $(FIND) . -name _the.package.api.notify -exec dirname \{\} \; >> $$($1_PUBAPI_NOTIFICATIONS_FILE) ; \
   14.76                      true) &&)
   14.77 -    # The capture nativeapi macro scans for native api change notificiations. If such notifications are
   14.78 -    # found, then we will run javah on the changed classes. It also collects all classes with native methods
   14.79 -    # to be used to find out which classes no longer has native methods, to trigger deletion of those .h files.
   14.80 -    $1_CAPTURE_NATIVEAPI=$$(foreach src,$$($1_SRCS),\
   14.81 -                    (cd $$(src) && \
   14.82 -                    $(FIND) . -name _the.package.native.notify | $(SED) 's/package.native.notify/package.native/' | \
   14.83 -                            $(XARGS) $(CAT)  | $(GREP) '^TYPE ' | $(SED) 's/.*TYPE //' >> $$($1_NATIVEAPI_NOTIFICATIONS_FILE) ; \
   14.84 -                    $(FIND) . -name _the.package.native -exec $(CAT) \{\} \; | $(SED) -n 's/^TYPE //p' >> $$($1_NATIVEAPI_FILE) ; \
   14.85 -                    true) &&)
   14.86      # The update contents macro updates the jar file with the previously capture contents.
   14.87      $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
   14.88                      (cd $$(src) && \
   14.89 @@ -205,13 +221,18 @@
   14.90                       fi) &&)
   14.91      # The s-variants of the above macros are used when the jar is created from scratch.
   14.92      $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\
   14.93 -                    (($(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) && )
   14.94 +                    (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
   14.95 +			$$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)) | $(SED) 's|$$(src)/||g' > \
   14.96 +			$$(src)/_the.$$($1_JARNAME)_contents) && )
   14.97 +
   14.98      ifeq (,$$($1_SKIP_METAINF))
   14.99          $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS),\
  14.100 -                    ($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents) && )
  14.101 +                    ($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> \
  14.102 +			$$(src)/_the.$$($1_JARNAME)_contents) && )
  14.103      endif
  14.104      $1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
  14.105                      (cd $$(src) && $(JAR) uf $$@ @$$(src)/_the.$$($1_JARNAME)_contents) &&)
  14.106 +
  14.107      # The TOUCH macro is used to make sure all timestamps are identical for package files and the pubapi files.
  14.108      # If we do not do this, we get random recompilations, the next time we run make, since the order of package building is random,
  14.109      # ie independent of package --dependes on-> public api of another package. This is of course
  14.110 @@ -223,7 +244,7 @@
  14.111      # Use a slightly shorter name for logging, but with enough path to identify this jar.
  14.112      $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
  14.113      # Here is the rule that creates/updates the jar file.
  14.114 -    $$($1_JAR) : $2
  14.115 +    $$($1_JAR) : $2 $$($1_ALL_SRC)
  14.116  	$(MKDIR) -p $$($1_BIN)
  14.117  	if [ -n "$$($1_MANIFEST)" ]; then \
  14.118  		$(SED) -e "s#@@RELEASE@@#$(RELEASE)#"           \
  14.119 @@ -231,9 +252,11 @@
  14.120  	else \
  14.121  		$(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE); \
  14.122  	fi
  14.123 -	$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE)
  14.124 +	if [ -n "$$(strip $$($1_JARMAIN))" ]; then \
  14.125 +		$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE); \
  14.126 +	fi
  14.127  	if [ -n "$$($1_EXTRA_MANIFEST_ATTR)" ]; then \
  14.128 -		$(ECHO) "$$($1_EXTRA_MANIFEST_ATTR)" >> $$($1_MANIFEST_FILE); \
  14.129 +		$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE); \
  14.130  	fi
  14.131  	+if [ -s $$@ ]; then \
  14.132  		$(RM) -r $$($1_PUBAPI_NOTIFICATIONS_FILE) && \
  14.133 @@ -255,20 +278,8 @@
  14.134  	                        $(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \
  14.135  			fi && \
  14.136  			$$($1_UPDATE_CONTENTS) true && \
  14.137 +			$$($1_JARINDEX) && \
  14.138  			$$($1_TOUCH_API_FILES) true && \
  14.139 -			$(RM) -r $$($1_NATIVEAPI_NOTIFICATIONS_FILE) $$($1_NATIVEAPI_FILE) && \
  14.140 -			$$($1_CAPTURE_NATIVEAPI) true && \
  14.141 -			if [ "x$$($1_JAVAH)" != "x" ] && [ -s $$($1_NATIVEAPI_NOTIFICATIONS_FILE) ]; then \
  14.142 -				$(ECHO) Native api change detected in: && $(CAT) $$($1_NATIVEAPI_NOTIFICATIONS_FILE) && \
  14.143 -		                $$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_JAR)" -d $$($1_HEADERS) @$$($1_NATIVEAPI_NOTIFICATIONS_FILE) ; \
  14.144 -	    		fi && \
  14.145 -			$(TOUCH) $$($1_NATIVEAPI_FILE)_prev ; \
  14.146 -			($(GREP) -xvf $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev > $$($1_NATIVEAPI_FILE)_deleted; true) && \
  14.147 -			$(CP) $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev && \
  14.148 -			if [ -s $$($1_NATIVEAPI_FILE)_deleted ]; then \
  14.149 -				$(ECHO) Native methods dropped from classes: && $(CAT) $$($1_NATIVEAPI_FILE)_deleted && \
  14.150 -				$(RM) `$(CAT) $$($1_NATIVEAPI_FILE)_deleted | $(SED) -e 's|\.|_|g' -e 's|.*|$$($1_HEADERS)/&.h $$($1_HEADERS)/&_*|'` ; \
  14.151 -			fi && \
  14.152  			$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) true ; \
  14.153  		fi ; \
  14.154  	else \
  14.155 @@ -276,15 +287,9 @@
  14.156  	        $$($1_SCAPTURE_CONTENTS) \
  14.157  		$$($1_SCAPTURE_METAINF) \
  14.158  		$$($1_SUPDATE_CONTENTS) \
  14.159 +		$$($1_JARINDEX) && \
  14.160  		$$($1_TOUCH_API_FILES) true && \
  14.161  		$(RM) -r $$($1_NATIVEAPI_NOTIFICATIONS_FILE) $$($1_NATIVEAPI_FILE) && \
  14.162 -		$$($1_CAPTURE_NATIVEAPI) true && \
  14.163 -		if [ "x$$($1_JAVAH)" != "x" ] && [ -s $$($1_NATIVEAPI_FILE) ]; then \
  14.164 -			$(ECHO) Generating native api headers for `$(CAT) $$($1_NATIVEAPI_FILE) | $(WC) -l` classes && \
  14.165 -			$(RM) $$($1_HEADERS)/*.h && \
  14.166 -			$$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_JAR)" -d $$($1_HEADERS) @$$($1_NATIVEAPI_FILE) && \
  14.167 -			$(CP) $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev ; \
  14.168 -		fi && \
  14.169  		$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name "*.notify" $(FIND_DELETE); true) &&) true ; \
  14.170  	fi; 
  14.171  
  14.172 @@ -297,7 +302,7 @@
  14.173  define SetupZipArchive
  14.174      # param 1 is for example ZIP_MYSOURCE
  14.175      # param 2,3,4,5,6,7,8,9 are named args.
  14.176 -    #    SRC,ZIP,INCLUDES,EXCLUDES,EXCLUDE_FILES
  14.177 +    #    SRC,ZIP,INCLUDES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS
  14.178      $(if $2,$1_$(strip $2))
  14.179      $(if $3,$1_$(strip $3))
  14.180      $(if $4,$1_$(strip $4))
  14.181 @@ -308,11 +313,17 @@
  14.182      $(if $9,$1_$(strip $9))
  14.183  
  14.184      # Find all files in the source tree.
  14.185 -    $1_ALL_SRCS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f -a ! -name "_the.*"))
  14.186 +    $1_SUFFIX_FILTER := $$(patsubst %,-o -name $(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
  14.187 +    $1_ALL_SRCS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f -a ! -name "_the.*" \( -name FALSE_DUMMY  $$($1_SUFFIX_FILTER) \) ))
  14.188  
  14.189      ifneq ($$($1_INCLUDES),)
  14.190          $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
  14.191 -        $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
  14.192 +        ifneq ($$($1_SUFFIXES),)
  14.193 +            $1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES),\
  14.194 +		$$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES))))
  14.195 +        else
  14.196 +            $1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
  14.197 +        endif
  14.198          $1_ALL_SRCS     := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_SRCS))
  14.199      endif
  14.200      ifneq ($$($1_EXCLUDES),)
  14.201 @@ -329,7 +340,7 @@
  14.202      # Explicitly excluded files can be given with absolute path. The patsubst solution
  14.203      # isn't perfect but the likelyhood of an absolute path to match something in a src
  14.204      # dir is very small.
  14.205 -    $$($1_ZIP) : $$($1_ALL_SRCS)
  14.206 +    $$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
  14.207  		$(MKDIR) -p $$(@D)
  14.208  		$(ECHO) Updating $$($1_NAME)
  14.209  		$$(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
  14.210 @@ -472,7 +483,7 @@
  14.211  		   | $(SED) -e '/^#/d' -e '/^$$$$/d' \
  14.212  		            -e :a -e '/\\$$$$/N; s/\\\n//; ta' \
  14.213  			    -e 's/^[ \t]*//;s/[ \t]*$$$$//' \
  14.214 -			    -e 's/\\=/=/' | LANG=C sort > $$@
  14.215 +			    -e 's/\\=/=/' | LANG=C $(SORT) > $$@
  14.216  	$(CHMOD) -f ug+w $$@
  14.217  
  14.218      # And do not forget this target
  14.219 @@ -623,6 +634,7 @@
  14.220      #    JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=Don't use this. This forces an explicit -sourcepath to javac.
  14.221      #                                     Its only here until we cleanup some nasty source code pasta in the jdk.
  14.222      #    HEADERS:=path to directory where all generated c-headers are written.
  14.223 +    #    DEPENDS:=Extra dependecy
  14.224      $(if $2,$1_$(strip $2))
  14.225      $(if $3,$1_$(strip $3))
  14.226      $(if $4,$1_$(strip $4))
  14.227 @@ -650,9 +662,6 @@
  14.228  $1_JAVAC := $$($$($1_SETUP)_JAVAC)
  14.229  $1_JAVAH := $$($$($1_SETUP)_JAVAH)
  14.230  $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
  14.231 -ifeq (,$$($1_HEADERS))
  14.232 -    $1_HEADERS := $$($1_BIN)
  14.233 -endif
  14.234  
  14.235  # Handle addons and overrides.
  14.236  $1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
  14.237 @@ -776,24 +785,21 @@
  14.238        $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC)))
  14.239      endif
  14.240  
  14.241 +    ifneq (,$$($1_HEADERS))
  14.242 +      $1_HEADERS_ARG := -h $$($1_HEADERS)
  14.243 +    endif
  14.244 +
  14.245      # Create a sed expression to remove the source roots and to replace / with .
  14.246      # and remove .java at the end. 
  14.247      $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
  14.248  
  14.249      # Here is the batch rules that depends on all the sources.
  14.250 -    $$($1_BIN)/_the.batch: $$($1_SRCS)
  14.251 +    $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS)
  14.252  	$(MKDIR) -p $$(@D)
  14.253  	$(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp
  14.254  	$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
  14.255  	$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files in batch $1
  14.256 -	($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) -implicit:none -sourcepath "$$($1_SRCROOTSC)" -d $$($1_BIN) @$$($1_BIN)/_the.batch.tmp && \
  14.257 -	 $$(if $$($1_JAVAH),\
  14.258 -             $(CAT) $$($1_BIN)/_the.batch.tmp | $(XARGS) $(GREP) -E "[[:space:]]native[[:space:]]|@GenerateNativeHeader" |\
  14.259 -             $(GREP) -v '*' | $(GREP) -v '//' | $(CUT) -f 1 -d ':' | $(SORT) -u |\
  14.260 -             $(SED) $$($1_REWRITE_INTO_CLASSES) > $$($1_BIN)/_the.batch.natives && \
  14.261 -         if test -s $$($1_BIN)/_the.batch.natives; then \
  14.262 -             $$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_BIN)" -d $$($1_HEADERS) @$$($1_BIN)/_the.batch.natives ; \
  14.263 -         fi &&) \
  14.264 +	($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) -implicit:none -sourcepath "$$($1_SRCROOTSC)" -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \
  14.265           $(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
  14.266  else
  14.267      # Ok, we have a modern javac server running!
  14.268 @@ -868,6 +874,7 @@
  14.269  	JARMAIN:=$$($1_JARMAIN),\
  14.270  	MANIFEST:=$$($1_MANIFEST),\
  14.271  	EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR),\
  14.272 +	JARINDEX:=$$($1_JARINDEX),\
  14.273  	HEADERS:=$$($1_HEADERS),\
  14.274  	SETUP:=$$($1_SETUP)))
  14.275  endif
    15.1 --- a/common/makefiles/MakeBase.gmk	Fri Jun 08 12:01:05 2012 -0700
    15.2 +++ b/common/makefiles/MakeBase.gmk	Wed Jun 13 16:53:05 2012 -0700
    15.3 @@ -91,6 +91,15 @@
    15.4    > $(BUILDTIMESDIR)/build_time_diff_$1
    15.5  endef
    15.6  
    15.7 +# Check if the current target is the final target, as specified by
    15.8 +# the user on the command line. If so, call PrintEndMessage.
    15.9 +define CheckIfFinished
   15.10 +$(if $(filter $@,$(MAKECMDGOALS)),$(call PrintEndMessage))
   15.11 +# If no taget is given, "all" is default. Check for that, too.
   15.12 +# At most one of the tests can be true.
   15.13 +$(if $(MAKECMDGOALS),,$(if $(filter $@,all),$(call PrintEndMessage)))
   15.14 +endef
   15.15 +
   15.16  # Indicate that we are done.
   15.17  # Record ending time and print out the total time it took to build.
   15.18  define MakeFinish 
   15.19 @@ -101,6 +110,7 @@
   15.20  "########################################################################" \
   15.21  $(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \
   15.22  "########################################################################"
   15.23 +$(call CheckIfFinished)
   15.24  endef
   15.25  
   15.26  # Find all build_time_* files and print their contents in a list sorted
   15.27 @@ -126,6 +136,18 @@
   15.28  	$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
   15.29  endef
   15.30  
   15.31 +# Hook to be called as the very first thing when running a normal build
   15.32 +define AtRootMakeStart
   15.33 +	$(call PrintStartMessage)
   15.34 +	$(call StartTimer)
   15.35 +endef
   15.36 +
   15.37 +# Hook to be called as the very last thing for targets that are "top level" targets
   15.38 +define AtRootMakeEnd
   15.39 +	$(call StopTimer)
   15.40 +	$(call CheckIfFinished)
   15.41 +endef
   15.42 +
   15.43  # If the variable that you want to send to stdout for piping into a file or otherwise,
   15.44  # is potentially long, for example the a list of file paths, eg a list of all package directories.
   15.45  # Then you need to use ListPathsSafely, which optimistically splits the output into several shell
   15.46 @@ -324,4 +346,51 @@
   15.47  
   15.48  endef
   15.49  
   15.50 +# The source tips can come from the Mercurial repository, or in the files
   15.51 +#   $(HGTIP_FILENAME) which contains the tip but is also positioned in the same
   15.52 +#   directory as the original $(HGDIR) directory.
   15.53 +#   These should not be := assignments, only used from the root Makefile.
   15.54 +HG_VERSION = $(shell $(HG) version 2> /dev/null)
   15.55 +HG_DIRECTORY=.hg
   15.56 +HGTIP_FILENAME=.hgtip
   15.57 +HG_SEARCH = ./REPO ./*/REPO ./*/*/REPO ./*/*/*/REPO
   15.58 +REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \
   15.59 +    $(shell $(CD) $(SRC_ROOT) ; ( $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \
   15.60 +                                   $(LS)    $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \
   15.61 +	        2> /dev/null)))))
   15.62 +
   15.63 +# Emit the repo:tip pairs to $@
   15.64 +define GetSourceTips
   15.65 +$(CD) $(SRC_ROOT) ; \
   15.66 +for i in $(REPO_LIST) IGNORE ; do \
   15.67 +  if [ "$${i}" = "IGNORE" ] ; then \
   15.68 +    continue; \
   15.69 +  elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
   15.70 +    $(PRINTF) " %s:%s" \
   15.71 +      "$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \
   15.72 +  elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
   15.73 +    $(PRINTF) " %s:%s" \
   15.74 +      "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
   15.75 +  fi; \
   15.76 +done >> $@
   15.77 +$(PRINTF) "\n" >> $@
   15.78 +endef
   15.79 +
   15.80 +# Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk
   15.81 +define CreateHgTip
   15.82 +$(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME);\
   15.83 +$(ECHO) $1/$(HGTIP_FILENAME)
   15.84 +endef
   15.85 +
   15.86 +define SetupLogging
   15.87 +    ifneq ($(findstring $(LOG),debug trace),)
   15.88 +        # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
   15.89 +        OLD_SHELL:=$$(SHELL)
   15.90 +        SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x
   15.91 +    endif
   15.92 +endef
   15.93 +
   15.94 +# Make sure logging is setup for everyone that includes MakeBase.gmk.
   15.95 +$(eval $(call SetupLogging))
   15.96 +
   15.97  endif # _MAKEBASE_GMK
    16.1 --- a/common/makefiles/Makefile	Fri Jun 08 12:01:05 2012 -0700
    16.2 +++ b/common/makefiles/Makefile	Wed Jun 13 16:53:05 2012 -0700
    16.3 @@ -23,49 +23,144 @@
    16.4  # questions.
    16.5  #
    16.6  
    16.7 -# Default to sane output from make.
    16.8 -# Override with empty string to get insane amount of output.
    16.9 -# Override with -d to get even more insane amount of debugging output.
   16.10 -# Override with "-d -p" to get it all.
   16.11 -VERBOSE=-s
   16.12 +# This must be the first rule
   16.13 +default: all
   16.14 +
   16.15 +# Find out which variables were passed explicitely on the make command line. These
   16.16 +# will be passed on to sub-makes, overriding spec.gmk settings.
   16.17 +MAKE_ARGS=$(foreach var,$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))),$(var)=$($(var)))
   16.18 +
   16.19 +define fatal-error
   16.20 +    # If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
   16.21 +    $$(if $$(findstring help,$$(MAKECMDGOALS)),,$$(error Cannot continue))
   16.22 +endef
   16.23 +
   16.24 +ifeq ($(origin VERBOSE),undefined)
   16.25 +    # Setup logging according to LOG (but only if VERBOSE is not given)
   16.26 +    ifeq ($(LOG),)
   16.27 +        # Set LOG to "warn" as default if not set (and no VERBOSE given)
   16.28 +        LOG=warn
   16.29 +    endif
   16.30 +    ifeq ($(LOG),warn)
   16.31 +        VERBOSE=-s
   16.32 +    else ifeq ($(LOG),info)
   16.33 +        VERBOSE=
   16.34 +    else ifeq ($(LOG),debug)
   16.35 +        VERBOSE=
   16.36 +    else ifeq ($(LOG),trace)
   16.37 +        VERBOSE=-d -p
   16.38 +    else
   16.39 +        $(info Error: LOG must be one of: warn, info, debug or trace.)
   16.40 +        $(eval $(call fatal-error))
   16.41 +    endif
   16.42 +else
   16.43 +    ifneq ($(LOG),)
   16.44 +        # We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves,
   16.45 +        # but complain if this is the top-level make call.
   16.46 +        ifeq ($(MAKELEVEL),0)
   16.47 +            $(info Cannot use LOG=$(LOG) and VERBOSE=$(VERBOSE) at the same time. Choose one.)
   16.48 +            $(eval $(call fatal-error))
   16.49 +        endif
   16.50 +    endif
   16.51 +endif
   16.52 +
   16.53 +# TODO: Fix duplication in MakeBase.gmk
   16.54 +define SetupLogging
   16.55 +    ifneq ($(findstring $(LOG),debug trace),)
   16.56 +        # Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
   16.57 +        OLD_SHELL:=$$(SHELL)
   16.58 +        SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x
   16.59 +    endif
   16.60 +endef
   16.61 +
   16.62 +$(eval $(call SetupLogging))
   16.63  
   16.64  # Find all environment or command line variables that begin with ALT.
   16.65  list_alt_overrides_with_origins = $(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))
   16.66  list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins)))
   16.67 -ifneq ($(list_alt_overrides),)
   16.68 -    $(info You have set the following ALT_ variables:)
   16.69 -    $(foreach var,$(list_alt_overrides), $(info $(var)=$($(var))))
   16.70 -    $(error Using ALT_ variables is deprecated! Please clean your environment!)
   16.71 +
   16.72 +ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
   16.73 +    makefile_path=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
   16.74 +else
   16.75 +    makefile_path=$(lastword $(MAKEFILE_LIST))
   16.76  endif
   16.77 +root_dir=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path))
   16.78 +output_dir=$(root_dir)/build
   16.79  
   16.80 -# The spec.gmk file contains the variables extracted by the configure script.
   16.81 -# It is usually set with SPEC=....spec.gmk on the make command line.
   16.82 -# However if you simply type make from the openjdk source root, it will go looking
   16.83 -# for a spec file, if only one is found, use it. If more than one is found,
   16.84 -# complain. If none is found, request the user to run configure!
   16.85 -SPEC ?= $(wildcard $(CURDIR)/../../build/*/spec.gmk)
   16.86 +ifneq ($(origin SPEC),undefined)
   16.87 +    # We have been given a SPEC, check that it works out properly
   16.88 +    ifeq ($(wildcard $(SPEC)),)
   16.89 +        $(info Cannot locate spec.gmk, given by SPEC=$(SPEC))
   16.90 +        $(eval $(call fatal-error))
   16.91 +    endif
   16.92 +    ifneq ($(origin CONF),undefined)
   16.93 +        # We also have a CONF argument. This is OK only if this is a repeated call by ourselves,
   16.94 +        # but complain if this is the top-level make call.
   16.95 +        ifeq ($(MAKELEVEL),0)
   16.96 +            $(info Cannot use CONF=$(CONF) and SPEC=$(SPEC) at the same time. Choose one.)
   16.97 +            $(eval $(call fatal-error))
   16.98 +        endif
   16.99 +    endif
  16.100 +    # ... OK, we're satisfied, we'll use this SPEC later on
  16.101 +else
  16.102 +    # Find all spec.gmk files in the build output directory
  16.103 +    all_spec_files=$(wildcard $(output_dir)/*/spec.gmk)
  16.104 +    ifeq ($(all_spec_files),)
  16.105 +        $(info No configurations found for $(root_dir)! Please run configure to create a configuration.)
  16.106 +        $(eval $(call fatal-error))
  16.107 +    endif
  16.108 +    # Extract the configuration names from the path
  16.109 +    all_confs=$(patsubst %/spec.gmk,%,$(patsubst $(output_dir)/%,%,$(all_spec_files)))
  16.110  
  16.111 -ifeq ($(words $(SPEC)),0)
  16.112 -    $(error You must run configure!)
  16.113 +    ifneq ($(origin CONF),undefined)
  16.114 +        # User have given a CONF= argument.
  16.115 +        ifeq ($(CONF),)
  16.116 +            # If given CONF=, match all configurations
  16.117 +            matching_confs=$(strip $(all_confs))
  16.118 +        else
  16.119 +            # Otherwise select those that contain the given CONF string
  16.120 +            matching_confs=$(strip $(foreach var,$(all_confs),$(if $(findstring $(CONF),$(var)),$(var))))
  16.121 +        endif
  16.122 +        ifeq ($(matching_confs),)
  16.123 +            $(info No configurations found matching CONF=$(CONF))
  16.124 +            $(info Available configurations:)
  16.125 +            $(foreach var,$(all_confs),$(info * $(var)))
  16.126 +            $(eval $(call fatal-error))
  16.127 +        else
  16.128 +            ifeq ($(words $(matching_confs)),1)
  16.129 +                $(info Building '$(matching_confs)' (matching CONF=$(CONF)))
  16.130 +            else
  16.131 +                $(info Building the following configurations (matching CONF=$(CONF)):)
  16.132 +                $(foreach var,$(matching_confs),$(info * $(var)))
  16.133 +            endif
  16.134 +        endif
  16.135 +
  16.136 +        # Create a SPEC definition. This will contain the path to one or more spec.gmk files.
  16.137 +        SPEC=$(addsuffix /spec.gmk,$(addprefix $(output_dir)/,$(matching_confs)))
  16.138 +    else
  16.139 +        # No CONF or SPEC given, check the available configurations
  16.140 +        ifneq ($(words $(all_spec_files)),1)
  16.141 +            $(info No CONF or SPEC given, but more than one spec.gmk found in $(output_dir).)
  16.142 +            $(info Available configurations:)
  16.143 +            $(foreach var,$(all_confs),$(info * $(var)))
  16.144 +            $(info Please retry building with CONF=<config> or SPEC=<specfile>)
  16.145 +            $(eval $(call fatal-error))
  16.146 +        endif
  16.147 +
  16.148 +        # We found exactly one configuration, use it
  16.149 +        SPEC=$(strip $(all_spec_files))
  16.150 +    endif
  16.151  endif
  16.152  
  16.153  ifneq ($(words $(SPEC)),1)
  16.154 -    ifeq ($(MAKECMDGOALS),all-conf)
  16.155 -        SPECS:=$(shell echo $(SPEC) | sed -e 's|$(CURDIR)/build/||g' -e 's|/spec.gmk|\\n|g' -e 's| ||g')
  16.156 -        allconf:
  16.157 -		@echo Building configurations:
  16.158 -		@printf "$(SPECS)"
  16.159 -		@$(foreach s,$(SPEC),($(MAKE) SPEC=$s $(VERBOSE) VERBOSE=$(VERBOSE) images) &&) true
  16.160 -		@echo Done building configurations:
  16.161 -		@printf "$(SPECS)"
  16.162 -        .PHONY: all-conf
  16.163 -    else
  16.164 -        $(error Since you have more than one output dir configured under build, \
  16.165 -            you have to either run make from the output dir of your choice \
  16.166 -            or specify run "make SPEC=build/.../spec.gmk" or run all the build configurations \
  16.167 -	    using "make all-conf")
  16.168 -    endif
  16.169 +# We have multiple configurations to build, call make repeatedly
  16.170 +all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean:
  16.171 +	@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@ $(MAKE_ARGS)) &&) true
  16.172 +
  16.173 +.PHONY: all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean
  16.174 +
  16.175  else
  16.176 +# This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
  16.177  
  16.178  # Now load the spec
  16.179  -include $(SPEC)
  16.180 @@ -88,51 +183,101 @@
  16.181  # Clean out any notifications from the previous build.
  16.182  $(shell find $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE))
  16.183  
  16.184 +# If make was called explicitely with -j, don't add a -j ourself to sub-makes, since
  16.185 +# this will be inherited automatically by make. Otherwise use our default for sub-makes.
  16.186 +# The -j in MAKEFLAGS is only visible when executing a recipe, hence this macro.
  16.187 +define GetMakeJobFlag
  16.188 +    $(if $(findstring -j,$(MAKEFLAGS)),,-j$(NUM_CORES))
  16.189 +endef
  16.190 +
  16.191 +define CheckEnvironment
  16.192 +    $(if $(list_alt_overrides),
  16.193 +        @$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n"
  16.194 +    @$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n"
  16.195 +    @$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n"
  16.196 +    )
  16.197 +endef
  16.198 +
  16.199 +define PrintStartMessage
  16.200 +    $(if $(VERBOSE),,@$(ECHO) Running make as $(MAKE) $(MFLAGS) $(MAKE_ARGS))
  16.201 +    $(call CheckEnvironment)
  16.202 +    @$(ECHO) "Building OpenJDK for target $(if $(MAKECMDGOALS),'$(MAKECMDGOALS)','all') in configuration '$(CONF_NAME)'"
  16.203 +endef
  16.204 +
  16.205 +define PrintEndMessage
  16.206 +    @$(ECHO) "Finished building OpenJDK for target '$@'"
  16.207 +    $(call CheckEnvironment)
  16.208 +endef
  16.209 +
  16.210  all: jdk
  16.211 -	@$(call StopTimer)
  16.212  	@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
  16.213 +	@$(call AtRootMakeEnd)
  16.214  
  16.215 -langtools: start-timer
  16.216 +langtools: start-make
  16.217  	@$(call MakeStart,langtools,all)
  16.218 -	@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(LANGTOOLS_MAKE_ARGS))
  16.219 +	@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(LANGTOOLS_MAKE_ARGS) $(MAKE_ARGS))
  16.220  	@$(call MakeFinish,langtools,all)
  16.221  
  16.222  corba: langtools
  16.223  	@$(call MakeStart,corba,all)
  16.224 -	@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
  16.225 +	@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
  16.226  	@$(call MakeFinish,corba,all)
  16.227  
  16.228  jaxp: langtools
  16.229  	@$(call MakeStart,jaxp,all)
  16.230 -	@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
  16.231 +	@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
  16.232  	@$(call MakeFinish,jaxp,all)
  16.233  
  16.234  jaxws: langtools jaxp
  16.235  	@$(call MakeStart,jaxws,all)
  16.236 -	@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
  16.237 +	@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
  16.238  	@$(call MakeFinish,jaxws,all)
  16.239  
  16.240  hotspot: langtools
  16.241  	@$(call MakeStart,hotspot,all)
  16.242 -	@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS))
  16.243 +	@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) $(MAKE_ARGS))
  16.244  	@$(call MakeFinish,hotspot,all)
  16.245  
  16.246  jdk: langtools corba jaxp jaxws hotspot
  16.247  	@$(call MakeStart,jdk,all)
  16.248 -	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(JDK_MAKE_ARGS))
  16.249 +	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS))
  16.250  	@$(call MakeFinish,jdk,all)
  16.251  
  16.252 -images install packages: start-timer jdk langtools corba jaxp jaxws hotspot
  16.253 +images install packages: source-tips start-make jdk langtools corba jaxp jaxws hotspot
  16.254  	@$(call MakeStart,jdk-images,$@)
  16.255 -	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(JDK_MAKE_ARGS) $@)
  16.256 +	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
  16.257  	@$(call MakeFinish,jdk-images,$@)
  16.258 -	@$(call StopTimer)
  16.259  	@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
  16.260 +	@$(call AtRootMakeEnd)
  16.261  
  16.262 -start-timer:
  16.263 -	@$(call StartTimer)
  16.264 +old-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot
  16.265 +	@$(call MakeStart,jdk-old-images,$@)
  16.266 +	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
  16.267 +	@$(call MakeFinish,old-jdk-images,$@)
  16.268 +	@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
  16.269 +	@$(call AtRootMakeEnd)
  16.270  
  16.271 -.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-timer
  16.272 +start-make:
  16.273 +	@$(call AtRootMakeStart)
  16.274 +
  16.275 +.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-make
  16.276 +
  16.277 +test: start-make
  16.278 +	@$(call MakeStart,test,$(if $(TEST),$(TEST),all))
  16.279 +	@($(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
  16.280 +	@$(call MakeFinish,test,$(if $(TEST),$(TEST),all))
  16.281 +	@$(call AtRootMakeEnd)
  16.282 +.PHONY: test
  16.283 +
  16.284 +
  16.285 +# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
  16.286 +# used to track the exact sources used to build that image.
  16.287 +source-tips: $(OUTPUT_ROOT)/source_tips
  16.288 +$(OUTPUT_ROOT)/source_tips: FRC
  16.289 +	@$(MKDIR) -p $(@D)
  16.290 +	@$(RM) $@
  16.291 +	@$(call GetSourceTips)
  16.292 +
  16.293  
  16.294  # Remove everything, except the output from configure.
  16.295  clean:
  16.296 @@ -152,25 +297,35 @@
  16.297  	@$(ECHO) "Cleaned jdk build artifacts (but not langtools,corba,jaxp,jaxws,hotspot nor the build configuration)"
  16.298  .PHONY: clean
  16.299  
  16.300 +endif
  16.301 +
  16.302 +# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
  16.303 +# If you addd more global targets, please update the fatal-error macro.
  16.304 +
  16.305  help:
  16.306 -	$(info     )
  16.307 -	$(info Typical make commands:)
  16.308 -	$(info     make)
  16.309 -	$(info     make VERBOSE=        # print all commands)
  16.310 -	$(info     make VERBOSE="-d -p" # debug make as well)
  16.311 -	$(info     make all-conf        # build images for all configurations)
  16.312 -	$(info     make clean           # remove build artifacts)
  16.313 -	$(info     make dist-clean      # you have to rerun configure)
  16.314 -#	$(info     make test            # run tests)
  16.315 -	$(info     make images          # create the jdk and jre images)
  16.316 -	$(info     make install         # install the jdk image)
  16.317 -#	$(info     make modules         # EXPERIMENTAL: Migrate JDK into a modularized form!)
  16.318 -	$(info     make packages        # create zips and other packages)
  16.319 -
  16.320 -#	$(info     make eclipse_workspace  # Create an Eclipse workspace)
  16.321 -#	$(info     make netbeans_workspace # Create a NetBeans workspace)
  16.322 -#	$(info     make vs_workspace       # Create a Visual Studio workspace)
  16.323 -
  16.324 +	$(info )
  16.325 +	$(info OpenJDK Makefile help)
  16.326 +	$(info =====================)
  16.327 +	$(info )
  16.328 +	$(info Common make targets)
  16.329 +	$(info .  make [all]            # Compile all code but do not create images)
  16.330 +	$(info .  make images           # Create complete j2sdk and j2re images)
  16.331 +	$(info .  make install          # Install the generated images locally)
  16.332 +	$(info .  make clean            # Remove all files generated by make, but not those generated by configure)
  16.333 +	$(info .  make dist-clean       # Remove all files generated by both make and configure)
  16.334 +	$(info .  make help             # Give some help on using make)
  16.335 +	$(info .  make test             # Run tests, default is all tests (see TEST below))
  16.336 +	$(info )
  16.337 +	$(info Useful make variables)
  16.338 +	$(info .  make CONF=            # Build all configurations (note, assignment is empty))
  16.339 +	$(info .  make CONF=<substring> # Build the configuration(s) with a name matching the given substring)
  16.340 +	$(info )
  16.341 +	$(info .  make LOG=<loglevel>   # Change loglevel from warn (default) to the given loglevel)
  16.342 +	$(info .                        # Available loglevels are: warn, info, debug and trace)
  16.343 +	$(info .                        # To see executed command lines, use LOG=info)
  16.344 +	$(info )
  16.345 +	$(info .  make test TEST=<test> # Only run the given test or tests, e.g.)
  16.346 +	$(info .                        # make test TEST="jdk_lang jdk_net")
  16.347 +	$(info )
  16.348  .PHONY: help
  16.349 -
  16.350 -endif
  16.351 +FRC: # Force target
    17.1 --- a/common/makefiles/NativeCompilation.gmk	Fri Jun 08 12:01:05 2012 -0700
    17.2 +++ b/common/makefiles/NativeCompilation.gmk	Wed Jun 13 16:53:05 2012 -0700
    17.3 @@ -28,7 +28,7 @@
    17.4  # desired whenever sort is used below!
    17.5  
    17.6  ifeq  (,$(_MAKEBASE_GMK))
    17.7 -    $(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
    17.8 +    $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
    17.9  endif
   17.10  
   17.11  ifeq ($(COMPILER_TYPE),CC)
   17.12 @@ -54,15 +54,22 @@
   17.13  
   17.14      ifneq (,$$(filter %.c,$2))
   17.15          # Compile as a C file
   17.16 -        $1_$2_FLAGS=$4
   17.17 +        $1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS)
   17.18          $1_$2_COMP=$5
   17.19 +        $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
   17.20 +    else ifneq (,$$(filter %.m,$2))
   17.21 +        # Compile as a objective-c file
   17.22 +        $1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS)
   17.23 +        $1_$2_COMP=$5
   17.24 +        $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
   17.25      else
   17.26          # Compile as a C++ file
   17.27 -        $1_$2_FLAGS=$6
   17.28 +        $1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS)
   17.29          $1_$2_COMP=$7
   17.30 +        $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
   17.31      endif
   17.32      # Generate the .o (.obj) file name and place it in the bin dir.
   17.33 -    $1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(notdir $2)))
   17.34 +    $1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $2))))
   17.35      # Only continue if this object file hasn't been processed already. This lets the first found
   17.36      # source file override any other with the same name.
   17.37      ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
   17.38 @@ -80,7 +87,7 @@
   17.39          $$($1_$2_OBJ) : $2
   17.40          ifeq ($(COMPILER_TYPE),CC)
   17.41  		$$(call COMPILING_MSG,$$(notdir $2))
   17.42 -		$$($1_$2_COMP) $$($1_$2_FLAGS) -MMD -MF $$($1_$2_DEP) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
   17.43 +		$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
   17.44          endif
   17.45          ifeq ($(COMPILER_TYPE),CL)
   17.46  		$$(call COMPILING_MSG,$$(notdir $2))
   17.47 @@ -109,6 +116,8 @@
   17.48      #    EXCLUDE_FILES with these names
   17.49      #    VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
   17.50      #    RC_FLAGS flags for RC.
   17.51 +    #    MAPFILE mapfile
   17.52 +    #    REORDER reorder file
   17.53      $(if $2,$1_$(strip $2))
   17.54      $(if $3,$1_$(strip $3))
   17.55      $(if $4,$1_$(strip $4))
   17.56 @@ -154,7 +163,7 @@
   17.57      ifneq ($$($1_EXCLUDE_FILES),)
   17.58          $1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
   17.59      endif
   17.60 -    $1_SRCS     := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.c %.cpp,$$($1_ALL_SRCS)))
   17.61 +    $1_SRCS     := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.c %.cpp %.m,$$($1_ALL_SRCS)))
   17.62      ifneq (,$$(strip $$($1_INCLUDE_FILES)))
   17.63          $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
   17.64      endif
   17.65 @@ -178,7 +187,7 @@
   17.66  
   17.67      # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
   17.68      # a reproducable order on the input files to the linker).
   17.69 -    $1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_BIN)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS))))))
   17.70 +    $1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_BIN)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS)))))))
   17.71      $1 := $$($1_EXPECTED_OBJS)
   17.72      # Are there too many object files on disk? Perhaps because some source file was removed?
   17.73      $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
   17.74 @@ -218,6 +227,11 @@
   17.75          $1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
   17.76      endif
   17.77  
   17.78 +    ifneq (,$$($1_REORDER))
   17.79 +          $1_EXTRA_CFLAGS += $$(C_FLAG_REORDER)
   17.80 +          $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
   17.81 +    endif
   17.82 +
   17.83      # Now create a list of the packages that are about to compile. Used when sending source
   17.84      # in a batch to the compiler.
   17.85      $$(shell $(RM) $$($1_BIN)/_the.list_of_sources)
   17.86 @@ -233,29 +247,53 @@
   17.87      ifeq ($(HOST_OS_API), winapi)
   17.88          ifneq (,$$($1_VERSIONINFO_RESOURCE))
   17.89              ifneq (,$$($1_LIB))
   17.90 -                ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
   17.91 -                    $1_RES:=$$(patsubst %$(SHARED_LIBRARY_SUFFIX),%.res,$$($1_LIB))
   17.92 -                else
   17.93 -                    $1_RES:=$$(patsubst %$(STATIC_LIBRARY_SUFFIX),%.res,$$($1_LIB))
   17.94 -                endif
   17.95 +                $1_BASENAME:=$$(basename $$(notdir $$($1_LIB)))
   17.96              endif
   17.97              ifneq (,$$($1_EXE))
   17.98 -                $1_RES:=$$(patsubst %$(EXE_SUFFIX),%.res,$$($1_EXE))
   17.99 +                $1_BASENAME:=$$(basename $$(notdir $$($1_EXE)))
  17.100              endif
  17.101 +            $1_RES:=$$($1_BIN)/$$($1_BASENAME).res
  17.102              $$($1_RES): $$($1_VERSIONINFO_RESOURCE)
  17.103  		$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
  17.104          endif
  17.105 +        ifneq (,$$($1_MANIFEST))
  17.106 +            $1_PROGRAM:=$$(basename $$(notdir $$($1_EXE)))
  17.107 +            $1_GEN_MANIFEST:=$$($1_BIN)/$$($1_PROGRAM).manifest
  17.108 +            IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
  17.109 +            $$($1_GEN_MANIFEST): $$($1_MANIFEST)
  17.110 +		$(SED) 's%IMVERSION%$$(IMVERSIONVALUE)%g;s%PROGRAM%$$($1_PROGRAM)%g' $$< > $$@
  17.111 +        endif
  17.112 +    endif
  17.113 +
  17.114 +    # mapfile doesnt seem to be implemented on macosx (yet??)
  17.115 +    ifneq ($(HOST_OS),macosx)
  17.116 +    ifneq ($(HOST_OS),windows)
  17.117 +        $1_REAL_MAPFILE := $$($1_MAPFILE)
  17.118 +        ifneq (,$$($1_REORDER))
  17.119 +            $1_REAL_MAPFILE := $$($1_BIN)/mapfile
  17.120 +
  17.121 +            $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER)
  17.122 +		$$(MKDIR) -p $$(@D)
  17.123 +		$$(CP) $$($1_MAPFILE) $$@.tmp
  17.124 +		$$(SED) -e 's=OUTPUTDIR=$$($1_BIN)=' $$($1_REORDER) >> $$@.tmp
  17.125 +		$$(MV) $$@.tmp $$@
  17.126 +        endif
  17.127 +    endif
  17.128      endif
  17.129  
  17.130      # Pickup extra HOST_OS_API dependent variables (posix or winapi) and 
  17.131      # (linux,solaris,windows,bsd) for LDFLAGS and LDFLAGS_SUFFIX
  17.132      $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(HOST_OS_API)) $$($1_LDFLAGS_$(PLATFORM))
  17.133      $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(HOST_OS_API)) $$($1_LDFLAGS_SUFFIX_$(PLATFORM))
  17.134 +    ifneq (,$$($1_REAL_MAPFILE))
  17.135 +	$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
  17.136 +    endif
  17.137 +
  17.138      ifneq (,$$($1_LIB))
  17.139          ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
  17.140              # Generating a dynamic library.
  17.141              $1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$(notdir $$($1_LIB)))
  17.142 -            $$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES)
  17.143 +            $$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE)
  17.144  	    	$$(call LINKING_MSG,$$(notdir $$($1_LIB)))
  17.145  		$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$($1_LIB) \
  17.146  			$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
  17.147 @@ -269,9 +307,13 @@
  17.148      endif
  17.149      ifneq (,$$($1_EXE))
  17.150          # A executable binary has been specified, setup the target for it.
  17.151 -        $$($1_EXE) : $$($1_EXPECTED_OBJS) $$($1_RES)
  17.152 +        $$($1_EXE) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST)
  17.153  	    	$$(call LINKING_EXE_MSG,$$(notdir $$($1_EXE)))
  17.154  		$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_EXE) \
  17.155 -			$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
  17.156 +			$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
  17.157 +			$$($1_EXTRA_LDFLAGS_SUFFIX)
  17.158 +        ifneq (,$$($1_GEN_MANIFEST))
  17.159 +		$(MT) -nologo /manifest $$($1_GEN_MANIFEST) /outputresource:$$@;#1
  17.160 +        endif
  17.161      endif
  17.162  endef
    18.1 --- a/make/scripts/hgforest.sh	Fri Jun 08 12:01:05 2012 -0700
    18.2 +++ b/make/scripts/hgforest.sh	Wed Jun 13 16:53:05 2012 -0700
    18.3 @@ -112,6 +112,9 @@
    18.4      sleep 5
    18.5    fi
    18.6  done
    18.7 +# Wait for all hg commands to complete
    18.8 +wait
    18.9 +
   18.10  if [ "${repos_extra}" != "" ] ; then
   18.11    for i in ${repos_extra} ; do
   18.12      echo "Starting on ${i}"
   18.13 @@ -127,11 +130,10 @@
   18.14        sleep 5
   18.15      fi
   18.16    done
   18.17 +  # Wait for all hg commands to complete
   18.18 +  wait
   18.19  fi
   18.20  
   18.21 -# Wait for all hg commands to complete
   18.22 -wait
   18.23 -
   18.24  # Cleanup
   18.25  rm -f -r ${tmp}
   18.26  

mercurial