From 7e59f937523b8f478216e0704d0ca533ec14b221 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Thu, 2 Feb 2017 12:10:12 +0000 Subject: build: Fix detection of uuid libs during configure This change cleans up the current logic for detecting the presence of uuid libs and avoids the following warning while executing configure script: . . . checking for UUID... yes checking uuid.h usability... yes checking uuid.h presence... no configure: WARNING: uuid.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: uuid.h: proceeding with the compiler's result checking for uuid.h... yes . . . Refer the following link for more details: https://www.gnu.org/software/autoconf/manual/autoconf.html#Present-But-Cannot-Be-Compiled Change-Id: Icc6e11097fed7c5a82ebd9d931b4e308f7d666c9 BUG: 1198849 Signed-off-by: Anoop C S Reviewed-on: https://review.gluster.org/16541 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos --- configure.ac | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 7e6ece50990..58bddf084d5 100644 --- a/configure.ac +++ b/configure.ac @@ -427,17 +427,21 @@ AC_SUBST(MATH_LIB) dnl use libuuid.so or fall-back to contrib/uuid PKG_CHECK_MODULES([UUID], [uuid], - [HAVE_LIBUUID=yes + [have_uuid=yes AC_DEFINE(HAVE_LIBUUID, 1, [have libuuid.so]) PKGCONFIG_UUID=uuid], - [HAVE_LIBUUID=no + [have_uuid=no UUID_CFLAGS='-I$(CONTRIBDIR)/uuid']) -AM_CONDITIONAL([HAVE_LIBUUID], [test x$HAVE_LIBUUID = xyes]) +AM_CONDITIONAL([HAVE_LIBUUID], [test x$have_uuid = xyes]) dnl older version of libuuid (from e2fsprogs) require including uuid/uuid.h saved_CFLAGS=${CFLAGS} CFLAGS="${CFLAGS} ${UUID_CFLAGS}" -AC_CHECK_HEADER([uuid.h], [], [AC_CHECK_HEADER([uuid/uuid.h])]) +AC_CHECK_HEADER([uuid.h], [], [AC_CHECK_HEADER([uuid/uuid.h])], + [[#if HAVE_UUID_H + #include + #endif + ]]) CFLAGS=${saved_CFLAGS} if test "x$ac_cv_header_uuid_uuid_h" = "xyes"; then UUID_CFLAGS="${UUID_CFLAGS} -I$(pkg-config --variable=includedir uuid)/uuid" -- cgit