common/autoconf/toolchain_windows.m4
author jmasa
Fri, 16 Aug 2013 06:12:46 -0700
changeset 19548 e81917358076
parent 18476 99bf8dc53505
child 19758 3e519fa7e632
permissions -rw-r--r--
8022817: CMS should not shrink if compaction was not done Reviewed-by: ysr, mgerdin
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
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    26
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    27
[
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    28
  if test "x$VS_ENV_CMD" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    29
    VS100BASE="$1"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    30
    METHOD="$2"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    31
    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS100BASE)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    32
    if test -d "$VS100BASE"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    33
      if test -f "$VS100BASE/$VCVARSFILE"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    34
        AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    35
        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    36
      else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    37
        AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    38
        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
    39
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    40
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    41
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    42
])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    43
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    44
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    45
[
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    46
  if test "x$VS_ENV_CMD" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    47
    WIN_SDK_BASE="$1"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    48
    METHOD="$2"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    49
    BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    50
    if test -d "$WIN_SDK_BASE"; then
14565
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
    51
      # 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
    52
      # lib dir is not going to work.
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
    53
      if test ! -d "$WIN_SDK_BASE/../lib"; then
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
    54
        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
    55
        AC_MSG_NOTICE([Warning: Installation is broken, lib dir is missing. Ignoring])
c499bdf08f27 8003414: build-infra: fails on on windows
erikj
parents: 14562
diff changeset
    56
      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    57
        AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    58
        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    59
        if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    60
          VS_ENV_ARGS="/x86"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    61
        else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    62
          VS_ENV_ARGS="/x64"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    63
        fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    64
      else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    65
        AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    66
        AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    67
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    68
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    69
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    70
])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    71
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    72
AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    73
[
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    74
  if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    75
    VCVARSFILE="vc/bin/vcvars32.bat"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    76
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    77
    VCVARSFILE="vc/bin/amd64/vcvars64.bat"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    78
  fi 
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    79
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    80
  VS_ENV_CMD=""
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    81
  VS_ENV_ARGS=""
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    82
  if test "x$with_toolsdir" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    83
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$with_toolsdir/../..], [--with-tools-dir])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    84
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    85
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    86
  if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    87
    # Having specified an argument which is incorrect will produce an instant failure;
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    88
    # we should not go on looking
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    89
    AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid Visual Studio installation])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    90
    AC_MSG_NOTICE([Please point to the VC/bin directory within the Visual Studio installation])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    91
    AC_MSG_ERROR([Cannot locate a valid Visual Studio installation])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    92
  fi  
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    93
17818
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
    94
  if test "x$VS100COMNTOOLS" != x; then
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
    95
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable])
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
    96
  fi
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
    97
  if test "x$PROGRAMFILES" != x; then
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
    98
    TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$PROGRAMFILES/Microsoft Visual Studio 10.0], [well-known name])
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
    99
  fi
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   100
  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files/Microsoft Visual Studio 10.0], [well-known name])
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   101
  TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files (x86)/Microsoft Visual Studio 10.0], [well-known name])
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   102
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   103
  if test "x$ProgramW6432" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   104
    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   105
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   106
  if test "x$PROGRAMW6432" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   107
    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   108
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   109
  if test "x$PROGRAMFILES" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   110
    TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   111
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   112
  TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   113
  TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   114
])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   115
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   116
# Check if the VS env variables were setup prior to running configure.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   117
# If not, then find vcvarsall.bat and run it automatically, and integrate
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   118
# the set env variables into the spec file.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   119
AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   120
[
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   121
  # Store path to cygwin link.exe to help excluding it when searching for 
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   122
  # 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
   123
  AC_PATH_PROG(CYGWIN_LINK, link)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   124
  if test "x$CYGWIN_LINK" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   125
    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
   126
    "$CYGWIN_LINK" --version > /dev/null
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   127
    if test $? -eq 0 ; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   128
      AC_MSG_RESULT([yes])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   129
    else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   130
      AC_MSG_RESULT([no])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   131
      # This might be the VS linker. Don't exclude it later on.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   132
      CYGWIN_LINK=""
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   133
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   134
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   135
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   136
  # First-hand choice is to locate and run the vsvars bat file.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   137
  TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   138
  if test "x$VS_ENV_CMD" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   139
    # 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
   140
    BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   141
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   142
    # 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
   143
    AC_MSG_NOTICE([Trying to extract Visual Studio environment variables])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   144
    cd $OUTPUT_ROOT
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   145
    # FIXME: The code betweeen ---- was inlined from a separate script and is not properly adapted
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   146
    # to autoconf standards.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   147
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   148
    #----
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   149
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   150
    # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   151
    # but calculate the difference in Cygwin environment before/after running it and then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   152
    # apply the diff.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   153
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   154
    if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   155
      _vs10varsall=`cygpath -a -m -s "$VS_ENV_CMD"`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   156
      _dosvs10varsall=`cygpath -a -w -s $_vs10varsall`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   157
      _dosbash=`cygpath -a -w -s \`which bash\`.*`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   158
    else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   159
      _dosvs10varsall=`cmd //c echo $VS_ENV_CMD`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   160
      _dosbash=`cmd //c echo \`which bash\``
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   161
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   162
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   163
    # generate the set of exported vars before/after the vs10 setup
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   164
    $ECHO "@echo off"                                           >  localdevenvtmp.bat
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   165
    $ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export0" >> localdevenvtmp.bat
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   166
    $ECHO "call $_dosvs10varsall $VS_ENV_ARGS"                  >> localdevenvtmp.bat
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   167
    $ECHO "$_dosbash -c \"export -p\" > localdevenvtmp.export1" >> localdevenvtmp.bat
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   168
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   169
    # Now execute the newly created bat file.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   170
    # The | cat is to stop SetEnv.Cmd to mess with system colors on msys
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   171
    cmd /c localdevenvtmp.bat | cat
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   172
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   173
    # apply the diff (less some non-vs10 vars named by "!")
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   174
    $SORT localdevenvtmp.export0 | $GREP -v "!" > localdevenvtmp.export0.sort
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   175
    $SORT localdevenvtmp.export1 | $GREP -v "!" > localdevenvtmp.export1.sort
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   176
    $COMM -1 -3 localdevenvtmp.export0.sort localdevenvtmp.export1.sort > localdevenv.sh
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   177
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   178
    # cleanup
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   179
    $RM localdevenvtmp*
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   180
    #----
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   181
    cd $CURDIR
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   182
    if test ! -s $OUTPUT_ROOT/localdevenv.sh; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   183
      AC_MSG_RESULT([no])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   184
      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
   185
      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
   186
      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
   187
      AC_MSG_ERROR([Cannot continue])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   188
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   189
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   190
    # Now set all paths and other env variables. This will allow the rest of 
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   191
    # the configure script to find and run the compiler in the proper way.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   192
    AC_MSG_NOTICE([Setting extracted environment variables])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   193
    . $OUTPUT_ROOT/localdevenv.sh
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   194
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   195
    # 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
   196
    AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   197
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   198
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   199
  # At this point, we should have corrent variables in the environment, or we can't continue.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   200
  AC_MSG_CHECKING([for Visual Studio variables])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   201
  
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   202
  if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   203
    if test "x$INCLUDE" = x || test "x$LIB" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   204
      AC_MSG_RESULT([present but broken])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   205
      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
   206
    else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   207
      AC_MSG_RESULT([ok])
14562
ab12d5824d04 8003819: build-infra: backslashes at end of LIB and INCLUDE in spec.gmk
erikj
parents: 14111
diff changeset
   208
      # Remove any trailing \ from INCLUDE and LIB to avoid trouble in spec.gmk.
ab12d5824d04 8003819: build-infra: backslashes at end of LIB and INCLUDE in spec.gmk
erikj
parents: 14111
diff changeset
   209
      VS_INCLUDE=`$ECHO "$INCLUDE" | $SED 's/\\\\$//'`
ab12d5824d04 8003819: build-infra: backslashes at end of LIB and INCLUDE in spec.gmk
erikj
parents: 14111
diff changeset
   210
      VS_LIB=`$ECHO "$LIB" | $SED 's/\\\\$//'`
18476
99bf8dc53505 8009315: F# on PATH breaks Cygwin tools (mkdir, echo, mktemp ...)
tbell
parents: 17818
diff changeset
   211
      # Remove any paths containing # (typically F#) as that messes up make
99bf8dc53505 8009315: F# on PATH breaks Cygwin tools (mkdir, echo, mktemp ...)
tbell
parents: 17818
diff changeset
   212
      PATH=`$ECHO "$PATH" | $SED 's/[[^:#]]*#[^:]*://g'`
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   213
      VS_PATH="$PATH"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   214
      AC_SUBST(VS_INCLUDE)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   215
      AC_SUBST(VS_LIB)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   216
      AC_SUBST(VS_PATH)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   217
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   218
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   219
    AC_MSG_RESULT([not found])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   220
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   221
    if test "x$VS_ENV_CMD" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   222
      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
   223
      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
   224
    else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   225
      AC_MSG_NOTICE([Running the extraction script failed.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   226
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   227
    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
   228
    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
   229
    AC_MSG_ERROR([Cannot continue])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   230
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   231
  
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   232
  AC_MSG_CHECKING([for msvcr100.dll])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   233
  AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   234
      [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   235
  if test "x$with_msvcr_dll" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   236
    MSVCR_DLL="$with_msvcr_dll"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   237
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   238
    if test "x$VCINSTALLDIR" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   239
      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   240
        MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   241
      else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   242
        MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   243
        if test "x$MSVCR_DLL" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   244
          MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   245
        fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   246
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   247
      if test "x$MSVCR_DLL" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   248
        AC_MSG_NOTICE([msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   249
      else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   250
        AC_MSG_NOTICE([Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   251
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   252
    fi
17818
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   253
    # Try some fallback alternatives
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   254
    if test "x$MSVCR_DLL" = x; then
17818
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   255
      # If visual studio express is installed, there is usually one with the debugger
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   256
      if test "x$VS100COMNTOOLS" != x; then
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   257
        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   258
          MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1`
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   259
          AC_MSG_NOTICE([msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS..])
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   260
        fi
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   261
      fi
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   262
    fi
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   263
    if test "x$MSVCR_DLL" = x; then
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   264
      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   265
        # Fallback for 32bit builds, look in the windows directory.
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   266
        if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   267
          AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32])
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   268
          MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
cfaa38a17d56 8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents: 15844
diff changeset
   269
        fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   270
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   271
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   272
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   273
  if test "x$MSVCR_DLL" = x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   274
    AC_MSG_RESULT([no])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   275
    AC_MSG_ERROR([Could not find msvcr100.dll !])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   276
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   277
  AC_MSG_RESULT([$MSVCR_DLL])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   278
  BASIC_FIXUP_PATH(MSVCR_DLL)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
   279
])
15842
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   280
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   281
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   282
# Setup the DXSDK paths
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   283
AC_DEFUN([TOOLCHAIN_SETUP_DXSDK],
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   284
[
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   285
  AC_ARG_WITH(dxsdk, [AS_HELP_STRING([--with-dxsdk],
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   286
      [the DirectX SDK (Windows only) @<:@probed@:>@])])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   287
  AC_ARG_WITH(dxsdk-lib, [AS_HELP_STRING([--with-dxsdk-lib],
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   288
      [the DirectX SDK lib directory (Windows only) @<:@probed@:>@])])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   289
  AC_ARG_WITH(dxsdk-include, [AS_HELP_STRING([--with-dxsdk-include],
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   290
      [the DirectX SDK include directory (Windows only) @<:@probed@:>@])])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   291
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   292
  AC_MSG_CHECKING([for DirectX SDK])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   293
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   294
  if test "x$with_dxsdk" != x; then
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   295
    dxsdk_path="$with_dxsdk"
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   296
  elif test "x$DXSDK_DIR" != x; then
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   297
    dxsdk_path="$DXSDK_DIR"
15844
13e9af9186a2 8009819: build-infra: RE jdk8 build forest fails for windows since addition of --with-dxsdk
tbell
parents: 15842
diff changeset
   298
  elif test -d "C:/DXSDK"; then
13e9af9186a2 8009819: build-infra: RE jdk8 build forest fails for windows since addition of --with-dxsdk
tbell
parents: 15842
diff changeset
   299
    dxsdk_path="C:/DXSDK"
15842
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   300
  else
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   301
    AC_MSG_ERROR([Could not find the DirectX SDK])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   302
  fi
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   303
  AC_MSG_RESULT([$dxsdk_path])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   304
  BASIC_FIXUP_PATH(dxsdk_path)
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   305
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   306
  AC_MSG_CHECKING([for DirectX SDK lib dir])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   307
  if test "x$with_dxsdk_lib" != x; then
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   308
    DXSDK_LIB_PATH="$with_dxsdk_lib"
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   309
  elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   310
    DXSDK_LIB_PATH="$dxsdk_path/Lib/x64"
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   311
  else
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   312
    DXSDK_LIB_PATH="$dxsdk_path/Lib"
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   313
  fi
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   314
  # dsound.lib is linked to in jsoundds
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   315
  if test ! -f "$DXSDK_LIB_PATH/dsound.lib"; then
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   316
    AC_MSG_ERROR([Invalid DirectX SDK lib dir])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   317
  fi
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   318
  AC_MSG_RESULT([$DXSDK_LIB_PATH])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   319
  BASIC_FIXUP_PATH(DXSDK_LIB_PATH)
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   320
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   321
  AC_MSG_CHECKING([for DirectX SDK include dir])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   322
  if test "x$with_dxsdk_include" != x; then
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   323
    DXSDK_INCLUDE_PATH="$with_dxsdk_include"
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   324
  else
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   325
    DXSDK_INCLUDE_PATH="$dxsdk_path/Include"
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   326
  fi
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   327
  # dsound.h is included in jsoundds
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   328
  if test ! -f "$DXSDK_INCLUDE_PATH/dsound.h"; then
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   329
    AC_MSG_ERROR([Invalid DirectX SDK lib dir])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   330
  fi
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   331
  AC_MSG_RESULT([$DXSDK_INCLUDE_PATH])
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   332
  BASIC_FIXUP_PATH(DXSDK_INCLUDE_PATH)
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   333
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   334
  AC_SUBST(DXSDK_LIB_PATH)
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   335
  AC_SUBST(DXSDK_INCLUDE_PATH)
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   336
  LDFLAGS_JDK="$LDFLAGS_JDK -libpath:$DXSDK_LIB_PATH"
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 14565
diff changeset
   337
])