]> git.mxchange.org Git - simgear.git/blob - autogen.sh
733ac8d04199177bf9fe3620146e60a71cb468af
[simgear.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/\.\([0-9]*\).*/\1/'`
6 if test $AUTO_MAKE_VERSION -lt 15; then
7     echo ""
8     echo "You need to upgrade to automake version 1.5 or greater."
9     echo "Most distributions have packages available to install or you can"
10     echo "find the source for the most recent version at"
11     echo "ftp://ftp.gnu.org/gnu/automake"
12     exit 1
13 fi
14
15 echo "Host info: $OSTYPE $MACHINE"
16 echo -n " automake: `automake --version | head -1 | awk '{print $4}'`"
17 echo " ($AUTO_MAKE_VERSION)"
18 echo ""
19
20 ACLOCAL_OPTS=""
21 if [ $AUTO_MAKE_VERSION -ge 14 ]; then
22     if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then    echo " -I ."
23         ACLOCAL_OPTS="-I ."
24     fi
25 fi
26 echo "Running aclocal $ACLOCAL_OPTS"
27 aclocal $ACLOCAL_OPTS
28
29 echo "Running autoheader"
30 autoheader
31 if [ ! -e simgear/simgear_config.h.in ]; then
32     echo "ERROR: autoheader didn't create simgear/simgear_config.h.in!"
33     exit 1
34 fi    
35
36 echo -n "Running automake"
37 if [ $OSTYPE = "IRIX" -o $OSTYPE = "IRIX64" ]; then
38     echo " --add-missing --include-deps"
39     automake --add-missing --include-deps
40 else
41     echo " --add-missing"
42     automake --add-missing
43 fi
44
45 echo "Running autoconf"
46 autoconf
47
48 if [ ! -e configure ]; then
49     echo "ERROR: configure was not created!"
50     exit 1
51 fi
52
53 # fixup Makefiles for Irix
54 if test "$OSTYPE" = "IRIX" -o "$OSTYPE" = "IRIX64"; then
55     echo "Fixing Makefiles for Irix"
56     for n in `find . -name Makefile.in`; do \
57         mv -f $n $n.ar-new; \
58         sed 's/$(AR) cru /$(AR) -o /g' $n.ar-new > $n; \
59         rm -f $n.ar-new; \
60     done;
61 fi
62
63 echo ""
64 echo "======================================"
65
66 if [ -f config.cache ]; then
67     echo "config.cache exists.  Removing the config.cache file will force"
68     echo "the ./configure script to rerun all it's tests rather than using"
69     echo "the previously cached values."
70     echo ""
71 fi
72
73 echo "Now you are ready to run './configure'"
74 echo "======================================"