1999-09-27 18:44:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-04-26 10:06:36 +00:00
|
|
|
ACLOCAL="aclocal -I m4 -I config"
|
2002-10-15 08:10:57 +00:00
|
|
|
AUTOHEADER="autoheader"
|
2006-01-26 00:01:00 +00:00
|
|
|
AUTOMAKE="automake --add-missing --copy --foreign"
|
2002-10-15 08:10:57 +00:00
|
|
|
AUTOCONF="autoconf"
|
|
|
|
|
2005-02-23 14:54:20 +00:00
|
|
|
# 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"
|
|
|
|
} || {
|
2007-04-26 14:49:31 +00:00
|
|
|
echo "LyX requires automake >= 1.5"
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
2005-02-23 14:54:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
case $automake_version in
|
2007-04-26 14:49:31 +00:00
|
|
|
*' '1.[5-9]*|*' '1.10*)
|
2005-02-23 14:54:20 +00:00
|
|
|
;;
|
|
|
|
*)
|
2006-08-06 20:45:31 +00:00
|
|
|
|
2005-02-23 14:54:20 +00:00
|
|
|
echo "This automake version is not supported by LyX."
|
2007-04-26 14:49:31 +00:00
|
|
|
echo "LyX only supports automake 1.5 to 1.10."
|
2006-08-06 20:45:31 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
2005-02-23 14:54:20 +00:00
|
|
|
esac
|
2006-07-22 16:47:31 +00:00
|
|
|
|
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"
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
2005-02-23 14:54:20 +00:00
|
|
|
}
|
2006-07-22 14:32:57 +00:00
|
|
|
|
2002-08-07 22:45:38 +00:00
|
|
|
case $autoversion in
|
2006-12-10 01:33:05 +00:00
|
|
|
*' '2.5[2-9]|*' '2.60[ab]|*' '2.6[0-1])
|
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."
|
2006-12-10 01:33:05 +00:00
|
|
|
echo "LyX only supports autoconf 2.52-2.61."
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
2002-08-07 22:45:38 +00:00
|
|
|
;;
|
|
|
|
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."
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
2002-10-15 08:10:57 +00:00
|
|
|
else
|
|
|
|
echo `which $GNUM4`
|
2000-01-08 21:02:58 +00:00
|
|
|
fi
|
|
|
|
|
2005-03-07 12:28:33 +00:00
|
|
|
# Delete old cache directories.
|
|
|
|
# automake will stop if their contents was created by an earlier version.
|
2005-07-16 15:18:14 +00:00
|
|
|
rm -rf autom4te.cache
|
2005-03-07 12:28:33 +00:00
|
|
|
|
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..."
|
2005-07-16 15:18:14 +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 ; $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"
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
1999-09-27 18:44:28 +00:00
|
|
|
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"
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
1999-09-27 18:44:28 +00:00
|
|
|
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..."
|
2005-07-16 15:18:14 +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 ; $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"
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
1999-09-27 18:44:28 +00:00
|
|
|
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..."
|
2005-07-16 15:18:14 +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 ; $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"
|
2005-03-05 15:26:00 +00:00
|
|
|
exit 1
|
1999-09-27 18:44:28 +00:00
|
|
|
fi
|
|
|
|
|
2000-01-12 11:16:01 +00:00
|
|
|
echo
|
|
|
|
echo 'run "./configure ; make"'
|
|
|
|
echo
|