diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-09 20:09:55 -0300 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-09 20:09:55 -0300 |
commit | 502ed6760d9d2d674d0dcc87a6cb223ff079745d (patch) | |
tree | 1de3473703970658ecc84acefc2e917fb4f40d43 /configure.ac | |
parent | beb44f4372e0af7dafc7fff6f5184737d61fc8d3 (diff) | |
download | blogc-502ed6760d9d2d674d0dcc87a6cb223ff079745d.tar.gz blogc-502ed6760d9d2d674d0dcc87a6cb223ff079745d.tar.bz2 blogc-502ed6760d9d2d674d0dcc87a6cb223ff079745d.zip |
loader: added tests
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 716daa7..a2cace4 100644 --- a/configure.ac +++ b/configure.ac @@ -43,8 +43,25 @@ AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests], AS_IF([test "x$enable_tests" != "xno"], [ PKG_PROG_PKG_CONFIG PKG_CHECK_MODULES([CMOCKA], [cmocka], [ - TESTS="enabled" - have_cmocka=yes + AC_MSG_CHECKING([whether the linker supports -wrap]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,-wrap,exit" + AC_RUN_IFELSE([ + AC_LANG_PROGRAM([ + [void __wrap_exit(int s){__real_exit(0);}] + ], [ + [exit(1);] + ]) + ], [ + TESTS="enabled" + have_cmocka=yes + ], [ + have_cmocka=no + ], [ + have_cmocka=no + ]) + AC_MSG_RESULT([$have_cmocka]) + LDFLAGS="$save_LDFLAGS" ], [ have_cmocka=no ]) |