common/autoconf/toolchain_windows.m4
author erikj
Fri, 03 Apr 2015 08:45:08 -0700
changeset 29643 89e91c724316
parent 29065 907bcc4ce290
child 29790 79641c886929
permissions -rw-r--r--
8076531: Switch default compiler on Windows to VS2013 Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     1
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     4
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    10
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    15
# accompanied this code).
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    16
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    20
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    23
# questions.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    24
#
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    25
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    26
################################################################################
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
    27
# The order of these defines the priority by which we try to find them.
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
    28
VALID_VS_VERSIONS="2013 2012 2010"
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    29
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    30
VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    31
VS_VERSION_INTERNAL_2010=100
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    32
VS_MSVCR_2010=msvcr100.dll
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    33
# We don't use msvcp on Visual Studio 2010
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    34
#VS_MSVCP_2010=msvcp100.dll
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    35
VS_ENVVAR_2010="VS100COMNTOOLS"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    36
VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    37
VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    38
VS_VS_PLATFORM_NAME_2010="v100"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    39
VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    40
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    41
VS_DESCRIPTION_2012="Microsoft Visual Studio 2012"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    42
VS_VERSION_INTERNAL_2012=110
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    43
VS_MSVCR_2012=msvcr110.dll
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    44
VS_MSVCP_2012=msvcp110.dll
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    45
VS_ENVVAR_2012="VS110COMNTOOLS"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    46
VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    47
VS_SDK_INSTALLDIR_2012=
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    48
VS_VS_PLATFORM_NAME_2012="v110"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    49
VS_SDK_PLATFORM_NAME_2012=
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    50
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    51
VS_DESCRIPTION_2013="Microsoft Visual Studio 2013"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    52
VS_VERSION_INTERNAL_2013=120
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    53
VS_MSVCR_2013=msvcr120.dll
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    54
VS_MSVCP_2013=msvcp120.dll
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    55
VS_ENVVAR_2013="VS120COMNTOOLS"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    56
VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    57
VS_SDK_INSTALLDIR_2013=
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    58
VS_VS_PLATFORM_NAME_2013="v120"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    59
VS_SDK_PLATFORM_NAME_2013=
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    60
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    61
################################################################################
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    62
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    63
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    64
[
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    65
  if test "x$VS_ENV_CMD" = x; then
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    66
    VS_VERSION="$1"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    67
    VS_BASE="$2"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    68
    METHOD="$3"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    69
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    70
    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    71
      VCVARSFILE="vc/bin/vcvars32.bat"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    72
    else
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    73
      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    74
    fi
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
    75
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    76
    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE)
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    77
    if test -d "$VS_BASE"; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    78
      if test -f "$VS_BASE/$VCVARSFILE"; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    79
        AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    80
        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25882
diff changeset
    81
        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25882
diff changeset
    82
        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    83
        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    84
      else
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    85
        AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    86
        AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    87
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    88
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    89
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    90
])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    91
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    92
################################################################################
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    93
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    94
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    95
[
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    96
  if test "x$VS_ENV_CMD" = x; then
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    97
    VS_VERSION="$1"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    98
    WIN_SDK_BASE="$2"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
    99
    METHOD="$3"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   100
    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   101
    if test -d "$WIN_SDK_BASE"; then
14565
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
   102
      # There have been cases of partial or broken SDK installations. A missing
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
   103
      # lib dir is not going to work.
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   104
      if test ! -d "$WIN_SDK_BASE/lib"; then
14565
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
   105
        AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
   106
        AC_MSG_NOTICE([Warning: Installation is broken, lib dir is missing. Ignoring])
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   107
      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   108
        AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   109
        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   110
        if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   111
          VS_ENV_ARGS="/x86"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   112
        else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   113
          VS_ENV_ARGS="/x64"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   114
        fi
26400
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25882
diff changeset
   115
        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25882
diff changeset
   116
        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
4d6c6f2df610 8057538: Build the freetype library during configure on Windows
simonis
parents: 25882
diff changeset
   117
        # TODO: improve detection for other versions of SDK
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   118
        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   119
      else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   120
        AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   121
        AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   122
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   123
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   124
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   125
])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   126
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   127
################################################################################
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   128
# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   129
# build environment and assigns it to VS_ENV_CMD
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   130
AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   131
[
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   132
  VS_VERSION="$1"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   133
  eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   134
  eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   135
  eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   136
  eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   137
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   138
  # When using --with-tools-dir, assume it points to the correct and default
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   139
  # version of Visual Studio or that --with-toolchain-version was also set.
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   140
  if test "x$with_tools_dir" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   141
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   142
        [$with_tools_dir/../..], [--with-tools-dir])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   143
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   144
        [$with_tools_dir/../../..], [--with-tools-dir])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   145
    if test "x$VS_ENV_CMD" = x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   146
      # Having specified an argument which is incorrect will produce an instant failure;
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   147
      # we should not go on looking
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   148
      AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   149
      AC_MSG_NOTICE([Visual Studio installation. Please point to the VC/bin or VC/bin/amd64])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   150
      AC_MSG_NOTICE([directory within the Visual Studio installation])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   151
      AC_MSG_ERROR([Cannot locate a valid Visual Studio installation])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   152
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19758
diff changeset
   153
  fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   154
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   155
  VS_ENV_CMD=""
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   156
  VS_ENV_ARGS=""
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   157
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   158
  if test "x$VS_COMNTOOLS" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   159
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   160
        [$VS_COMNTOOLS/../..], [$VS_COMNTOOLS_VAR variable])
17818
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   161
  fi
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   162
  if test "x$PROGRAMFILES" != x; then
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   163
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   164
        [$PROGRAMFILES/$VS_INSTALL_DIR], [well-known name])
17818
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   165
  fi
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   166
  # Work around the insanely named ProgramFiles(x86) env variable
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   167
  PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   168
  if test "x$PROGRAMFILES_X86" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   169
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   170
        [$PROGRAMFILES_X86/$VS_INSTALL_DIR], [well-known name])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   171
  fi
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   172
  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   173
      [C:/Program Files/$VS_INSTALL_DIR], [well-known name])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   174
  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   175
      [C:/Program Files (x86)/$VS_INSTALL_DIR], [well-known name])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   176
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   177
  if test "x$SDK_INSTALL_DIR" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   178
    if test "x$ProgramW6432" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   179
      TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   180
          [$ProgramW6432/$SDK_INSTALL_DIR], [well-known name])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   181
    fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   182
    if test "x$PROGRAMW6432" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   183
      TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   184
          [$PROGRAMW6432/$SDK_INSTALL_DIR], [well-known name])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   185
    fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   186
    if test "x$PROGRAMFILES" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   187
      TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   188
          [$PROGRAMFILES/$SDK_INSTALL_DIR], [well-known name])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   189
    fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   190
    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   191
        [C:/Program Files/$SDK_INSTALL_DIR], [well-known name])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   192
    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   193
        [C:/Program Files (x86)/$SDK_INSTALL_DIR], [well-known name])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   194
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   195
])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   196
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   197
################################################################################
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   198
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   199
AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   200
[
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   201
  AC_ARG_WITH(toolchain-version, [AS_HELP_STRING([--with-toolchain-version],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   202
      [the version of the toolchain to look for, use '--help' to show possible values @<:@platform dependent@:>@])])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   203
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   204
  if test "x$with_toolchain_version" = xlist; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   205
    # List all toolchains
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   206
    AC_MSG_NOTICE([The following toolchain versions are valid on this platform:])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   207
    for version in $VALID_VS_VERSIONS; do
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   208
      eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version}
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   209
      $PRINTF "  %-10s  %s\n" $version "$VS_DESCRIPTION"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   210
    done
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   211
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   212
    exit 0
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   213
  elif test "x$with_toolchain_version" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   214
    # User override; check that it is valid
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   215
    if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   216
      AC_MSG_NOTICE([Visual Studio version $with_toolchain_version is not valid.])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   217
      AC_MSG_NOTICE([Valid Visual Studio versions: $VALID_VS_VERSIONS.])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   218
      AC_MSG_ERROR([Cannot continue.])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   219
    fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   220
    VS_VERSIONS_PROBE_LIST="$with_toolchain_version"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   221
  else
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   222
    # No flag given, use default
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   223
    VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   224
  fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   225
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   226
  for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   227
    TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE([$VS_VERSION])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   228
    if test "x$VS_ENV_CMD" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   229
      TOOLCHAIN_VERSION=$VS_VERSION
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   230
      eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   231
      eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   232
      eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   233
      eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   234
      # The rest of the variables are already evaled while probing
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   235
      AC_MSG_NOTICE([Found $VS_DESCRIPTION])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   236
      break
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   237
    fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   238
  done
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   239
])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   240
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   241
################################################################################
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   242
# Check if the VS env variables were setup prior to running configure.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   243
# If not, then find vcvarsall.bat and run it automatically, and integrate
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   244
# the set env variables into the spec file.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   245
AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   246
[
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19758
diff changeset
   247
  # Store path to cygwin link.exe to help excluding it when searching for
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   248
  # VS linker. This must be done before changing the PATH when looking for VS.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   249
  AC_PATH_PROG(CYGWIN_LINK, link)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   250
  if test "x$CYGWIN_LINK" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   251
    AC_MSG_CHECKING([if the first found link.exe is actually the Cygwin link tool])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   252
    "$CYGWIN_LINK" --version > /dev/null
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   253
    if test $? -eq 0 ; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   254
      AC_MSG_RESULT([yes])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   255
    else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   256
      AC_MSG_RESULT([no])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   257
      # This might be the VS linker. Don't exclude it later on.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   258
      CYGWIN_LINK=""
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   259
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   260
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   261
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   262
  # First-hand choice is to locate and run the vsvars bat file.
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   263
  TOOLCHAIN_FIND_VISUAL_STUDIO
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   264
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   265
  if test "x$VS_ENV_CMD" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   266
    # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   267
    BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   268
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   269
    # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   270
    AC_MSG_NOTICE([Trying to extract Visual Studio environment variables])
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   271
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   272
    # We need to create a couple of temporary files.
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   273
    VS_ENV_TMP_DIR="$OUTPUT_ROOT/vs-env"
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   274
    $MKDIR -p $VS_ENV_TMP_DIR
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   275
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   276
    # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment).
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   277
    # Instead create a shell script which will set the relevant variables when run.
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   278
    WINPATH_VS_ENV_CMD="$VS_ENV_CMD"
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   279
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD])
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   280
    WINPATH_BASH="$BASH"
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   281
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   282
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   283
    # Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   284
    # script (executable by bash) that will setup the important variables.
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   285
    EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat"
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   286
    $ECHO "@echo off" >  $EXTRACT_VC_ENV_BAT_FILE
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   287
    # This will end up something like:
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   288
    # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   289
    $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   290
    # These will end up something like:
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   291
    # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   292
    # The trailing space for everyone except PATH is no typo, but is needed due
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   293
    # to trailing \ in the Windows paths. These will be stripped later.
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   294
    $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
28287
d031becc9e35 8068735: Configure fails on Windows if Visual Studio $LIB/$INCLUDE is lower case
ihse
parents: 27595
diff changeset
   295
    $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
d031becc9e35 8068735: Configure fails on Windows if Visual Studio $LIB/$INCLUDE is lower case
ihse
parents: 27595
diff changeset
   296
    $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   297
    $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   298
    $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   299
    $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   300
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   301
    # Now execute the newly created bat file.
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   302
    # The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   303
    # Change directory so we don't need to mess with Windows paths in redirects.
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   304
    cd $VS_ENV_TMP_DIR
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   305
    cmd /c extract-vs-env.bat | $CAT
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   306
    cd $CURDIR
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   307
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   308
    if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   309
      AC_MSG_NOTICE([Could not succesfully extract the envionment variables needed for the VS setup.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   310
      AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   311
      AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   312
      AC_MSG_ERROR([Cannot continue])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   313
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   314
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19758
diff changeset
   315
    # Now set all paths and other env variables. This will allow the rest of
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   316
    # the configure script to find and run the compiler in the proper way.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   317
    AC_MSG_NOTICE([Setting extracted environment variables])
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   318
    . $VS_ENV_TMP_DIR/set-vs-env.sh
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   319
    # Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   320
    # also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR.
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   321
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   322
    # We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   323
    AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   324
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   325
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   326
  # At this point, we should have correct variables in the environment, or we can't continue.
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   327
  AC_MSG_CHECKING([for Visual Studio variables])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19758
diff changeset
   328
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   329
  if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   330
    if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   331
      AC_MSG_RESULT([present but broken])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   332
      AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   333
    else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   334
      AC_MSG_RESULT([ok])
28809
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   335
      # Remove any trailing "\" ";" and " " from the variables.
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   336
      VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'`
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   337
      VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'`
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   338
      VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   339
      WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   340
      WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
23432
f8964bac59db 8039030: 9-dev windows-i586 build failed with mktemp: command not found
erikj
parents: 23429
diff changeset
   341
      # Remove any paths containing # (typically F#) as that messes up make. This
f8964bac59db 8039030: 9-dev windows-i586 build failed with mktemp: command not found
erikj
parents: 23429
diff changeset
   342
      # is needed if visual studio was installed with F# support.
f8964bac59db 8039030: 9-dev windows-i586 build failed with mktemp: command not found
erikj
parents: 23429
diff changeset
   343
      VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[[^:#]]*#[^:]*://g'`
23429
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   344
fe4f0848a307 8035751: Clean up Visual Studio detection logic
ihse
parents: 20643
diff changeset
   345
      AC_SUBST(VS_PATH)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   346
      AC_SUBST(VS_INCLUDE)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   347
      AC_SUBST(VS_LIB)
28809
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   348
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   349
      # Convert VS_INCLUDE into SYSROOT_CFLAGS
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   350
      OLDIFS="$IFS"
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   351
      IFS=";"
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   352
      for i in $VS_INCLUDE; do
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   353
        ipath=$i
29065
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   354
        # Only process non-empty elements
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   355
        if test "x$ipath" != x; then
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   356
          IFS="$OLDIFS"
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   357
          # Check that directory exists before calling fixup_path
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   358
          testpath=$ipath
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   359
          BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath])
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   360
          if test -d "$testpath"; then
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   361
            BASIC_FIXUP_PATH([ipath])
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   362
            SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   363
          fi
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   364
          IFS=";"
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   365
        fi
28809
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   366
      done
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   367
      # Convert VS_LIB into SYSROOT_LDFLAGS
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   368
      for i in $VS_LIB; do
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   369
        libpath=$i
29065
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   370
        # Only process non-empty elements
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   371
        if test "x$libpath" != x; then
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   372
          IFS="$OLDIFS"
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   373
          # Check that directory exists before calling fixup_path
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   374
          testpath=$libpath
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   375
          BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath])
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   376
          if test -d "$testpath"; then
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   377
            BASIC_FIXUP_PATH([libpath])
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   378
            SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   379
          fi
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   380
          IFS=";"
907bcc4ce290 8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents: 28908
diff changeset
   381
        fi
28809
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   382
      done
6481e27e00ee 8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents: 28287
diff changeset
   383
      IFS="$OLDIFS"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   384
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   385
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   386
    AC_MSG_RESULT([not found])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   387
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   388
    if test "x$VS_ENV_CMD" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   389
      AC_MSG_NOTICE([Cannot locate a valid Visual Studio or Windows SDK installation on disk,])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   390
      AC_MSG_NOTICE([nor is this script run from a Visual Studio command prompt.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   391
    else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   392
      AC_MSG_NOTICE([Running the extraction script failed.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   393
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   394
    AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   395
    AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   396
    AC_MSG_ERROR([Cannot continue])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   397
  fi
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   398
])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 19758
diff changeset
   399
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   400
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL],
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   401
[
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   402
  DLL_NAME="$1"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   403
  POSSIBLE_MSVC_DLL="$2"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   404
  METHOD="$3"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   405
  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   406
    AC_MSG_NOTICE([Found $1 at $POSSIBLE_MSVC_DLL using $METHOD])
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
   407
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   408
    # Need to check if the found msvcr is correct architecture
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   409
    AC_MSG_CHECKING([found $1 architecture])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   410
    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
25882
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   411
    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   412
      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   413
      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   414
      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   415
        CORRECT_MSVCR_ARCH="PE32 executable"
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   416
      else
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   417
        CORRECT_MSVCR_ARCH="PE32+ executable"
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   418
      fi
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   419
    else
25882
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   420
      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   421
        CORRECT_MSVCR_ARCH=386
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   422
      else
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   423
        CORRECT_MSVCR_ARCH=x86-64
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 23432
diff changeset
   424
      fi
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   425
    fi
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   426
    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   427
      AC_MSG_RESULT([ok])
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   428
      MSVC_DLL="$POSSIBLE_MSVC_DLL"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   429
      AC_MSG_CHECKING([for $1])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   430
      AC_MSG_RESULT([$MSVC_DLL])
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   431
    else
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   432
      AC_MSG_RESULT([incorrect, ignoring])
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   433
      AC_MSG_NOTICE([The file type of the located $1 is $MSVC_DLL_FILETYPE])
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   434
    fi
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   435
  fi
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   436
])
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   437
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   438
AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   439
[
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   440
  VAR_NAME="$1"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   441
  DLL_NAME="$2"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   442
  MSVC_DLL=
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   443
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   444
  if test "x$MSVC_DLL" = x; then
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   445
    # Probe: Using well-known location from Visual Studio 10.0
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   446
    if test "x$VCINSTALLDIR" != x; then
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   447
      CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   448
      BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   449
      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   450
        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   451
      else
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   452
        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   453
      fi
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   454
      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   455
      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   456
          [well-known location in VCINSTALLDIR])
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   457
    fi
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   458
  fi
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   459
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   460
  if test "x$MSVC_DLL" = x; then
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   461
    # Probe: Check in the Boot JDK directory.
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   462
    POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   463
    TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   464
        [well-known location in Boot JDK])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   465
  fi
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
   466
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   467
  if test "x$MSVC_DLL" = x; then
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
   468
    # Probe: Look in the Windows system32 directory
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   469
    CYGWIN_SYSTEMROOT="$SYSTEMROOT"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   470
    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   471
    POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME"
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   472
    TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   473
        [well-known location in SYSTEMROOT])
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   474
  fi
27595
cff167b3bfa2 8065914: Various improvements and cleanup of build system
ihse
parents: 26400
diff changeset
   475
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   476
  if test "x$MSVC_DLL" = x; then
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   477
    # Probe: If Visual Studio Express is installed, there is usually one with the debugger
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   478
    if test "x$VS100COMNTOOLS" != x; then
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   479
      CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   480
      BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR)
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   481
      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   482
        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   483
	    | $GREP -i /x64/ | $HEAD --lines 1`
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   484
      else
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   485
        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   486
	    | $GREP -i /x86/ | $HEAD --lines 1`
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   487
      fi
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   488
      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   489
          [search of VS100COMNTOOLS])
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   490
    fi
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   491
  fi
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
   492
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   493
  if test "x$MSVC_DLL" = x; then
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   494
    # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   495
    # (This was the original behaviour; kept since it might turn something up)
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   496
    if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   497
      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   498
        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   499
	    | $GREP x64 | $HEAD --lines 1`
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   500
      else
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   501
        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   502
	    | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   503
        if test "x$POSSIBLE_MSVC_DLL" = x; then
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   504
          # We're grasping at straws now...
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   505
          POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   506
	      | $HEAD --lines 1`
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   507
        fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   508
      fi
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
   509
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   510
      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   511
          [search of VCINSTALLDIR])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   512
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   513
  fi
29643
89e91c724316 8076531: Switch default compiler on Windows to VS2013
erikj
parents: 29065
diff changeset
   514
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   515
  if test "x$MSVC_DLL" = x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   516
    AC_MSG_CHECKING([for $DLL_NAME])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   517
    AC_MSG_RESULT([no])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   518
    AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   519
  fi
27595
cff167b3bfa2 8065914: Various improvements and cleanup of build system
ihse
parents: 26400
diff changeset
   520
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   521
  $1=$MSVC_DLL
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   522
  BASIC_FIXUP_PATH($1)
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   523
  AC_SUBST($1, [$]$1)
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   524
])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   525
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   526
AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   527
[
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   528
  AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   529
      [path to microsoft C runtime dll (msvcr*.dll) (Windows only) @<:@probed@:>@])])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   530
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   531
  if test "x$with_msvcr_dll" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   532
    # If given explicitely by user, do not probe. If not present, fail directly.
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   533
    TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcr_dll],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   534
        [--with-msvcr-dll])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   535
    if test "x$MSVC_DLL" = x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   536
      AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   537
    fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   538
  else
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   539
    TOOLCHAIN_SETUP_MSVC_DLL([MSVCR_DLL], [${MSVCR_NAME}])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   540
  fi
20643
fa095e917446 8001912: Improve detection of msvcr100.dll
ihse
parents: 20363
diff changeset
   541
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   542
  AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   543
      [path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   544
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   545
  if test "x$MSVCP_NAME" != "x"; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   546
    if test "x$with_msvcp_dll" != x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   547
      # If given explicitely by user, do not probe. If not present, fail directly.
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   548
      TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcp_dll],
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   549
          [--with-msvcp-dll])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   550
      if test "x$MSVC_DLL" = x; then
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   551
        AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   552
      fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   553
    else
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   554
      TOOLCHAIN_SETUP_MSVC_DLL([MSVCP_DLL], [${MSVCP_NAME}])
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   555
    fi
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 28287
diff changeset
   556
  fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   557
])