From 93f295496dc6dc0838c09692b6a3a008b35d461b Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Mon, 28 Jul 2014 12:57:32 +0300 Subject: build: Distinguish libini_config version checks Use separate shell variable name prefixes for checks of separate libini_config versions, as repeated invocations of PKG_CHECK_MODULES with the same prefix are not generally supposed to have an effect. Otherwise only the checks before and including the first one defining both *_CFLAGS and *_LIBS variables will be done and all that follow will assume success. This happens on RHEL6.5, where both "pkg-config --cflags" and "pkg-config --libs" for ini_config produce non-empty output and successful check for v0.6.1 results in incorrectly successful check for v1.1.0. Resolves: https://fedorahosted.org/sssd/ticket/2388 Reviewed-by: Jakub Hrozek --- src/external/libini_config.m4 | 8 ++++++-- src/external/samba.m4 | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/external/libini_config.m4 b/src/external/libini_config.m4 index b9fefcc3..13be9c2f 100644 --- a/src/external/libini_config.m4 +++ b/src/external/libini_config.m4 @@ -1,12 +1,16 @@ -PKG_CHECK_MODULES(INI_CONFIG, [ +PKG_CHECK_MODULES(INI_CONFIG_V1, [ ini_config >= 1.0.0], [ + INI_CONFIG_CFLAGS="$INI_CONFIG_V1_CFLAGS" + INI_CONFIG_LIBS="$INI_CONFIG_V1_LIBS" AC_DEFINE_UNQUOTED(HAVE_LIBINI_CONFIG_V1, 1, [libini_config version greater than 1.0.0]) ], [ AC_MSG_WARN([libini_config-devel >= 1.0.0 not available, trying older version]) - PKG_CHECK_MODULES(INI_CONFIG, [ + PKG_CHECK_MODULES(INI_CONFIG_V0, [ ini_config >= 0.6.1], [ + INI_CONFIG_CFLAGS="$INI_CONFIG_V0_CFLAGS" + INI_CONFIG_LIBS="$INI_CONFIG_V0_LIBS" AC_DEFINE_UNQUOTED(HAVE_LIBINI_CONFIG_V0, 1, [libini_config version lesser than 1.0.0]) ], [ AC_MSG_ERROR([Please install libini_config-devel]) diff --git a/src/external/samba.m4 b/src/external/samba.m4 index 62a9fa3f..e896739f 100644 --- a/src/external/samba.m4 +++ b/src/external/samba.m4 @@ -20,7 +20,7 @@ without them. In this case, you will need to execute configure script with argument --without-samba ]])) - PKG_CHECK_MODULES(INI_CONFIG, ini_config >= 1.1.0, , + PKG_CHECK_MODULES(INI_CONFIG_V1_1, ini_config >= 1.1.0, , AC_MSG_ERROR([[Please install libini_config development libraries v1.1.0, or newer. libini_config libraries are necessary for building ipa provider, as well as for building gpo-based access control in ad provider. If -- cgit