2004-10-22 14:38:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
|
|
|
|
# Do a build using the IRIX TOOLROOT
|
|
|
|
|
# Use "-f" to force a configure.
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2004 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
# under the terms of version 2 of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it would be useful, but
|
|
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
#
|
|
|
|
|
# Further, this software is distributed without any warranty that it is
|
|
|
|
|
# free of the rightful claim of any third person regarding infringement
|
|
|
|
|
# or the like. Any license provided herein, whether implied or
|
|
|
|
|
# otherwise, applies only to this software file. Patent licenses, if
|
|
|
|
|
# any, provided herein do not apply to combinations of this program with
|
|
|
|
|
# other software, or any other product whatsoever.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
|
# with this program; if not, write the Free Software Foundation, Inc., 59
|
|
|
|
|
# Temple Place - Suite 330, Boston MA 02111-1307, USA.
|
|
|
|
|
#
|
|
|
|
|
# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
|
|
|
|
|
# Mountain View, CA 94043, or:
|
|
|
|
|
#
|
|
|
|
|
# http://www.sgi.com
|
|
|
|
|
#
|
|
|
|
|
# For further information regarding this notice, see:
|
|
|
|
|
#
|
|
|
|
|
# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
error=false
|
2005-06-27 14:57:07 +00:00
|
|
|
|
|
|
|
|
# Do initial checks
|
|
|
|
|
|
|
|
|
|
# check have root/toolroot set
|
2004-10-22 14:38:06 +00:00
|
|
|
if [ -z "$TOOLROOT" ]; then
|
|
|
|
|
echo "TOOLROOT needs to be set to a populated IRIX toolroot"
|
|
|
|
|
error=true
|
|
|
|
|
fi
|
|
|
|
|
if [ -z "$ROOT" ]; then
|
|
|
|
|
echo "ROOT needs to be set to a populated IRIX root"
|
|
|
|
|
error=true
|
|
|
|
|
fi
|
2005-06-27 14:57:07 +00:00
|
|
|
|
|
|
|
|
# check we have c compiler license
|
|
|
|
|
if ! grep -iq '^feature cc' /var/flexlm/license.dat; then
|
|
|
|
|
echo "Unable to find cc license for IRIX"
|
|
|
|
|
echo "Get license: http://www.csd.sgi.com/prod/software/swl/keyrequest.html"
|
|
|
|
|
error=true
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# check we have dev.sw.lib installed
|
|
|
|
|
# needed by ld32 even though we have $ROOT
|
|
|
|
|
if versions dev.sw.lib | grep -q dev.sw.lib; then
|
|
|
|
|
:
|
|
|
|
|
else
|
|
|
|
|
echo "dev.sw.lib is not installed"
|
|
|
|
|
echo "Install from irix-6.5-development-libraries-1/dist"
|
|
|
|
|
error=true
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# any check failures then exit out
|
2004-10-22 14:38:06 +00:00
|
|
|
$error && exit 1
|
|
|
|
|
|
|
|
|
|
# root/toolroot paths
|
|
|
|
|
fw_bin=$TOOLROOT/usr/freeware/bin
|
|
|
|
|
fw_tools=$TOOLROOT/usr/fw_tools
|
|
|
|
|
fw_share=$ROOT/usr/freeware/share
|
|
|
|
|
irix_bin=$TOOLROOT/usr/bin
|
|
|
|
|
|
|
|
|
|
# env vars
|
|
|
|
|
export AC_MACRODIR=$fw_share/autoconf
|
|
|
|
|
export M4=$irix_bin/gnum4
|
|
|
|
|
export CC=$irix_bin/cc
|
|
|
|
|
export LIBTOOL=$fw_bin/libtool
|
|
|
|
|
export MAKE=$fw_tools/gmake
|
|
|
|
|
export AWK=$irix_bin/nawk
|
|
|
|
|
|
|
|
|
|
# check all tools/files are in root/toolroot that we need
|
|
|
|
|
FILES="$AC_MACRODIR $M4 $CC $LIBTOOL $MAKE $fw_bin/aclocal $fw_bin/autoheader $fw_bin/autoconf"
|
|
|
|
|
for f in $FILES; do
|
|
|
|
|
if [ ! -e $f ]; then
|
|
|
|
|
echo "file $f not found in ROOT/TOOLROOT"
|
|
|
|
|
error=true
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
$error && exit 1
|
|
|
|
|
|
|
|
|
|
# force a full configure
|
|
|
|
|
if [ $# -eq 1 ]; then
|
|
|
|
|
if [ $1 = "-f" ]; then
|
2005-06-27 14:57:07 +00:00
|
|
|
rm -f config.cache configure include/builddefs
|
2004-10-22 14:38:06 +00:00
|
|
|
shift
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# --- do all the configure stuff using the toolroot paths ---
|
|
|
|
|
|
|
|
|
|
# aclocal.m4 is actually checked in - probably won't recreate it often
|
|
|
|
|
if [ ! -e aclocal.m4 ]; then
|
|
|
|
|
set -x
|
|
|
|
|
$fw_bin/aclocal --acdir=m4 --output=aclocal.m4
|
|
|
|
|
set -
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! -e ./configure ]; then
|
|
|
|
|
set -x
|
|
|
|
|
$fw_bin/autoheader
|
|
|
|
|
$fw_bin/autoconf
|
|
|
|
|
set -
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! -e include/builddefs ]; then
|
|
|
|
|
set -x
|
|
|
|
|
./configure
|
|
|
|
|
set -
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Now call gmake with any args we were given
|
|
|
|
|
set -x
|
|
|
|
|
$MAKE $@
|
|
|
|
|
set -
|