3 ACLOCAL="aclocal -I ${PWD}/m4"
4 AUTOHEADER="autoheader"
5 AUTOMAKE="automake -a -c --foreign"
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"
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]."
24 echo -n "Locating GNU m4... "
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
37 if test x$GNUM4 = x ; then
44 # Generate acinclude.m4
45 echo -n "Generate acinclude.m4... "
47 (cd config ; cat ${ACINCLUDE_FILES} ${EXTRA_ACINCLUDE_FILES} >../acinclude.m4)
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
55 ( cd $dir ; $ACLOCAL )
59 echo "aclocal not found -- aborting"
63 if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
64 echo "Building config header template..."
67 ( cd $dir ; $AUTOHEADER )
71 echo "autoheader not found -- aborting"
75 if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
76 echo "Building Makefile templates..."
77 for dir in . lib/reLyX ; do
79 ( cd $dir ; $AUTOMAKE )
83 echo "automake not found -- aborting"
87 if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
88 echo "Building configure..."
89 for dir in . lib/reLyX ; do
91 ( cd $dir ; $AUTOCONF )
95 echo "autoconf not found -- aborting"
99 # Autogenerate lib/configure.m4.
100 echo -n "Building lib/configure ... "
102 $GNUM4 lib/configure.m4 > lib/configure
103 chmod a+x lib/configure
107 echo 'run "./configure ; make"'