fixing wrong case of \lang -> \language
[lyx.git] / autogen.sh
blobc1740d5928061cb617ddbd8fdf6d85b6e75cef16
1 #!/bin/sh
3 ACLOCAL="aclocal -I ${PWD}/m4"
4 AUTOHEADER="autoheader"
5 AUTOMAKE="automake -a -c --foreign"
6 AUTOCONF="autoconf"
7 ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 spell.m4 cygwin.m4 pkg.m4"
9 # Discover what version of automake we are using.
10 automake_version=`$AUTOMAKE --version 2>/dev/null | head -n 1`
12 test "$automake_version" != "" && {
13 echo "Using $automake_version"
14 } || {
15 echo "LyX requires automake >= 1.5"
16 exit 1
19 case $automake_version in
20 *' '1.[5-9]*)
24 echo "This automake version is not supported by LyX."
25 echo "LyX only supports automake 1.[5-9]."
26 exit 1
28 esac
30 # Discover what version of autoconf we are using.
31 autoversion=`$AUTOCONF --version 2>/dev/null | head -n 1`
33 test "$autoversion" != "" && {
34 echo "Using $autoversion"
35 } || {
36 echo "LyX requires autoconf >= 2.52"
37 exit 1
40 case $autoversion in
41 *' '2.5[2-9])
42 EXTRA_ACINCLUDE_FILES="lyxinclude25x.m4"
45 echo "This autoconf version is not supported by LyX."
46 echo "LyX only supports autoconf 2.5[2-9]."
47 exit 1
49 esac
51 echo -n "Locating GNU m4... "
52 GNUM4=
53 for prog in $M4 gm4 gnum4 m4; do
54 # continue if $prog generates error (e.g. does not exist)
55 ( $prog --version ) < /dev/null > /dev/null 2>&1
56 if test $? -ne 0 ; then continue; fi
58 # /dev/null input prevents a hang of the script for some m4 compilers (e.g. on FreeBSD)
59 case `$prog --version < /dev/null 2>&1` in
60 *GNU*) GNUM4=$prog
61 break ;;
62 esac
63 done
64 if test x$GNUM4 = x ; then
65 echo "not found."
66 exit 1
67 else
68 echo `which $GNUM4`
71 # Delete old cache directories.
72 # automake will stop if their contents was created by an earlier version.
73 rm -rf autom4te.cache
75 # Generate acinclude.m4
76 echo -n "Generate acinclude.m4... "
77 rm -f acinclude.m4
78 (cd config ; cat ${ACINCLUDE_FILES} ${EXTRA_ACINCLUDE_FILES} >../acinclude.m4)
79 echo "done."
81 # Generate the Makefiles and configure files
82 if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
83 echo "Building macros..."
84 for dir in . ; do
85 echo " $dir"
86 ( cd $dir ; $ACLOCAL )
87 done
88 echo "done."
89 else
90 echo "aclocal not found -- aborting"
91 exit 1
94 if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
95 echo "Building config header template..."
96 for dir in . ; do
97 echo " $dir"
98 ( cd $dir ; $AUTOHEADER )
99 done
100 echo "done."
101 else
102 echo "autoheader not found -- aborting"
103 exit 1
106 if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
107 echo "Building Makefile templates..."
108 for dir in . ; do
109 echo " $dir"
110 ( cd $dir ; $AUTOMAKE )
111 done
112 echo "done."
113 else
114 echo "automake not found -- aborting"
115 exit 1
118 if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
119 echo "Building configure..."
120 for dir in . ; do
121 echo " $dir"
122 ( cd $dir ; $AUTOCONF )
123 done
124 echo "done."
125 else
126 echo "autoconf not found -- aborting"
127 exit 1
130 # Autogenerate lib/configure.m4.
131 echo -n "Building lib/configure ... "
132 rm -f lib/configure
133 $GNUM4 lib/configure.m4 > lib/configure
134 chmod a+x lib/configure
135 echo "done."
137 echo
138 echo 'run "./configure ; make"'
139 echo