From f425f564d5062fdc3f7a0d15c7cc5c36a1723abd Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Mon, 21 Jul 2014 07:50:32 -0500 Subject: test for and use system explicit_bzero if it exists ok beck@ guenther@ --- configure.ac.tpl | 5 +++++ crypto/Makefile.am.tpl | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac.tpl b/configure.ac.tpl index 84d2f69..ac66565 100644 --- a/configure.ac.tpl +++ b/configure.ac.tpl @@ -105,6 +105,11 @@ AC_CHECK_FUNC(strtonum,[AC_SEARCH_LIBS(write,, [NO_STRTONUM=], AC_SUBST(NO_STRTONUM) AM_CONDITIONAL(NO_STRTONUM, test "x$NO_STRTONUM" = "xyes") +AC_CHECK_FUNC(explicit_bzero,[AC_SEARCH_LIBS(write,, [NO_EXPLICIT_BZERO=], + [NO_EXPLICIT_BZERO=yes])], [NO_EXPLICIT_BZERO=yes]) +AC_SUBST(NO_EXPLICIT_BZERO) +AM_CONDITIONAL(NO_EXPLICIT_BZERO, test "x$NO_EXPLICIT_BZERO" = "xyes") + AC_CHECK_FUNC(getauxval, AC_DEFINE(HAVE_GETAUXVAL)) AC_CHECK_FUNC(funopen, AC_DEFINE(HAVE_FUNOPEN)) diff --git a/crypto/Makefile.am.tpl b/crypto/Makefile.am.tpl index ac87a77..6e1c423 100644 --- a/crypto/Makefile.am.tpl +++ b/crypto/Makefile.am.tpl @@ -14,7 +14,11 @@ noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la # compatibility functions that need to be built without optimizations libcompatnoopt_la_CFLAGS = -O0 -libcompatnoopt_la_SOURCES = compat/explicit_bzero.c +libcompatnoopt_la_SOURCES = + +if NO_EXPLICIT_BZERO +libcompatnoopt_la_SOURCES += compat/explicit_bzero.c +endif # other compatibility functions libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) -- cgit v1.2.3-55-g6feb