Hopefully make autogen.sh more robust by checking for m4 files and AWK/convert.

I've also added a blaring (hopefully) notice about not supporting the SVN
version.  There are no 'official' distfiles yet, but I'm working on that, for
now they can try their luck with the SVN version anyway.

Originally committed to SVN as r2021.
This commit is contained in:
Amar Takhar 2008-03-11 16:43:49 +00:00
parent 4c3dde50f6
commit 1d34474ca6
1 changed files with 72 additions and 39 deletions

View File

@ -21,7 +21,9 @@ AUTOMAKE_REQUIRED_VERSION=1.9
INTLTOOL_REQUIRED_VERSION=0.31 INTLTOOL_REQUIRED_VERSION=0.31
LIBTOOL_REQUIRED_VERSION=1.5 LIBTOOL_REQUIRED_VERSION=1.5
PROJECT="aegsub http://aegisub.net/" REQUIRED_M4="fontutil.m4 wxwin28.m4 glib-gettext.m4 intltool.m4 intl.m4 pkg.m4 iconv.m4"
PROJECT="aegisub http://aegisub.net/"
TEST_TYPE=-d TEST_TYPE=-d
FILE=aegisub FILE=aegisub
@ -29,7 +31,6 @@ srcdir=`pwd`
test -z "$srcdir" && srcdir=. test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd` ORIGDIR=`pwd`
cd $srcdir cd $srcdir
AWK_BIN=awk
test $TEST_TYPE $FILE || { test $TEST_TYPE $FILE || {
echo echo
@ -38,27 +39,6 @@ test $TEST_TYPE $FILE || {
exit 1 exit 1
} }
# XXX: This is a kludge until I sort out the config/includes situation.
touch ${srcdir}/aegisub/posix/config.h
# bmp -> xmp via the res.rc
if [ ! -f ${srcdir}/aegisub/bitmaps/Makefile.bitmaps ]; then
cat ${srcdir}/aegisub/res.rc | ${AWK_BIN} -f ${srcdir}/aegisub/bitmaps/genxpm.awk > ${srcdir}/aegisub/bitmaps/Makefile.bitmaps
fi
cd ${srcdir}/aegisub/bitmaps
make -f Makefile.bitmaps
cd ${srcdir}
awk '/BITMAP/ { image[count] = $1; ++count} END { printf("EXTRA_DIST= \\\n wxicon_xpm.xpm"); for (v in image) printf(" \\\n %s_xpm.xpm", image[v])}' \
${srcdir}/aegisub/res.rc \
> ${srcdir}/aegisub/bitmaps/Makefile.am
cd ${srcdir}/aegisub/posix
sh genres.sh ${srcdir}/aegisub/res.rc
cd ${srcdir}
check_version () check_version ()
{ {
VERSION_A=$1 VERSION_A=$1
@ -98,15 +78,19 @@ check_version ()
fi fi
} }
echo
echo "I am testing that you have the tools required to build the"
echo "$PROJECT from Subversion. This test is not foolproof,"
echo "so if anything goes wrong, see the file HACKING for more information..."
echo
DIE=0 DIE=0
echo
echo "***********************************************************************"
echo "*"
echo "* Please note that the SVN version of Aegisub is NOT SUPPORTED, you must"
echo "* download an official distfile in order to receive support."
echo "*"
echo "***********************************************************************"
echo
echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... " echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
if ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1; then if ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1; then
LIBTOOLIZE=$LIBTOOLIZE LIBTOOLIZE=$LIBTOOLIZE
@ -197,6 +181,32 @@ else
DIE=1 DIE=1
fi fi
WHICH_CONVERT=`which convert`
echo -n "checking for ImageMagick 'convert' utility ... "
if test -x "$WHICH_CONVERT"; then
BIN_CONVERT=$WHICH_CONVERT
echo $BIN_CONVERT
else
echo
echo " You must have 'convert' installed from the"
echo " ImageMagick project."
echo
DIE=1
fi
WHICH_AWK=`which awk`
echo -n "checking for AWK ... "
if test -x "$WHICH_AWK"; then
BIN_AWK=$WHICH_AWK
echo $BIN_AWK
else
echo
echo " You must have 'convert' installed from the"
echo " ImageMagick project."
echo
DIE=1
fi
if test "$DIE" -eq 1; then if test "$DIE" -eq 1; then
echo echo
echo "Please install/upgrade the missing tools and call me again." echo "Please install/upgrade the missing tools and call me again."
@ -206,6 +216,7 @@ fi
echo echo
echo "I am going to run ./configure with the following arguments:" echo "I am going to run ./configure with the following arguments:"
echo echo
@ -220,10 +231,11 @@ if test -z "$*"; then
fi fi
if test -z "$ACLOCAL_FLAGS"; then if test -z "$ACLOCAL_FLAGS"; then
acdir=`$ACLOCAL --print-ac-dir` acdir=`$ACLOCAL --print-ac-dir`
m4list="glib-2.0.m4 glib-gettext.m4 gtk-2.0.m4 intltool.m4 pkg.m4" m4list=$REQUIRED_M4
for file in $m4list for file in $m4list
do do
@ -240,6 +252,27 @@ if test -z "$ACLOCAL_FLAGS"; then
done done
fi fi
# XXX: This is a kludge until I sort out the config/includes situation.
touch ${srcdir}/aegisub/posix/config.h
# bmp -> xmp via the res.rc
if [ ! -f ${srcdir}/aegisub/bitmaps/Makefile.bitmaps ]; then
cat ${srcdir}/aegisub/res.rc | ${AWK_BIN} -f ${srcdir}/aegisub/bitmaps/genxpm.awk > ${srcdir}/aegisub/bitmaps/Makefile.bitmaps
fi
cd ${srcdir}/aegisub/bitmaps
make -f Makefile.bitmaps
cd ${srcdir}
awk '/BITMAP/ { image[count] = $1; ++count} END { printf("EXTRA_DIST= \\\n wxicon_xpm.xpm"); for (v in image) printf(" \\\n %s_xpm.xpm", image[v])}' \
${srcdir}/aegisub/res.rc \
> ${srcdir}/aegisub/bitmaps/Makefile.am
cd ${srcdir}/aegisub/posix
sh genres.sh ${srcdir}/aegisub/res.rc
cd ${srcdir}
rm -rf autom4te.cache rm -rf autom4te.cache
$ACLOCAL $ACLOCAL_FLAGS $ACLOCAL $ACLOCAL_FLAGS
@ -263,13 +296,13 @@ intltoolize --force --automake || exit $?
cd $ORIGDIR cd $ORIGDIR
#$srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@"
#RC=$? RC=$?
#if test $RC -ne 0; then if test $RC -ne 0; then
# echo echo
# echo "Configure failed or did not finish!" echo "Configure failed or did not finish!"
# exit $RC exit $RC
#fi fi
#echo echo
#echo "Now type 'make' to compile the $PROJECT." echo "Now type 'make' to compile the $PROJECT."