buildit
author Alan Coopersmith <Alan.Coopersmith@Sun.COM>
Mon, 15 Mar 2010 13:30:45 -0700
changeset 926 776b160bcc74
parent 919 425233ae7236
child 943 294f64612d23
permissions -rwxr-xr-x
6928973 Remove /usr/sfw/lib/64 symlink from SUNWfreetype2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
     1
#!/bin/ksh93
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     2
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     3
# buildit
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     4
# Script for building OpenSolaris X Consolidation
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     5
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     6
###########################################################################
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     7
#
905
d2b59d5a79ed 6926932 Removal of Xsun on SPARC [PSARC 2008/033]: X consolidation portion
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 841
diff changeset
     8
# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
     9
# Use is subject to license terms.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    10
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    11
# Permission is hereby granted, free of charge, to any person obtaining a
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    12
# copy of this software and associated documentation files (the "Software"),
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    13
# to deal in the Software without restriction, including without limitation
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    14
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    15
# and/or sell copies of the Software, and to permit persons to whom the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    16
# Software is furnished to do so, subject to the following conditions:
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    17
#
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    18
# The above copyright notice and this permission notice (including the next
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    19
# paragraph) shall be included in all copies or substantial portions of the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    20
# Software.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    21
#
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    22
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    23
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    24
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    25
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    26
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    27
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    28
# DEALINGS IN THE SOFTWARE.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    29
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    30
###########################################################################
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    31
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    32
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    33
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
    34
MAKE_PKGS=0
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    35
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    36
set -- $(getopt p $*)
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    37
if [ $? != 0 ] ; then
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    38
    print -u2 USAGE: $0 [-p]
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    39
    exit 2
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    40
fi
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    41
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    42
for i in $* ; do 
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    43
    case $i in
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    44
	-p)     MAKE_PKGS=1; shift;;
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    45
    esac
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    46
done
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    47
599
c195ef96916e 6787756 Use Solaris-bundled GNU tools where possible, instead of JDS CBE, when building X
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 585
diff changeset
    48
# Add /usr/bin to front of path in case user has /usr/gnu/bin default
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    49
# Add /usr/sbin to path for dtrace (to build probes in X servers)
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    50
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    51
PATH=/usr/bin:${PATH}:/usr/sbin
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    52
export PATH
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    53
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    54
[ -d log ] || mkdir log
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    55
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
    56
# Send all further output & errors to the log file
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    57
exec > log/buildit-XW 2>&1
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    58
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    59
# Find hg id and export it so set-elf-comments.pl doesn't have to re-run
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    60
# for every module built
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    61
export XBUILD_HG_ID="$(hg id)"
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    62
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    63
START="$(perl -e 'print time')"
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    64
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    65
print "------------------------------------------------------------------------------"
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    66
print "Building gate at hg id: ${XBUILD_HG_ID}"
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    67
print -n "Start time: " ; date
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    68
print -n "Building on: " ; uname -a
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    69
print "Using these compilers: "
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    70
whence cc gcc
599
c195ef96916e 6787756 Use Solaris-bundled GNU tools where possible, instead of JDS CBE, when building X
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 585
diff changeset
    71
# Make sure Sun C compiler is at least version 5.9 (Studio 12)
802
159b5b227862 6865400 X consolidation does not build with Studio 12 Update 1 compilers
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 705
diff changeset
    72
cc -V 2>&1 | perl -n -e 'if (($_ =~ m| C (\d+).(\d+)|)) { \
599
c195ef96916e 6787756 Use Solaris-bundled GNU tools where possible, instead of JDS CBE, when building X
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 585
diff changeset
    73
    print $_ ; print "*** Compiler too old!\n" if ( ($1 != 5) || ($2 < 9) ) }'
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
    74
gcc -v
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
    75
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    76
# Exported to stop Sun compilers from reporting home on each usage
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    77
export SUNW_NO_UPDATE_NOTIFY='true'
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    78
export UT_NO_USAGE_TRACKING='1'
705
24ca414edbff 6826940 Xorg server 1.6.1, Mesa 7.4.1, and associated module upgrades [PSARC 2009/292]
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 648
diff changeset
    79
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    80
print "Using these environment variables: "
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
    81
env
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    82
print "------------------------------------------------------------------------------"
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    83
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    84
MACH="$(uname -p)"
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
    85
if [ "${MACH}" = "i386" ]; then
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    86
    /bin/rm -rf proto-i386-svr4
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    87
else
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    88
    /bin/rm -rf proto-sun4-svr4
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    89
fi
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    90
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    91
XMAKE="$(pwd)/open-src/util/build-tools/xmake"
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    92
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    93
cd open-src
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    94
# Run as two steps to avoid race between cleaning & rebuilding when
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    95
# using parallel make
905
d2b59d5a79ed 6926932 Removal of Xsun on SPARC [PSARC 2008/033]: X consolidation portion
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 841
diff changeset
    96
${XMAKE} -v -k clean 
d2b59d5a79ed 6926932 Removal of Xsun on SPARC [PSARC 2008/033]: X consolidation portion
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 841
diff changeset
    97
${XMAKE} -v -k install
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    98
cd ..
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    99
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   100
print "\nFinished building the X Window System Consolidation for OpenSolaris.\n"
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   101
print -n "Finish time: " ; date
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   102
perl -e '$runtime = time - $ARGV[0];
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   103
	 printf("Runtime: %d:%02d\n", $runtime/3600, ($runtime%3600)/60); ' \
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   104
	"${START}"
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
   105
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
   106
if [ "${MAKE_PKGS}" = 1 ] ; then
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   107
    ./make_release_packages
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   108
fi