jaxws/make/jprt.config
author tbell
Fri, 06 Feb 2009 09:44:58 -0800
changeset 1995 99d627a393ca
parent 8 474761f14bca
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8
474761f14bca Initial load
duke
parents:
diff changeset
     1
#!echo "This is not a shell script"
474761f14bca Initial load
duke
parents:
diff changeset
     2
#############################################################################
474761f14bca Initial load
duke
parents:
diff changeset
     3
#
474761f14bca Initial load
duke
parents:
diff changeset
     4
# Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
474761f14bca Initial load
duke
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
474761f14bca Initial load
duke
parents:
diff changeset
     6
#
474761f14bca Initial load
duke
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
474761f14bca Initial load
duke
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
474761f14bca Initial load
duke
parents:
diff changeset
     9
# published by the Free Software Foundation.  Sun designates this
474761f14bca Initial load
duke
parents:
diff changeset
    10
# particular file as subject to the "Classpath" exception as provided
474761f14bca Initial load
duke
parents:
diff changeset
    11
# by Sun in the LICENSE file that accompanied this code.
474761f14bca Initial load
duke
parents:
diff changeset
    12
#
474761f14bca Initial load
duke
parents:
diff changeset
    13
# This code is distributed in the hope that it will be useful, but WITHOUT
474761f14bca Initial load
duke
parents:
diff changeset
    14
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
474761f14bca Initial load
duke
parents:
diff changeset
    15
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
474761f14bca Initial load
duke
parents:
diff changeset
    16
# version 2 for more details (a copy is included in the LICENSE file that
474761f14bca Initial load
duke
parents:
diff changeset
    17
# accompanied this code).
474761f14bca Initial load
duke
parents:
diff changeset
    18
#
474761f14bca Initial load
duke
parents:
diff changeset
    19
# You should have received a copy of the GNU General Public License version
474761f14bca Initial load
duke
parents:
diff changeset
    20
# 2 along with this work; if not, write to the Free Software Foundation,
474761f14bca Initial load
duke
parents:
diff changeset
    21
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
474761f14bca Initial load
duke
parents:
diff changeset
    22
#
474761f14bca Initial load
duke
parents:
diff changeset
    23
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
474761f14bca Initial load
duke
parents:
diff changeset
    24
# CA 95054 USA or visit www.sun.com if you need additional information or
474761f14bca Initial load
duke
parents:
diff changeset
    25
# have any questions.
474761f14bca Initial load
duke
parents:
diff changeset
    26
#
474761f14bca Initial load
duke
parents:
diff changeset
    27
#############################################################################
474761f14bca Initial load
duke
parents:
diff changeset
    28
#
474761f14bca Initial load
duke
parents:
diff changeset
    29
# JPRT shell configuration for building.
474761f14bca Initial load
duke
parents:
diff changeset
    30
#
474761f14bca Initial load
duke
parents:
diff changeset
    31
# Input environment variables:
474761f14bca Initial load
duke
parents:
diff changeset
    32
#    ALT_BOOTDIR
474761f14bca Initial load
duke
parents:
diff changeset
    33
#    ALT_SLASH_JAVA
474761f14bca Initial load
duke
parents:
diff changeset
    34
#    ALT_JDK_IMPORT_PATH
474761f14bca Initial load
duke
parents:
diff changeset
    35
#    Windows Only:
474761f14bca Initial load
duke
parents:
diff changeset
    36
#      PATH
474761f14bca Initial load
duke
parents:
diff changeset
    37
#      PROCESSOR_IDENTIFIER
474761f14bca Initial load
duke
parents:
diff changeset
    38
#      ROOTDIR
474761f14bca Initial load
duke
parents:
diff changeset
    39
#
474761f14bca Initial load
duke
parents:
diff changeset
    40
# Output variable settings:
474761f14bca Initial load
duke
parents:
diff changeset
    41
#    make    Full path to GNU make
474761f14bca Initial load
duke
parents:
diff changeset
    42
#
474761f14bca Initial load
duke
parents:
diff changeset
    43
# Output environment variables:
474761f14bca Initial load
duke
parents:
diff changeset
    44
#    PATH
474761f14bca Initial load
duke
parents:
diff changeset
    45
#    Windows Only:
474761f14bca Initial load
duke
parents:
diff changeset
    46
#      ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
474761f14bca Initial load
duke
parents:
diff changeset
    47
#
474761f14bca Initial load
duke
parents:
diff changeset
    48
# After JDK6, most settings will be found via ALT_SLASH_JAVA or
474761f14bca Initial load
duke
parents:
diff changeset
    49
#   by way of other system environment variables. If this was JDK5
474761f14bca Initial load
duke
parents:
diff changeset
    50
#   or an older JDK, you might need to export more ALT_* variables.
474761f14bca Initial load
duke
parents:
diff changeset
    51
#
474761f14bca Initial load
duke
parents:
diff changeset
    52
#############################################################################
474761f14bca Initial load
duke
parents:
diff changeset
    53
474761f14bca Initial load
duke
parents:
diff changeset
    54
#############################################################################
474761f14bca Initial load
duke
parents:
diff changeset
    55
# Error
474761f14bca Initial load
duke
parents:
diff changeset
    56
error() # message
474761f14bca Initial load
duke
parents:
diff changeset
    57
{
474761f14bca Initial load
duke
parents:
diff changeset
    58
  echo "ERROR: $1"
474761f14bca Initial load
duke
parents:
diff changeset
    59
  exit 6
474761f14bca Initial load
duke
parents:
diff changeset
    60
}
474761f14bca Initial load
duke
parents:
diff changeset
    61
# Directory must exist
474761f14bca Initial load
duke
parents:
diff changeset
    62
dirMustExist() # dir name
474761f14bca Initial load
duke
parents:
diff changeset
    63
{
474761f14bca Initial load
duke
parents:
diff changeset
    64
  if [ ! -d "$1" ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
    65
    error "Directory for $2 does not exist: $1"
474761f14bca Initial load
duke
parents:
diff changeset
    66
  fi
474761f14bca Initial load
duke
parents:
diff changeset
    67
}
474761f14bca Initial load
duke
parents:
diff changeset
    68
# File must exist
474761f14bca Initial load
duke
parents:
diff changeset
    69
fileMustExist() # dir name
474761f14bca Initial load
duke
parents:
diff changeset
    70
{
474761f14bca Initial load
duke
parents:
diff changeset
    71
  if [ ! -f "$1" ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
    72
    error "File for $2 does not exist: $1"
474761f14bca Initial load
duke
parents:
diff changeset
    73
  fi
474761f14bca Initial load
duke
parents:
diff changeset
    74
}
474761f14bca Initial load
duke
parents:
diff changeset
    75
#############################################################################
474761f14bca Initial load
duke
parents:
diff changeset
    76
474761f14bca Initial load
duke
parents:
diff changeset
    77
# Should be set by JPRT as the 3 basic inputs
474761f14bca Initial load
duke
parents:
diff changeset
    78
bootdir="${ALT_BOOTDIR}"
474761f14bca Initial load
duke
parents:
diff changeset
    79
slashjava="${ALT_SLASH_JAVA}"
474761f14bca Initial load
duke
parents:
diff changeset
    80
jdk_import="${ALT_JDK_IMPORT_PATH}"
474761f14bca Initial load
duke
parents:
diff changeset
    81
474761f14bca Initial load
duke
parents:
diff changeset
    82
# Check input
474761f14bca Initial load
duke
parents:
diff changeset
    83
dirMustExist "${bootdir}"    ALT_BOOTDIR
474761f14bca Initial load
duke
parents:
diff changeset
    84
dirMustExist "${slashjava}"  ALT_SLASH_JAVA
474761f14bca Initial load
duke
parents:
diff changeset
    85
dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH
474761f14bca Initial load
duke
parents:
diff changeset
    86
474761f14bca Initial load
duke
parents:
diff changeset
    87
# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
474761f14bca Initial load
duke
parents:
diff changeset
    88
osname=`uname -s`
474761f14bca Initial load
duke
parents:
diff changeset
    89
if [ "${osname}" = SunOS ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
    90
   
474761f14bca Initial load
duke
parents:
diff changeset
    91
    # SOLARIS: Sparc or X86
474761f14bca Initial load
duke
parents:
diff changeset
    92
    osarch=`uname -p`
474761f14bca Initial load
duke
parents:
diff changeset
    93
    if [ "${osarch}" = sparc ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
    94
	solaris_arch=sparc
474761f14bca Initial load
duke
parents:
diff changeset
    95
    else
474761f14bca Initial load
duke
parents:
diff changeset
    96
	solaris_arch=i386
474761f14bca Initial load
duke
parents:
diff changeset
    97
    fi
474761f14bca Initial load
duke
parents:
diff changeset
    98
474761f14bca Initial load
duke
parents:
diff changeset
    99
    # Add basic solaris system paths
474761f14bca Initial load
duke
parents:
diff changeset
   100
    path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
474761f14bca Initial load
duke
parents:
diff changeset
   101
474761f14bca Initial load
duke
parents:
diff changeset
   102
    # Get the previous JDK to be used to bootstrap the build
474761f14bca Initial load
duke
parents:
diff changeset
   103
    path4sdk=${bootdir}/bin:${path4sdk}
474761f14bca Initial load
duke
parents:
diff changeset
   104
474761f14bca Initial load
duke
parents:
diff changeset
   105
    # Ant
474761f14bca Initial load
duke
parents:
diff changeset
   106
    ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
474761f14bca Initial load
duke
parents:
diff changeset
   107
    export ANT_HOME
474761f14bca Initial load
duke
parents:
diff changeset
   108
    antbindir=${ANT_HOME}/bin
474761f14bca Initial load
duke
parents:
diff changeset
   109
    fileMustExist "${antbindir}/ant" ant
474761f14bca Initial load
duke
parents:
diff changeset
   110
    path4sdk=${antbindir}:${path4sdk}
474761f14bca Initial load
duke
parents:
diff changeset
   111
474761f14bca Initial load
duke
parents:
diff changeset
   112
    # Find GNU make
474761f14bca Initial load
duke
parents:
diff changeset
   113
    make=/usr/sfw/bin/gmake
474761f14bca Initial load
duke
parents:
diff changeset
   114
    if [ ! -f ${make} ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   115
	make=/opt/sfw/bin/gmake
474761f14bca Initial load
duke
parents:
diff changeset
   116
	if [ ! -f ${make} ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   117
	    make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
474761f14bca Initial load
duke
parents:
diff changeset
   118
        fi 
474761f14bca Initial load
duke
parents:
diff changeset
   119
    fi
474761f14bca Initial load
duke
parents:
diff changeset
   120
    fileMustExist "${make}" make
474761f14bca Initial load
duke
parents:
diff changeset
   121
474761f14bca Initial load
duke
parents:
diff changeset
   122
    # File creation mask
474761f14bca Initial load
duke
parents:
diff changeset
   123
    umask 002
474761f14bca Initial load
duke
parents:
diff changeset
   124
474761f14bca Initial load
duke
parents:
diff changeset
   125
elif [ "${osname}" = Linux ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   126
   
474761f14bca Initial load
duke
parents:
diff changeset
   127
    # LINUX: X86, AMD64
474761f14bca Initial load
duke
parents:
diff changeset
   128
    osarch=`uname -m`
474761f14bca Initial load
duke
parents:
diff changeset
   129
    if [ "${osarch}" = i686 ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   130
	linux_arch=i586
474761f14bca Initial load
duke
parents:
diff changeset
   131
    elif [ "${osarch}" = x86_64 ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   132
	linux_arch=amd64
474761f14bca Initial load
duke
parents:
diff changeset
   133
    fi
474761f14bca Initial load
duke
parents:
diff changeset
   134
474761f14bca Initial load
duke
parents:
diff changeset
   135
    # Add basic paths
474761f14bca Initial load
duke
parents:
diff changeset
   136
    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
474761f14bca Initial load
duke
parents:
diff changeset
   137
474761f14bca Initial load
duke
parents:
diff changeset
   138
    # Get the previous JDK to be used to bootstrap the build
474761f14bca Initial load
duke
parents:
diff changeset
   139
    path4sdk=${bootdir}/bin:${path4sdk}
474761f14bca Initial load
duke
parents:
diff changeset
   140
474761f14bca Initial load
duke
parents:
diff changeset
   141
    # Ant
474761f14bca Initial load
duke
parents:
diff changeset
   142
    ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
474761f14bca Initial load
duke
parents:
diff changeset
   143
    export ANT_HOME
474761f14bca Initial load
duke
parents:
diff changeset
   144
    antbindir=${ANT_HOME}/bin
474761f14bca Initial load
duke
parents:
diff changeset
   145
    fileMustExist "${antbindir}/ant" ant
474761f14bca Initial load
duke
parents:
diff changeset
   146
    path4sdk=${antbindir}:${path4sdk}
474761f14bca Initial load
duke
parents:
diff changeset
   147
    
474761f14bca Initial load
duke
parents:
diff changeset
   148
    # Find GNU make
474761f14bca Initial load
duke
parents:
diff changeset
   149
    make=/usr/bin/make
474761f14bca Initial load
duke
parents:
diff changeset
   150
    fileMustExist "${make}" make
474761f14bca Initial load
duke
parents:
diff changeset
   151
474761f14bca Initial load
duke
parents:
diff changeset
   152
    umask 002
474761f14bca Initial load
duke
parents:
diff changeset
   153
474761f14bca Initial load
duke
parents:
diff changeset
   154
else
474761f14bca Initial load
duke
parents:
diff changeset
   155
474761f14bca Initial load
duke
parents:
diff changeset
   156
    # Windows: Differs on CYGWIN vs. MKS.
474761f14bca Initial load
duke
parents:
diff changeset
   157
    #   Also, blanks in pathnames gives GNU make headaches, so anything placed
474761f14bca Initial load
duke
parents:
diff changeset
   158
    #   in any ALT_* variable should be the short windows dosname.
474761f14bca Initial load
duke
parents:
diff changeset
   159
   
474761f14bca Initial load
duke
parents:
diff changeset
   160
    # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
474761f14bca Initial load
duke
parents:
diff changeset
   161
    #   Assumption here is that you are in a shell window via MKS or cygwin.
474761f14bca Initial load
duke
parents:
diff changeset
   162
    #   MKS install should have defined the environment variable ROOTDIR.
474761f14bca Initial load
duke
parents:
diff changeset
   163
    #   We also need to figure out which one we have: X86, AMD64
474761f14bca Initial load
duke
parents:
diff changeset
   164
    if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   165
	windows_arch=amd64
474761f14bca Initial load
duke
parents:
diff changeset
   166
    else
474761f14bca Initial load
duke
parents:
diff changeset
   167
	windows_arch=i586
474761f14bca Initial load
duke
parents:
diff changeset
   168
    fi
474761f14bca Initial load
duke
parents:
diff changeset
   169
    
474761f14bca Initial load
duke
parents:
diff changeset
   170
    # We need to determine if we are running a CYGWIN shell or an MKS shell
474761f14bca Initial load
duke
parents:
diff changeset
   171
    #    (if uname isn't available, then it will be unix_toolset=unknown)
474761f14bca Initial load
duke
parents:
diff changeset
   172
    unix_toolset=unknown
474761f14bca Initial load
duke
parents:
diff changeset
   173
    if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   174
        # We kind of assume ROOTDIR is where MKS is and it's ok
474761f14bca Initial load
duke
parents:
diff changeset
   175
        unix_toolset=MKS
474761f14bca Initial load
duke
parents:
diff changeset
   176
        mkshome=`dosname -s "${ROOTDIR}"`
474761f14bca Initial load
duke
parents:
diff changeset
   177
	# Utility to convert to short pathnames without spaces
474761f14bca Initial load
duke
parents:
diff changeset
   178
	dosname="${mkshome}/mksnt/dosname -s"
474761f14bca Initial load
duke
parents:
diff changeset
   179
        # Most unix utilities are in the mksnt directory of ROOTDIR
474761f14bca Initial load
duke
parents:
diff changeset
   180
        unixcommand_path="${mkshome}/mksnt"
474761f14bca Initial load
duke
parents:
diff changeset
   181
        path4sdk="${unixcommand_path}"
474761f14bca Initial load
duke
parents:
diff changeset
   182
        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
474761f14bca Initial load
duke
parents:
diff changeset
   183
	devtools_path="${slashjava}/devtools/win32/bin"
474761f14bca Initial load
duke
parents:
diff changeset
   184
	path4sdk="${devtools_path};${path4sdk}"
474761f14bca Initial load
duke
parents:
diff changeset
   185
	# Normally this need not be set, but on Windows it's default is C:/UTILS
474761f14bca Initial load
duke
parents:
diff changeset
   186
        ALT_DEVTOOLS_PATH="${devtools_path}"
474761f14bca Initial load
duke
parents:
diff changeset
   187
	export ALT_DEVTOOLS_PATH
474761f14bca Initial load
duke
parents:
diff changeset
   188
        dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
474761f14bca Initial load
duke
parents:
diff changeset
   189
        # Find GNU make
474761f14bca Initial load
duke
parents:
diff changeset
   190
        make="${devtools_path}/gnumake.exe"
474761f14bca Initial load
duke
parents:
diff changeset
   191
        fileMustExist "${make}" make
474761f14bca Initial load
duke
parents:
diff changeset
   192
    elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   193
        # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
474761f14bca Initial load
duke
parents:
diff changeset
   194
        unix_toolset=CYGWIN
474761f14bca Initial load
duke
parents:
diff changeset
   195
	# Utility to convert to short pathnames without spaces
474761f14bca Initial load
duke
parents:
diff changeset
   196
	dosname="/usr/bin/cygpath -a -m -s"
474761f14bca Initial load
duke
parents:
diff changeset
   197
        # Most unix utilities are in the /usr/bin
474761f14bca Initial load
duke
parents:
diff changeset
   198
        unixcommand_path="/usr/bin"
474761f14bca Initial load
duke
parents:
diff changeset
   199
        path4sdk="${unixcommand_path}"
474761f14bca Initial load
duke
parents:
diff changeset
   200
        dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
474761f14bca Initial load
duke
parents:
diff changeset
   201
        # Find GNU make
474761f14bca Initial load
duke
parents:
diff changeset
   202
        make="${unixcommand_path}/make.exe"
474761f14bca Initial load
duke
parents:
diff changeset
   203
        fileMustExist "${make}" make
474761f14bca Initial load
duke
parents:
diff changeset
   204
    else
474761f14bca Initial load
duke
parents:
diff changeset
   205
      echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
474761f14bca Initial load
duke
parents:
diff changeset
   206
    fi
474761f14bca Initial load
duke
parents:
diff changeset
   207
474761f14bca Initial load
duke
parents:
diff changeset
   208
    # WINDOWS: Get the previous JDK to be used to bootstrap the build
474761f14bca Initial load
duke
parents:
diff changeset
   209
    path4sdk="${bootdir}/bin;${path4sdk}"
474761f14bca Initial load
duke
parents:
diff changeset
   210
474761f14bca Initial load
duke
parents:
diff changeset
   211
    # Ant
474761f14bca Initial load
duke
parents:
diff changeset
   212
    ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
474761f14bca Initial load
duke
parents:
diff changeset
   213
    export ANT_HOME
474761f14bca Initial load
duke
parents:
diff changeset
   214
    antbindir=${ANT_HOME}/bin
474761f14bca Initial load
duke
parents:
diff changeset
   215
    fileMustExist "${antbindir}/ant" ant
474761f14bca Initial load
duke
parents:
diff changeset
   216
    path4sdk="${antbindir};${path4sdk}"
474761f14bca Initial load
duke
parents:
diff changeset
   217
474761f14bca Initial load
duke
parents:
diff changeset
   218
    # Turn all \\ into /, remove duplicates and trailing /
474761f14bca Initial load
duke
parents:
diff changeset
   219
    slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
474761f14bca Initial load
duke
parents:
diff changeset
   220
    
474761f14bca Initial load
duke
parents:
diff changeset
   221
    # For windows, it's hard to know where the system is, so we just add this
474761f14bca Initial load
duke
parents:
diff changeset
   222
    #    to PATH.
474761f14bca Initial load
duke
parents:
diff changeset
   223
    path4sdk="${slash_path};${PATH}"
474761f14bca Initial load
duke
parents:
diff changeset
   224
    
474761f14bca Initial load
duke
parents:
diff changeset
   225
    # Convert path4sdk to cygwin style
474761f14bca Initial load
duke
parents:
diff changeset
   226
    if [ "${unix_toolset}" = CYGWIN ] ; then
474761f14bca Initial load
duke
parents:
diff changeset
   227
	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
474761f14bca Initial load
duke
parents:
diff changeset
   228
    fi
474761f14bca Initial load
duke
parents:
diff changeset
   229
474761f14bca Initial load
duke
parents:
diff changeset
   230
fi
474761f14bca Initial load
duke
parents:
diff changeset
   231
474761f14bca Initial load
duke
parents:
diff changeset
   232
# Export PATH setting
474761f14bca Initial load
duke
parents:
diff changeset
   233
PATH="${path4sdk}"
474761f14bca Initial load
duke
parents:
diff changeset
   234
export PATH
474761f14bca Initial load
duke
parents:
diff changeset
   235
474761f14bca Initial load
duke
parents:
diff changeset
   236
# Things we need to unset
474761f14bca Initial load
duke
parents:
diff changeset
   237
unset LD_LIBRARY_PATH
474761f14bca Initial load
duke
parents:
diff changeset
   238
unset LD_LIBRARY_PATH_32
474761f14bca Initial load
duke
parents:
diff changeset
   239
unset LD_LIBRARY_PATH_64
474761f14bca Initial load
duke
parents:
diff changeset
   240
unset JAVA_HOME
474761f14bca Initial load
duke
parents:
diff changeset
   241