jdk/make/jdk_generic_profile.sh
author amurillo
Fri, 11 Jan 2013 01:43:09 -0800
changeset 15120 8bac833614e0
parent 14342 8435a30053c1
child 19870 19ebc43b932b
permissions -rw-r--r--
Merge
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
#
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 14091
diff changeset
     4
# Copyright (c) 2007, 2012, Oracle and/or its affiliates. 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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4111
diff changeset
     9
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4111
diff changeset
    11
# by Oracle in the LICENSE file that accompanied this code.
2
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
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4111
diff changeset
    23
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4111
diff changeset
    24
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4111
diff changeset
    25
# questions.
2
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
#
8018
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
    53
# On Windows, assumes PROCESSOR_IDENTIFIER, VS100COMNTOOLS,
2
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
#    Windows Only:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
#      ALT_UNIXCOMMAND_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
#      ALT_DXSDK_PATH
8018
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
    84
#      ALT_MSVCRNN_DLL_PATH
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
#############################################################################
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
# Keep in mind that at this point, we are running in some kind of shell
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
#   (sh, ksh, or bash). We don't know if it's solaris, linux, or windows 
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
#   CYGWIN. We need to figure that out.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
# Find user name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
if [ "${USERNAME}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    USERNAME="${LOGNAME}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
if [ "${USERNAME}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    USERNAME="${USER}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
export USERNAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
# Find machine name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
if [ "${COMPUTERNAME}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    COMPUTERNAME="$(hostname)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
export COMPUTERNAME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
# Boot jdk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
bootjdk=jdk1.6.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
importjdk=jdk1.7.0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
osname=$(uname -s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
if [ "${osname}" = SunOS ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
  # System place where JDK installed images are stored?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
  jdk_instances=/usr/jdk/instances
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
642
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   118
  # Get the Sun Studio compilers (and latest patches for them too)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
  if [ "${ALT_COMPILER_PATH}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    ALT_COMPILER_PATH=/opt/SUNWspro/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    export ALT_COMPILER_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
  if [ ! -d ${ALT_COMPILER_PATH} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    echo "WARNING: Cannot access ALT_COMPILER_PATH=${ALT_COMPILER_PATH}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
  # Place compiler path early in PATH to avoid 'cc' conflicts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
  path4sdk=${ALT_COMPILER_PATH}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
  # Make sure these are unset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
  unset JAVA_HOME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
  unset LD_LIBRARY_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
  # Build in C locale
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
  LANG=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
  export LANG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
  LC_ALL=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
  export LC_ALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
  umask 002
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
elif [ "${osname}" = Linux ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
  # System place where JDK installed images are stored?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
  jdk_instances=/opt/java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
  # Use compilers from /usr/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
  path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
  # Make sure these are unset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
  unset JAVA_HOME
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
  unset LD_LIBRARY_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
  # Build in C locale
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
  LANG=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
  export LANG
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
  LC_ALL=C
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
  export LC_ALL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
  umask 002
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  # System place where JDK installed images are stored?
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
  jdk_instances="C:"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
  # Windows: Differs on CYGWIN and the compiler available.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
  #   Also, blanks in pathnames gives make headaches, so anything placed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
  #   in any ALT_* variable should be the short windows DOS names.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
   
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
  # Check CYGWIN (should have already been done)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
  #   Assumption here is that you are in a shell window via cygwin.
5633
d20431ead333 6959116: Fix regression in make/jdk_generic_profile.sh (PROCESSOR_IDENTIFIER)
ohair
parents: 5506
diff changeset
   173
  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'`
2300
103e268e2d16 6822374: Windows: detect X64 when PROCESSOR_IDENTIFIER contains EM64T or Intel64
ohair
parents: 715
diff changeset
   174
  if [ "${proc_arch}" = "X64" ] ; then
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    windows_arch=amd64
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    windows_arch=i586
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
  fi
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   179
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   180
  repo=`hg root | sed -e 's@\\\\@/@g'`
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
  # We need to check if we are running a CYGWIN shell
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   182
  if [ "$(echo ${osname} | fgrep Cygwin)" != "" -a -f /bin/cygpath ] ; then
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    # Utility to convert to short pathnames without spaces
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    cygpath="/usr/bin/cygpath -a -m -s"
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   186
    cygpathp="/usr/bin/cygpath -p"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    # Most unix utilities are in the /usr/bin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    unixcommand_path="/usr/bin"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    # Make the prompt tell you CYGWIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    export PS1="CYGWIN:${COMPUTERNAME}:${USERNAME}[\!] "
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   191
  elif [ "$(echo ${osname} | fgrep MINGW)" != "" ] ; then
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   192
    # Utility to convert to short pathnames without spaces
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   193
    cygpath="${repo}/make/tools/msys_build_scripts/dospath.sh"
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   194
    if [ ! -f ${cygpath} ] ; then
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   195
        echo "ERROR: Cannot find cygpath or equivalent on this machine"
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   196
        exit 1
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   197
    fi
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   198
    # Utility to fix a path to MinGW/MSYS format - the equivalent of 'cygpath -p'
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   199
    for tfile in "${repo}/make/scripts/fixpath.pl" "${repo}/../make/scripts/fixpath.pl"; do
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   200
        if [ -f ${tfile} ] ; then
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   201
            cygpathp="/bin/perl ${tfile} -m"
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   202
        fi
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   203
    done;
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   204
    if [ -z "${cygpathp}" ] ; then
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   205
        echo "ERROR: Cannot find make/scripts/fixpath.pl on this machine"
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   206
        exit 1
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   207
    fi
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   208
    unixcommand_path="/usr/bin"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
  else
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   210
    echo "ERROR: Cannot find CYGWIN or MinGW/MSYS on this machine"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    exit 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
  if [ "${ALT_UNIXCOMMAND_PATH}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    unixcommand_path=${ALT_UNIXCOMMAND_PATH}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
  # Default shell
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
  export SHELL="${unixcommand_path}/sh"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
  # Setup path system (verify this is right)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
  if [ "${SystemRoot}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    sys_root=$(${cygpath} "${SystemRoot}")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
  elif [ "${SYSTEMROOT}" != "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    sys_root=$(${cygpath} "${SYSTEMROOT}")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    sys_root=$(${cygpath} "C:/WINNT")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
  if [ ! -d "${sys_root}" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    echo "WARNING: No system root found at: ${sys_root}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
14091
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   232
  # Build a : separated path making sure each segment is acceptable to ${osname}
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   233
  path4sdk="${unixcommand_path}:"`${cygpathp} "${sys_root}/system32;${sys_root};${sys_root}/System32/Wbem"`
e5c8662f325d 7152336: Enable builds on Windows with MinGW/MSYS
tbell
parents: 13567
diff changeset
   234
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
  # Compiler setup (nasty part)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
  #   NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
  #   NOTE: CYGWIN has a link.exe too, make sure the compilers are first
8018
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   238
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   239
  # Use supplied vsvars.sh
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   240
  if [ -f "${repo}/make/scripts/vsvars.sh" ] ; then
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   241
    eval `sh ${repo}/make/scripts/vsvars.sh -v10`
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   242
  elif [ -f "${repo}/../make/scripts/vsvars.sh" ] ; then
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   243
    eval `sh ${repo}/../make/scripts/vsvars.sh -v10`
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   244
  else
79ce40b4ab5e 6950375: Remove msvcrt.dll from the Windows JRE bundles
ohair
parents: 7666
diff changeset
   245
    echo "WARNING: No make/scripts/vsvars.sh file found"
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
  fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
# Get the previous JDK to be used to bootstrap the build
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
if [ "${ALT_BOOTDIR}" = "" ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
  ALT_BOOTDIR=${jdk_instances}/${bootjdk}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
  export ALT_BOOTDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
if [ ! -d ${ALT_BOOTDIR} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
  echo "WARNING: Cannot access ALT_BOOTDIR=${ALT_BOOTDIR}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
# Get the import JDK to be used to get hotspot VM if not built
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
if [ "${ALT_JDK_IMPORT_PATH}" = "" -a -d ${jdk_instances}/${importjdk} ] ; then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
  ALT_JDK_IMPORT_PATH=${jdk_instances}/${importjdk}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
  export ALT_JDK_IMPORT_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
# Export PATH setting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
PATH="${path4sdk}"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
export PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   269
# Export variables required for Zero
6305
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   270
if [ "${SHARK_BUILD}" = true ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   271
  ZERO_BUILD=true
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   272
  export ZERO_BUILD
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   273
fi
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   274
if [ "${ZERO_BUILD}" = true ] ; then
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   275
  # ZERO_LIBARCH is the name of the architecture-specific
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   276
  # subdirectory under $JAVA_HOME/jre/lib
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   277
  arch=$(uname -m)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   278
  case "${arch}" in
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   279
    x86_64)  ZERO_LIBARCH=amd64     ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   280
    i?86)    ZERO_LIBARCH=i386      ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   281
    sparc64) ZERO_LIBARCH=sparcv9   ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   282
    arm*)    ZERO_LIBARCH=arm       ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   283
    *)       ZERO_LIBARCH="$(arch)"
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   284
  esac
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   285
  export ZERO_LIBARCH
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   286
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   287
  # ARCH_DATA_MODEL is the number of bits in a pointer
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   288
  case "${ZERO_LIBARCH}" in
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   289
    i386|ppc|s390|sparc|arm)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   290
      ARCH_DATA_MODEL=32
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   291
      ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   292
    amd64|ppc64|s390x|sparcv9|ia64|alpha)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   293
      ARCH_DATA_MODEL=64
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   294
      ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   295
    *)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   296
      echo "ERROR: Unable to determine ARCH_DATA_MODEL for ${ZERO_LIBARCH}"
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   297
      exit 1
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   298
  esac
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   299
  export ARCH_DATA_MODEL
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   300
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   301
  # ZERO_ENDIANNESS is the endianness of the processor
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   302
  case "${ZERO_LIBARCH}" in
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   303
    i386|amd64|ia64)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   304
      ZERO_ENDIANNESS=little
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   305
      ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   306
    ppc*|s390*|sparc*|alpha)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   307
      ZERO_ENDIANNESS=big
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   308
      ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   309
    *)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   310
      echo "ERROR: Unable to determine ZERO_ENDIANNESS for ${ZERO_LIBARCH}"
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   311
      exit 1
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   312
  esac
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   313
  export ZERO_ENDIANNESS
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   314
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   315
  # ZERO_ARCHDEF is used to enable architecture-specific code
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   316
  case "${ZERO_LIBARCH}" in
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   317
    i386)   ZERO_ARCHDEF=IA32  ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   318
    ppc*)   ZERO_ARCHDEF=PPC   ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   319
    s390*)  ZERO_ARCHDEF=S390  ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   320
    sparc*) ZERO_ARCHDEF=SPARC ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   321
    *)      ZERO_ARCHDEF=$(echo "${ZERO_LIBARCH}" | tr a-z A-Z)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   322
  esac
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   323
  export ZERO_ARCHDEF
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   324
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   325
  # ZERO_ARCHFLAG tells the compiler which mode to build for
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   326
  case "${ZERO_LIBARCH}" in
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   327
    s390)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   328
      ZERO_ARCHFLAG="-m31"
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   329
      ;;
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   330
    *)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   331
      ZERO_ARCHFLAG="-m${ARCH_DATA_MODEL}"
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   332
  esac
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   333
  export ZERO_ARCHFLAG
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   334
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   335
  # LIBFFI_CFLAGS and LIBFFI_LIBS tell the compiler how to compile and
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   336
  # link against libffi
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   337
  pkgconfig=$(which pkg-config 2>/dev/null)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   338
  if [ -x "${pkgconfig}" ] ; then
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   339
    if [ "${LIBFFI_CFLAGS}" = "" ] ; then
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   340
      LIBFFI_CFLAGS=$("${pkgconfig}" --cflags libffi)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   341
    fi
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   342
    if [ "${LIBFFI_LIBS}" = "" ] ; then
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   343
      LIBFFI_LIBS=$("${pkgconfig}" --libs libffi)
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   344
    fi
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   345
  fi
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   346
  if [ "${LIBFFI_LIBS}" = "" ] ; then
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   347
      LIBFFI_LIBS="-lffi"
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   348
  fi
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   349
  export LIBFFI_CFLAGS
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   350
  export LIBFFI_LIBS
6305
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   351
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   352
  # LLVM_CFLAGS, LLVM_LDFLAGS and LLVM_LIBS tell the compiler how to
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   353
  # compile and link against LLVM
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   354
  if [ "${SHARK_BUILD}" = true ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   355
    if [ "${LLVM_CONFIG}" = "" ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   356
      LLVM_CONFIG=$(which llvm-config 2>/dev/null)
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   357
    fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   358
    if [ ! -x "${LLVM_CONFIG}" ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   359
      echo "ERROR: Unable to locate llvm-config"
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   360
      exit 1
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   361
    fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   362
    llvm_components="jit engine nativecodegen"
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   363
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   364
    unset LLVM_CFLAGS
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   365
    for flag in $("${LLVM_CONFIG}" --cxxflags $llvm_components); do
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   366
      if echo "${flag}" | grep -q '^-[ID]'; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   367
        if [ "${flag}" != "-D_DEBUG" ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   368
          if [ "${LLVM_CFLAGS}" != "" ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   369
            LLVM_CFLAGS="${LLVM_CFLAGS} "
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   370
          fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   371
          LLVM_CFLAGS="${LLVM_CFLAGS}${flag}"
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   372
        fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   373
      fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   374
    done
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   375
    llvm_version=$("${LLVM_CONFIG}" --version | sed 's/\.//; s/svn.*//')
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   376
    LLVM_CFLAGS="${LLVM_CFLAGS} -DSHARK_LLVM_VERSION=${llvm_version}"
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   377
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   378
    unset LLVM_LDFLAGS
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   379
    for flag in $("${LLVM_CONFIG}" --ldflags $llvm_components); do
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   380
      if echo "${flag}" | grep -q '^-L'; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   381
        if [ "${LLVM_LDFLAGS}" != "" ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   382
          LLVM_LDFLAGS="${LLVM_LDFLAGS} "
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   383
        fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   384
        LLVM_LDFLAGS="${LLVM_LDFLAGS}${flag}"
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   385
      fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   386
    done
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   387
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   388
    unset LLVM_LIBS
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   389
    for flag in $("${LLVM_CONFIG}" --libs $llvm_components); do
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   390
      if echo "${flag}" | grep -q '^-l'; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   391
        if [ "${LLVM_LIBS}" != "" ] ; then
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   392
          LLVM_LIBS="${LLVM_LIBS} "
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   393
        fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   394
        LLVM_LIBS="${LLVM_LIBS}${flag}"
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   395
      fi
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   396
    done
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   397
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   398
    export LLVM_CFLAGS
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   399
    export LLVM_LDFLAGS
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   400
    export LLVM_LIBS
b05cc5bdc0db 6976186: Integrate Shark
gbenson
parents: 5633
diff changeset
   401
  fi
4111
ffc9c33335f4 6891677: java/build integrate zero assembler JDK changes
gbenson
parents: 2300
diff changeset
   402
fi
13567
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   403
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   404
# Export variables for system zlib
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   405
# ZLIB_CFLAGS and ZLIB_LIBS tell the compiler how to compile and
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   406
# link against zlib
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   407
pkgconfig=$(which pkg-config 2>/dev/null)
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   408
if [ -x "${pkgconfig}" ] ; then
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   409
  if [ "${ZLIB_CFLAGS}" = "" ] ; then
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   410
    ZLIB_CFLAGS=$("${pkgconfig}" --cflags zlib)
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   411
  fi
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   412
  if [ "${ZLIB_LIBS}" = "" ] ; then
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   413
    ZLIB_LIBS=$("${pkgconfig}" --libs zlib)
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   414
  fi
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   415
fi
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   416
if [ "${ZLIB_LIBS}" = "" ] ; then
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   417
    ZLIB_LIBS="-lz"
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   418
fi
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   419
export ZLIB_CFLAGS
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   420
export ZLIB_LIBS
b124faa29aef 7110151: Use underlying platform's zlib library for Java zlib support
andrew
parents: 9035
diff changeset
   421