8017047: Can't use --with-java-devtools and --with-devkit at the same time

Thu, 27 Jun 2013 09:27:06 +0200

author
erikj
date
Thu, 27 Jun 2013 09:27:06 +0200
changeset 750
f5eb23490e6a
parent 748
c156084add48
child 751
e5cf1735638c

8017047: Can't use --with-java-devtools and --with-devkit at the same time
Reviewed-by: tbell

common/autoconf/basics.m4 file | annotate | diff | comparison | revisions
common/autoconf/generated-configure.sh file | annotate | diff | comparison | revisions
common/autoconf/toolchain.m4 file | annotate | diff | comparison | revisions
     1.1 --- a/common/autoconf/basics.m4	Tue Jun 25 13:47:00 2013 -0700
     1.2 +++ b/common/autoconf/basics.m4	Thu Jun 27 09:27:06 2013 +0200
     1.3 @@ -43,6 +43,16 @@
     1.4      fi
     1.5  ])
     1.6  
     1.7 +# Appends a string to a path variable, only adding the : when needed.
     1.8 +AC_DEFUN([BASIC_APPEND_TO_PATH],
     1.9 +[
    1.10 +  if test "x[$]$1" = x; then
    1.11 +    $1="$2"
    1.12 +  else
    1.13 +    $1="[$]$1:$2"
    1.14 +  fi
    1.15 +])
    1.16 +
    1.17  # This will make sure the given variable points to a full and proper
    1.18  # path. This means:
    1.19  # 1) There will be no spaces in the path. On posix platforms,
    1.20 @@ -351,7 +361,10 @@
    1.21  AC_SUBST(SYS_ROOT)
    1.22  
    1.23  AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
    1.24 -  [search this directory for compilers and tools (for cross-compiling)])], [TOOLS_DIR=$with_tools_dir])
    1.25 +  [search this directory for compilers and tools (for cross-compiling)])], 
    1.26 +  [TOOLS_DIR=$with_tools_dir
    1.27 +   BASIC_FIXUP_PATH([TOOLS_DIR])
    1.28 +  ])
    1.29  
    1.30  AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
    1.31    [use this directory as base for tools-dir and sys-root (for cross-compiling)])],
    1.32 @@ -359,17 +372,14 @@
    1.33      if test "x$with_sys_root" != x; then
    1.34        AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time])
    1.35      fi
    1.36 -    if test "x$with_tools_dir" != x; then
    1.37 -      AC_MSG_ERROR([Cannot specify both --with-devkit and --with-tools-dir at the same time])
    1.38 -    fi
    1.39 -    TOOLS_DIR=$with_devkit/bin
    1.40 +    BASIC_FIXUP_PATH([with_devkit])
    1.41 +    BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin)
    1.42      if test -d "$with_devkit/$host_alias/libc"; then
    1.43        SYS_ROOT=$with_devkit/$host_alias/libc
    1.44      elif test -d "$with_devkit/$host/sys-root"; then
    1.45        SYS_ROOT=$with_devkit/$host/sys-root
    1.46      fi
    1.47    ])
    1.48 -
    1.49  ])
    1.50  
    1.51  AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
     2.1 --- a/common/autoconf/generated-configure.sh	Tue Jun 25 13:47:00 2013 -0700
     2.2 +++ b/common/autoconf/generated-configure.sh	Thu Jun 27 09:27:06 2013 +0200
     2.3 @@ -3083,6 +3083,9 @@
     2.4  # Also set JVM_ARG_OK to true/false depending on outcome.
     2.5  
     2.6  
     2.7 +# Appends a string to a path variable, only adding the : when needed.
     2.8 +
     2.9 +
    2.10  # This will make sure the given variable points to a full and proper
    2.11  # path. This means:
    2.12  # 1) There will be no spaces in the path. On posix platforms,
    2.13 @@ -3782,7 +3785,7 @@
    2.14  #CUSTOM_AUTOCONF_INCLUDE
    2.15  
    2.16  # Do not change or remove the following line, it is needed for consistency checks:
    2.17 -DATE_WHEN_GENERATED=1371547824
    2.18 +DATE_WHEN_GENERATED=1372317997
    2.19  
    2.20  ###############################################################################
    2.21  #
    2.22 @@ -7457,6 +7460,129 @@
    2.23  # Check whether --with-tools-dir was given.
    2.24  if test "${with_tools_dir+set}" = set; then :
    2.25    withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir
    2.26 +
    2.27 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    2.28 +
    2.29 +  # Input might be given as Windows format, start by converting to
    2.30 +  # unix format.
    2.31 +  path="$TOOLS_DIR"
    2.32 +  new_path=`$CYGPATH -u "$path"`
    2.33 +
    2.34 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
    2.35 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
    2.36 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
    2.37 +  # "foo.exe" is OK but "foo" is an error.
    2.38 +  #
    2.39 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
    2.40 +  # It is also a way to make sure we got the proper file name for the real test later on.
    2.41 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
    2.42 +  if test "x$test_shortpath" = x; then
    2.43 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&5
    2.44 +$as_echo "$as_me: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&6;}
    2.45 +    as_fn_error $? "Cannot locate the the path of TOOLS_DIR" "$LINENO" 5
    2.46 +  fi
    2.47 +
    2.48 +  # Call helper function which possibly converts this using DOS-style short mode.
    2.49 +  # If so, the updated path is stored in $new_path.
    2.50 +
    2.51 +  input_path="$new_path"
    2.52 +  # Check if we need to convert this using DOS-style short mode. If the path
    2.53 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
    2.54 +  # take no chances and rewrite it.
    2.55 +  # Note: m4 eats our [], so we need to use [ and ] instead.
    2.56 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
    2.57 +  if test "x$has_forbidden_chars" != x; then
    2.58 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
    2.59 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
    2.60 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
    2.61 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
    2.62 +      # Going to short mode and back again did indeed matter. Since short mode is
    2.63 +      # case insensitive, let's make it lowercase to improve readability.
    2.64 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    2.65 +      # Now convert it back to Unix-stile (cygpath)
    2.66 +      input_path=`$CYGPATH -u "$shortmode_path"`
    2.67 +      new_path="$input_path"
    2.68 +    fi
    2.69 +  fi
    2.70 +
    2.71 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
    2.72 +  if test "x$test_cygdrive_prefix" = x; then
    2.73 +    # As a simple fix, exclude /usr/bin since it's not a real path.
    2.74 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
    2.75 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
    2.76 +      # a path prefixed by /cygdrive for fixpath to work.
    2.77 +      new_path="$CYGWIN_ROOT_PATH$input_path"
    2.78 +    fi
    2.79 +  fi
    2.80 +
    2.81 +
    2.82 +  if test "x$path" != "x$new_path"; then
    2.83 +    TOOLS_DIR="$new_path"
    2.84 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOOLS_DIR to \"$new_path\"" >&5
    2.85 +$as_echo "$as_me: Rewriting TOOLS_DIR to \"$new_path\"" >&6;}
    2.86 +  fi
    2.87 +
    2.88 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
    2.89 +
    2.90 +  path="$TOOLS_DIR"
    2.91 +  has_colon=`$ECHO $path | $GREP ^.:`
    2.92 +  new_path="$path"
    2.93 +  if test "x$has_colon" = x; then
    2.94 +    # Not in mixed or Windows style, start by that.
    2.95 +    new_path=`cmd //c echo $path`
    2.96 +  fi
    2.97 +
    2.98 +
    2.99 +  input_path="$new_path"
   2.100 +  # Check if we need to convert this using DOS-style short mode. If the path
   2.101 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.102 +  # take no chances and rewrite it.
   2.103 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.104 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   2.105 +  if test "x$has_forbidden_chars" != x; then
   2.106 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.107 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.108 +  fi
   2.109 +
   2.110 +
   2.111 +  windows_path="$new_path"
   2.112 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.113 +    unix_path=`$CYGPATH -u "$windows_path"`
   2.114 +    new_path="$unix_path"
   2.115 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.116 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   2.117 +    new_path="$unix_path"
   2.118 +  fi
   2.119 +
   2.120 +  if test "x$path" != "x$new_path"; then
   2.121 +    TOOLS_DIR="$new_path"
   2.122 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting TOOLS_DIR to \"$new_path\"" >&5
   2.123 +$as_echo "$as_me: Rewriting TOOLS_DIR to \"$new_path\"" >&6;}
   2.124 +  fi
   2.125 +
   2.126 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   2.127 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   2.128 +
   2.129 +  else
   2.130 +    # We're on a posix platform. Hooray! :)
   2.131 +    path="$TOOLS_DIR"
   2.132 +    has_space=`$ECHO "$path" | $GREP " "`
   2.133 +    if test "x$has_space" != x; then
   2.134 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&5
   2.135 +$as_echo "$as_me: The path of TOOLS_DIR, which resolves as \"$path\", is invalid." >&6;}
   2.136 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   2.137 +    fi
   2.138 +
   2.139 +    # Use eval to expand a potential ~
   2.140 +    eval path="$path"
   2.141 +    if test ! -f "$path" && test ! -d "$path"; then
   2.142 +      as_fn_error $? "The path of TOOLS_DIR, which resolves as \"$path\", is not found." "$LINENO" 5
   2.143 +    fi
   2.144 +
   2.145 +    TOOLS_DIR="`cd "$path"; $THEPWDCMD -L`"
   2.146 +  fi
   2.147 +
   2.148 +
   2.149  fi
   2.150  
   2.151  
   2.152 @@ -7467,10 +7593,135 @@
   2.153      if test "x$with_sys_root" != x; then
   2.154        as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5
   2.155      fi
   2.156 -    if test "x$with_tools_dir" != x; then
   2.157 -      as_fn_error $? "Cannot specify both --with-devkit and --with-tools-dir at the same time" "$LINENO" 5
   2.158 -    fi
   2.159 -    TOOLS_DIR=$with_devkit/bin
   2.160 +
   2.161 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.162 +
   2.163 +  # Input might be given as Windows format, start by converting to
   2.164 +  # unix format.
   2.165 +  path="$with_devkit"
   2.166 +  new_path=`$CYGPATH -u "$path"`
   2.167 +
   2.168 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   2.169 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   2.170 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   2.171 +  # "foo.exe" is OK but "foo" is an error.
   2.172 +  #
   2.173 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   2.174 +  # It is also a way to make sure we got the proper file name for the real test later on.
   2.175 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   2.176 +  if test "x$test_shortpath" = x; then
   2.177 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
   2.178 +$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;}
   2.179 +    as_fn_error $? "Cannot locate the the path of with_devkit" "$LINENO" 5
   2.180 +  fi
   2.181 +
   2.182 +  # Call helper function which possibly converts this using DOS-style short mode.
   2.183 +  # If so, the updated path is stored in $new_path.
   2.184 +
   2.185 +  input_path="$new_path"
   2.186 +  # Check if we need to convert this using DOS-style short mode. If the path
   2.187 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.188 +  # take no chances and rewrite it.
   2.189 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.190 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   2.191 +  if test "x$has_forbidden_chars" != x; then
   2.192 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.193 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   2.194 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   2.195 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   2.196 +      # Going to short mode and back again did indeed matter. Since short mode is
   2.197 +      # case insensitive, let's make it lowercase to improve readability.
   2.198 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.199 +      # Now convert it back to Unix-stile (cygpath)
   2.200 +      input_path=`$CYGPATH -u "$shortmode_path"`
   2.201 +      new_path="$input_path"
   2.202 +    fi
   2.203 +  fi
   2.204 +
   2.205 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   2.206 +  if test "x$test_cygdrive_prefix" = x; then
   2.207 +    # As a simple fix, exclude /usr/bin since it's not a real path.
   2.208 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   2.209 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   2.210 +      # a path prefixed by /cygdrive for fixpath to work.
   2.211 +      new_path="$CYGWIN_ROOT_PATH$input_path"
   2.212 +    fi
   2.213 +  fi
   2.214 +
   2.215 +
   2.216 +  if test "x$path" != "x$new_path"; then
   2.217 +    with_devkit="$new_path"
   2.218 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5
   2.219 +$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
   2.220 +  fi
   2.221 +
   2.222 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.223 +
   2.224 +  path="$with_devkit"
   2.225 +  has_colon=`$ECHO $path | $GREP ^.:`
   2.226 +  new_path="$path"
   2.227 +  if test "x$has_colon" = x; then
   2.228 +    # Not in mixed or Windows style, start by that.
   2.229 +    new_path=`cmd //c echo $path`
   2.230 +  fi
   2.231 +
   2.232 +
   2.233 +  input_path="$new_path"
   2.234 +  # Check if we need to convert this using DOS-style short mode. If the path
   2.235 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   2.236 +  # take no chances and rewrite it.
   2.237 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   2.238 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   2.239 +  if test "x$has_forbidden_chars" != x; then
   2.240 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   2.241 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   2.242 +  fi
   2.243 +
   2.244 +
   2.245 +  windows_path="$new_path"
   2.246 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   2.247 +    unix_path=`$CYGPATH -u "$windows_path"`
   2.248 +    new_path="$unix_path"
   2.249 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   2.250 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   2.251 +    new_path="$unix_path"
   2.252 +  fi
   2.253 +
   2.254 +  if test "x$path" != "x$new_path"; then
   2.255 +    with_devkit="$new_path"
   2.256 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5
   2.257 +$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
   2.258 +  fi
   2.259 +
   2.260 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   2.261 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   2.262 +
   2.263 +  else
   2.264 +    # We're on a posix platform. Hooray! :)
   2.265 +    path="$with_devkit"
   2.266 +    has_space=`$ECHO "$path" | $GREP " "`
   2.267 +    if test "x$has_space" != x; then
   2.268 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
   2.269 +$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;}
   2.270 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   2.271 +    fi
   2.272 +
   2.273 +    # Use eval to expand a potential ~
   2.274 +    eval path="$path"
   2.275 +    if test ! -f "$path" && test ! -d "$path"; then
   2.276 +      as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5
   2.277 +    fi
   2.278 +
   2.279 +    with_devkit="`cd "$path"; $THEPWDCMD -L`"
   2.280 +  fi
   2.281 +
   2.282 +
   2.283 +  if test "x$TOOLS_DIR" = x; then
   2.284 +    TOOLS_DIR="$with_devkit/bin"
   2.285 +  else
   2.286 +    TOOLS_DIR="$TOOLS_DIR:$with_devkit/bin"
   2.287 +  fi
   2.288 +
   2.289      if test -d "$with_devkit/$host_alias/libc"; then
   2.290        SYS_ROOT=$with_devkit/$host_alias/libc
   2.291      elif test -d "$with_devkit/$host/sys-root"; then
   2.292 @@ -7481,7 +7732,6 @@
   2.293  
   2.294  
   2.295  
   2.296 -
   2.297  # Setup default logging of stdout and stderr to build.log in the output root.
   2.298  BUILD_LOG='$(OUTPUT_ROOT)/build.log'
   2.299  BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old'
   2.300 @@ -18933,15 +19183,6 @@
   2.301      fi
   2.302  
   2.303  
   2.304 -if test "x$SYS_ROOT" != "x/" ; then
   2.305 -    CFLAGS="--sysroot=$SYS_ROOT $CFLAGS"
   2.306 -    CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS"
   2.307 -    OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
   2.308 -    OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
   2.309 -    CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS"
   2.310 -    LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS"
   2.311 -fi
   2.312 -
   2.313  # Store the CFLAGS etal passed to the configure script.
   2.314  ORG_CFLAGS="$CFLAGS"
   2.315  ORG_CXXFLAGS="$CXXFLAGS"
     3.1 --- a/common/autoconf/toolchain.m4	Tue Jun 25 13:47:00 2013 -0700
     3.2 +++ b/common/autoconf/toolchain.m4	Thu Jun 27 09:27:06 2013 +0200
     3.3 @@ -226,15 +226,6 @@
     3.4                      ],
     3.5                      [])
     3.6  
     3.7 -if test "x$SYS_ROOT" != "x/" ; then
     3.8 -    CFLAGS="--sysroot=$SYS_ROOT $CFLAGS"
     3.9 -    CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS"
    3.10 -    OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
    3.11 -    OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
    3.12 -    CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS"
    3.13 -    LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS"
    3.14 -fi
    3.15 -
    3.16  # Store the CFLAGS etal passed to the configure script.
    3.17  ORG_CFLAGS="$CFLAGS"
    3.18  ORG_CXXFLAGS="$CXXFLAGS"

mercurial