annotate make/jprt.config @ 0:a61af66fc99e

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children a49545cab84a
rev   line source
duke@0 1 #!echo "This is not a shell script"
duke@0 2 #
duke@0 3 # Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
duke@0 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 5 #
duke@0 6 # This code is free software; you can redistribute it and/or modify it
duke@0 7 # under the terms of the GNU General Public License version 2 only, as
duke@0 8 # published by the Free Software Foundation.
duke@0 9 #
duke@0 10 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 13 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 14 # accompanied this code).
duke@0 15 #
duke@0 16 # You should have received a copy of the GNU General Public License version
duke@0 17 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 19 #
duke@0 20 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 21 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 22 # have any questions.
duke@0 23 #
duke@0 24 #
duke@0 25
duke@0 26 #############################################################################
duke@0 27 # Error
duke@0 28 error() # message
duke@0 29 {
duke@0 30 echo "ERROR: $1"
duke@0 31 exit 6
duke@0 32 }
duke@0 33 # Directory must exist
duke@0 34 dirMustExist() # dir name
duke@0 35 {
duke@0 36 if [ ! -d "$1" ] ; then
duke@0 37 error "Directory for $2 does not exist: $1"
duke@0 38 fi
duke@0 39 }
duke@0 40 # File must exist
duke@0 41 fileMustExist() # dir name
duke@0 42 {
duke@0 43 if [ ! -f "$1" ] ; then
duke@0 44 error "File for $2 does not exist: $1"
duke@0 45 fi
duke@0 46 }
duke@0 47 #############################################################################
duke@0 48
duke@0 49 # Should be set by JPRT as the 3 basic inputs
duke@0 50 bootdir="${ALT_BOOTDIR}"
duke@0 51 slashjava="${ALT_SLASH_JAVA}"
duke@0 52 jdk_import="${ALT_JDK_IMPORT_PATH}"
duke@0 53
duke@0 54 # Check input
duke@0 55 dirMustExist "${bootdir}" ALT_BOOTDIR
duke@0 56 dirMustExist "${slashjava}" ALT_SLASH_JAVA
duke@0 57 dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH
duke@0 58
duke@0 59 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
duke@0 60 osname=`uname -s`
duke@0 61 if [ "${osname}" = SunOS ] ; then
duke@0 62
duke@0 63 # SOLARIS: Sparc or X86
duke@0 64 osarch=`uname -p`
duke@0 65 if [ "${osarch}" = sparc ] ; then
duke@0 66 solaris_arch=sparc
duke@0 67 else
duke@0 68 solaris_arch=i386
duke@0 69 fi
duke@0 70
duke@0 71 # Get the SS11 compilers into path (make sure it matches ALT setting)
duke@0 72 compiler_path=${slashjava}/devtools/${solaris_arch}/SUNWspro/SS11/bin
duke@0 73 dirMustExist "${compiler_path}" COMPILER_PATH
duke@0 74 path4sdk=${compiler_path}
duke@0 75
duke@0 76 # Add basic solaris system paths
duke@0 77 path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
duke@0 78
duke@0 79 # Get the previous JDK to be used to bootstrap the build
duke@0 80 path4sdk=${bootdir}/bin:${path4sdk}
duke@0 81
duke@0 82 # Find GNU make
duke@0 83 make=/usr/sfw/bin/gmake
duke@0 84 if [ ! -f ${make} ] ; then
duke@0 85 make=/opt/sfw/bin/gmake
duke@0 86 if [ ! -f ${make} ] ; then
duke@0 87 make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
duke@0 88 fi
duke@0 89 fi
duke@0 90 fileMustExist "${make}" make
duke@0 91
duke@0 92 # File creation mask
duke@0 93 umask 002
duke@0 94
duke@0 95 elif [ "${osname}" = Linux ] ; then
duke@0 96
duke@0 97 # LINUX: X86, AMD64
duke@0 98 osarch=`uname -m`
duke@0 99 if [ "${osarch}" = i686 ] ; then
duke@0 100 linux_arch=i586
duke@0 101 elif [ "${osarch}" = x86_64 ] ; then
duke@0 102 linux_arch=amd64
duke@0 103 fi
duke@0 104
duke@0 105 # Get the compilers into path (make sure it matches ALT setting)
duke@0 106 compiler_path=/usr/bin
duke@0 107 dirMustExist "${compiler_path}" COMPILER_PATH
duke@0 108 path4sdk=${compiler_path}
duke@0 109
duke@0 110 # Add basic paths
duke@0 111 path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
duke@0 112
duke@0 113 # Get the previous JDK to be used to bootstrap the build
duke@0 114 path4sdk=${bootdir}/bin:${path4sdk}
duke@0 115
duke@0 116 # Find GNU make
duke@0 117 make=/usr/bin/make
duke@0 118 fileMustExist "${make}" make
duke@0 119
duke@0 120 umask 002
duke@0 121
duke@0 122 else
duke@0 123
duke@0 124 # Windows: Differs on CYGWIN vs. MKS, and the compiler available.
duke@0 125 # Also, blanks in pathnames gives GNU make headaches, so anything placed
duke@0 126 # in any ALT_* variable should be the short windows dosname.
duke@0 127
duke@0 128 # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
duke@0 129 # Assumption here is that you are in a shell window via MKS or cygwin.
duke@0 130 # MKS install should have defined the environment variable ROOTDIR.
duke@0 131 # We also need to figure out which one we have: X86, AMD64
duke@0 132 if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
duke@0 133 windows_arch=amd64
duke@0 134 else
duke@0 135 windows_arch=i586
duke@0 136 fi
duke@0 137
duke@0 138 # We need to determine if we are running a CYGWIN shell or an MKS shell
duke@0 139 # (if uname isn't available, then it will be unix_toolset=unknown)
duke@0 140 unix_toolset=unknown
duke@0 141 if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
duke@0 142 # We kind of assume ROOTDIR is where MKS is and it's ok
duke@0 143 unix_toolset=MKS
duke@0 144 mkshome=`dosname -s "${ROOTDIR}"`
duke@0 145 # Utility to convert to short pathnames without spaces
duke@0 146 dosname="${mkshome}/mksnt/dosname -s"
duke@0 147 # Most unix utilities are in the mksnt directory of ROOTDIR
duke@0 148 unixcommand_path="${mkshome}/mksnt"
duke@0 149 path4sdk="${unixcommand_path}"
duke@0 150 dirMustExist "${unixcommand_path}" UNIXCOMMAND_PATH
duke@0 151 devtools_path="${slashjava}/devtools/win32/bin"
duke@0 152 path4sdk="${devtools_path};${path4sdk}"
duke@0 153 dirMustExist "${devtools_path}" DEVTOOLS_PATH
duke@0 154 # Find GNU make
duke@0 155 make="${devtools_path}/gnumake.exe"
duke@0 156 fileMustExist "${make}" make
duke@0 157 elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
duke@0 158 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@0 159 unix_toolset=CYGWIN
duke@0 160 # Utility to convert to short pathnames without spaces
duke@0 161 dosname="/usr/bin/cygpath -a -m -s"
duke@0 162 # Most unix utilities are in the /usr/bin
duke@0 163 unixcommand_path="/usr/bin"
duke@0 164 path4sdk="${unixcommand_path}"
duke@0 165 dirMustExist "${unixcommand_path}" UNIXCOMMAND_PATH
duke@0 166 # Find GNU make
duke@0 167 make="${unixcommand_path}/make.exe"
duke@0 168 fileMustExist "${make}" make
duke@0 169 else
duke@0 170 echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
duke@0 171 fi
duke@0 172
duke@0 173 # WINDOWS: Compiler setup (nasty part)
duke@0 174 # NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
duke@0 175 # NOTE: CYGWIN has a link.exe too, make sure the compilers are first
duke@0 176 if [ "${windows_arch}" = i586 ] ; then
duke@0 177 # 32bit Windows compiler settings
duke@0 178 # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
duke@0 179 vs_root=`${dosname} "${VS71COMNTOOLS}/../.."`
duke@0 180 # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
duke@0 181 vc7_root="${vs_root}/Vc7"
duke@0 182 compiler_path="${vc7_root}/bin"
duke@0 183 platform_sdk="${vc7_root}/PlatformSDK"
duke@0 184 # LIB and INCLUDE must use ; as a separator
duke@0 185 include4sdk="${vc7_root}/atlmfc/include"
duke@0 186 include4sdk="${include4sdk};${vc7_root}/include"
duke@0 187 include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
duke@0 188 include4sdk="${include4sdk};${platform_sdk}/include"
duke@0 189 include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
duke@0 190 lib4sdk="${vc7_root}/atlmfc/lib"
duke@0 191 lib4sdk="${lib4sdk};${vc7_root}/lib"
duke@0 192 lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
duke@0 193 lib4sdk="${lib4sdk};${platform_sdk}/lib"
duke@0 194 lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
duke@0 195 # Search path and DLL locating path
duke@0 196 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@0 197 path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
duke@0 198 path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
duke@0 199 path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
duke@0 200 path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
duke@0 201 path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
duke@0 202 path4sdk="${compiler_path};${path4sdk}"
duke@0 203 elif [ "${windows_arch}" = amd64 ] ; then
duke@0 204 # AMD64 64bit Windows compiler settings
duke@0 205 if [ "${MSSDK}" != "" ] ; then
duke@0 206 platform_sdk="${MSSDK}"
duke@0 207 else
duke@0 208 platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"`
duke@0 209 fi
duke@0 210 compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
duke@0 211 # LIB and INCLUDE must use ; as a separator
duke@0 212 include4sdk="${platform_sdk}/Include"
duke@0 213 include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
duke@0 214 include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
duke@0 215 include4sdk="${include4sdk};${platform_sdk}/Include/atl"
duke@0 216 include4sdk="${include4sdk};${platform_sdk}/Include/crt"
duke@0 217 lib4sdk="${platform_sdk}/Lib/AMD64"
duke@0 218 lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
duke@0 219 # Search path and DLL locating path
duke@0 220 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@0 221 path4sdk="${platform_sdk}/bin;${path4sdk}"
duke@0 222 path4sdk="${compiler_path};${path4sdk}"
duke@0 223 fi
duke@0 224 # Export LIB and INCLUDE
duke@0 225 unset lib
duke@0 226 unset Lib
duke@0 227 LIB="${lib4sdk}"
duke@0 228 export LIB
duke@0 229 unset include
duke@0 230 unset Include
duke@0 231 INCLUDE="${include4sdk}"
duke@0 232 export INCLUDE
duke@0 233 # Set the ALT variable
duke@0 234 dirMustExist "${compiler_path}" COMPILER_PATH
duke@0 235
duke@0 236 # WINDOWS: Get the previous JDK to be used to bootstrap the build
duke@0 237 path4sdk="${bootdir}/bin;${path4sdk}"
duke@0 238
duke@0 239 # Turn all \\ into /, remove duplicates and trailing /
duke@0 240 slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
duke@0 241
duke@0 242 # For windows, it's hard to know where the system is, so we just add this
duke@0 243 # to PATH.
duke@0 244 path4sdk="${slash_path};${PATH}"
duke@0 245
duke@0 246 # Convert path4sdk to cygwin style
duke@0 247 if [ "${unix_toolset}" = CYGWIN ] ; then
duke@0 248 path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
duke@0 249 fi
duke@0 250
duke@0 251 fi
duke@0 252
duke@0 253 # Export PATH setting
duke@0 254 PATH="${path4sdk}"
duke@0 255 export PATH
duke@0 256
duke@0 257 # Unset certain vars
duke@0 258 unset LD_LIBRARY_PATH
duke@0 259 unset LD_LIBRARY_PATH_32
duke@0 260 unset LD_LIBRARY_PATH_64
duke@0 261