diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2013-08-31 12:17:38 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-09-09 16:32:12 +0200 |
commit | a31df2979265339f71fe3e2d587c4176375b1eff (patch) | |
tree | 00c2824900da10f8c1b31471deca139520467ac2 /src/external/libpcre.m4 | |
parent | 84ef91035f36ca6aed70d17da170d323880c5393 (diff) | |
download | sssd-a31df2979265339f71fe3e2d587c4176375b1eff.tar.gz sssd-a31df2979265339f71fe3e2d587c4176375b1eff.tar.xz sssd-a31df2979265339f71fe3e2d587c4176375b1eff.zip |
AUTOTOOLS: Use pkg-config to detect libraries.
We used pkg-config only as a fallback if header files was not found,
but detection of library failed in case of available header file and
linking problem (missing -Ldir).
This patch prefers pkg-config.
Diffstat (limited to 'src/external/libpcre.m4')
-rw-r--r-- | src/external/libpcre.m4 | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/external/libpcre.m4 b/src/external/libpcre.m4 index 5917c8cfd..8df860904 100644 --- a/src/external/libpcre.m4 +++ b/src/external/libpcre.m4 @@ -3,7 +3,7 @@ AC_SUBST(PCRE_OBJ) AC_SUBST(PCRE_LIBS) AC_SUBST(PCRE_CFLAGS) -PKG_CHECK_MODULES(PCRE, libpcre) +PKG_CHECK_MODULES([PCRE], [libpcre], [found_libpcre=yes], [found_libpcre=no]) PKG_CHECK_EXISTS(libpcre >= 7, [AC_MSG_NOTICE([PCRE version is 7 or higher])], [AC_MSG_NOTICE([PCRE version is below 7]) @@ -11,5 +11,13 @@ PKG_CHECK_EXISTS(libpcre >= 7, 1, [Define if libpcre version is less than 7])]) -AC_CHECK_HEADERS(pcre.h) -AC_CHECK_LIB(pcre, pcre_compile, [ PCRE_LIBS="-lpcre" ], [AC_MSG_ERROR([PCRE is required])]) +SSS_AC_EXPAND_LIB_DIR() +AS_IF([test x"$found_libpcre" != xyes], + [AC_CHECK_HEADERS([pcre.h], + [AC_CHECK_LIB([pcre], + [pcre_compile], + [PCRE_LIBS="-L$sss_extra_libdir -lpcre"], + [AC_MSG_ERROR([No usable PCRE library found])], + [-L$sss_extra_libdir])], + [AC_MSG_ERROR([pcre header files are not installed])])] +) |