From: Paul Eggert Date: Sun, 22 Apr 2012 06:56:42 +0000 (-0700) Subject: * configure.in (doug_lea_malloc): Check for __malloc_initialize_hook. X-Git-Tag: emacs-24.2.90~471^2~318 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b5b5289577b4cc89ee45595832f943ef9a43de6;p=emacs.git * 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. --- 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.