xfs: stress XFS delalloc indirect block reservations
[xfstests-dev.git] / make_irix
1 #!/bin/bash
2 #
3 # Copyright (c) 2004 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it would be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write the Free Software Foundation,
16 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17 #
18 #
19 # Do a build using the IRIX TOOLROOT
20 # Use "-f" to force a configure.
21 #
22
23 error=false
24
25 # Do initial checks
26
27 # check have root/toolroot set
28 if [ -z "$TOOLROOT" ]; then
29         echo "TOOLROOT needs to be set to a populated IRIX toolroot"
30         error=true
31 fi 
32 if [ -z "$ROOT" ]; then
33         echo "ROOT needs to be set to a populated IRIX root"
34         error=true
35 fi 
36
37 # check we have c compiler license
38 if ! grep -iq '^feature cc' /var/flexlm/license.dat; then
39         echo "Unable to find cc license for IRIX"
40         echo "Get license: http://www.csd.sgi.com/prod/software/swl/keyrequest.html"
41         error=true
42 fi
43
44 # check we have dev.sw.lib installed
45 # needed by ld32 even though we have $ROOT
46 if versions dev.sw.lib | grep -q dev.sw.lib; then
47         :
48 else
49         echo "dev.sw.lib is not installed"
50         echo "Install from irix-6.5-development-libraries-1/dist"
51         error=true
52 fi
53
54 # any check failures then exit out
55 $error && exit 1
56
57 # root/toolroot paths
58 fw_bin=$TOOLROOT/usr/freeware/bin
59 fw_tools=$TOOLROOT/usr/fw_tools
60 fw_share=$ROOT/usr/freeware/share
61 irix_bin=$TOOLROOT/usr/bin
62
63 # env vars
64 export AC_MACRODIR=$fw_share/autoconf
65 export M4=$irix_bin/gnum4
66 export CC=$irix_bin/cc
67 export LIBTOOL=$fw_bin/libtool
68 export MAKE=$fw_tools/gmake
69 export AWK=$irix_bin/nawk
70
71 # check all tools/files are in root/toolroot that we need
72 FILES="$AC_MACRODIR $M4 $CC $LIBTOOL $MAKE $fw_bin/aclocal $fw_bin/autoheader $fw_bin/autoconf"
73 for f in $FILES; do
74         if [ ! -e $f ]; then
75                 echo "file $f not found in ROOT/TOOLROOT"
76                 error=true
77         fi
78 done
79 $error && exit 1
80
81 # force a full configure
82 if [ $# -eq 1 ]; then
83         if [ $1 = "-f" ]; then
84                 rm -f config.cache configure include/builddefs
85                 shift
86         fi
87 fi
88
89 # --- do all the configure stuff using the toolroot paths ---
90
91 # aclocal.m4 is actually checked in - probably won't recreate it often
92 if [ ! -e aclocal.m4 ]; then
93         set -x
94         $fw_bin/aclocal --acdir=m4 --output=aclocal.m4
95         set -
96 fi
97
98 if [ ! -e ./configure ]; then
99         set -x
100         $fw_bin/autoheader
101         $fw_bin/autoconf
102         set -
103 fi
104
105 if [ ! -e include/builddefs ]; then
106         set -x
107         ./configure
108         set -
109 fi
110
111 # Now call gmake with any args we were given
112 set -x
113 $MAKE $@
114 set -