4 AUTOHEADER="autoheader"
5 AUTOMAKE="automake -a -c --foreign"
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"
9 # Discover what version of autoconf we are using.
10 autoversion=`$AUTOCONF --version | head -n 1`
12 echo "Using $autoversion"
15 cp config/acconfig.h .
16 cp config/configure.in .
18 cp config/relyx_configure.in lib/reLyX/configure.in
19 rm -f lib/reLyX/configure.ac
20 EXTRA_ACINCLUDE_FILES="lyxinclude213.m4"
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"
31 echo "This autoconf version is not supported by LyX."
32 echo "LyX only supports autoconf 2.13 and 2.5[23]."
37 echo -n "Locating GNU m4... "
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
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
50 if test x$GNUM4 = x ; then
57 # Generate acinclude.m4
58 echo -n "Generate acinclude.m4... "
60 (cd config ; cat ${ACINCLUDE_FILES} ${EXTRA_ACINCLUDE_FILES} >../acinclude.m4)
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
68 ( cd $dir ; $ACLOCAL )
72 echo "aclocal not found -- aborting"
76 if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
77 echo "Building config header template..."
80 ( cd $dir ; $AUTOHEADER )
84 echo "autoheader not found -- aborting"
88 if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
89 echo "Building Makefile templates..."
90 for dir in . lib/reLyX ; do
92 ( cd $dir ; $AUTOMAKE )
96 echo "automake not found -- aborting"
100 if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
101 echo "Building configure..."
102 for dir in . lib/reLyX ; do
104 ( cd $dir ; $AUTOCONF )
108 echo "autoconf not found -- aborting"
112 # Autogenerate lib/configure.m4.
113 echo -n "Building lib/configure ... "
115 $GNUM4 lib/configure.m4 > lib/configure
116 chmod a+x lib/configure
120 echo 'run "./configure ; make"'