jdk/make/jdk_generic_profile.sh
author tbell
Wed, 01 Apr 2009 04:44:30 -0700
changeset 2302 5ccdc0e16a39
parent 2300 103e268e2d16
child 4111 ffc9c33335f4
permissions -rw-r--r--
6824595: OpenJDK fix breaks product build for jdk7 Reviewed-by: xdono, ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#!/bin/sh
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
#
715
f16baef3a20e 6719955: Update copyright year
xdono
parents: 642
diff changeset
     4
# Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#############################################################################
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
# Generic build profile.sh for all platforms, works in bash, sh, and ksh.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
# Copy this file to your own area, and edit it to suit your needs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
# Ideally you either won't need to set the ALT_* variables because the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#   build system will find what it needs through system provided paths
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#   or environment variables, or you have installed the component in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#   recommended default path.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
# If you find yourself forced to set an ALT_* environment variable and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#   suspect we could have figured it out automatically, please let us know.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
# Most ALT_* directory defaults are based on being in the parent directory in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#    ALT_SLASH_JAVA, so it's possible to create for example a "C:/jdk6"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#    directory, assign that to ALT_SLASH_JAVA, and place all the components
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#    in that directory. This could also minimize the ALT_* environment
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#    variables you need to set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
########
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
# Assumes basic unix utilities are in the PATH already (uname, hostname, etc.).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
# On Windows, assumes PROCESSOR_IDENTIFIER, VS71COMNTOOLS,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
#   SYSTEMROOT (or SystemRoot), COMPUTERNAME (or hostname works), and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
#   USERNAME is defined in the environment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
#   This profile does not rely on using vcvars32.bat and 64bit Setup.bat.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
#   Uses CYGWIN cygpath to make sure paths are space-free.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
# The JDK Makefiles may change in the future, making some of these
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#   settings unnecessary or redundant.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
# This is a working example, but may or may not work on all systems.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
#############################################################################
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
# WARNING: This file will clobber the value of some environment variables.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
# Sets up these environment variables for doing JDK builds:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
#    USERNAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
#    COMPUTERNAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#    PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
#    Windows Only:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#      LIB
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
#      INCLUDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#      PS1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
#      SHELL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
# Attempts to set these variables for the JDK builds:           
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
#    ALT_COMPILER_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
#    ALT_BOOTDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
#    ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#    ALT_CLOSED_JDK_IMPORT_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
#    Windows Only:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
#      ALT_UNIXCOMMAND_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
#      ALT_MSDEVTOOLS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
#      ALT_DXSDK_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
#      ALT_MSVCRT_DLL_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
#      ALT_MSVCR71_DLL_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#############################################################################
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
# Keep in mind that at this point, we are running in some kind of shell
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
#   (sh, ksh, or bash). We don't know if it's solaris, linux, or windows 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
#   CYGWIN. We need to figure that out.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
# Find user name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
if [ "${USERNAME}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    USERNAME="${LOGNAME}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
if [ "${USERNAME}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    USERNAME="${USER}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
export USERNAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
# Find machine name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
if [ "${COMPUTERNAME}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    COMPUTERNAME="$(hostname)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
export COMPUTERNAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
# Boot jdk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
bootjdk=jdk1.6.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
importjdk=jdk1.7.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
osname=$(uname -s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
if [ "${osname}" = SunOS ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
  # System place where JDK installed images are stored?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
  jdk_instances=/usr/jdk/instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
642
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   122
  # Get the Sun Studio compilers (and latest patches for them too)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
  if [ "${ALT_COMPILER_PATH}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    ALT_COMPILER_PATH=/opt/SUNWspro/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    export ALT_COMPILER_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
  if [ ! -d ${ALT_COMPILER_PATH} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    echo "WARNING: Cannot access ALT_COMPILER_PATH=${ALT_COMPILER_PATH}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  # Place compiler path early in PATH to avoid 'cc' conflicts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
  path4sdk=${ALT_COMPILER_PATH}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
  # Make sure these are unset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
  unset JAVA_HOME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
  unset LD_LIBRARY_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
  # Build in C locale
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
  LANG=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
  export LANG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
  LC_ALL=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
  export LC_ALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
  umask 002
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
elif [ "${osname}" = Linux ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
  # System place where JDK installed images are stored?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
  jdk_instances=/opt/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
  # Use compilers from /usr/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
  path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
  # Make sure these are unset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
  unset JAVA_HOME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
  unset LD_LIBRARY_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
  # Build in C locale
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
  LANG=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
  export LANG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
  LC_ALL=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
  export LC_ALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  umask 002
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
  # System place where JDK installed images are stored?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
  jdk_instances="C:"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
  # Windows: Differs on CYGWIN and the compiler available.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
  #   Also, blanks in pathnames gives make headaches, so anything placed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
  #   in any ALT_* variable should be the short windows DOS names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
   
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
  # Check CYGWIN (should have already been done)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
  #   Assumption here is that you are in a shell window via cygwin.
2300
103e268e2d16 6822374: Windows: detect X64 when PROCESSOR_IDENTIFIER contains EM64T or Intel64
ohair
parents: 715
diff changeset
   177
  proc_arch=`echo "$(PROCESSOR_IDENTIFIER)" | expand | cut -d' ' -f1 | sed -e 's@x86@X86@g' -e 's@Intel64@X64@g' -e 's@em64t@X64@g' -e 's@EM64T@X64@g' -e 's@amd64@X64@g' -e 's@AMD64@X64@g' -e 's@ia64@IA64@g'`
103e268e2d16 6822374: Windows: detect X64 when PROCESSOR_IDENTIFIER contains EM64T or Intel64
ohair
parents: 715
diff changeset
   178
  if [ "${proc_arch}" = "X64" ] ; then
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    windows_arch=amd64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    windows_arch=i586
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
  # We need to check if we are running a CYGWIN shell
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
  if [ "$(uname -a | fgrep Cygwin)" != "" -a -f /bin/cygpath ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    # Utility to convert to short pathnames without spaces
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    cygpath="/usr/bin/cygpath -a -m -s"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    # Most unix utilities are in the /usr/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    unixcommand_path="/usr/bin"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    # Make the prompt tell you CYGWIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    export PS1="CYGWIN:${COMPUTERNAME}:${USERNAME}[\!] "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    echo "ERROR: Cannot find CYGWIN on this machine"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
  if [ "${ALT_UNIXCOMMAND_PATH}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    unixcommand_path=${ALT_UNIXCOMMAND_PATH}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
  # Default shell
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
  export SHELL="${unixcommand_path}/sh"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
  # Setup path system (verify this is right)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
  if [ "${SystemRoot}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    sys_root=$(${cygpath} "${SystemRoot}")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
  elif [ "${SYSTEMROOT}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    sys_root=$(${cygpath} "${SYSTEMROOT}")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    sys_root=$(${cygpath} "C:/WINNT")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
  path4sdk="${unixcommand_path};${sys_root}/system32;${sys_root};${sys_root}/System32/Wbem"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
  if [ ! -d "${sys_root}" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    echo "WARNING: No system root found at: ${sys_root}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
  # Compiler setup (nasty part)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
  #   NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
  #   NOTE: CYGWIN has a link.exe too, make sure the compilers are first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
  if [ "${windows_arch}" = i586 ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    # 32bit Windows compiler settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    vs_root=$(${cygpath} "${VS71COMNTOOLS}/../..")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    msdev_root="${vs_root}/Common7/Tools"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    msdevtools_path="${msdev_root}/bin"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    vc7_root="${vs_root}/Vc7"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    compiler_path="${vc7_root}/bin"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    platform_sdk="${vc7_root}/PlatformSDK"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    # LIB and INCLUDE must use ; as a separator
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    include4sdk="${vc7_root}/atlmfc/include"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    include4sdk="${include4sdk};${vc7_root}/include"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    include4sdk="${include4sdk};${platform_sdk}/include"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    lib4sdk="${lib4sdk};${vc7_root}/lib"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    lib4sdk="${lib4sdk};${platform_sdk}/lib"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    # Search path and DLL locating path
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    path4sdk="${compiler_path};${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
  elif [ "${windows_arch}" = amd64 ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    # AMD64 64bit Windows compiler settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    if [ "${ALT_DEPLOY_MSSDK}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
      platform_sdk=${ALT_DEPLOY_MSSDK}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
      platform_sdk=$(${cygpath} "C:/Program Files/Microsoft Platform SDK/")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    if [ "${ALT_COMPILER_PATH}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
      compiler_path=${ALT_COMPILER_PATH}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
      if [ "${ALT_DEPLOY_MSSDK}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        platform_sdk=${ALT_COMPILER_PATH}/../../../..
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
      fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
      compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    if [ "${ALT_MSDEVTOOLS_PATH}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
      msdevtools_path=${ALT_MSDEVTOOLS_PATH}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
      msdevtools_path="${platform_sdk}/Bin/win64/x86/AMD64"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    msdevtools_path="${compiler_path}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    # LIB and INCLUDE must use ; as a separator
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    include4sdk="${platform_sdk}/Include"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    include4sdk="${include4sdk};${platform_sdk}/Include/atl"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
    include4sdk="${include4sdk};${platform_sdk}/Include/crt"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    lib4sdk="${platform_sdk}/Lib/AMD64"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    # Search path and DLL locating path
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    #   WARNING: CYGWIN has a link.exe too, make sure compilers are first
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    path4sdk="${platform_sdk}/bin;${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    path4sdk="${compiler_path};${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
  # Export LIB and INCLUDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
  unset lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
  unset Lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
  LIB="${lib4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
  export LIB
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
  unset include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
  unset Include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
  INCLUDE="${include4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
  export INCLUDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
  # Turn all \\ into /, remove duplicates and trailing /
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
  slash_path="$(echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g')"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
  path4sdk="${slash_path}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
   
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
  # Convert path4sdk to cygwin style
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
  path4sdk="$(/usr/bin/cygpath -p ${path4sdk})"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
# Get the previous JDK to be used to bootstrap the build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
if [ "${ALT_BOOTDIR}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
  ALT_BOOTDIR=${jdk_instances}/${bootjdk}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
  export ALT_BOOTDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
if [ ! -d ${ALT_BOOTDIR} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
  echo "WARNING: Cannot access ALT_BOOTDIR=${ALT_BOOTDIR}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
# Get the import JDK to be used to get hotspot VM if not built
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
if [ "${ALT_JDK_IMPORT_PATH}" = "" -a -d ${jdk_instances}/${importjdk} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
  ALT_JDK_IMPORT_PATH=${jdk_instances}/${importjdk}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
  export ALT_JDK_IMPORT_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
# Get the latest JDK binary plugs or build to import pre-built binaries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
if [ "${ALT_BINARY_PLUGS_PATH}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
  binplugs=${jdk_instances}/openjdk-binary-plugs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
  jdkplugs=${jdk_instances}/${importjdk}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
  if [ -d ${binplugs} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    ALT_BINARY_PLUGS_PATH=${binplugs}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    export ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
  elif [  "${ALT_CLOSED_JDK_IMPORT_PATH}" = "" -a -d ${jdkplugs} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    ALT_CLOSED_JDK_IMPORT_PATH=${jdkplugs}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    export ALT_CLOSED_JDK_IMPORT_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
  if [ "${ALT_BINARY_PLUGS_PATH}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    echo "WARNING: Missing ALT_BINARY_PLUGS_PATH: ${binplugs}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
if [ "${ALT_BINARY_PLUGS_PATH}" != "" -a ! -d "${ALT_BINARY_PLUGS_PATH}" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
  echo "WARNING: Cannot access ALT_BINARY_PLUGS_PATH=${ALT_BINARY_PLUGS_PATH}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
if [ "${ALT_CLOSED_JDK_IMPORT_PATH}" != "" -a ! -d "${ALT_CLOSED_JDK_IMPORT_PATH}" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
  echo "WARNING: Cannot access ALT_CLOSED_JDK_IMPORT_PATH=${ALT_CLOSED_JDK_IMPORT_PATH}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
# Export PATH setting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
PATH="${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
export PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341