Correctly handle quotation marks in command preferences (bug 2016):
[lyx.git] / autogen.sh
blobb9b81f6d76441307c0a87eacefd64e33a0539079
1 #!/bin/sh
3 ACLOCAL="aclocal -I m4 -I config"
4 AUTOHEADER="autoheader"
5 AUTOMAKE="automake --add-missing --copy --foreign"
6 AUTOCONF="autoconf"
8 # Discover what version of automake we are using.
9 automake_version=`$AUTOMAKE --version 2>/dev/null | head -n 1`
11 test "$automake_version" != "" && {
12 echo "Using $automake_version"
13 } || {
14 echo "LyX requires automake >= 1.5"
15 exit 1
18 case $automake_version in
19 *' '1.[5-9]*|*' '1.10*)
23 echo "This automake version is not supported by LyX."
24 echo "LyX only supports automake 1.5 to 1.10."
25 exit 1
27 esac
29 # Discover what version of autoconf we are using.
30 autoversion=`$AUTOCONF --version 2>/dev/null | head -n 1`
32 test "$autoversion" != "" && {
33 echo "Using $autoversion"
34 } || {
35 echo "LyX requires autoconf >= 2.52"
36 exit 1
39 case $autoversion in
40 *' '2.5[2-9]|*' '2.60[ab]|*' '2.6[0-1])
43 echo "This autoconf version is not supported by LyX."
44 echo "LyX only supports autoconf 2.52-2.61."
45 exit 1
47 esac
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
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`
69 # Delete old cache directories.
70 # automake will stop if their contents was created by an earlier version.
71 rm -rf autom4te.cache
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
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
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
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
122 echo
123 echo 'run "./configure ; make"'
124 echo