glusterfs/autogen.sh
Eli Schwartz 82987486a9
configure.ac: fix option to stop automake aborting on pointless error
glusterfs does not follow the GNU coding standards and therefore must
use the "foreign" strictness. Without this, autoreconf -fi would fail to
execute successfully because automake returned non-zero.

This change ensures that people using autoreconf, the GNU preferred
invocation method for the autotools build system, can successfully set
up the build.

Remove the pointless --foreign argument from the autogen.sh invocation
of automake. Not only is configure.ac the preferred way to define such
options (rather than handwritten, piecemeal invocations of every tool in
the autotools toolchain), it was never needed in the autogen.sh as that
script provides no error handling at all and always (incorrectly)
returns successfully as long as autotools itself is installed (no matter
how broken glusterfs itself is).

Change-Id: Ib0246d5368a54594f517a322465cffb9a85c1b49
fixes: bz#1656100
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
2018-12-04 12:06:50 -05:00

93 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
echo
echo ... GlusterFS autogen ...
echo
## Check all dependencies are present
MISSING=""
# Check for aclocal
env aclocal --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
ACLOCAL=aclocal
else
MISSING="$MISSING aclocal"
fi
# Check for autoconf
env autoconf --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
AUTOCONF=autoconf
else
MISSING="$MISSING autoconf"
fi
# Check for autoheader
env autoheader --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
AUTOHEADER=autoheader
else
MISSING="$MISSING autoheader"
fi
# Check for automake
env automake --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
AUTOMAKE=automake
else
MISSING="$MISSING automake"
fi
# Check for libtoolize or glibtoolize
env libtoolize --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
# libtoolize was found, so use it
TOOL=libtoolize
else
# libtoolize wasn't found, so check for glibtoolize
env glibtoolize --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
TOOL=glibtoolize
else
MISSING="$MISSING libtoolize/glibtoolize"
fi
fi
# Check for tar
env tar -cf /dev/null /dev/null > /dev/null 2>&1
if [ $? -ne 0 ]; then
MISSING="$MISSING tar"
fi
## If dependencies are missing, warn the user and abort
if [ "x$MISSING" != "x" ]; then
echo "Aborting."
echo
echo "The following build tools are missing:"
echo
for pkg in $MISSING; do
echo " * $pkg"
done
echo
echo "Please install them and try again."
echo
exit 1
fi
## Do the autogeneration
echo Running ${ACLOCAL}...
$ACLOCAL -I ./contrib/aclocal
echo Running ${AUTOHEADER}...
$AUTOHEADER
echo Running ${TOOL}...
$TOOL --automake --copy --force
echo Running ${AUTOCONF}...
$AUTOCONF
echo Running ${AUTOMAKE}...
$AUTOMAKE --add-missing --force-missing --copy
# Instruct user on next steps
echo
echo "Please proceed with configuring, compiling, and installing."