196 # Now set all paths and other env variables. This will allow the rest of 197 # the configure script to find and run the compiler in the proper way. 198 AC_MSG_NOTICE([Setting extracted environment variables]) 199 . $VS_ENV_TMP_DIR/set-vs-env.sh 200 # Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we 201 # also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR. 202 else 203 # We did not find a vsvars bat file, let's hope we are run from a VS command prompt. 204 AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment]) 205 fi 206 207 # At this point, we should have correct variables in the environment, or we can't continue. 208 AC_MSG_CHECKING([for Visual Studio variables]) 209 210 if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then 211 if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then 212 AC_MSG_RESULT([present but broken]) 213 AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.]) 214 else 215 AC_MSG_RESULT([ok]) 216 # Remove any trailing "\" and " " from the variables. 217 VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'` 218 VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'` 219 VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` 220 WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'` 221 WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` 222 # Remove any paths containing # (typically F#) as that messes up make. This 223 # is needed if visual studio was installed with F# support. 224 VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[[^:#]]*#[^:]*://g'` 225 226 AC_SUBST(VS_PATH) 227 AC_SUBST(VS_INCLUDE) 228 AC_SUBST(VS_LIB) 229 fi 230 else 231 AC_MSG_RESULT([not found]) 232 233 if test "x$VS_ENV_CMD" = x; then 234 AC_MSG_NOTICE([Cannot locate a valid Visual Studio or Windows SDK installation on disk,]) 235 AC_MSG_NOTICE([nor is this script run from a Visual Studio command prompt.]) 236 else 237 AC_MSG_NOTICE([Running the extraction script failed.]) 238 fi 239 AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) 240 AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) 241 AC_MSG_ERROR([Cannot continue]) 242 fi 243 ]) 244 245 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL], 246 [ 247 POSSIBLE_MSVCR_DLL="$1" 248 METHOD="$2" | 196 # Now set all paths and other env variables. This will allow the rest of 197 # the configure script to find and run the compiler in the proper way. 198 AC_MSG_NOTICE([Setting extracted environment variables]) 199 . $VS_ENV_TMP_DIR/set-vs-env.sh 200 # Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we 201 # also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR. 202 else 203 # We did not find a vsvars bat file, let's hope we are run from a VS command prompt. 204 AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment]) 205 fi 206 207 # At this point, we should have correct variables in the environment, or we can't continue. 208 AC_MSG_CHECKING([for Visual Studio variables]) 209 210 if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then 211 if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then 212 AC_MSG_RESULT([present but broken]) 213 AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.]) 214 else 215 AC_MSG_RESULT([ok]) 216 # Remove any trailing "\" ";" and " " from the variables. 217 VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'` 218 VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'` 219 VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` 220 WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'` 221 WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` 222 # Remove any paths containing # (typically F#) as that messes up make. This 223 # is needed if visual studio was installed with F# support. 224 VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[[^:#]]*#[^:]*://g'` 225 226 AC_SUBST(VS_PATH) 227 AC_SUBST(VS_INCLUDE) 228 AC_SUBST(VS_LIB) 229 230 # Convert VS_INCLUDE into SYSROOT_CFLAGS 231 OLDIFS="$IFS" 232 IFS=";" 233 for i in $VS_INCLUDE; do 234 ipath=$i 235 IFS="$OLDIFS" 236 BASIC_FIXUP_PATH([ipath]) 237 IFS=";" 238 SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath" 239 done 240 # Convert VS_LIB into SYSROOT_LDFLAGS 241 for i in $VS_LIB; do 242 libpath=$i 243 IFS="$OLDIFS" 244 BASIC_FIXUP_PATH([libpath]) 245 IFS=";" 246 SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath" 247 done 248 IFS="$OLDIFS" 249 fi 250 else 251 AC_MSG_RESULT([not found]) 252 253 if test "x$VS_ENV_CMD" = x; then 254 AC_MSG_NOTICE([Cannot locate a valid Visual Studio or Windows SDK installation on disk,]) 255 AC_MSG_NOTICE([nor is this script run from a Visual Studio command prompt.]) 256 else 257 AC_MSG_NOTICE([Running the extraction script failed.]) 258 fi 259 AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) 260 AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) 261 AC_MSG_ERROR([Cannot continue]) 262 fi 263 ]) 264 265 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL], 266 [ 267 POSSIBLE_MSVCR_DLL="$1" 268 METHOD="$2" |