diff options
author | Anoop C S <anoopcs@redhat.com> | 2017-02-02 12:10:12 +0000 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2017-02-15 06:41:47 -0500 |
commit | 7e59f937523b8f478216e0704d0ca533ec14b221 (patch) | |
tree | 1335fa75671d01455b3b577caf12d7e27892c3df /configure.ac | |
parent | a6ece44d0bbdecf38252f477b4aa98a76771a328 (diff) |
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 <anoopcs@redhat.com>
Reviewed-on: https://review.gluster.org/16541
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 12 |
1 files 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 <uuid.h> + #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" |