aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-01-03 02:39:59 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-01-06 18:47:33 +0100
commitcd312bb82c8693ffeb9b143e5361567657a7cede (patch)
tree39b6e764593576f1a8631e1f8a8eb459af4e1847 /configure.ac
parent11a7b775f53e5cdcc845e3746945e2910f78f202 (diff)
downloadblogc-cd312bb82c8693ffeb9b143e5361567657a7cede.tar.gz
blogc-cd312bb82c8693ffeb9b143e5361567657a7cede.tar.bz2
blogc-cd312bb82c8693ffeb9b143e5361567657a7cede.zip
build: travis: fix osx support
This commit fixes builds of blogc and helper tools on osx, and enables travis tests on it. This also includes some general improvements for travis, and disable tests that require mocked functions if the linker does not supports `-wrap` ldflag
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 11 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index dec5c3d..9e6d7eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,6 +144,7 @@ AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests],
[disable unit tests, ignoring presence of cmocka]))
AS_IF([test "x$enable_tests" != "xno"], [
PKG_CHECK_MODULES([CMOCKA], [cmocka], [
+ have_cmocka=yes
AC_MSG_CHECKING([whether the linker supports -wrap])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-wrap,exit"
@@ -154,13 +155,16 @@ AS_IF([test "x$enable_tests" != "xno"], [
[exit(1);]
])
], [
- have_cmocka=yes
+ have_ld_wrap=yes
], [
- have_cmocka=no
+ have_ld_wrap=no
], [
- have_cmocka=no
+ have_ld_wrap=no
+ ])
+ AC_MSG_RESULT([$have_ld_wrap])
+ AS_IF([test "x$have_ld_wrap" = "xyes"],, [
+ AC_MSG_WARN([linker does not supports -wrap. tests requiring it will be disabled])
])
- AC_MSG_RESULT([$have_cmocka])
LDFLAGS="$save_LDFLAGS"
], [
have_cmocka=no
@@ -169,9 +173,9 @@ AS_IF([test "x$enable_tests" != "xno"], [
have_tests=no
TESTS="disabled"
AS_IF([test "x$enable_tests" = "xyes"], [
- AC_MSG_ERROR([tests requested but cmocka was not found or -wrap is not supported by your linker])
+ AC_MSG_ERROR([tests requested but cmocka was not found])
], [
- AC_MSG_WARN([cmocka was not found or -wrap is not supported by your linker, disabling tests])
+ AC_MSG_WARN([cmocka was not found, disabling tests])
])
])
@@ -211,6 +215,7 @@ AS_IF([test "x$enable_tests" != "xno"], [
])
AM_CONDITIONAL([BUILD_TESTS], [test "x$have_tests" = "xyes"])
AM_CONDITIONAL([USE_CMOCKA], [test "x$have_cmocka" = "xyes"])
+AM_CONDITIONAL([USE_LD_WRAP], [test "x$have_ld_wrap" = "xyes"])
AM_CONDITIONAL([USE_BGR_DEPS], [test "x$have_bgr_deps" = "xyes"])
BASH="$ac_cv_path_bash"
AC_SUBST(BASH)