diff options
-rw-r--r-- | configure.ac | 25 | ||||
-rw-r--r-- | tests/unit_tests/openvpn/Makefile.am | 6 |
2 files changed, 30 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 43487b0..8783109 100644 --- a/configure.ac +++ b/configure.ac @@ -582,6 +582,30 @@ AC_COMPILE_IFELSE( [AC_MSG_RESULT([no])] ) +saved_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -Wl,--wrap=exit" +AC_MSG_CHECKING([linker supports --wrap]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ + void exit(int); + void __real_exit(int); + void __wrap_exit(int i) { + __real_exit(i); + } + ]], + [[ + exit(0); + ]] + )], + [ + AC_MSG_RESULT([yes]) + have_ld_wrap_support=yes + ], + [AC_MSG_RESULT([no])], +) +LDFLAGS="$saved_LDFLAGS" + dnl We emulate signals in Windows AC_CHECK_DECLS( [SIGHUP], @@ -1244,6 +1268,7 @@ AM_CONDITIONAL([GIT_CHECKOUT], [test "${GIT_CHECKOUT}" = "yes"]) AM_CONDITIONAL([ENABLE_PLUGIN_AUTH_PAM], [test "${enable_plugin_auth_pam}" = "yes"]) AM_CONDITIONAL([ENABLE_PLUGIN_DOWN_ROOT], [test "${enable_plugin_down_root}" = "yes"]) AM_CONDITIONAL([ENABLE_CRYPTO], [test "${enable_crypto}" = "yes"]) +AM_CONDITIONAL([HAVE_LD_WRAP_SUPPORT], [test "${have_ld_wrap_support}" = "yes"]) plugindir="${with_plugindir}" sampledir="\$(docdir)/sample" diff --git a/tests/unit_tests/openvpn/Makefile.am b/tests/unit_tests/openvpn/Makefile.am index fafe6b2..b902b20 100644 --- a/tests/unit_tests/openvpn/Makefile.am +++ b/tests/unit_tests/openvpn/Makefile.am @@ -1,6 +1,10 @@ AUTOMAKE_OPTIONS = foreign -check_PROGRAMS = argv_testdriver buffer_testdriver +check_PROGRAMS= + +if HAVE_LD_WRAP_SUPPORT +check_PROGRAMS += argv_testdriver buffer_testdriver +endif if ENABLE_CRYPTO check_PROGRAMS += tls_crypt_testdriver |