]> git.lyx.org Git - lyx.git/blob - autogen.sh
Add autoconf 2.62 to the list of supported versions
[lyx.git] / autogen.sh
1 #!/bin/sh
2
3 ACLOCAL="aclocal -I m4 -I config"
4 AUTOHEADER="autoheader"
5 AUTOMAKE="automake --add-missing --copy --foreign"
6 AUTOCONF="autoconf"
7
8 # Discover what version of automake we are using.
9 automake_version=`$AUTOMAKE --version 2>/dev/null | head -n 1`
10
11 test "$automake_version" != "" && {
12     echo "Using $automake_version"
13 } || {
14     echo "LyX requires automake >= 1.5"
15     exit 1
16 }
17
18 case $automake_version in
19     *' '1.[5-9]*|*' '1.10*)
20         ;;
21     *)
22
23         echo "This automake version is not supported by LyX."
24         echo "LyX only supports automake 1.5 to 1.10."
25         exit 1
26         ;;
27 esac
28
29 # Discover what version of autoconf we are using.
30 autoversion=`$AUTOCONF --version 2>/dev/null | head -n 1`
31
32 test "$autoversion" != "" && {
33     echo "Using $autoversion"
34 } || {
35     echo "LyX requires autoconf >= 2.52"
36     exit 1
37 }
38
39 case $autoversion in
40     *' '2.5[2-9]|*' '2.60[ab]|*' '2.6[0-2])
41         ;;
42     *)
43         echo "This autoconf version is not supported by LyX."
44         echo "LyX only supports autoconf 2.52-2.61."
45         exit 1
46         ;;
47 esac
48
49 echo -n "Locating GNU m4... "
50 GNUM4=
51 for prog in $M4 gm4 gnum4 m4; do
52         # continue if $prog generates error (e.g. does not exist)
53         ( $prog --version ) < /dev/null > /dev/null 2>&1
54         if test $? -ne 0 ; then continue; fi
55
56         # /dev/null input prevents a hang of the script for some m4 compilers (e.g. on FreeBSD)
57         case `$prog --version < /dev/null 2>&1` in
58         *GNU*)  GNUM4=$prog
59                 break ;;
60         esac
61 done
62 if test x$GNUM4 = x ; then
63         echo "not found."
64         exit 1
65 else
66         echo `which $GNUM4`
67 fi
68
69 # Delete old cache directories.
70 # automake will stop if their contents was created by an earlier version.
71 rm -rf autom4te.cache
72
73 # Generate the Makefiles and configure files
74 if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
75         echo "Building macros..."
76         for dir in . ; do
77             echo "        $dir"
78             ( cd $dir ; $ACLOCAL )
79         done
80         echo "done."
81 else
82         echo "aclocal not found -- aborting"
83         exit 1
84 fi
85
86 if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
87         echo "Building config header template..."
88         for dir in . ; do
89             echo "        $dir"
90             ( cd $dir ; $AUTOHEADER )
91         done
92         echo "done."
93 else
94         echo "autoheader not found -- aborting"
95         exit 1
96 fi
97
98 if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
99         echo "Building Makefile templates..."
100         for dir in . ; do
101             echo "        $dir"
102             ( cd $dir ; $AUTOMAKE )
103         done
104         echo "done."
105 else
106         echo "automake not found -- aborting"
107         exit 1
108 fi
109
110 if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
111         echo "Building configure..."
112         for dir in . ; do
113             echo "       $dir"
114             ( cd $dir ; $AUTOCONF )
115         done
116         echo "done."
117 else
118         echo "autoconf not found -- aborting"
119         exit 1
120 fi
121
122 echo
123 echo 'run "./configure ; make"'
124 echo