1999-09-27 18:44:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2002-11-25 16:02:21 +00:00
|
|
|
ACLOCAL="aclocal"
|
2002-10-15 08:10:57 +00:00
|
|
|
AUTOHEADER="autoheader"
|
|
|
|
AUTOMAKE="automake -a -c --foreign"
|
|
|
|
AUTOCONF="autoconf"
|
2003-03-19 23:08:25 +00:00
|
|
|
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 cygwin.m4 pkg.m4"
|
2002-10-15 08:10:57 +00:00
|
|
|
|
2002-08-07 22:45:38 +00:00
|
|
|
# Discover what version of autoconf we are using.
|
2002-10-15 08:10:57 +00:00
|
|
|
autoversion=`$AUTOCONF --version | head -n 1`
|
2002-08-07 22:45:38 +00:00
|
|
|
|
2002-10-15 08:10:57 +00:00
|
|
|
echo "Using $autoversion"
|
2002-08-07 22:45:38 +00:00
|
|
|
case $autoversion in
|
|
|
|
*2.13)
|
|
|
|
cp config/acconfig.h .
|
|
|
|
cp config/configure.in .
|
2002-09-10 15:00:40 +00:00
|
|
|
rm -f configure.ac
|
2002-08-07 22:45:38 +00:00
|
|
|
cp config/relyx_configure.in lib/reLyX/configure.in
|
2002-09-10 15:00:40 +00:00
|
|
|
rm -f lib/reLyX/configure.ac
|
2002-11-25 16:02:21 +00:00
|
|
|
EXTRA_ACINCLUDE_FILES="lyxinclude213.m4"
|
2002-08-07 22:45:38 +00:00
|
|
|
;;
|
2003-02-11 13:07:37 +00:00
|
|
|
*2.5[23467])
|
2002-09-10 15:00:40 +00:00
|
|
|
rm -f acconfig.h
|
|
|
|
rm -f configure.in
|
2002-08-07 22:45:38 +00:00
|
|
|
cp config/configure.ac .
|
2002-09-10 15:00:40 +00:00
|
|
|
rm -f lib/reLyX/configure.in
|
2002-08-07 22:45:38 +00:00
|
|
|
cp config/relyx_configure.ac lib/reLyX/configure.ac
|
2002-11-25 16:02:21 +00:00
|
|
|
EXTRA_ACINCLUDE_FILES="lyxinclude25x.m4"
|
2002-08-07 22:45:38 +00:00
|
|
|
;;
|
|
|
|
*)
|
2002-10-15 08:10:57 +00:00
|
|
|
echo "This autoconf version is not supported by LyX."
|
2002-12-16 16:26:58 +00:00
|
|
|
echo "LyX only supports autoconf 2.13 and 2.5[236]."
|
2002-08-07 22:45:38 +00:00
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2000-01-12 11:16:01 +00:00
|
|
|
echo -n "Locating GNU m4... "
|
2002-10-15 08:10:57 +00:00
|
|
|
GNUM4=
|
|
|
|
for prog in $M4 gm4 gnum4 m4; do
|
|
|
|
# continue if $prog generates error (e.g. does not exist)
|
|
|
|
( $prog --version ) < /dev/null > /dev/null 2>&1
|
|
|
|
if test $? -ne 0 ; then continue; fi
|
|
|
|
|
|
|
|
# /dev/null input prevents a hang of the script for some m4 compilers (e.g. on FreeBSD)
|
|
|
|
case `$prog --version < /dev/null 2>&1` in
|
|
|
|
*GNU*) GNUM4=$prog
|
|
|
|
break ;;
|
|
|
|
esac
|
2000-01-08 21:02:58 +00:00
|
|
|
done
|
2002-10-15 08:10:57 +00:00
|
|
|
if test x$GNUM4 = x ; then
|
|
|
|
echo "not found."
|
|
|
|
exit
|
|
|
|
else
|
|
|
|
echo `which $GNUM4`
|
2000-01-08 21:02:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Generate acinclude.m4
|
2000-01-12 11:16:01 +00:00
|
|
|
echo -n "Generate acinclude.m4... "
|
2002-05-29 16:21:03 +00:00
|
|
|
rm -f acinclude.m4
|
2002-11-25 16:02:21 +00:00
|
|
|
(cd config ; cat ${ACINCLUDE_FILES} ${EXTRA_ACINCLUDE_FILES} >../acinclude.m4)
|
2000-01-08 21:02:58 +00:00
|
|
|
echo "done."
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
# Generate the Makefiles and configure files
|
2002-10-15 08:10:57 +00:00
|
|
|
if ( $ACLOCAL --version ) < /dev/null > /dev/null 2>&1; then
|
2001-02-12 14:09:09 +00:00
|
|
|
echo "Building macros..."
|
2002-05-29 16:21:03 +00:00
|
|
|
for dir in . lib/reLyX ; do
|
2001-02-13 15:33:30 +00:00
|
|
|
echo " $dir"
|
2001-02-12 14:09:09 +00:00
|
|
|
( cd $dir ; $ACLOCAL )
|
|
|
|
done
|
2000-01-08 21:02:58 +00:00
|
|
|
echo "done."
|
1999-09-27 18:44:28 +00:00
|
|
|
else
|
|
|
|
echo "aclocal not found -- aborting"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2002-10-15 08:10:57 +00:00
|
|
|
if ( $AUTOHEADER --version ) < /dev/null > /dev/null 2>&1; then
|
2001-02-12 14:09:09 +00:00
|
|
|
echo "Building config header template..."
|
2002-05-29 16:21:03 +00:00
|
|
|
for dir in . ; do
|
2001-02-13 15:33:30 +00:00
|
|
|
echo " $dir"
|
2001-02-12 14:09:09 +00:00
|
|
|
( cd $dir ; $AUTOHEADER )
|
|
|
|
done
|
2000-01-08 21:02:58 +00:00
|
|
|
echo "done."
|
1999-09-27 18:44:28 +00:00
|
|
|
else
|
|
|
|
echo "autoheader not found -- aborting"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2002-10-15 08:10:57 +00:00
|
|
|
if ( $AUTOMAKE --version ) < /dev/null > /dev/null 2>&1; then
|
2001-02-12 14:09:09 +00:00
|
|
|
echo "Building Makefile templates..."
|
2002-05-29 16:21:03 +00:00
|
|
|
for dir in . lib/reLyX ; do
|
2001-02-13 15:33:30 +00:00
|
|
|
echo " $dir"
|
2001-02-12 14:09:09 +00:00
|
|
|
( cd $dir ; $AUTOMAKE )
|
|
|
|
done
|
2000-01-08 21:02:58 +00:00
|
|
|
echo "done."
|
1999-09-27 18:44:28 +00:00
|
|
|
else
|
|
|
|
echo "automake not found -- aborting"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2002-10-15 08:10:57 +00:00
|
|
|
if ( $AUTOCONF --version ) < /dev/null > /dev/null 2>&1; then
|
2001-02-12 14:09:09 +00:00
|
|
|
echo "Building configure..."
|
2002-05-29 16:21:03 +00:00
|
|
|
for dir in . lib/reLyX ; do
|
2001-02-13 15:33:30 +00:00
|
|
|
echo " $dir"
|
2001-02-12 14:09:09 +00:00
|
|
|
( cd $dir ; $AUTOCONF )
|
|
|
|
done
|
2000-01-08 21:02:58 +00:00
|
|
|
echo "done."
|
1999-09-27 18:44:28 +00:00
|
|
|
else
|
|
|
|
echo "autoconf not found -- aborting"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2000-01-08 21:02:58 +00:00
|
|
|
# Autogenerate lib/configure.m4.
|
2002-10-15 08:10:57 +00:00
|
|
|
echo -n "Building lib/configure ... "
|
|
|
|
rm -f lib/configure
|
|
|
|
$GNUM4 lib/configure.m4 > lib/configure
|
|
|
|
chmod a+x lib/configure
|
|
|
|
echo "done."
|
1999-11-26 14:31:33 +00:00
|
|
|
|
2000-01-12 11:16:01 +00:00
|
|
|
echo
|
|
|
|
echo 'run "./configure ; make"'
|
|
|
|
echo
|