summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-03-04 14:42:40 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-03-04 14:42:40 +0000
commit0de07f4189cbd191a765c60ed3d7c72f72112e68 (patch)
tree83781a0df06c9110c6f3db12caad23ea00832b53 /configure.ac
parentc28972ea53cc7cdb91c7aac01754dd7f0b66e1a7 (diff)
parent9f45d0f6212d6d5c96dafc4aba73d9d12b39c3d6 (diff)
Merge branch 'upstream' into merge
Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Conflicts: api/src/glfs-fops.c libglusterfs/src/syncop.c libglusterfs/src/syncop.h Change-Id: I8c3fa7a20fb167d9e6bc2749e177c0c8b366827b
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac64
1 files changed, 42 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index 604b535..226648d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,18 @@ AC_PROG_CC
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
+# Initialize CFLAGS before usage
+AC_ARG_ENABLE([debug],
+ AC_HELP_STRING([--enable-debug],
+ [Enable debug build options.]))
+if test "x$enable_debug" = "xyes"; then
+ BUILD_DEBUG=yes
+ CFLAGS="${CFLAGS} -g -O0 -DDEBUG"
+else
+ BUILD_DEBUG=no
+ CFLAGS="${CFLAGS} -g -O2"
+fi
+
AC_ARG_WITH(pkgconfigdir,
[ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
[pkgconfigdir=$withval],
@@ -571,10 +583,18 @@ if test "x$enable_xml_output" != "xno"; then
if test "x${no_xml}" = "x"; then
AC_DEFINE([HAVE_LIB_XML], [1], [Define to 1 if using libxml2.])
else
- AC_MSG_WARN([libxml2 devel libraries not found disabling XML support])
- BUILD_XML_OUTPUT="no"
+ if test "x$enable_georeplication" != "xno"; then
+ AC_MSG_ERROR([libxml2 devel libraries not found])
+ else
+ AC_MSG_WARN([libxml2 devel libraries not found disabling XML support])
+ BUILD_XML_OUTPUT="no"
+ fi
+
fi
else
+ if test "x$enable_georeplication" != "xno"; then
+ AC_MSG_ERROR([geo-replication requires xml output])
+ fi
BUILD_XML_OUTPUT="no"
fi
# end of xml-output
@@ -702,14 +722,14 @@ fi
case $host_os in
linux*)
GF_HOST_OS="GF_LINUX_HOST_OS"
- GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O0"
+ GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS}"
GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
GF_LDADD="${ARGP_STANDALONE_LDADD}"
GF_FUSE_CFLAGS="-DFUSERMOUNT_DIR=\\\"\$(bindir)\\\""
;;
solaris*)
GF_HOST_OS="GF_SOLARIS_HOST_OS"
- GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -O0 -m64"
+ GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -m64"
GF_LDFLAGS=""
GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
GF_LDADD="${ARGP_STANDALONE_LDADD}"
@@ -733,7 +753,7 @@ case $host_os in
;;
*bsd*)
GF_HOST_OS="GF_BSD_HOST_OS"
- GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -O0"
+ GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS}"
GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
GF_GLUSTERFS_CFLAGS="${GF_CFLAGS}"
@@ -746,10 +766,10 @@ case $host_os in
darwin*)
GF_HOST_OS="GF_DARWIN_HOST_OS"
LIBTOOL=glibtool
- GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -bundle -undefined suppress -flat_namespace -D_XOPEN_SOURCE -O0"
+ GF_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -bundle -undefined suppress -flat_namespace -D_XOPEN_SOURCE"
GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_BASENAME"
GF_CFLAGS="${GF_CFLAGS} -DTHREAD_UNSAFE_DIRNAME"
- GF_GLUSTERFS_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -undefined suppress -flat_namespace -O0"
+ GF_GLUSTERFS_CFLAGS="${ARGP_STANDALONE_CPPFLAGS} -D__DARWIN_64_BIT_INO_T -undefined suppress -flat_namespace"
GF_LDADD="${ARGP_STANDALONE_LDADD}"
GF_FUSE_CFLAGS="-I\$(CONTRIBDIR)/macfuse"
;;
@@ -814,6 +834,8 @@ AM_PATH_PYTHON()
if echo $PYTHON_VERSION | grep ^2; then
have_python2=yes
fi
+
+# Save flags before testing python
saved_CFLAGS=$CFLAGS
saved_CPPFLAGS=$CPPFLAGS
saved_LDFLAGS=$LDFLAGS
@@ -828,9 +850,12 @@ case x$enable_glupy in
xyes)
if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
BUILD_GLUPY=yes
- saved_CFLAGS="$saved_CFLAGS $CFLAGS"
- saved_CPPFLAGS="$saved_CPPFLAGS $CPPFLAGS"
- saved_LDFLAGS="$saved_LDFLAGS $LDFLAGS"
+ PYTHONDEV_CFLAGS="$CFLAGS"
+ PYTHONDEV_CPPFLAGS="$CPPFLAGS"
+ PYTHONDEV_LDFLAGS="$LDFLAGS"
+ AC_SUBST(PYTHONDEV_CFLAGS)
+ AC_SUBST(PYTHONDEV_CPPFLAGS)
+ AC_SUBST(PYTHONDEV_LDFLAGS)
else
AC_MSG_ERROR([glupy requires python-devel/python-dev package and python2.x])
fi
@@ -840,9 +865,12 @@ case x$enable_glupy in
*)
if test "x$have_python2" = "xyes" -a "x$have_Python_h" = "xyes"; then
BUILD_GLUPY=yes
- saved_CFLAGS="$saved_CFLAGS $CFLAGS"
- saved_CPPFLAGS="$saved_CPPFLAGS $CPPFLAGS"
- saved_LDFLAGS="$saved_LDFLAGS $LDFLAGS"
+ PYTHONDEV_CFLAGS="$CFLAGS"
+ PYTHONDEV_CPPFLAGS="$CPPFLAGS"
+ PYTHONDEV_LDFLAGS="$LDFLAGS"
+ AC_SUBST(PYTHONDEV_CFLAGS)
+ AC_SUBST(PYTHONDEV_CPPFLAGS)
+ AC_SUBST(PYTHONDEV_LDFLAGS)
else
AC_MSG_WARN([
---------------------------------------------------------------------------------
@@ -851,6 +879,7 @@ case x$enable_glupy in
fi
;;
esac
+# Restore flags
CFLAGS=$saved_CFLAGS
CPPFLAGS=$saved_CPPFLAGS
LDFLAGS=$saved_LDFLAGS
@@ -870,15 +899,6 @@ if test "x$BUILD_GLUPY" = "xyes"; then
fi
# end glupy section
-# Other stuff (most notably the glupy section) might have injected another -O2
-# into CFLAGS, so *do this last*.
-BUILD_DEBUG=no
-if test "x$enable_debug" = "xyes"; then
- BUILD_DEBUG=yes
- CFLAGS=`echo $CFLAGS | sed -e s/O2/O0/g`
-else
- BUILD_DEBUG=no
-fi
AC_SUBST(CFLAGS)
# end enable debug section