From 58d7ef2f7628744db4c7bf8bf5735671e023f1d7 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Sun, 9 Feb 2014 21:57:45 -0500 Subject: build: CFLAGS was being polluted by python flags The CFLAGS were being polluted by the python test for glupy. The test also sets CFLAGS -NDEBUG even when passing --enable-debug to configure. To fix it, the patch now saves the necessary python flags into new makefile flags which can now be used by the glupy Makefile.am. BUG: 1063541 Change-Id: I8546a64b8ad4fe9318a97fb6a2f0c36087be1b29 Signed-off-by: Luis Pabon Reviewed-on: http://review.gluster.org/6957 Tested-by: Gluster Build System Reviewed-by: Harshavardhana Tested-by: Harshavardhana --- configure.ac | 52 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 20 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 010e27097..0c516c4fd 100644 --- a/configure.ac +++ b/configure.ac @@ -184,6 +184,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="-g -O0 -DDEBUG" +else + BUILD_DEBUG=no + CFLAGS="-g -O2" +fi + AC_ARG_WITH(pkgconfigdir, [ --with-pkgconfigdir=DIR pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@], [pkgconfigdir=$withval], @@ -696,14 +708,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}" @@ -727,7 +739,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}" @@ -740,10 +752,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" ;; @@ -795,6 +807,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 @@ -809,9 +823,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 @@ -821,9 +838,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([ --------------------------------------------------------------------------------- @@ -832,6 +852,7 @@ case x$enable_glupy in fi ;; esac +# Restore flags CFLAGS=$saved_CFLAGS CPPFLAGS=$saved_CPPFLAGS LDFLAGS=$saved_LDFLAGS @@ -851,15 +872,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 -- cgit From f1f91f8016e468718df9c581662f8417a1fb999c Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Tue, 18 Feb 2014 15:44:56 +0530 Subject: build: Don't discard CFLAGS in configure The configure script was discarding the passed CFLAGS inadvertently. This caused failures while building rpms on epel7 and fedora-{19,20}, as the hardened CFLAGS passed by rpmbuild on these distros were discarded which lead to the failure of rpmbuild. Thanks to Neils de Vos for helping track this down. Change-Id: I5b2aa5d449d13bf67df6c19cda178bddfe6c3652 BUG: 1066385 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/7029 Reviewed-by: Justin Clift Tested-by: Justin Clift Reviewed-by: Niels de Vos Tested-by: Niels de Vos Reviewed-by: Vijay Bellur --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0c516c4fd..7c383532e 100644 --- a/configure.ac +++ b/configure.ac @@ -190,10 +190,10 @@ AC_ARG_ENABLE([debug], [Enable debug build options.])) if test "x$enable_debug" = "xyes"; then BUILD_DEBUG=yes - CFLAGS="-g -O0 -DDEBUG" + CFLAGS="${CFLAGS} -g -O0 -DDEBUG" else BUILD_DEBUG=no - CFLAGS="-g -O2" + CFLAGS="${CFLAGS} -g -O2" fi AC_ARG_WITH(pkgconfigdir, -- cgit From 64079f83528edb4cc4ae1a85a8633fd578b6e393 Mon Sep 17 00:00:00 2001 From: Vijaykumar Koppad Date: Wed, 19 Feb 2014 18:51:26 +0530 Subject: build: fail configure if the libxml2 devel package is missing. Problem: Geo-replication uses volume info xml output. While installing glusterfs through build+install from source, and if the libxml2-devel package is not present in the system, build will succeed with just warning and XML output : no. If user fails to observe this and doesn't know that geo-rep is dependent on xml output, user won't be able use geo-rep. Solution: If libxml2-devel is unavailable, and if geo-rep is enabled error out in configure, otherwise just warn with XML_OUTPUT = no. If the xml-output is disabled while configuring, error out if geo-rep is enabled, otherwise just warn. Change-Id: Icde5d0c1e5f3b869e7db6ed6a046bdc49b450fcb BUG: 1066997 Signed-off-by: Vijaykumar Koppad Reviewed-on: http://review.gluster.org/7131 Reviewed-by: Niels de Vos Tested-by: Gluster Build System --- configure.ac | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7c383532e..69d25e4da 100644 --- a/configure.ac +++ b/configure.ac @@ -577,10 +577,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 -- cgit