]> git.lyx.org Git - lyx.git/blob - autogen.sh
Trivial; keep the error message in sync with reality.
[lyx.git] / autogen.sh
1 #!/bin/sh
2
3 ACLOCAL="aclocal"
4 AUTOHEADER="autoheader"
5 AUTOMAKE="automake -a -c --foreign"
6 AUTOCONF="autoconf"
7 ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4 progtest.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 pspell.m4 pkg.m4"
8
9 # Discover what version of autoconf we are using.
10 autoversion=`$AUTOCONF --version | head -n 1`
11
12 echo "Using $autoversion"
13 case $autoversion in
14     *2.13)
15         cp config/acconfig.h .
16         cp config/configure.in .
17         rm -f configure.ac
18         cp config/relyx_configure.in lib/reLyX/configure.in
19         rm -f lib/reLyX/configure.ac
20         EXTRA_ACINCLUDE_FILES="lyxinclude213.m4"
21         ;;
22     *2.5[236])
23         rm -f acconfig.h
24         rm -f configure.in
25         cp config/configure.ac .
26         rm -f lib/reLyX/configure.in
27         cp config/relyx_configure.ac lib/reLyX/configure.ac
28         EXTRA_ACINCLUDE_FILES="lyxinclude25x.m4"
29         ;;
30     *)
31         echo "This autoconf version is not supported by LyX."
32         echo "LyX only supports autoconf 2.13 and 2.5[236]."
33         exit
34         ;;
35 esac
36
37 echo -n "Locating GNU m4... "
38 GNUM4=
39 for prog in $M4 gm4 gnum4 m4; do
40         # continue if $prog generates error (e.g. does not exist)
41         ( $prog --version ) < /dev/null > /dev/null 2>&1
42         if test $? -ne 0 ; then continue; fi
43
44         # /dev/null input prevents a hang of the script for some m4 compilers (e.g. on FreeBSD)
45         case `$prog --version < /dev/null 2>&1` in
46         *GNU*)  GNUM4=$prog
47                 break ;;
48         esac
49 done
50 if test x$GNUM4 = x ; then
51         echo "not found."
52         exit
53 else
54         echo `which $GNUM4`
55 fi
56
57 # Generate acinclude.m4
58 echo -n "Generate acinclude.m4... "
59 rm -f acinclude.m4
60 (cd config ; cat ${ACINCLUDE_FILES} ${EXTRA_ACINCLUDE_FILES} >../acinclude.m4)
61 echo "done."
62
63 # Generate the Makefiles and configure files
64 if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
65         echo "Building macros..."
66         for dir in . lib/reLyX ; do
67             echo "        $dir"
68             ( cd $dir ; $ACLOCAL )
69         done
70         echo "done."
71 else
72         echo "aclocal not found -- aborting"
73         exit
74 fi
75
76 if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
77         echo "Building config header template..."
78         for dir in . ; do
79             echo "        $dir"
80             ( cd $dir ; $AUTOHEADER )
81         done
82         echo "done."
83 else
84         echo "autoheader not found -- aborting"
85         exit
86 fi
87
88 if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
89         echo "Building Makefile templates..."
90         for dir in . lib/reLyX ; do
91             echo "        $dir"
92             ( cd $dir ; $AUTOMAKE )
93         done
94         echo "done."
95 else
96         echo "automake not found -- aborting"
97         exit
98 fi
99
100 if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
101         echo "Building configure..."
102         for dir in . lib/reLyX ; do
103             echo "       $dir"
104             ( cd $dir ; $AUTOCONF )
105         done
106         echo "done."
107 else
108         echo "autoconf not found -- aborting"
109         exit
110 fi
111
112 # Autogenerate lib/configure.m4.
113 echo -n "Building lib/configure ... "
114 rm -f lib/configure
115 $GNUM4 lib/configure.m4 > lib/configure
116 chmod a+x lib/configure
117 echo "done."
118
119 echo
120 echo 'run "./configure ; make"'
121 echo