replace most &dquot;...&dquot; by <...>
[lyx.git] / autogen.sh
blob0b75d7be01b4f15d7cebe68a6921e547f81ba700
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 aspell.m4 pspell.m4 cygwin.m4 pkg.m4"
9 # Discover what version of autoconf we are using.
10 autoversion=`$AUTOCONF --version | head -n 1`
12 echo "Using $autoversion"
13 case $autoversion in
14 *2.5[2-9])
15 EXTRA_ACINCLUDE_FILES="lyxinclude25x.m4"
18 echo "This autoconf version is not supported by LyX."
19 echo "LyX only supports autoconf 2.5[2-9]."
20 exit
22 esac
24 echo -n "Locating GNU m4... "
25 GNUM4=
26 for prog in $M4 gm4 gnum4 m4; do
27 # continue if $prog generates error (e.g. does not exist)
28 ( $prog --version ) < /dev/null > /dev/null 2>&1
29 if test $? -ne 0 ; then continue; fi
31 # /dev/null input prevents a hang of the script for some m4 compilers (e.g. on FreeBSD)
32 case `$prog --version < /dev/null 2>&1` in
33 *GNU*) GNUM4=$prog
34 break ;;
35 esac
36 done
37 if test x$GNUM4 = x ; then
38 echo "not found."
39 exit
40 else
41 echo `which $GNUM4`
44 # Generate acinclude.m4
45 echo -n "Generate acinclude.m4... "
46 rm -f acinclude.m4
47 (cd config ; cat ${ACINCLUDE_FILES} ${EXTRA_ACINCLUDE_FILES} >../acinclude.m4)
48 echo "done."
50 # Generate the Makefiles and configure files
51 if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
52 echo "Building macros..."
53 for dir in . lib/reLyX ; do
54 echo " $dir"
55 ( cd $dir ; $ACLOCAL )
56 done
57 echo "done."
58 else
59 echo "aclocal not found -- aborting"
60 exit
63 if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
64 echo "Building config header template..."
65 for dir in . ; do
66 echo " $dir"
67 ( cd $dir ; $AUTOHEADER )
68 done
69 echo "done."
70 else
71 echo "autoheader not found -- aborting"
72 exit
75 if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
76 echo "Building Makefile templates..."
77 for dir in . lib/reLyX ; do
78 echo " $dir"
79 ( cd $dir ; $AUTOMAKE )
80 done
81 echo "done."
82 else
83 echo "automake not found -- aborting"
84 exit
87 if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
88 echo "Building configure..."
89 for dir in . lib/reLyX ; do
90 echo " $dir"
91 ( cd $dir ; $AUTOCONF )
92 done
93 echo "done."
94 else
95 echo "autoconf not found -- aborting"
96 exit
99 # Autogenerate lib/configure.m4.
100 echo -n "Building lib/configure ... "
101 rm -f lib/configure
102 $GNUM4 lib/configure.m4 > lib/configure
103 chmod a+x lib/configure
104 echo "done."
106 echo
107 echo 'run "./configure ; make"'
108 echo