emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107989: * configure.in (doug_lea_mal


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107989: * configure.in (doug_lea_malloc): Check for __malloc_initialize_hook.
Date: Sat, 21 Apr 2012 23:56:42 -0700
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107989
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sat 2012-04-21 23:56:42 -0700
message:
  * 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.
modified:
  ChangeLog
  configure.in
=== modified file 'ChangeLog'
--- a/ChangeLog 2012-04-21 17:15:03 +0000
+++ b/ChangeLog 2012-04-22 06:56:42 +0000
@@ -1,3 +1,14 @@
+2012-04-22  Paul Eggert  <address@hidden>
+
+       * 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  <address@hidden>
 
        Sync from gnulib version 4f11d6bebc3098c64ffde27079ab0d0cecfd0cdc

=== modified file 'configure.in'
--- a/configure.in      2012-04-21 17:15:03 +0000
+++ b/configure.in      2012-04-22 06:56:42 +0000
@@ -1708,17 +1708,20 @@
 # 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]