annotate m4/malloc.m4 @ 285:9010796c6253 2.3 2.3.1

Generated manual for distribution
author lost
date Fri, 24 Apr 2009 22:36:09 +0000
parents 2cb097e760a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
1 # malloc.m4 serial 8
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
2 dnl Copyright (C) 2007 Free Software Foundation, Inc.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
6
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
7 # gl_FUNC_MALLOC_POSIX
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
8 # --------------------
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
9 # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
10 # fails), and replace malloc if it is not.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
11 AC_DEFUN([gl_FUNC_MALLOC_POSIX],
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
12 [
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
13 AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
14 if test $gl_cv_func_malloc_posix = yes; then
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
15 HAVE_MALLOC_POSIX=1
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
16 AC_DEFINE([HAVE_MALLOC_POSIX], 1,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
17 [Define if the 'malloc' function is POSIX compliant.])
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
18 else
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
19 AC_LIBOBJ([malloc])
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
20 HAVE_MALLOC_POSIX=0
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
21 fi
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
22 AC_SUBST([HAVE_MALLOC_POSIX])
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
23 ])
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
24
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
25 # Test whether malloc, realloc, calloc are POSIX compliant,
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
26 # Set gl_cv_func_malloc_posix to yes or no accordingly.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
27 AC_DEFUN([gl_CHECK_MALLOC_POSIX],
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
28 [
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
29 AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
30 [gl_cv_func_malloc_posix],
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
31 [
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
32 dnl It is too dangerous to try to allocate a large amount of memory:
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
33 dnl some systems go to their knees when you do that. So assume that
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
34 dnl all Unix implementations of the function are POSIX compliant.
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
35 AC_TRY_COMPILE([],
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
36 [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
37 choke me
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
38 #endif
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
39 ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
40 ])
2cb097e760a5 Added various generated files in prep for release
lost
parents:
diff changeset
41 ])