]> git.eshelyaron.com Git - emacs.git/commitdiff
* configure.in (doug_lea_malloc): Check for __malloc_initialize_hook.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 22 Apr 2012 06:56:42 +0000 (23:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 22 Apr 2012 06:56:42 +0000 (23:56 -0700)
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
configure.in

index ca3bcff5a8c45c8236409c04ecd5949fdf1f5e5d..199754292601b2ece74cac36f4b47e3384b5a5ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * 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  <eggert@cs.ucla.edu>
 
        Sync from gnulib version 4f11d6bebc3098c64ffde27079ab0d0cecfd0cdc
index c9592921e75c2fd4b78ad66190ff105350fba72b..e4e11bdf7b5241c77e46c59e2ec91da258806331 100644 (file)
@@ -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 <malloc.h>
+         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.