buildit revision 802
3321N/A#!/bin/ksh93
3321N/A#
3321N/A# buildit
3321N/A# Script for building OpenSolaris X Consolidation
3321N/A#
3321N/A###########################################################################
3321N/A#
3321N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3321N/A#
3321N/A# Permission is hereby granted, free of charge, to any person obtaining a
3321N/A# copy of this software and associated documentation files (the
3321N/A# "Software"), to deal in the Software without restriction, including
3321N/A# without limitation the rights to use, copy, modify, merge, publish,
3321N/A# distribute, and/or sell copies of the Software, and to permit persons
3321N/A# to whom the Software is furnished to do so, provided that the above
3321N/A# copyright notice(s) and this permission notice appear in all copies of
3321N/A# the Software and that both the above copyright notice(s) and this
3321N/A# permission notice appear in supporting documentation.
3321N/A#
3321N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
3321N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3321N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
3321N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
3321N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
3321N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
3321N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
3321N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
3321N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3321N/A#
3321N/A# Except as contained in this notice, the name of a copyright holder
3321N/A# shall not be used in advertising or otherwise to promote the sale, use
3321N/A# or other dealings in this Software without prior written authorization
3321N/A# of the copyright holder.
3321N/A#
3321N/A###########################################################################
3321N/A#
3321N/A# ident "@(#)buildit 1.8 09/05/15 SMI"
3321N/A#
3321N/A
3321N/AMAKE_PKGS=0
3321N/A
3321N/Aset -- `getopt p $*`
3321N/Aif [ $? != 0 ]
3321N/Athen
3321N/A echo USAGE: $0 [-p]
3321N/A exit 2
fi
for i in $* ; do
case $i in
-p) MAKE_PKGS=1; shift;;
esac
done
# Add /usr/bin to front of path in case user has /usr/gnu/bin default
# Add /usr/sbin to path for dtrace
# Add /usr/X11/bin to path for makedepend
PATH=/usr/bin:$PATH:/usr/sbin:/usr/X11/bin
export PATH
[ -d log ] || mkdir log
# Send all further output & errors to the log file
exec > log/buildit-XW 2>&1
echo "------------------------------------------------------------------------------"
echo "Start time: "
date
START=`perl -e 'print time'`
echo "Building on: "
uname -a
echo "Using these compilers: "
which cc gcc
# Make sure Sun C compiler is at least version 5.9 (Studio 12)
cc -V 2>&1 | perl -n -e 'if (($_ =~ m| C (\d+).(\d+)|)) { \
print $_ ; print "*** Compiler too old!\n" if ( ($1 != 5) || ($2 < 9) ) }'
gcc -v
# Exported to reduce number of times it's evaluated in makefiles
export POUND_SIGN='#'
echo "Using these environment variables: "
env
echo "------------------------------------------------------------------------------"
MACH=`uname -p`
if [ "$MACH" = "i386" ]; then
/bin/rm -rf proto-i386-svr4
else
/bin/rm -rf proto-sun4-svr4
fi
cd open-src
make -k clean install
cd ..
echo ""
date
echo "\nFinished building the X Window System Consolidation for OpenSolaris.\n"
echo ""
echo "Finish time: "
date
perl -e '$runtime=time-$ARGV[0];printf("Runtime: %d:%02d\n", $runtime/3600, ($runtime%3600)/60); ' $START
if [ $MAKE_PKGS = 1 ] ; then
PACKAGE_LIST=`cd packages && echo SUNW* FSW*`
export PACKAGE_LIST
chmod +x make_release_packages
mkdir packages/common_files
./make_release_packages
fi