1999-09-27 18:44:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2004-05-26 20:26:10 +00:00
|
|
|
ACLOCAL="aclocal -I ${PWD}/m4"
|
2002-10-15 08:10:57 +00:00
|
|
|
AUTOHEADER="autoheader"
|
|
|
|
AUTOMAKE="automake -a -c --foreign"
|
|
|
|
AUTOCONF="autoconf"
|
2004-05-26 16:53:50 +00:00
|
|
|
ACINCLUDE_FILES="lyxinclude.m4 libtool.m4 xforms.m4 qt.m4 gtk--.m4 gnome--.m4 gnome.m4 aspell.m4 pspell.m4 cygwin.m4 pkg.m4"
|
2002-10-15 08:10:57 +00:00
|
|
|
|
2005-02-23 14:54:20 +00:00
|
|
|
# Discover what version of gettext we are using.
|
|
|
|
gettext_version=`gettext --version 2>/dev/null | head -n 1`
|
|
|
|
|
|
|
|
test "$gettext_version" != "" && {
|
|
|
|
echo "Using $gettext_version"
|
|
|
|
} || {
|
|
|
|
echo "LyX requires getttext >= 0.12"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
case $gettext_version in
|
|
|
|
*' '0.1[2-4]*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "This gettext version is not supported by LyX."
|
|
|
|
echo "LyX supports only gettext 0.1[2-4]."
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Discover what version of automake we are using.
|
|
|
|
automake_version=`$AUTOMAKE --version 2>/dev/null | head -n 1`
|
|
|
|
|
|
|
|
test "$automake_version" != "" && {
|
|
|
|
echo "Using $automake_version"
|
|
|
|
} || {
|
|
|
|
echo "LyX requires automake >= 1.5"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
case $automake_version in
|
2005-02-24 08:49:34 +00:00
|
|
|
*' '1.[5-9]*)
|
2005-02-23 14:54:20 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
|
|
|
|
echo "This automake version is not supported by LyX."
|
2005-02-24 08:49:34 +00:00
|
|
|
echo "LyX only supports automake 1.[5-9]."
|
2005-02-23 14:54:20 +00:00
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2002-08-07 22:45:38 +00:00
|
|
|
# Discover what version of autoconf we are using.
|
2005-02-23 14:54:20 +00:00
|
|
|
autoversion=`$AUTOCONF --version 2>/dev/null | head -n 1`
|
2002-08-07 22:45:38 +00:00
|
|
|
|
2005-02-23 14:54:20 +00:00
|
|
|
test "$autoversion" != "" && {
|
|
|
|
echo "Using $autoversion"
|
|
|
|
} || {
|
|
|
|
echo "LyX requires autoconf >= 2.52"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2002-08-07 22:45:38 +00:00
|
|
|
case $autoversion in
|
2005-02-23 14:54:20 +00:00
|
|
|
*' '2.5[2-9])
|
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."
|
2004-01-26 20:28:59 +00:00
|
|
|
echo "LyX only supports autoconf 2.5[2-9]."
|
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
|