test for and use system explicit_bzero if it exists

ok beck@ guenther@
This commit is contained in:
Brent Cook 2014-07-21 07:50:32 -05:00
parent 0ec7cdcbad
commit f425f564d5
2 changed files with 10 additions and 1 deletions

View File

@ -105,6 +105,11 @@ AC_CHECK_FUNC(strtonum,[AC_SEARCH_LIBS(write,, [NO_STRTONUM=],
AC_SUBST(NO_STRTONUM) AC_SUBST(NO_STRTONUM)
AM_CONDITIONAL(NO_STRTONUM, test "x$NO_STRTONUM" = "xyes") 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(getauxval, AC_DEFINE(HAVE_GETAUXVAL))
AC_CHECK_FUNC(funopen, AC_DEFINE(HAVE_FUNOPEN)) AC_CHECK_FUNC(funopen, AC_DEFINE(HAVE_FUNOPEN))

View File

@ -14,7 +14,11 @@ noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la
# compatibility functions that need to be built without optimizations # compatibility functions that need to be built without optimizations
libcompatnoopt_la_CFLAGS = -O0 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 # other compatibility functions
libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS) libcompat_la_CFLAGS = $(CFLAGS) $(USER_CFLAGS)