Update copyright annotations and license boilerplates to correspond with SGI Legals...
[xfstests-dev.git] / make_irix
1 #!/bin/sh
2 #
3 # Do a build using the IRIX TOOLROOT
4 # Use "-f" to force a configure.
5 #
6 # Copyright (c) 2004 Silicon Graphics, Inc.  All Rights Reserved.
7
8 # This program is free software; you can redistribute it and/or modify it
9 # under the terms of version 2 of the GNU General Public License as
10 # published by the Free Software Foundation.
11
12 # This program is distributed in the hope that it would be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
16 # Further, this software is distributed without any warranty that it is
17 # free of the rightful claim of any third person regarding infringement
18 # or the like.  Any license provided herein, whether implied or
19 # otherwise, applies only to this software file.  Patent licenses, if
20 # any, provided herein do not apply to combinations of this program with
21 # other software, or any other product whatsoever.
22
23 # You should have received a copy of the GNU General Public License along
24 # with this program; if not, write the Free Software Foundation, Inc., 59
25 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
26
27 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
28 # Mountain View, CA  94043, or:
29
30 # http://www.sgi.com 
31
32 # For further information regarding this notice, see: 
33
34 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
35 #
36 #
37
38 error=false
39
40 # Do initial checks
41
42 # check have root/toolroot set
43 if [ -z "$TOOLROOT" ]; then
44         echo "TOOLROOT needs to be set to a populated IRIX toolroot"
45         error=true
46 fi 
47 if [ -z "$ROOT" ]; then
48         echo "ROOT needs to be set to a populated IRIX root"
49         error=true
50 fi 
51
52 # check we have c compiler license
53 if ! grep -iq '^feature cc' /var/flexlm/license.dat; then
54         echo "Unable to find cc license for IRIX"
55         echo "Get license: http://www.csd.sgi.com/prod/software/swl/keyrequest.html"
56         error=true
57 fi
58
59 # check we have dev.sw.lib installed
60 # needed by ld32 even though we have $ROOT
61 if versions dev.sw.lib | grep -q dev.sw.lib; then
62         :
63 else
64         echo "dev.sw.lib is not installed"
65         echo "Install from irix-6.5-development-libraries-1/dist"
66         error=true
67 fi
68
69 # any check failures then exit out
70 $error && exit 1
71
72 # root/toolroot paths
73 fw_bin=$TOOLROOT/usr/freeware/bin
74 fw_tools=$TOOLROOT/usr/fw_tools
75 fw_share=$ROOT/usr/freeware/share
76 irix_bin=$TOOLROOT/usr/bin
77
78 # env vars
79 export AC_MACRODIR=$fw_share/autoconf
80 export M4=$irix_bin/gnum4
81 export CC=$irix_bin/cc
82 export LIBTOOL=$fw_bin/libtool
83 export MAKE=$fw_tools/gmake
84 export AWK=$irix_bin/nawk
85
86 # check all tools/files are in root/toolroot that we need
87 FILES="$AC_MACRODIR $M4 $CC $LIBTOOL $MAKE $fw_bin/aclocal $fw_bin/autoheader $fw_bin/autoconf"
88 for f in $FILES; do
89         if [ ! -e $f ]; then
90                 echo "file $f not found in ROOT/TOOLROOT"
91                 error=true
92         fi
93 done
94 $error && exit 1
95
96 # force a full configure
97 if [ $# -eq 1 ]; then
98         if [ $1 = "-f" ]; then
99                 rm -f config.cache configure include/builddefs
100                 shift
101         fi
102 fi
103
104 # --- do all the configure stuff using the toolroot paths ---
105
106 # aclocal.m4 is actually checked in - probably won't recreate it often
107 if [ ! -e aclocal.m4 ]; then
108         set -x
109         $fw_bin/aclocal --acdir=m4 --output=aclocal.m4
110         set -
111 fi
112
113 if [ ! -e ./configure ]; then
114         set -x
115         $fw_bin/autoheader
116         $fw_bin/autoconf
117         set -
118 fi
119
120 if [ ! -e include/builddefs ]; then
121         set -x
122         ./configure
123         set -
124 fi
125
126 # Now call gmake with any args we were given
127 set -x
128 $MAKE $@
129 set -