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