8001912: Improve detection of msvcr100.dll

Fri, 18 Oct 2013 10:41:18 +0200

author
ihse
date
Fri, 18 Oct 2013 10:41:18 +0200
changeset 857
5b4f14990dd1
parent 841
547316ea137d
child 858
65c1752b4c38
child 859
17d195bd56fc

8001912: Improve detection of msvcr100.dll
Reviewed-by: erikj

common/autoconf/generated-configure.sh 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	Wed Oct 16 11:55:44 2013 -0700
     1.2 +++ b/common/autoconf/generated-configure.sh	Fri Oct 18 10:41:18 2013 +0200
     1.3 @@ -3812,13 +3812,17 @@
     1.4  
     1.5  
     1.6  
     1.7 +
     1.8 +
     1.9 +
    1.10 +
    1.11  # This line needs to be here, verbatim, after all includes and the dummy hook
    1.12  # definitions. It is replaced with custom functionality when building
    1.13  # custom sources.
    1.14  #CUSTOM_AUTOCONF_INCLUDE
    1.15  
    1.16  # Do not change or remove the following line, it is needed for consistency checks:
    1.17 -DATE_WHEN_GENERATED=1381407169
    1.18 +DATE_WHEN_GENERATED=1382084973
    1.19  
    1.20  ###############################################################################
    1.21  #
    1.22 @@ -17415,63 +17419,303 @@
    1.23      as_fn_error $? "Cannot continue" "$LINENO" 5
    1.24    fi
    1.25  
    1.26 -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
    1.27 -$as_echo_n "checking for msvcr100.dll... " >&6; }
    1.28 +
    1.29  
    1.30  # Check whether --with-msvcr-dll was given.
    1.31  if test "${with_msvcr_dll+set}" = set; then :
    1.32    withval=$with_msvcr_dll;
    1.33  fi
    1.34  
    1.35 +
    1.36    if test "x$with_msvcr_dll" != x; then
    1.37 -    MSVCR_DLL="$with_msvcr_dll"
    1.38 -  else
    1.39 +    # If given explicitely by user, do not probe. If not present, fail directly.
    1.40 +
    1.41 +  POSSIBLE_MSVCR_DLL="$with_msvcr_dll"
    1.42 +  METHOD="--with-msvcr-dll"
    1.43 +  if test -e "$POSSIBLE_MSVCR_DLL"; then
    1.44 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
    1.45 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
    1.46 +
    1.47 +    # Need to check if the found msvcr is correct architecture
    1.48 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
    1.49 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
    1.50 +    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
    1.51 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
    1.52 +      CORRECT_MSVCR_ARCH=386
    1.53 +    else
    1.54 +      CORRECT_MSVCR_ARCH=x86-64
    1.55 +    fi
    1.56 +    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
    1.57 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
    1.58 +$as_echo "ok" >&6; }
    1.59 +      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
    1.60 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
    1.61 +$as_echo_n "checking for msvcr100.dll... " >&6; }
    1.62 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
    1.63 +$as_echo "$MSVCR_DLL" >&6; }
    1.64 +    else
    1.65 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
    1.66 +$as_echo "incorrect, ignoring" >&6; }
    1.67 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
    1.68 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
    1.69 +    fi
    1.70 +  fi
    1.71 +
    1.72 +    if test "x$MSVCR_DLL" = x; then
    1.73 +      as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5
    1.74 +    fi
    1.75 +  fi
    1.76 +
    1.77 +  if test "x$MSVCR_DLL" = x; then
    1.78 +    # Probe: Using well-known location from Visual Studio 10.0
    1.79      if test "x$VCINSTALLDIR" != x; then
    1.80 +      CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
    1.81 +
    1.82 +  windows_path="$CYGWIN_VC_INSTALL_DIR"
    1.83 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
    1.84 +    unix_path=`$CYGPATH -u "$windows_path"`
    1.85 +    CYGWIN_VC_INSTALL_DIR="$unix_path"
    1.86 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
    1.87 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
    1.88 +    CYGWIN_VC_INSTALL_DIR="$unix_path"
    1.89 +  fi
    1.90 +
    1.91        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
    1.92 -        MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1`
    1.93 -      else
    1.94 -        MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1`
    1.95 -        if test "x$MSVCR_DLL" = x; then
    1.96 -          MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1`
    1.97 -        fi
    1.98 -      fi
    1.99 -      if test "x$MSVCR_DLL" != x; then
   1.100 -        { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&5
   1.101 -$as_echo "$as_me: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&6;}
   1.102 -      else
   1.103 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&5
   1.104 -$as_echo "$as_me: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&6;}
   1.105 -      fi
   1.106 -    fi
   1.107 -    # Try some fallback alternatives
   1.108 -    if test "x$MSVCR_DLL" = x; then
   1.109 -      # If visual studio express is installed, there is usually one with the debugger
   1.110 -      if test "x$VS100COMNTOOLS" != x; then
   1.111 -        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   1.112 -          MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1`
   1.113 -          { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&5
   1.114 -$as_echo "$as_me: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&6;}
   1.115 -        fi
   1.116 -      fi
   1.117 -    fi
   1.118 -    if test "x$MSVCR_DLL" = x; then
   1.119 -      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.120 -        # Fallback for 32bit builds, look in the windows directory.
   1.121 -        if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
   1.122 -          { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $SYSTEMROOT/system32" >&5
   1.123 -$as_echo "$as_me: msvcr100.dll found in $SYSTEMROOT/system32" >&6;}
   1.124 -          MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
   1.125 -        fi
   1.126 -      fi
   1.127 -    fi
   1.128 -  fi
   1.129 +        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll"
   1.130 +      else
   1.131 +        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"
   1.132 +      fi
   1.133 +
   1.134 +  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.135 +  METHOD="well-known location in VCINSTALLDIR"
   1.136 +  if test -e "$POSSIBLE_MSVCR_DLL"; then
   1.137 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
   1.138 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
   1.139 +
   1.140 +    # Need to check if the found msvcr is correct architecture
   1.141 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
   1.142 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
   1.143 +    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
   1.144 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.145 +      CORRECT_MSVCR_ARCH=386
   1.146 +    else
   1.147 +      CORRECT_MSVCR_ARCH=x86-64
   1.148 +    fi
   1.149 +    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
   1.150 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
   1.151 +$as_echo "ok" >&6; }
   1.152 +      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.153 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.154 +$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.155 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.156 +$as_echo "$MSVCR_DLL" >&6; }
   1.157 +    else
   1.158 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
   1.159 +$as_echo "incorrect, ignoring" >&6; }
   1.160 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
   1.161 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
   1.162 +    fi
   1.163 +  fi
   1.164 +
   1.165 +    fi
   1.166 +  fi
   1.167 +
   1.168    if test "x$MSVCR_DLL" = x; then
   1.169 +    # Probe: Check in the Boot JDK directory.
   1.170 +    POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
   1.171 +
   1.172 +  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.173 +  METHOD="well-known location in Boot JDK"
   1.174 +  if test -e "$POSSIBLE_MSVCR_DLL"; then
   1.175 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
   1.176 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
   1.177 +
   1.178 +    # Need to check if the found msvcr is correct architecture
   1.179 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
   1.180 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
   1.181 +    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
   1.182 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.183 +      CORRECT_MSVCR_ARCH=386
   1.184 +    else
   1.185 +      CORRECT_MSVCR_ARCH=x86-64
   1.186 +    fi
   1.187 +    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
   1.188 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
   1.189 +$as_echo "ok" >&6; }
   1.190 +      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.191 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.192 +$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.193 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.194 +$as_echo "$MSVCR_DLL" >&6; }
   1.195 +    else
   1.196 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
   1.197 +$as_echo "incorrect, ignoring" >&6; }
   1.198 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
   1.199 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
   1.200 +    fi
   1.201 +  fi
   1.202 +
   1.203 +  fi
   1.204 +
   1.205 +  if test "x$MSVCR_DLL" = x; then
   1.206 +    # Probe: Look in the Windows system32 directory
   1.207 +    CYGWIN_SYSTEMROOT="$SYSTEMROOT"
   1.208 +
   1.209 +  windows_path="$CYGWIN_SYSTEMROOT"
   1.210 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.211 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.212 +    CYGWIN_SYSTEMROOT="$unix_path"
   1.213 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.214 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.215 +    CYGWIN_SYSTEMROOT="$unix_path"
   1.216 +  fi
   1.217 +
   1.218 +    POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
   1.219 +
   1.220 +  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.221 +  METHOD="well-known location in SYSTEMROOT"
   1.222 +  if test -e "$POSSIBLE_MSVCR_DLL"; then
   1.223 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
   1.224 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
   1.225 +
   1.226 +    # Need to check if the found msvcr is correct architecture
   1.227 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
   1.228 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
   1.229 +    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
   1.230 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.231 +      CORRECT_MSVCR_ARCH=386
   1.232 +    else
   1.233 +      CORRECT_MSVCR_ARCH=x86-64
   1.234 +    fi
   1.235 +    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
   1.236 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
   1.237 +$as_echo "ok" >&6; }
   1.238 +      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.239 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.240 +$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.241 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.242 +$as_echo "$MSVCR_DLL" >&6; }
   1.243 +    else
   1.244 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
   1.245 +$as_echo "incorrect, ignoring" >&6; }
   1.246 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
   1.247 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
   1.248 +    fi
   1.249 +  fi
   1.250 +
   1.251 +  fi
   1.252 +
   1.253 +  if test "x$MSVCR_DLL" = x; then
   1.254 +    # Probe: If Visual Studio Express is installed, there is usually one with the debugger
   1.255 +    if test "x$VS100COMNTOOLS" != x; then
   1.256 +      CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
   1.257 +
   1.258 +  windows_path="$CYGWIN_VS_TOOLS_DIR"
   1.259 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.260 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.261 +    CYGWIN_VS_TOOLS_DIR="$unix_path"
   1.262 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.263 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.264 +    CYGWIN_VS_TOOLS_DIR="$unix_path"
   1.265 +  fi
   1.266 +
   1.267 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   1.268 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1`
   1.269 +      else
   1.270 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1`
   1.271 +      fi
   1.272 +
   1.273 +  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.274 +  METHOD="search of VS100COMNTOOLS"
   1.275 +  if test -e "$POSSIBLE_MSVCR_DLL"; then
   1.276 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
   1.277 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
   1.278 +
   1.279 +    # Need to check if the found msvcr is correct architecture
   1.280 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
   1.281 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
   1.282 +    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
   1.283 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.284 +      CORRECT_MSVCR_ARCH=386
   1.285 +    else
   1.286 +      CORRECT_MSVCR_ARCH=x86-64
   1.287 +    fi
   1.288 +    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
   1.289 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
   1.290 +$as_echo "ok" >&6; }
   1.291 +      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.292 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.293 +$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.294 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.295 +$as_echo "$MSVCR_DLL" >&6; }
   1.296 +    else
   1.297 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
   1.298 +$as_echo "incorrect, ignoring" >&6; }
   1.299 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
   1.300 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
   1.301 +    fi
   1.302 +  fi
   1.303 +
   1.304 +    fi
   1.305 +  fi
   1.306 +
   1.307 +  if test "x$MSVCR_DLL" = x; then
   1.308 +    # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
   1.309 +    # (This was the original behaviour; kept since it might turn up something)
   1.310 +    if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
   1.311 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   1.312 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1`
   1.313 +      else
   1.314 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
   1.315 +        if test "x$POSSIBLE_MSVCR_DLL" = x; then
   1.316 +          # We're grasping at straws now...
   1.317 +          POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
   1.318 +        fi
   1.319 +      fi
   1.320 +
   1.321 +
   1.322 +  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.323 +  METHOD="search of VCINSTALLDIR"
   1.324 +  if test -e "$POSSIBLE_MSVCR_DLL"; then
   1.325 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
   1.326 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
   1.327 +
   1.328 +    # Need to check if the found msvcr is correct architecture
   1.329 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
   1.330 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
   1.331 +    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
   1.332 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.333 +      CORRECT_MSVCR_ARCH=386
   1.334 +    else
   1.335 +      CORRECT_MSVCR_ARCH=x86-64
   1.336 +    fi
   1.337 +    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
   1.338 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
   1.339 +$as_echo "ok" >&6; }
   1.340 +      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.341 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.342 +$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.343 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.344 +$as_echo "$MSVCR_DLL" >&6; }
   1.345 +    else
   1.346 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
   1.347 +$as_echo "incorrect, ignoring" >&6; }
   1.348 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
   1.349 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
   1.350 +    fi
   1.351 +  fi
   1.352 +
   1.353 +    fi
   1.354 +  fi
   1.355 +
   1.356 +  if test "x$MSVCR_DLL" = x; then
   1.357 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.358 +$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.359      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   1.360  $as_echo "no" >&6; }
   1.361 -    as_fn_error $? "Could not find msvcr100.dll !" "$LINENO" 5
   1.362 -  fi
   1.363 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.364 -$as_echo "$MSVCR_DLL" >&6; }
   1.365 +    as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5
   1.366 +  fi
   1.367 +
   1.368  
   1.369    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.370  
     2.1 --- a/common/autoconf/toolchain.m4	Wed Oct 16 11:55:44 2013 -0700
     2.2 +++ b/common/autoconf/toolchain.m4	Fri Oct 18 10:41:18 2013 +0200
     2.3 @@ -176,6 +176,7 @@
     2.4  [
     2.5    if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
     2.6      TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
     2.7 +    TOOLCHAIN_SETUP_MSVCR_DLL
     2.8      BASIC_DEPRECATED_ARG_WITH([dxsdk])
     2.9      BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
    2.10      BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
     3.1 --- a/common/autoconf/toolchain_windows.m4	Wed Oct 16 11:55:44 2013 -0700
     3.2 +++ b/common/autoconf/toolchain_windows.m4	Fri Oct 18 10:41:18 2013 +0200
     3.3 @@ -228,52 +228,113 @@
     3.4      AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
     3.5      AC_MSG_ERROR([Cannot continue])
     3.6    fi
     3.7 +])
     3.8  
     3.9 -  AC_MSG_CHECKING([for msvcr100.dll])
    3.10 +AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL],
    3.11 +[
    3.12 +  POSSIBLE_MSVCR_DLL="$1"
    3.13 +  METHOD="$2"
    3.14 +  if test -e "$POSSIBLE_MSVCR_DLL"; then
    3.15 +    AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD])
    3.16 +    
    3.17 +    # Need to check if the found msvcr is correct architecture
    3.18 +    AC_MSG_CHECKING([found msvcr100.dll architecture])
    3.19 +    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
    3.20 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
    3.21 +      CORRECT_MSVCR_ARCH=386
    3.22 +    else
    3.23 +      CORRECT_MSVCR_ARCH=x86-64
    3.24 +    fi
    3.25 +    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then
    3.26 +      AC_MSG_RESULT([ok])
    3.27 +      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
    3.28 +      AC_MSG_CHECKING([for msvcr100.dll])
    3.29 +      AC_MSG_RESULT([$MSVCR_DLL])
    3.30 +    else
    3.31 +      AC_MSG_RESULT([incorrect, ignoring])
    3.32 +      AC_MSG_NOTICE([The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE])
    3.33 +    fi
    3.34 +  fi
    3.35 +])
    3.36 +
    3.37 +AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
    3.38 +[
    3.39    AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
    3.40        [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])])
    3.41 +
    3.42    if test "x$with_msvcr_dll" != x; then
    3.43 -    MSVCR_DLL="$with_msvcr_dll"
    3.44 -  else
    3.45 +    # If given explicitely by user, do not probe. If not present, fail directly.
    3.46 +    TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$with_msvcr_dll], [--with-msvcr-dll])
    3.47 +    if test "x$MSVCR_DLL" = x; then
    3.48 +      AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll])
    3.49 +    fi
    3.50 +  fi
    3.51 +  
    3.52 +  if test "x$MSVCR_DLL" = x; then
    3.53 +    # Probe: Using well-known location from Visual Studio 10.0
    3.54      if test "x$VCINSTALLDIR" != x; then
    3.55 +      CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
    3.56 +      BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR)
    3.57        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
    3.58 -        MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1`
    3.59 +        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll"
    3.60        else
    3.61 -        MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1`
    3.62 -        if test "x$MSVCR_DLL" = x; then
    3.63 -          MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1`
    3.64 +        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"
    3.65 +      fi
    3.66 +      TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in VCINSTALLDIR])
    3.67 +    fi
    3.68 +  fi
    3.69 +
    3.70 +  if test "x$MSVCR_DLL" = x; then
    3.71 +    # Probe: Check in the Boot JDK directory.
    3.72 +    POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
    3.73 +    TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK])
    3.74 +  fi
    3.75 +  
    3.76 +  if test "x$MSVCR_DLL" = x; then
    3.77 +    # Probe: Look in the Windows system32 directory 
    3.78 +    CYGWIN_SYSTEMROOT="$SYSTEMROOT"
    3.79 +    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
    3.80 +    POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
    3.81 +    TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in SYSTEMROOT])
    3.82 +  fi
    3.83 +
    3.84 +  if test "x$MSVCR_DLL" = x; then
    3.85 +    # Probe: If Visual Studio Express is installed, there is usually one with the debugger
    3.86 +    if test "x$VS100COMNTOOLS" != x; then
    3.87 +      CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
    3.88 +      BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR)
    3.89 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
    3.90 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1`
    3.91 +      else
    3.92 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1`
    3.93 +      fi
    3.94 +      TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS])
    3.95 +    fi
    3.96 +  fi
    3.97 +      
    3.98 +  if test "x$MSVCR_DLL" = x; then
    3.99 +    # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
   3.100 +    # (This was the original behaviour; kept since it might turn up something)
   3.101 +    if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
   3.102 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   3.103 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1`
   3.104 +      else
   3.105 +        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
   3.106 +        if test "x$POSSIBLE_MSVCR_DLL" = x; then
   3.107 +          # We're grasping at straws now...
   3.108 +          POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
   3.109          fi
   3.110        fi
   3.111 -      if test "x$MSVCR_DLL" != x; then
   3.112 -        AC_MSG_NOTICE([msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR])
   3.113 -      else
   3.114 -        AC_MSG_NOTICE([Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR])
   3.115 -      fi
   3.116 -    fi
   3.117 -    # Try some fallback alternatives
   3.118 -    if test "x$MSVCR_DLL" = x; then
   3.119 -      # If visual studio express is installed, there is usually one with the debugger
   3.120 -      if test "x$VS100COMNTOOLS" != x; then
   3.121 -        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   3.122 -          MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1`
   3.123 -          AC_MSG_NOTICE([msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS..])
   3.124 -        fi
   3.125 -      fi
   3.126 -    fi
   3.127 -    if test "x$MSVCR_DLL" = x; then
   3.128 -      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   3.129 -        # Fallback for 32bit builds, look in the windows directory.
   3.130 -        if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
   3.131 -          AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32])
   3.132 -          MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
   3.133 -        fi
   3.134 -      fi
   3.135 +      
   3.136 +      TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR])
   3.137      fi
   3.138    fi
   3.139 +  
   3.140    if test "x$MSVCR_DLL" = x; then
   3.141 +    AC_MSG_CHECKING([for msvcr100.dll])
   3.142      AC_MSG_RESULT([no])
   3.143 -    AC_MSG_ERROR([Could not find msvcr100.dll !])
   3.144 +    AC_MSG_ERROR([Could not find msvcr100.dll. Please specify using --with-msvcr-dll.])
   3.145    fi
   3.146 -  AC_MSG_RESULT([$MSVCR_DLL])
   3.147 +
   3.148    BASIC_FIXUP_PATH(MSVCR_DLL)
   3.149  ])

mercurial