8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?

Wed, 06 Mar 2013 10:50:37 +0100

author
erikj
date
Wed, 06 Mar 2013 10:50:37 +0100
changeset 637
52741ab7c601
parent 635
907a926d3c96
child 638
235854886494

8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
Reviewed-by: tbell

common/autoconf/generated-configure.sh file | annotate | diff | comparison | revisions
common/autoconf/spec.gmk.in file | annotate | diff | comparison | revisions
common/autoconf/toolchain.m4 file | annotate | diff | comparison | revisions
common/autoconf/toolchain_windows.m4 file | annotate | diff | comparison | revisions
     1.1 --- a/common/autoconf/generated-configure.sh	Mon Mar 04 16:45:07 2013 +0100
     1.2 +++ b/common/autoconf/generated-configure.sh	Wed Mar 06 10:50:37 2013 +0100
     1.3 @@ -725,6 +725,8 @@
     1.4  BUILD_CXX
     1.5  BUILD_CC
     1.6  MSVCR_DLL
     1.7 +DXSDK_INCLUDE_PATH
     1.8 +DXSDK_LIB_PATH
     1.9  VS_PATH
    1.10  VS_LIB
    1.11  VS_INCLUDE
    1.12 @@ -985,6 +987,9 @@
    1.13  with_override_jdk
    1.14  with_import_hotspot
    1.15  with_msvcr_dll
    1.16 +with_dxsdk
    1.17 +with_dxsdk_lib
    1.18 +with_dxsdk_include
    1.19  with_extra_cflags
    1.20  with_extra_cxxflags
    1.21  with_extra_ldflags
    1.22 @@ -1736,6 +1741,11 @@
    1.23                            source
    1.24    --with-msvcr-dll        copy this msvcr100.dll into the built JDK (Windows
    1.25                            only) [probed]
    1.26 +  --with-dxsdk            the DirectX SDK (Windows only) [probed]
    1.27 +  --with-dxsdk-lib        the DirectX SDK lib directory (Windows only)
    1.28 +                          [probed]
    1.29 +  --with-dxsdk-include    the DirectX SDK include directory (Windows only)
    1.30 +                          [probed]
    1.31    --with-extra-cflags     extra flags to be used when compiling jdk c-files
    1.32    --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
    1.33    --with-extra-ldflags    extra flags to be used when linking jdk
    1.34 @@ -3720,6 +3730,10 @@
    1.35  
    1.36  
    1.37  
    1.38 +# Setup the DXSDK paths
    1.39 +
    1.40 +
    1.41 +
    1.42  
    1.43  
    1.44  
    1.45 @@ -3729,7 +3743,7 @@
    1.46  #CUSTOM_AUTOCONF_INCLUDE
    1.47  
    1.48  # Do not change or remove the following line, it is needed for consistency checks:
    1.49 -DATE_WHEN_GENERATED=1362411827
    1.50 +DATE_WHEN_GENERATED=1362563419
    1.51  
    1.52  ###############################################################################
    1.53  #
    1.54 @@ -16952,6 +16966,430 @@
    1.55    fi
    1.56  
    1.57  
    1.58 +
    1.59 +
    1.60 +# Check whether --with-dxsdk was given.
    1.61 +if test "${with_dxsdk+set}" = set; then :
    1.62 +  withval=$with_dxsdk;
    1.63 +fi
    1.64 +
    1.65 +
    1.66 +# Check whether --with-dxsdk-lib was given.
    1.67 +if test "${with_dxsdk_lib+set}" = set; then :
    1.68 +  withval=$with_dxsdk_lib;
    1.69 +fi
    1.70 +
    1.71 +
    1.72 +# Check whether --with-dxsdk-include was given.
    1.73 +if test "${with_dxsdk_include+set}" = set; then :
    1.74 +  withval=$with_dxsdk_include;
    1.75 +fi
    1.76 +
    1.77 +
    1.78 +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DirectX SDK" >&5
    1.79 +$as_echo_n "checking for DirectX SDK... " >&6; }
    1.80 +
    1.81 +  if test "x$with_dxsdk" != x; then
    1.82 +    dxsdk_path="$with_dxsdk"
    1.83 +  elif test "x$DXSDK_DIR" != x; then
    1.84 +    dxsdk_path="$DXSDK_DIR"
    1.85 +  else
    1.86 +    as_fn_error $? "Could not find the DirectX SDK" "$LINENO" 5
    1.87 +  fi
    1.88 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dxsdk_path" >&5
    1.89 +$as_echo "$dxsdk_path" >&6; }
    1.90 +
    1.91 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    1.92 +
    1.93 +  # Input might be given as Windows format, start by converting to
    1.94 +  # unix format.
    1.95 +  path="$dxsdk_path"
    1.96 +  new_path=`$CYGPATH -u "$path"`
    1.97 +
    1.98 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
    1.99 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   1.100 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   1.101 +  # "foo.exe" is OK but "foo" is an error.
   1.102 +  #
   1.103 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   1.104 +  # It is also a way to make sure we got the proper file name for the real test later on.
   1.105 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   1.106 +  if test "x$test_shortpath" = x; then
   1.107 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&5
   1.108 +$as_echo "$as_me: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&6;}
   1.109 +    as_fn_error $? "Cannot locate the the path of dxsdk_path" "$LINENO" 5
   1.110 +  fi
   1.111 +
   1.112 +  # Call helper function which possibly converts this using DOS-style short mode.
   1.113 +  # If so, the updated path is stored in $new_path.
   1.114 +
   1.115 +  input_path="$new_path"
   1.116 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.117 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.118 +  # take no chances and rewrite it.
   1.119 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.120 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   1.121 +  if test "x$has_forbidden_chars" != x; then
   1.122 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.123 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   1.124 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   1.125 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   1.126 +      # Going to short mode and back again did indeed matter. Since short mode is
   1.127 +      # case insensitive, let's make it lowercase to improve readability.
   1.128 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.129 +      # Now convert it back to Unix-stile (cygpath)
   1.130 +      input_path=`$CYGPATH -u "$shortmode_path"`
   1.131 +      new_path="$input_path"
   1.132 +    fi
   1.133 +  fi
   1.134 +
   1.135 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   1.136 +  if test "x$test_cygdrive_prefix" = x; then
   1.137 +    # As a simple fix, exclude /usr/bin since it's not a real path.
   1.138 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   1.139 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   1.140 +      # a path prefixed by /cygdrive for fixpath to work.
   1.141 +      new_path="$CYGWIN_ROOT_PATH$input_path"
   1.142 +    fi
   1.143 +  fi
   1.144 +
   1.145 +
   1.146 +  if test "x$path" != "x$new_path"; then
   1.147 +    dxsdk_path="$new_path"
   1.148 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting dxsdk_path to \"$new_path\"" >&5
   1.149 +$as_echo "$as_me: Rewriting dxsdk_path to \"$new_path\"" >&6;}
   1.150 +  fi
   1.151 +
   1.152 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.153 +
   1.154 +  path="$dxsdk_path"
   1.155 +  has_colon=`$ECHO $path | $GREP ^.:`
   1.156 +  new_path="$path"
   1.157 +  if test "x$has_colon" = x; then
   1.158 +    # Not in mixed or Windows style, start by that.
   1.159 +    new_path=`cmd //c echo $path`
   1.160 +  fi
   1.161 +
   1.162 +
   1.163 +  input_path="$new_path"
   1.164 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.165 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.166 +  # take no chances and rewrite it.
   1.167 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.168 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   1.169 +  if test "x$has_forbidden_chars" != x; then
   1.170 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.171 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.172 +  fi
   1.173 +
   1.174 +
   1.175 +  windows_path="$new_path"
   1.176 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.177 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.178 +    new_path="$unix_path"
   1.179 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.180 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.181 +    new_path="$unix_path"
   1.182 +  fi
   1.183 +
   1.184 +  if test "x$path" != "x$new_path"; then
   1.185 +    dxsdk_path="$new_path"
   1.186 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting dxsdk_path to \"$new_path\"" >&5
   1.187 +$as_echo "$as_me: Rewriting dxsdk_path to \"$new_path\"" >&6;}
   1.188 +  fi
   1.189 +
   1.190 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   1.191 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   1.192 +
   1.193 +  else
   1.194 +    # We're on a posix platform. Hooray! :)
   1.195 +    path="$dxsdk_path"
   1.196 +
   1.197 +    if test ! -f "$path" && test ! -d "$path"; then
   1.198 +      as_fn_error $? "The path of dxsdk_path, which resolves as \"$path\", is not found." "$LINENO" 5
   1.199 +    fi
   1.200 +
   1.201 +    has_space=`$ECHO "$path" | $GREP " "`
   1.202 +    if test "x$has_space" != x; then
   1.203 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&5
   1.204 +$as_echo "$as_me: The path of dxsdk_path, which resolves as \"$path\", is invalid." >&6;}
   1.205 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   1.206 +    fi
   1.207 +  fi
   1.208 +
   1.209 +
   1.210 +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DirectX SDK lib dir" >&5
   1.211 +$as_echo_n "checking for DirectX SDK lib dir... " >&6; }
   1.212 +  if test "x$with_dxsdk_lib" != x; then
   1.213 +    DXSDK_LIB_PATH="$with_dxsdk_lib"
   1.214 +  elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
   1.215 +    DXSDK_LIB_PATH="$dxsdk_path/Lib/x64"
   1.216 +  else
   1.217 +    DXSDK_LIB_PATH="$dxsdk_path/Lib"
   1.218 +  fi
   1.219 +  # dsound.lib is linked to in jsoundds
   1.220 +  if test ! -f "$DXSDK_LIB_PATH/dsound.lib"; then
   1.221 +    as_fn_error $? "Invalid DirectX SDK lib dir" "$LINENO" 5
   1.222 +  fi
   1.223 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DXSDK_LIB_PATH" >&5
   1.224 +$as_echo "$DXSDK_LIB_PATH" >&6; }
   1.225 +
   1.226 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.227 +
   1.228 +  # Input might be given as Windows format, start by converting to
   1.229 +  # unix format.
   1.230 +  path="$DXSDK_LIB_PATH"
   1.231 +  new_path=`$CYGPATH -u "$path"`
   1.232 +
   1.233 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   1.234 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   1.235 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   1.236 +  # "foo.exe" is OK but "foo" is an error.
   1.237 +  #
   1.238 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   1.239 +  # It is also a way to make sure we got the proper file name for the real test later on.
   1.240 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   1.241 +  if test "x$test_shortpath" = x; then
   1.242 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&5
   1.243 +$as_echo "$as_me: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
   1.244 +    as_fn_error $? "Cannot locate the the path of DXSDK_LIB_PATH" "$LINENO" 5
   1.245 +  fi
   1.246 +
   1.247 +  # Call helper function which possibly converts this using DOS-style short mode.
   1.248 +  # If so, the updated path is stored in $new_path.
   1.249 +
   1.250 +  input_path="$new_path"
   1.251 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.252 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.253 +  # take no chances and rewrite it.
   1.254 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.255 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   1.256 +  if test "x$has_forbidden_chars" != x; then
   1.257 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.258 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   1.259 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   1.260 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   1.261 +      # Going to short mode and back again did indeed matter. Since short mode is
   1.262 +      # case insensitive, let's make it lowercase to improve readability.
   1.263 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.264 +      # Now convert it back to Unix-stile (cygpath)
   1.265 +      input_path=`$CYGPATH -u "$shortmode_path"`
   1.266 +      new_path="$input_path"
   1.267 +    fi
   1.268 +  fi
   1.269 +
   1.270 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   1.271 +  if test "x$test_cygdrive_prefix" = x; then
   1.272 +    # As a simple fix, exclude /usr/bin since it's not a real path.
   1.273 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   1.274 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   1.275 +      # a path prefixed by /cygdrive for fixpath to work.
   1.276 +      new_path="$CYGWIN_ROOT_PATH$input_path"
   1.277 +    fi
   1.278 +  fi
   1.279 +
   1.280 +
   1.281 +  if test "x$path" != "x$new_path"; then
   1.282 +    DXSDK_LIB_PATH="$new_path"
   1.283 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DXSDK_LIB_PATH to \"$new_path\"" >&5
   1.284 +$as_echo "$as_me: Rewriting DXSDK_LIB_PATH to \"$new_path\"" >&6;}
   1.285 +  fi
   1.286 +
   1.287 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.288 +
   1.289 +  path="$DXSDK_LIB_PATH"
   1.290 +  has_colon=`$ECHO $path | $GREP ^.:`
   1.291 +  new_path="$path"
   1.292 +  if test "x$has_colon" = x; then
   1.293 +    # Not in mixed or Windows style, start by that.
   1.294 +    new_path=`cmd //c echo $path`
   1.295 +  fi
   1.296 +
   1.297 +
   1.298 +  input_path="$new_path"
   1.299 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.300 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.301 +  # take no chances and rewrite it.
   1.302 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.303 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   1.304 +  if test "x$has_forbidden_chars" != x; then
   1.305 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.306 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.307 +  fi
   1.308 +
   1.309 +
   1.310 +  windows_path="$new_path"
   1.311 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.312 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.313 +    new_path="$unix_path"
   1.314 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.315 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.316 +    new_path="$unix_path"
   1.317 +  fi
   1.318 +
   1.319 +  if test "x$path" != "x$new_path"; then
   1.320 +    DXSDK_LIB_PATH="$new_path"
   1.321 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DXSDK_LIB_PATH to \"$new_path\"" >&5
   1.322 +$as_echo "$as_me: Rewriting DXSDK_LIB_PATH to \"$new_path\"" >&6;}
   1.323 +  fi
   1.324 +
   1.325 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   1.326 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   1.327 +
   1.328 +  else
   1.329 +    # We're on a posix platform. Hooray! :)
   1.330 +    path="$DXSDK_LIB_PATH"
   1.331 +
   1.332 +    if test ! -f "$path" && test ! -d "$path"; then
   1.333 +      as_fn_error $? "The path of DXSDK_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
   1.334 +    fi
   1.335 +
   1.336 +    has_space=`$ECHO "$path" | $GREP " "`
   1.337 +    if test "x$has_space" != x; then
   1.338 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&5
   1.339 +$as_echo "$as_me: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
   1.340 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   1.341 +    fi
   1.342 +  fi
   1.343 +
   1.344 +
   1.345 +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DirectX SDK include dir" >&5
   1.346 +$as_echo_n "checking for DirectX SDK include dir... " >&6; }
   1.347 +  if test "x$with_dxsdk_include" != x; then
   1.348 +    DXSDK_INCLUDE_PATH="$with_dxsdk_include"
   1.349 +  else
   1.350 +    DXSDK_INCLUDE_PATH="$dxsdk_path/Include"
   1.351 +  fi
   1.352 +  # dsound.h is included in jsoundds
   1.353 +  if test ! -f "$DXSDK_INCLUDE_PATH/dsound.h"; then
   1.354 +    as_fn_error $? "Invalid DirectX SDK lib dir" "$LINENO" 5
   1.355 +  fi
   1.356 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DXSDK_INCLUDE_PATH" >&5
   1.357 +$as_echo "$DXSDK_INCLUDE_PATH" >&6; }
   1.358 +
   1.359 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.360 +
   1.361 +  # Input might be given as Windows format, start by converting to
   1.362 +  # unix format.
   1.363 +  path="$DXSDK_INCLUDE_PATH"
   1.364 +  new_path=`$CYGPATH -u "$path"`
   1.365 +
   1.366 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   1.367 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   1.368 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   1.369 +  # "foo.exe" is OK but "foo" is an error.
   1.370 +  #
   1.371 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   1.372 +  # It is also a way to make sure we got the proper file name for the real test later on.
   1.373 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   1.374 +  if test "x$test_shortpath" = x; then
   1.375 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
   1.376 +$as_echo "$as_me: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
   1.377 +    as_fn_error $? "Cannot locate the the path of DXSDK_INCLUDE_PATH" "$LINENO" 5
   1.378 +  fi
   1.379 +
   1.380 +  # Call helper function which possibly converts this using DOS-style short mode.
   1.381 +  # If so, the updated path is stored in $new_path.
   1.382 +
   1.383 +  input_path="$new_path"
   1.384 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.385 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.386 +  # take no chances and rewrite it.
   1.387 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.388 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   1.389 +  if test "x$has_forbidden_chars" != x; then
   1.390 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.391 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   1.392 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   1.393 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   1.394 +      # Going to short mode and back again did indeed matter. Since short mode is
   1.395 +      # case insensitive, let's make it lowercase to improve readability.
   1.396 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.397 +      # Now convert it back to Unix-stile (cygpath)
   1.398 +      input_path=`$CYGPATH -u "$shortmode_path"`
   1.399 +      new_path="$input_path"
   1.400 +    fi
   1.401 +  fi
   1.402 +
   1.403 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   1.404 +  if test "x$test_cygdrive_prefix" = x; then
   1.405 +    # As a simple fix, exclude /usr/bin since it's not a real path.
   1.406 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   1.407 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   1.408 +      # a path prefixed by /cygdrive for fixpath to work.
   1.409 +      new_path="$CYGWIN_ROOT_PATH$input_path"
   1.410 +    fi
   1.411 +  fi
   1.412 +
   1.413 +
   1.414 +  if test "x$path" != "x$new_path"; then
   1.415 +    DXSDK_INCLUDE_PATH="$new_path"
   1.416 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DXSDK_INCLUDE_PATH to \"$new_path\"" >&5
   1.417 +$as_echo "$as_me: Rewriting DXSDK_INCLUDE_PATH to \"$new_path\"" >&6;}
   1.418 +  fi
   1.419 +
   1.420 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.421 +
   1.422 +  path="$DXSDK_INCLUDE_PATH"
   1.423 +  has_colon=`$ECHO $path | $GREP ^.:`
   1.424 +  new_path="$path"
   1.425 +  if test "x$has_colon" = x; then
   1.426 +    # Not in mixed or Windows style, start by that.
   1.427 +    new_path=`cmd //c echo $path`
   1.428 +  fi
   1.429 +
   1.430 +
   1.431 +  input_path="$new_path"
   1.432 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.433 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.434 +  # take no chances and rewrite it.
   1.435 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.436 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   1.437 +  if test "x$has_forbidden_chars" != x; then
   1.438 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.439 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.440 +  fi
   1.441 +
   1.442 +
   1.443 +  windows_path="$new_path"
   1.444 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.445 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.446 +    new_path="$unix_path"
   1.447 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.448 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.449 +    new_path="$unix_path"
   1.450 +  fi
   1.451 +
   1.452 +  if test "x$path" != "x$new_path"; then
   1.453 +    DXSDK_INCLUDE_PATH="$new_path"
   1.454 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DXSDK_INCLUDE_PATH to \"$new_path\"" >&5
   1.455 +$as_echo "$as_me: Rewriting DXSDK_INCLUDE_PATH to \"$new_path\"" >&6;}
   1.456 +  fi
   1.457 +
   1.458 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   1.459 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   1.460 +
   1.461 +  else
   1.462 +    # We're on a posix platform. Hooray! :)
   1.463 +    path="$DXSDK_INCLUDE_PATH"
   1.464 +
   1.465 +    if test ! -f "$path" && test ! -d "$path"; then
   1.466 +      as_fn_error $? "The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
   1.467 +    fi
   1.468 +
   1.469 +    has_space=`$ECHO "$path" | $GREP " "`
   1.470 +    if test "x$has_space" != x; then
   1.471 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
   1.472 +$as_echo "$as_me: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
   1.473 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   1.474 +    fi
   1.475 +  fi
   1.476 +
   1.477 +
   1.478 +
   1.479 +
   1.480 +  LDFLAGS_JDK="$LDFLAGS_JDK -libpath:$DXSDK_LIB_PATH"
   1.481 +
   1.482  fi
   1.483  
   1.484  
     2.1 --- a/common/autoconf/spec.gmk.in	Mon Mar 04 16:45:07 2013 +0100
     2.2 +++ b/common/autoconf/spec.gmk.in	Wed Mar 06 10:50:37 2013 +0100
     2.3 @@ -285,6 +285,10 @@
     2.4  X_LIBS:=@X_LIBS@
     2.5  OPENWIN_HOME:=@OPENWIN_HOME@
     2.6  
     2.7 +# DirectX SDK
     2.8 +DXSDK_LIB_PATH=@DXSDK_LIB_PATH@
     2.9 +DXSDK_INCLUDE_PATH=@DXSDK_INCLUDE_PATH@
    2.10 +
    2.11  # The lowest required version of macosx to enforce compatiblity for
    2.12  MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
    2.13  
     3.1 --- a/common/autoconf/toolchain.m4	Mon Mar 04 16:45:07 2013 +0100
     3.2 +++ b/common/autoconf/toolchain.m4	Wed Mar 06 10:50:37 2013 +0100
     3.3 @@ -176,6 +176,7 @@
     3.4  [
     3.5  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
     3.6    TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
     3.7 +  TOOLCHAIN_SETUP_DXSDK
     3.8  fi
     3.9  
    3.10  AC_SUBST(MSVCR_DLL)
     4.1 --- a/common/autoconf/toolchain_windows.m4	Mon Mar 04 16:45:07 2013 +0100
     4.2 +++ b/common/autoconf/toolchain_windows.m4	Wed Mar 06 10:50:37 2013 +0100
     4.3 @@ -262,3 +262,59 @@
     4.4    AC_MSG_RESULT([$MSVCR_DLL])
     4.5    BASIC_FIXUP_PATH(MSVCR_DLL)
     4.6  ])
     4.7 +
     4.8 +
     4.9 +# Setup the DXSDK paths
    4.10 +AC_DEFUN([TOOLCHAIN_SETUP_DXSDK],
    4.11 +[
    4.12 +  AC_ARG_WITH(dxsdk, [AS_HELP_STRING([--with-dxsdk],
    4.13 +      [the DirectX SDK (Windows only) @<:@probed@:>@])])
    4.14 +  AC_ARG_WITH(dxsdk-lib, [AS_HELP_STRING([--with-dxsdk-lib],
    4.15 +      [the DirectX SDK lib directory (Windows only) @<:@probed@:>@])])
    4.16 +  AC_ARG_WITH(dxsdk-include, [AS_HELP_STRING([--with-dxsdk-include],
    4.17 +      [the DirectX SDK include directory (Windows only) @<:@probed@:>@])])
    4.18 +
    4.19 +  AC_MSG_CHECKING([for DirectX SDK])
    4.20 +
    4.21 +  if test "x$with_dxsdk" != x; then
    4.22 +    dxsdk_path="$with_dxsdk"
    4.23 +  elif test "x$DXSDK_DIR" != x; then
    4.24 +    dxsdk_path="$DXSDK_DIR"
    4.25 +  else
    4.26 +    AC_MSG_ERROR([Could not find the DirectX SDK])
    4.27 +  fi
    4.28 +  AC_MSG_RESULT([$dxsdk_path])
    4.29 +  BASIC_FIXUP_PATH(dxsdk_path)
    4.30 +
    4.31 +  AC_MSG_CHECKING([for DirectX SDK lib dir])
    4.32 +  if test "x$with_dxsdk_lib" != x; then
    4.33 +    DXSDK_LIB_PATH="$with_dxsdk_lib"
    4.34 +  elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
    4.35 +    DXSDK_LIB_PATH="$dxsdk_path/Lib/x64"
    4.36 +  else
    4.37 +    DXSDK_LIB_PATH="$dxsdk_path/Lib"
    4.38 +  fi
    4.39 +  # dsound.lib is linked to in jsoundds
    4.40 +  if test ! -f "$DXSDK_LIB_PATH/dsound.lib"; then
    4.41 +    AC_MSG_ERROR([Invalid DirectX SDK lib dir])
    4.42 +  fi
    4.43 +  AC_MSG_RESULT([$DXSDK_LIB_PATH])
    4.44 +  BASIC_FIXUP_PATH(DXSDK_LIB_PATH)
    4.45 +
    4.46 +  AC_MSG_CHECKING([for DirectX SDK include dir])
    4.47 +  if test "x$with_dxsdk_include" != x; then
    4.48 +    DXSDK_INCLUDE_PATH="$with_dxsdk_include"
    4.49 +  else
    4.50 +    DXSDK_INCLUDE_PATH="$dxsdk_path/Include"
    4.51 +  fi
    4.52 +  # dsound.h is included in jsoundds
    4.53 +  if test ! -f "$DXSDK_INCLUDE_PATH/dsound.h"; then
    4.54 +    AC_MSG_ERROR([Invalid DirectX SDK lib dir])
    4.55 +  fi
    4.56 +  AC_MSG_RESULT([$DXSDK_INCLUDE_PATH])
    4.57 +  BASIC_FIXUP_PATH(DXSDK_INCLUDE_PATH)
    4.58 +
    4.59 +  AC_SUBST(DXSDK_LIB_PATH)
    4.60 +  AC_SUBST(DXSDK_INCLUDE_PATH)
    4.61 +  LDFLAGS_JDK="$LDFLAGS_JDK -libpath:$DXSDK_LIB_PATH"
    4.62 +])

mercurial