buildit revision 379
1N/A#!/bin/sh
1N/A#
1N/A# buildit
1N/A# Script for building OpenSolaris X Consolidation
1N/A#
1N/A###########################################################################
1N/A#
1N/A# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
1N/A#
1N/A# Permission is hereby granted, free of charge, to any person obtaining a
1N/A# copy of this software and associated documentation files (the
1N/A# "Software"), to deal in the Software without restriction, including
1N/A# without limitation the rights to use, copy, modify, merge, publish,
1N/A# distribute, and/or sell copies of the Software, and to permit persons
1N/A# to whom the Software is furnished to do so, provided that the above
1N/A# copyright notice(s) and this permission notice appear in all copies of
1N/A# the Software and that both the above copyright notice(s) and this
1N/A# permission notice appear in supporting documentation.
1N/A#
1N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1N/A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1N/A# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
1N/A# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1N/A# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
1N/A# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
1N/A# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
1N/A# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1N/A# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1N/A#
1N/A# Except as contained in this notice, the name of a copyright holder
1N/A# shall not be used in advertising or otherwise to promote the sale, use
1N/A# or other dealings in this Software without prior written authorization
1N/A# of the copyright holder.
1N/A#
1N/A###########################################################################
1N/A#
1N/A# ident "@(#)buildit 1.3 08/03/24 SMI"
1N/A#
1N/A
1N/A
1N/ACLOBBER=0
1N/AMAKE_PKGS=0
1N/AXORG_BUILD_ARGS="$*"
1N/A
1N/Aset -- `getopt cp $*`
1N/Aif [ $? != 0 ]
1N/Athen
1N/A echo USAGE: $0 [-c] [-p]
1N/A exit 2
1N/Afi
1N/A
1N/Afor i in $* ; do
1N/A case $i in
1N/A -c) CLOBBER=1; shift;;
1N/A -p) MAKE_PKGS=1; shift;;
1N/A esac
1N/Adone
1N/A
1N/A
1N/A# Add /usr/sfw/bin, /opt/sfw/bin, & /opt/jdsbld/bin to path for GNU tools
1N/A
1N/APATH=$PATH:/opt/jdsbld/bin:/usr/sfw/bin:/opt/sfw/bin
1N/Aexport PATH
1N/A
1N/A[ -d log ] || mkdir log
1N/A
1N/A# Append all further output & errors to the log file
1N/Aexec > log/buildit-XW 2>&1
1N/A
1N/Aecho "------------------------------------------------------------------------------"
1N/Aecho "Start time: "
1N/Adate
1N/ASTART=`perl -e 'print time'`
1N/Aecho "Building on: "
1N/Auname -a
1N/Aecho "Using this compiler: "
1N/Awhich cc
1N/Acc -V
1N/A
1N/AMACH=`uname -p`
1N/Aif [ "$MACH" = "i386" ]; then
1N/A /bin/rm -rf proto-i386-svr4
1N/Aelse
1N/A /bin/rm -rf proto-sun4-svr4
1N/Afi
1N/A
1N/Acd open-src
1N/Amake -k clean install
1N/Acd ..
1N/A
1N/Aif [ $MAKE_PKGS = 1 ] ; then
1N/A PACKAGE_LIST=`cd packages && echo SUNW*`
1N/A export PACKAGE_LIST
1N/A chmod +x make_release_packages
1N/A mkdir packages/common_files
1N/A ./make_release_packages
1N/Afi
1N/A
1N/A
1N/Aecho ""
1N/Adate
1N/Aecho "\nFinished building the X Window System Consolidation for OpenSolaris.\n"
1N/Aecho ""
1N/Aecho "Finish time: "
1N/Adate
1N/Aperl -e '$runtime=time-$ARGV[0];printf("Runtime: %d:%02d\n", $runtime/3600, ($runtime%3600)/60); ' $START
1N/A