buildit
author henryzh <henry.zhao@oracle.com>
Tue, 27 Jan 2015 17:22:30 -0800
changeset 1497 0d93999e1d26
parent 1494 a72f39592745
child 1499 0246d6998615
permissions -rwxr-xr-x
19477028 Toshiba laptop - external monitor cannot be enabled after booting 20185088 Fix parfait errors for dispswitch
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
1422
4db080f5236f 17861091 Remove workarounds for old compiler bugs
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1296
diff changeset
     4
# Script for building Solaris X Consolidation
0
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
#
1494
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1479
diff changeset
     8
# Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
     9
#
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    10
# 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
    11
# 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
    12
# 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
    13
# 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
    14
# 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
    15
# 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
    16
#
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    17
# 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
    18
# 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
    19
# Software.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    20
#
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    21
# 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
    22
# 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
    23
# 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
    24
# 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
    25
# 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
    26
# 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
    27
# DEALINGS IN THE SOFTWARE.
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    28
#
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
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
    33
# Add /usr/bin to front of path in case user has /usr/gnu/bin default
1124
7bc7e624f965 7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1022
diff changeset
    34
# Add /usr/gnu/bin to path for gnu sed/awk/etc. that configure scripts prefer
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
    35
# Add /usr/sbin to path for dtrace (to build probes in X servers)
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
    36
1494
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1479
diff changeset
    37
MACH="$(uname -p)"
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1479
diff changeset
    38
a72f39592745 PSARC 2014/148 Move DRM drivers to X11
Randy Fishel <Randy.Fishel@Oracle.COM>
parents: 1479
diff changeset
    39
PATH=/usr/bin:${PATH}:/usr/gnu/bin:/usr/sbin:/opt/onbld/bin/${MACH}
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
    40
export PATH
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    41
1003
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
    42
progname="$0"
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
    43
function fatal_error
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
    44
{
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
    45
    print -u2 "${progname}: ERROR: $*"
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
    46
    exit 1
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
    47
}
a4d17d6bc179 6980773 X gate needs branding options
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 970
diff changeset
    48
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
    49
MAKE_PKGS=0
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
    50
MAKE_SRC_RELEASE=0	# generate sources for Solaris FOSS release process
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    51
VERBOSE_FLAGS=""	# verbosity flag passed to xmake/make_release_packages
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    52
PUBLISHER_FLAGS=""
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
    53
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
    54
while getopts pP:sv i; do
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    55
    case $i in
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    56
	p) MAKE_PKGS=1 ;;
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
    57
	s) MAKE_SRC_RELEASE=1 ;;
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    58
	v) VERBOSE_FLAGS="-v" ;;
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    59
	P) PUBLISHER_FLAGS="-p $OPTARG" ;;
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
    60
	?) print -u2 "USAGE: $0 [-p [-P publisher]] [-s] [-v]"; exit 2 ;;
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    61
    esac
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    62
done
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    63
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    64
shift $(($OPTIND-1))
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    65
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    66
if [[ $? != 0 ]] ; then
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    67
    print -u2 "USAGE: $0 [-p [-P publisher]] [-v]"
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    68
    exit 2
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    69
fi
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    70
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    71
[ -d log ] || mkdir log
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    72
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
    73
# 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
    74
exec > log/buildit-XW 2>&1
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
    75
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    76
START="$(perl -e 'print time')"
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    77
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    78
XMAKE="$(pwd)/open-src/util/build-tools/xmake ${VERBOSE_FLAGS} -k"
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    79
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    80
${XMAKE} setup || fatal_error "make setup failed: cannot build"
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    81
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    82
# Extract variables from makefiles via make and set them in the shell
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    83
get_make_var() {
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    84
    typeset -n var=$1
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    85
    eval "$(${XMAKE} -s -C open-src/util/util-macros print_make_vars VARS=$1)"
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    86
}
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
    87
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    88
# 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
    89
# for every module built
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    90
hg_id() {
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    91
    hg id -it | read rev tag
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    92
    case "${tag}" in
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    93
        tip)	print "${rev}" ;;
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    94
        *)	print "${tag}" ;;
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    95
    esac
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    96
}
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
    97
export XBUILD_HG_ID="$(hg_id)"
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    98
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
    99
print "------------------------------------------------------------------------------"
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 "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
   101
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
   102
print -n "Building on: " ; uname -a
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   103
print "Using these tools: "
1422
4db080f5236f 17861091 Remove workarounds for old compiler bugs
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1296
diff changeset
   104
# Make sure Studio C compiler is at least version 5.12 (Studio 12.3)
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   105
whence cc
802
159b5b227862 6865400 X consolidation does not build with Studio 12 Update 1 compilers
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 705
diff changeset
   106
cc -V 2>&1 | perl -n -e 'if (($_ =~ m| C (\d+).(\d+)|)) { \
1422
4db080f5236f 17861091 Remove workarounds for old compiler bugs
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1296
diff changeset
   107
    print $_ ; ( ($1 != 5) || ($2 < 12) ) ? exit(1) : exit(0) }' \
4db080f5236f 17861091 Remove workarounds for old compiler bugs
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1296
diff changeset
   108
    || fatal_error '*** Studio Compiler is too old! Studio 12.3 is required.' 
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   109
# Log paths & versions of tools which use gnu standard --version flag
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   110
get_make_var GCC
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   111
for tool in parfait ${GCC} gmake autoconf automake libtool ; do
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   112
    printf "%-22s\t" "$(whence ${tool}):"
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   113
    ${tool} --version | head -1
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   114
done
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
   115
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   116
# Exported to stop Studio compilers from reporting home on each usage
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
   117
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
   118
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
   119
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   120
print "Using these environment variables: "
493
f43507b5737d 6735203 open-src Makefile cleanup & enhancements
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 379
diff changeset
   121
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
   122
print "------------------------------------------------------------------------------"
810
6f94d3da0552 6889793 enable parallel builds of the X consolidation
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 802
diff changeset
   123
970
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   124
# Clean new proto areas for this architecture
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   125
/bin/rm -rf "proto/root_${MACH}" "proto/metadata_${MACH}" \
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   126
    "proto/pkg_${MACH}" "proto/tools_${MACH}"
272328fe1b4a 6941932 X should be able to build IPS packages natively
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 967
diff changeset
   127
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   128
${XMAKE} clobber
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   129
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   130
# Generate source release while tree is in clean state, but ensure we have all
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   131
# the required tarballs for both platforms, (and no extras/old ones) first.
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   132
if [ "${MAKE_SRC_RELEASE}" = 1 ] ; then
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   133
    rm -rf open-src/tarballs
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   134
    mkdir -p open-src/tarballs
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   135
    for darch in i386 sparc ; do
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   136
	(cd open-src ; \
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   137
	  ${XMAKE} download MACH="${darch}" ADD_PASSDOWN_VARS="MACH=${darch}")
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   138
    done
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   139
    rm -f proto/x.zip BUILD_INSTRUCTIONS.txt pkglist.txt
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   140
    ${XMAKE} proto/x.zip
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   141
fi
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   142
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   143
cd open-src
967
efbd0ee6805d 6963229 build race conditions and other makefile issues
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 943
diff changeset
   144
${XMAKE} install
1196
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   145
${XMAKE} check_rtime > ../log/check-rtime 2>&1 &
0
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   146
cd ..
b949c5054bc4 Initial OpenSolaris release: X-src-20060331
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
diff changeset
   147
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   148
get_make_var USE_PARFAIT
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   149
if [[ "${USE_PARFAIT}" == "yes" ]] ; then
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   150
    get_make_var DMAKE_MAX_JOBS
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   151
    /bin/rm -rf log/parfait
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   152
    parfait -e all -c open-src/common/X-parfait.conf -z "$(pwd)" \
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   153
        -j "${DMAKE_MAX_JOBS:-100%}" -r "${XBUILD_HG_ID}" \
1479
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   154
        -o log/parfait.txt -g log/parfait ${X_ADD_PARFAIT_FLAGS} \
4a76cf532c2c 19978574 Need an automated, repeatable way to generate X's FOSS required source releases
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1466
diff changeset
   155
        open-src > log/parfait.out 2>&1 &
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   156
fi
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   157
1196
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   158
# Set DISTRO_NAME based on open-src/common/Makefile.options
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   159
get_make_var DISTRO_NAME
1196
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   160
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   161
print "\nFinished building the X Window System Consolidation for" \
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   162
    "${DISTRO_NAME:-OpenSolaris}.\n"
1130
e9cbce844ef6 7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   163
e9cbce844ef6 7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   164
if [ "${MAKE_PKGS}" = 1 ] ; then
e9cbce844ef6 7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   165
    print -n "Build finish time: " ; date ; print ""
e9cbce844ef6 7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   166
    ./make_release_packages ${PUBLISHER_FLAGS} ${VERBOSE_FLAGS}
e9cbce844ef6 7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   167
fi
e9cbce844ef6 7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   168
1196
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   169
wait
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   170
1296
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   171
if [[ "${USE_PARFAIT}" == "yes" ]] ; then
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   172
    print -n "\nParfait issues: "
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   173
    wc -l < log/parfait/bugstatus.db
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   174
    print "Parfait results:"
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   175
    print " file:///net/$(hostname)$(pwd)/log/parfait/index.html"
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   176
fi
9f021f447b92 7172112 X builds need to add a layer of parfait on top
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1196
diff changeset
   177
1196
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   178
print -n "\ncheck-rtime errors: "
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   179
grep -c '^====' log/check-rtime
1ce455dae979 7081325 X builds should run check_rtime to ensure binaries are linked well
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1130
diff changeset
   180
1130
e9cbce844ef6 7041591 duplicate and missing dependencies in x11 IPS packages
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 1124
diff changeset
   181
print -n "\nFinish time: " ; date
906
4c633d8c519b 6927451 X gate build scripts & Makefiles need adjustments for hg master gate
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 905
diff changeset
   182
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
   183
	 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
   184
	"${START}"