summaryrefslogtreecommitdiffstats
path: root/src/external/libtevent.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 17:04:36 +0200
commite64a66e620aad51c1fada6138362c5a186af178a (patch)
tree91305d3db9f79cbdf8703217cb2b2d85363ab6cd /src/external/libtevent.m4
parent2ff2cc0d12b844c2e04ca6594c714ee3884c6351 (diff)
downloadsssd-e64a66e620aad51c1fada6138362c5a186af178a.tar.gz
sssd-e64a66e620aad51c1fada6138362c5a186af178a.tar.xz
sssd-e64a66e620aad51c1fada6138362c5a186af178a.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/libtevent.m4')
-rw-r--r--src/external/libtevent.m421
1 files changed, 12 insertions, 9 deletions
diff --git a/src/external/libtevent.m4 b/src/external/libtevent.m4
index f19f27bf2..d40b9d423 100644
--- a/src/external/libtevent.m4
+++ b/src/external/libtevent.m4
@@ -2,12 +2,15 @@ AC_SUBST(TEVENT_OBJ)
AC_SUBST(TEVENT_CFLAGS)
AC_SUBST(TEVENT_LIBS)
-AC_CHECK_HEADER(tevent.h,
- [AC_CHECK_LIB(
- tevent,
- tevent_context_init,
- [TEVENT_LIBS="-ltevent -ltalloc"],
- [AC_MSG_ERROR([libtevent missing tevent_context_init])],
- [-ltalloc]) ],
- [PKG_CHECK_MODULES(TEVENT, tevent)],
- )
+PKG_CHECK_MODULES([TEVENT], [tevent], [found_tevent=yes], [found_tevent=no])
+
+SSS_AC_EXPAND_LIB_DIR()
+AS_IF([test x"$found_tevent" != xyes],
+ [AC_CHECK_HEADER([tevent.h],
+ [AC_CHECK_LIB([tevent],
+ [tevent_context_init],
+ [TEVENT_LIBS="-L$sss_extra_libdir -ltevent -ltalloc"],
+ [AC_MSG_ERROR([libtevent missing tevent_context_init])],
+ [-L$sss_extra_libdir -ltalloc])],
+ [AC_MSG_ERROR([tevent header files are not installed])])]
+)