Whamcloud - gitweb
LU-9897 build: use pkgconf for detecting libblkid 31/35531/3
authorJames Simmons <uja.ornl@yahoo.com>
Tue, 16 Jul 2019 19:34:16 +0000 (15:34 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 9 Aug 2019 04:41:05 +0000 (04:41 +0000)
Currently we have extra complexity to determine where packages are
installed. This approach is also fragile if packages are not
installed in the standard location. This can be handled in a much
cleaner way with pkgconfig. Use pkgconf to discover libblkid.

Test-Parameters: trivial

Change-Id: I5241c2c38b1114d8f061ee5f2a4cb0c677ce2c71
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/35531
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre.spec.in
lustre/autoconf/lustre-core.m4
lustre/utils/Makefile.am

index db3c0d4..64fdb9b 100644 (file)
@@ -146,13 +146,18 @@ BuildRoot: %{_tmppath}/lustre-%{version}-root
 Requires: %{requires_kmod_name} = %{requires_kmod_version} zlib
 Requires: %{requires_yaml_name}
 BuildRequires: libtool libyaml-devel zlib-devel
 Requires: %{requires_kmod_name} = %{requires_kmod_version} zlib
 Requires: %{requires_yaml_name}
 BuildRequires: libtool libyaml-devel zlib-devel
+%if %{_vendor}=="redhat"
+BuildRequires: pkgconfig
+%else
+BuildRequires: pkg-config
+%endif
 %if %{with servers}
 Requires: lustre-osd
 Requires: lustre-osd-mount
 Obsoletes: lustre-client < %{version}
 Provides: lustre-client = %{version}-%{release}
 %endif
 %if %{with servers}
 Requires: lustre-osd
 Requires: lustre-osd-mount
 Obsoletes: lustre-client < %{version}
 Provides: lustre-client = %{version}-%{release}
 %endif
-# GSS requires this: BuildRequires: pkgconfig, libgssapi-devel >= 0.10
+# GSS requires this: BuildRequires: libgssapi-devel >= 0.10
 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
 #suse don't support selinux
 BuildRequires: libselinux-devel
 %if %{_vendor}=="redhat" || %{_vendor}=="fedora"
 #suse don't support selinux
 BuildRequires: libselinux-devel
index 22ed68a..4bd7e78 100644 (file)
@@ -3261,7 +3261,9 @@ AC_CHECK_HEADERS([netdb.h endian.h])
 AC_CHECK_FUNCS([gethostbyname])
 
 # lustre/utils/llverdev.c
 AC_CHECK_FUNCS([gethostbyname])
 
 # lustre/utils/llverdev.c
-AC_CHECK_HEADERS([blkid/blkid.h])
+AS_IF([test "x$enable_dist" = xno], [
+       PKG_CHECK_MODULES(blkid, [blkid])
+])
 
 # lustre/utils/llverfs.c
 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
 
 # lustre/utils/llverfs.c
 AC_CHECK_HEADERS([ext2fs/ext2fs.h])
@@ -3278,6 +3280,10 @@ AS_IF([test "$enable_dist" = "no"], [
 ])
 
 SELINUX=""
 ])
 
 SELINUX=""
+AS_IF([test "x$enable_dist" = xno], [
+       PKG_CHECK_MODULES(blkid, [blkid])
+])
+
 AC_CHECK_LIB([selinux], [is_selinux_enabled],
        [AC_CHECK_HEADERS([selinux/selinux.h],
                        [SELINUX="-lselinux"
 AC_CHECK_LIB([selinux], [is_selinux_enabled],
        [AC_CHECK_HEADERS([selinux/selinux.h],
                        [SELINUX="-lselinux"
@@ -3373,7 +3379,6 @@ AM_CONDITIONAL(MPITESTS, test x$enable_mpitests = xyes, Build MPI Tests)
 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
 AM_CONDITIONAL(CLIENT, test x$enable_client = xyes)
 AM_CONDITIONAL(SERVER, test x$enable_server = xyes)
 AM_CONDITIONAL(SPLIT, test x$enable_split = xyes)
-AM_CONDITIONAL(BLKID, test x$ac_cv_header_blkid_blkid_h = xyes)
 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
 AM_CONDITIONAL(EXT2FS_DEVEL, test x$ac_cv_header_ext2fs_ext2fs_h = xyes)
 AM_CONDITIONAL(GSS, test x$enable_gss = xyes)
 AM_CONDITIONAL(GSS_KEYRING, test x$enable_gss_keyring = xyes)
index 75e6018..44ae523 100644 (file)
@@ -89,15 +89,8 @@ E2PLIB =
 EXT2FSLIB =
 endif
 
 EXT2FSLIB =
 endif
 
-if BLKID
-BLKIDLIB = -lblkid -luuid
-else
-BLKIDLIB =
-endif
-
 llverfs_LDADD := $(EXT2FSLIB) $(E2PLIB)
 llverfs_LDADD := $(EXT2FSLIB) $(E2PLIB)
-
-llverdev_LDADD := $(EXT2FSLIB) $(BLKIDLIB)
+llverdev_LDADD := $(EXT2FSLIB) $(blkid_LIBS)
 
 liblustreapi_la_SOURCES = liblustreapi.c liblustreapi_hsm.c \
                          liblustreapi_nodemap.c lustreapi_internal.h \
 
 liblustreapi_la_SOURCES = liblustreapi.c liblustreapi_hsm.c \
                          liblustreapi_nodemap.c lustreapi_internal.h \