]> git.mxchange.org Git - flightgear.git/blob - autogen.sh
Brandon Bergren:
[flightgear.git] / autogen.sh
1 #!/bin/sh
2
3 OSTYPE=`uname -s`
4 MACHINE=`uname -m`
5 AUTO_MAKE_VERSION=`automake --version | head -1 | awk '{print $4}' | sed -e 's/\-p[0-9]$//' | sed -e 's/\.//'`
6
7 echo "Host info: $OSTYPE $MACHINE"
8 echo -n " automake: `automake --version | head -1 | awk '{print $4}'`"
9 echo " ($AUTO_MAKE_VERSION)"
10 echo ""
11
12 ACLOCAL_OPTS=""
13 if [ $AUTO_MAKE_VERSION -ge 14 ]; then
14     if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then    echo " -I ."
15         ACLOCAL_OPTS="-I ."
16     fi
17 fi
18 echo "Running aclocal $ACLOCAL_OPTS"
19 aclocal $ACLOCAL_OPTS 2> autogen.err
20
21 echo "Running autoheader"
22 autoheader 2>> autogen.err
23 if [ ! -e src/Include/config.h.in ]; then
24     echo "ERROR: autoheader didn't create simgear/simgear_config.h.in!"
25     echo "Aborting ... consulte autogen.err for details."
26     exit 1
27 fi    
28
29 echo -n "Running automake"
30 if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then
31     echo " --add-missing --include-deps"
32     automake --add-missing --include-deps 2>> autogen.err
33 else
34     echo " --add-missing"
35     automake --add-missing 2>> autogen.err
36 fi
37
38 echo "Running autoconf"
39 autoconf 2>> autogen.err
40
41 if [ ! -e configure ]; then
42     echo "ERROR: configure was not created!"
43     echo "Aborting ... consulte autogen.err for details."
44     exit 1
45 fi
46
47 # fixup Makefiles for Irix
48 if test "$OSTYPE" = "IRIX" -o "$OSTYPE" = "IRIX64"; then
49     echo "Fixing Makefiles for Irix"
50     for n in `find . -name Makefile.in`; do \
51         mv -f $n $n.ar-new; \
52         sed 's/$(AR) cru /$(AR) -o /g' $n.ar-new > $n; \
53         rm -f $n.ar-new; \
54     done;
55 fi
56
57 echo ""
58 echo "======================================"
59
60 if [ -f config.cache ]; then
61     echo "config.cache exists.  Removing the config.cache file will force"
62     echo "the ./configure script to rerun all it's tests rather than using"
63     echo "the previously cached values."
64     echo ""
65 fi
66
67 echo "Now you are ready to run './configure'"
68 echo "======================================"
69
70 rm -f autogen.err