< prev index next >
common/autoconf/toolchain_windows.m4
Print this page
*** 208,217 ****
--- 208,248 ----
eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version}
$PRINTF " %-10s %s\n" $version "$VS_DESCRIPTION"
done
exit 0
+ elif test "x$DEVKIT_VS_VERSION" != x; then
+ VS_VERSION=$DEVKIT_VS_VERSION
+ TOOLCHAIN_VERSION=$VS_VERSION
+ eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
+ eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
+ eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
+ eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
+ eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
+ VS_PATH="$TOOLCHAIN_PATH:$PATH"
+
+ # Convert DEVKIT_VS_INCLUDE into windows style VS_INCLUDE so that it
+ # can still be exported as INCLUDE for compiler invocations without
+ # SYSROOT_CFLAGS
+ OLDIFS="$IFS"
+ IFS=";"
+ for i in $DEVKIT_VS_INCLUDE; do
+ ipath=$i
+ BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([ipath])
+ VS_INCLUDE="$VS_INCLUDE;$ipath"
+ done
+ # Convert DEVKIT_VS_LIB into VS_LIB so that it can still be exported
+ # as LIB for compiler invocations without SYSROOT_LDFLAGS
+ for i in $DEVKIT_VS_LIB; do
+ libpath=$i
+ BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([libpath])
+ VS_LIB="$VS_LIB;$libpath"
+ done
+ IFS="$OLDIFS"
+
+ AC_MSG_NOTICE([Found devkit $VS_DESCRIPTION])
+
elif test "x$with_toolchain_version" != x; then
# User override; check that it is valid
if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then
AC_MSG_NOTICE([Visual Studio version $with_toolchain_version is not valid.])
AC_MSG_NOTICE([Valid Visual Studio versions: $VALID_VS_VERSIONS.])
*** 260,269 ****
--- 291,302 ----
fi
# First-hand choice is to locate and run the vsvars bat file.
TOOLCHAIN_FIND_VISUAL_STUDIO
+ # If we have a devkit, skip all of the below.
+ if test "x$DEVKIT_VS_VERSION" = x; then
if test "x$VS_ENV_CMD" != x; then
# We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD)
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
*** 289,304 ****
$ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
# These will end up something like:
# C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
# The trailing space for everyone except PATH is no typo, but is needed due
# to trailing \ in the Windows paths. These will be stripped later.
! $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
# Now execute the newly created bat file.
# The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
# Change directory so we don't need to mess with Windows paths in redirects.
cd $VS_ENV_TMP_DIR
--- 322,343 ----
$ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
# These will end up something like:
# C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
# The trailing space for everyone except PATH is no typo, but is needed due
# to trailing \ in the Windows paths. These will be stripped later.
! $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' \
! >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' \
! >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' \
! >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' \
! >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' \
! >> $EXTRACT_VC_ENV_BAT_FILE
! $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' \
! >> $EXTRACT_VC_ENV_BAT_FILE
# Now execute the newly created bat file.
# The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
# Change directory so we don't need to mess with Windows paths in redirects.
cd $VS_ENV_TMP_DIR
*** 320,334 ****
# also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR.
else
# We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
fi
# At this point, we should have correct variables in the environment, or we can't continue.
AC_MSG_CHECKING([for Visual Studio variables])
! if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then
if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then
AC_MSG_RESULT([present but broken])
AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
else
AC_MSG_RESULT([ok])
--- 359,375 ----
# also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR.
else
# We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
fi
+ fi
# At this point, we should have correct variables in the environment, or we can't continue.
AC_MSG_CHECKING([for Visual Studio variables])
! if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x \
! || test "x$WINDOWSSDKDIR" != x || test "x$DEVKIT_NAME" != x; then
if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then
AC_MSG_RESULT([present but broken])
AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
else
AC_MSG_RESULT([ok])
*** 401,414 ****
[
DLL_NAME="$1"
POSSIBLE_MSVC_DLL="$2"
METHOD="$3"
if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
! AC_MSG_NOTICE([Found $1 at $POSSIBLE_MSVC_DLL using $METHOD])
# Need to check if the found msvcr is correct architecture
! AC_MSG_CHECKING([found $1 architecture])
MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
# The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
# on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
--- 442,455 ----
[
DLL_NAME="$1"
POSSIBLE_MSVC_DLL="$2"
METHOD="$3"
if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
! AC_MSG_NOTICE([Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD])
# Need to check if the found msvcr is correct architecture
! AC_MSG_CHECKING([found $DLL_NAME architecture])
MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
# The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
# on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
*** 424,446 ****
fi
fi
if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
AC_MSG_RESULT([ok])
MSVC_DLL="$POSSIBLE_MSVC_DLL"
! AC_MSG_CHECKING([for $1])
AC_MSG_RESULT([$MSVC_DLL])
else
AC_MSG_RESULT([incorrect, ignoring])
! AC_MSG_NOTICE([The file type of the located $1 is $MSVC_DLL_FILETYPE])
fi
fi
])
AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
[
! VAR_NAME="$1"
! DLL_NAME="$2"
MSVC_DLL=
if test "x$MSVC_DLL" = x; then
# Probe: Using well-known location from Visual Studio 10.0
if test "x$VCINSTALLDIR" != x; then
--- 465,487 ----
fi
fi
if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
AC_MSG_RESULT([ok])
MSVC_DLL="$POSSIBLE_MSVC_DLL"
! BASIC_FIXUP_PATH(MSVC_DLL)
! AC_MSG_CHECKING([for $DLL_NAME])
AC_MSG_RESULT([$MSVC_DLL])
else
AC_MSG_RESULT([incorrect, ignoring])
! AC_MSG_NOTICE([The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE])
fi
fi
])
AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
[
! DLL_NAME="$1"
MSVC_DLL=
if test "x$MSVC_DLL" = x; then
# Probe: Using well-known location from Visual Studio 10.0
if test "x$VCINSTALLDIR" != x; then
*** 515,557 ****
if test "x$MSVC_DLL" = x; then
AC_MSG_CHECKING([for $DLL_NAME])
AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.])
fi
-
- $1=$MSVC_DLL
- BASIC_FIXUP_PATH($1)
- AC_SUBST($1, [$]$1)
])
AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
[
AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
[path to microsoft C runtime dll (msvcr*.dll) (Windows only) @<:@probed@:>@])])
if test "x$with_msvcr_dll" != x; then
# If given explicitely by user, do not probe. If not present, fail directly.
! TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcr_dll],
! [--with-msvcr-dll])
if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll])
fi
else
! TOOLCHAIN_SETUP_MSVC_DLL([MSVCR_DLL], [${MSVCR_NAME}])
fi
AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll],
[path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])])
if test "x$MSVCP_NAME" != "x"; then
if test "x$with_msvcp_dll" != x; then
# If given explicitely by user, do not probe. If not present, fail directly.
! TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcp_dll],
! [--with-msvcp-dll])
if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll])
fi
else
! TOOLCHAIN_SETUP_MSVC_DLL([MSVCP_DLL], [${MSVCP_NAME}])
fi
fi
])
--- 556,610 ----
if test "x$MSVC_DLL" = x; then
AC_MSG_CHECKING([for $DLL_NAME])
AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.])
fi
])
AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
[
AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
[path to microsoft C runtime dll (msvcr*.dll) (Windows only) @<:@probed@:>@])])
if test "x$with_msvcr_dll" != x; then
# If given explicitely by user, do not probe. If not present, fail directly.
! TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$with_msvcr_dll], [--with-msvcr-dll])
if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll])
fi
+ MSVCR_DLL="$MSVC_DLL"
+ elif test "x$DEVKIT_MSVCR_DLL" != x; then
+ TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$DEVKIT_MSVCR_DLL], [devkit])
+ if test "x$MSVC_DLL" = x; then
+ AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by devkit])
+ fi
+ MSVCR_DLL="$MSVC_DLL"
else
! TOOLCHAIN_SETUP_MSVC_DLL([${MSVCR_NAME}])
! MSVCR_DLL="$MSVC_DLL"
fi
+ AC_SUBST(MSVCR_DLL)
AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll],
[path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])])
if test "x$MSVCP_NAME" != "x"; then
if test "x$with_msvcp_dll" != x; then
# If given explicitely by user, do not probe. If not present, fail directly.
! TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$with_msvcp_dll], [--with-msvcp-dll])
if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll])
fi
+ MSVCP_DLL="$MSVC_DLL"
+ elif test "x$DEVKIT_MSVCP_DLL" != x; then
+ TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$DEVKIT_MSVCP_DLL], [devkit])
+ if test "x$MSVC_DLL" = x; then
+ AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by devkit])
+ fi
+ MSVCP_DLL="$MSVC_DLL"
else
! TOOLCHAIN_SETUP_MSVC_DLL([${MSVCP_NAME}])
! MSVCP_DLL="$MSVC_DLL"
fi
+ AC_SUBST(MSVCP_DLL)
fi
])
< prev index next >