Commit 135519e5 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Fix the configure.ac and Makefile.in to correctly test for --wrap

parent c8082556
This diff is collapsed.
......@@ -2210,15 +2210,25 @@ AC_SUBST([KYUA])
# Check for -Wl,--wrap= support
#
AX_CHECK_LINK_FLAG([--wrap],
[enable_ld_wrap=yes
LD_WRAP_TESTS=true
AC_DEFINE([LD_WRAP], [1], [define if the linker supports --wrap option])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
# AM_CONDITIONAL([LD_WRAP], [test $enable_ld_wrap = yes])
AX_SAVE_FLAGS([wrap])
LDFLAGS="-Wl,-wrap,exit"
LD_WRAP_TESTS=false
AC_MSG_CHECKING([for linker support for --wrap option])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <stdlib.h>
void __real_exit (int status);
void __wrap_exit (int status) { __real_exit (status); }
]],
[[exit (1);]])],
[LD_WRAP_TESTS=true
AC_DEFINE([LD_WRAP], [1], [define if the linker supports --wrap option])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AC_SUBST([LD_WRAP_TESTS])
AX_RESTORE_FLAGS([wrap])
#
# Check for i18n
#
......
......@@ -94,6 +94,8 @@ TARGETS = acl_test@EXEEXT@ \
@BIND9_MAKE_RULES@
LD_WRAP_TESTS=@LD_WRAP_TESTS@
acl_test@EXEEXT@: acl_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \
${LDFLAGS} -o $@ acl_test.@O@ dnstest.@O@ ${DNSLIBS} \
......@@ -234,9 +236,9 @@ time_test@EXEEXT@: time_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
WRAP = -Wl,--wrap=isc__mem_put,--wrap=isc__mem_get,--wrap=isc_mem_attach,--wrap=isc_mem_detach
tkey_test@EXEEXT@: tkey_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
if test "${LD_WRAP}" = true; then wrap="${WRAP}"; fi; \
if test "${LD_WRAP_TESTS}" = true; then wrap="${WRAP}"; fi; \
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} \
${LDFLAGS} -o $@ tkey_test.@O@ \
${LDFLAGS} ${WRAP} -o $@ tkey_test.@O@ \
${DNSLIBS} ${ISCLIBS} ${LIBS}
tsig_test@EXEEXT@: tsig_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment