summaryrefslogtreecommitdiffstats
path: root/src/external/libpopt.m4
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-08-31 12:17:38 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-09-09 16:32:12 +0200
commita31df2979265339f71fe3e2d587c4176375b1eff (patch)
tree00c2824900da10f8c1b31471deca139520467ac2 /src/external/libpopt.m4
parent84ef91035f36ca6aed70d17da170d323880c5393 (diff)
downloadsssd-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/libpopt.m4')
-rw-r--r--src/external/libpopt.m414
1 files changed, 11 insertions, 3 deletions
diff --git a/src/external/libpopt.m4 b/src/external/libpopt.m4
index e59b2610..a3681ead 100644
--- a/src/external/libpopt.m4
+++ b/src/external/libpopt.m4
@@ -3,7 +3,15 @@ AC_SUBST(POPT_OBJ)
AC_SUBST(POPT_LIBS)
AC_SUBST(POPT_CFLAGS)
-AC_CHECK_HEADERS([popt.h],
- [AC_CHECK_LIB(popt, poptGetContext, [ POPT_LIBS="-lpopt" ], [AC_MSG_ERROR([POPT must support poptGetContext])])],
- [AC_MSG_ERROR([POPT development libraries not installed])]
+PKG_CHECK_MODULES([POPT], [popt], [found_popt=yes], [found_popt=no])
+
+SSS_AC_EXPAND_LIB_DIR()
+AS_IF([test x"$found_popt" != xyes],
+ [AC_CHECK_HEADERS([popt.h],
+ [AC_CHECK_LIB([popt],
+ [poptGetContext],
+ [POPT_LIBS="-L$sss_extra_libdir -lpopt"],
+ [AC_MSG_ERROR([POPT library must support poptGetContext])],
+ [-L$sss_extra_libdir])],
+ [AC_MSG_ERROR([POPT header files are not installed])])]
)