glusterfs/autogen.sh
Kaleb S. KEITHLEY 544945a128 config: better (i.e. more portable) test for libxml2
Over the weekend I tried to build on MacOS X¹ and ran into the following
issues:
1) The recent change to autogen.sh to test for pkg-config falls down.
2) After removing the pkg-config test in autogen.sh, w/o pkg-config the
   PKG_CHECK_MODULES macro invocation in configure[.ac] falls down. N.B.
   Solaris users run into this too, even through there's a (broken)
   pkg-config package that can be installed.
3) There are other problems in the code related to fuse that are beyond the
   scope of this.

It seems that pkg-config is only a requirement for the definition of the
PKG_CHECK_MODULES macro used to detect libxml2. Since this seems to be
inherently unportable — at least to MacOS X and Solaris — I'd like to:
A) Change the use of the PKG_CHECK_MODULES macro to the more portable
   AM_PATH_XML2 macro provided by the libxml2 package in
   /usr/.../share/aclocal/libxml.m4
2) Revisit the decision to add the check for pkg-config in autogen.sh in
   BZ 921817.

For now this is just an rfc. If people are agreeable I'll reenter this
change against BZ 921817.

¹Mountain Lion 10.8.3, XCode 4.6.1

Change-Id: I237b1ed8919088345b8fd943423b2a6ad289981b
BUG: 921817
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/4720
Reviewed-by: Justin Clift <jclift@redhat.com>
Tested-by: Justin Clift <jclift@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-03-25 14:50:25 -07:00

96 lines
1.9 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 --version > /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 --copy --foreign
# Run autogen in the argp-standalone sub-directory
cd argp-standalone;./autogen.sh
# Instruct user on next steps
echo
echo "Please proceed with configuring, compiling, and installing."