summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-02-12 14:47:35 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-03-08 22:19:26 +0100
commita5077712fc8c24e8cad08207b7b5a6603bde6a7c (patch)
treed935c7b7fd30d7e4476b85e6fc740f9368a41978
parentb40583c6d52b72e41bf01106534535e54b4fba4f (diff)
downloadsssd-a5077712fc8c24e8cad08207b7b5a6603bde6a7c.tar.gz
sssd-a5077712fc8c24e8cad08207b7b5a6603bde6a7c.tar.xz
sssd-a5077712fc8c24e8cad08207b7b5a6603bde6a7c.zip
Detect the presence of libcmocka during configure
-rw-r--r--configure.ac2
-rw-r--r--src/external/libcmocka.m419
2 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index af976151a..0e7712389 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,6 +137,7 @@ m4_include([src/external/ldap.m4])
m4_include([src/external/libpcre.m4])
m4_include([src/external/krb5.m4])
m4_include([src/external/libcares.m4])
+m4_include([src/external/libcmocka.m4])
m4_include([src/external/docbook.m4])
m4_include([src/external/sizes.m4])
m4_include([src/external/python.m4])
@@ -269,6 +270,7 @@ AC_PATH_PROG([DOXYGEN], [doxygen], [false])
AM_CONDITIONAL([HAVE_DOXYGEN], [test x$DOXYGEN != xfalse ])
AM_CONDITIONAL([HAVE_CHECK], [test x$have_check != x])
+AM_CONDITIONAL([HAVE_CMOCKA], [test x$have_cmocka != x])
abs_build_dir=`pwd`
AC_DEFINE_UNQUOTED([ABS_BUILD_DIR], ["$abs_build_dir"], [Absolute path to the build directory])
diff --git a/src/external/libcmocka.m4 b/src/external/libcmocka.m4
new file mode 100644
index 000000000..c57327612
--- /dev/null
+++ b/src/external/libcmocka.m4
@@ -0,0 +1,19 @@
+dnl this file will be simplified when cmocka carries a .pc file
+AC_SUBST(CMOCKA_LIBS)
+AC_SUBST(CMOCKA_CFLAGS)
+
+AC_CHECK_HEADERS(
+ [setjmp.h cmocka.h],
+ [AC_CHECK_LIB([cmocka], [_will_return],
+ [ CMOCKA_LIBS="-lcmocka"
+ have_cmocka="yes" ],
+ [AC_MSG_WARN([No libcmocka library found])
+ have_cmocka="no" ])],
+ [AC_MSG_WARN([libcmocka header files not installed])],
+ [[ #include <stdarg.h>
+ # include <stddef.h>
+ #ifdef HAVE_SETJMP_H
+ # include <setjmp.h>
+ #endif
+ ]]
+)