From 4b5b5289577b4cc89ee45595832f943ef9a43de6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 21 Apr 2012 23:56:42 -0700 Subject: [PATCH] * configure.in (doug_lea_malloc): Check for __malloc_initialize_hook. With glibc 2.14 or later, when compiled with GCC 4.7.0's -Werror=deprecated-declarations flag, use of hooks like __malloc_initialize_hook causes compilation to fail because these hooks are deprecated. Modify 'configure' to check for these hooks too. Simplify the 'configure' code to test for all the hooks at once. (emacs_cv_var___after_morecore_hook): Remove, replacing with ... (emacs_cv_var_doug_lea_malloc): ... this new var. --- ChangeLog | 11 +++++++++++ configure.in | 25 ++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca3bcff5a8c..19975429260 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-04-22 Paul Eggert + + * configure.in (doug_lea_malloc): Check for __malloc_initialize_hook. + With glibc 2.14 or later, when compiled with GCC 4.7.0's + -Werror=deprecated-declarations flag, use of hooks like + __malloc_initialize_hook causes compilation to fail because these + hooks are deprecated. Modify 'configure' to check for these hooks too. + Simplify the 'configure' code to test for all the hooks at once. + (emacs_cv_var___after_morecore_hook): Remove, replacing with ... + (emacs_cv_var_doug_lea_malloc): ... this new var. + 2012-04-21 Paul Eggert Sync from gnulib version 4f11d6bebc3098c64ffde27079ab0d0cecfd0cdc diff --git a/configure.in b/configure.in index c9592921e75..e4e11bdf7b5 100644 --- a/configure.in +++ b/configure.in @@ -1708,17 +1708,20 @@ esac # Do the opsystem or machine files prohibit the use of the GNU malloc? # Assume not, until told otherwise. GNU_MALLOC=yes -doug_lea_malloc=yes -AC_CHECK_FUNC(malloc_get_state, ,doug_lea_malloc=no) -AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no) -AC_CACHE_CHECK(whether __after_morecore_hook exists, - emacs_cv_var___after_morecore_hook, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern void (* __after_morecore_hook)();]],[[__after_morecore_hook = 0]])], - emacs_cv_var___after_morecore_hook=yes, - emacs_cv_var___after_morecore_hook=no)]) -if test $emacs_cv_var___after_morecore_hook = no; then - doug_lea_malloc=no -fi + +AC_CACHE_CHECK( + [whether malloc is Doug Lea style], + [emacs_cv_var_doug_lea_malloc], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + static void hook (void) {}]], + [[malloc_set_state (malloc_get_state ()); + __after_morecore_hook = hook; + __malloc_initialize_hook = hook;]])], + [emacs_cv_var_doug_lea_malloc=yes], + [emacs_cv_var_doug_lea_malloc=no])]) +doug_lea_malloc=$emacs_cv_var_doug_lea_malloc dnl See comments in aix4-2.h about maybe using system malloc there. -- 2.39.2