2009-02-18 17:36:07 +05:30
#!/bin/sh
2013-03-08 19:29:33 +00:00
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
2013-03-15 02:20:42 +00:00
if [ $? -eq 0 ] ; then
2013-03-08 19:29:33 +00:00
# libtoolize was found, so use it
TOOL = libtoolize
else
# libtoolize wasn't found, so check for glibtoolize
env glibtoolize --version > /dev/null 2>& 1
2013-03-15 02:20:42 +00:00
if [ $? -eq 0 ] ; then
2013-03-08 19:29:33 +00:00
TOOL = glibtoolize
else
MISSING = " $MISSING libtoolize/glibtoolize "
fi
fi
2013-03-22 18:44:06 +00:00
# Check for tar
2013-11-19 13:57:30 +01:00
env tar -cf /dev/null /dev/null > /dev/null 2>& 1
2013-03-22 18:44:06 +00:00
if [ $? -ne 0 ] ; then
MISSING = " $MISSING tar "
fi
2013-11-19 13:57:30 +01:00
# Check for python
if [ " x ${ PYTHONBIN } " = "x" ] ; then
PYTHONBIN = python
fi
env ${ PYTHONBIN } -V > /dev/null 2>& 1
if [ $? -ne 0 ] ; then
MISSING = " $MISSING python "
fi
2013-03-08 19:29:33 +00:00
## 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
2013-05-10 12:30:17 +05:30
## generate gf-error-codes.h from error-codes.json
echo "Generate gf-error-codes.h ..."
2013-11-19 13:57:30 +01:00
if ${ PYTHONBIN } ./gen-headers.py; then
2013-05-10 12:30:17 +05:30
if ! mv -fv gf-error-codes.h libglusterfs/src/gf-error-codes.h; then
exit 1
fi
else
exit 1
fi
2013-03-08 19:29:33 +00:00
## 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 --copy --foreign
2014-02-20 13:50:19 -05:00
# Update git modules
echo "Obtaining git module cmockery2 ..."
git submodule update --init cmockery2
2013-03-08 19:29:33 +00:00
# Run autogen in the argp-standalone sub-directory
2014-02-20 13:50:19 -05:00
echo "Running autogen.sh in argp-standalone ..."
( cd argp-standalone; ./autogen.sh )
echo "Running autogen.sh in cmockery2 ..."
( cd cmockery2; ./autogen.sh )
2013-03-08 19:29:33 +00:00
# Instruct user on next steps
echo
echo "Please proceed with configuring, compiling, and installing."