summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2022-01-03 15:17:02 +0100
committerBruno Haible <bruno@clisp.org>2022-01-03 15:17:02 +0100
commit316ba778dc74385399d7bc10ec0fa1dfb8374e49 (patch)
tree717de7dd27041788823d2aaa3760e42111f4f078 /modules
parent5427cd71962b646bbb084233c5847b02b94b8f06 (diff)
downloadgnulib-316ba778dc74385399d7bc10ec0fa1dfb8374e49.tar.gz
calloc-gnu: Allow use as dependency from test modules.
* m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Set REPLACE_CALLOC_FOR_CALLOC_GNU instead of REPLACE_CALLOC. (gl_FUNC_CALLOC_POSIX): Set REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC. * m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the calloc-gnu module indicator. (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC. * modules/stdlib (Makefile.am): Substitute GNULIB_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC. * modules/calloc-posix (Depends-on, configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC. * modules/calloc-gnu (Depends-on): Add xalloc-oversized. (configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_GNU instead of REPLACE_CALLOC. Set a module indicator. * lib/stdlib.in.h (calloc): Test REPLACE_CALLOC_FOR_CALLOC_POSIX, REPLACE_CALLOC_FOR_CALLOC_GNU, and the respective module indicators instead of just REPLACE_CALLOC.
Diffstat (limited to 'modules')
-rw-r--r--modules/calloc-gnu4
-rw-r--r--modules/calloc-posix4
-rw-r--r--modules/stdlib4
3 files changed, 8 insertions, 4 deletions
diff --git a/modules/calloc-gnu b/modules/calloc-gnu
index bbd2a49330..037345bad2 100644
--- a/modules/calloc-gnu
+++ b/modules/calloc-gnu
@@ -7,12 +7,14 @@ m4/calloc.m4
Depends-on:
calloc-posix
+xalloc-oversized [test $REPLACE_REALLOC_FOR_CALLOC_GNU = 1]
configure.ac:
gl_FUNC_CALLOC_GNU
-if test $REPLACE_CALLOC = 1; then
+if test $REPLACE_CALLOC_FOR_CALLOC_GNU = 1; then
AC_LIBOBJ([calloc])
fi
+gl_STDLIB_MODULE_INDICATOR([calloc-gnu])
Makefile.am:
diff --git a/modules/calloc-posix b/modules/calloc-posix
index dc9cadd5cb..9ff6913b82 100644
--- a/modules/calloc-posix
+++ b/modules/calloc-posix
@@ -8,11 +8,11 @@ m4/malloc.m4
Depends-on:
stdlib
-xalloc-oversized [test $REPLACE_REALLOC = 1]
+xalloc-oversized [test $REPLACE_REALLOC_FOR_CALLOC_POSIX = 1]
configure.ac:
gl_FUNC_CALLOC_POSIX
-if test $REPLACE_CALLOC = 1; then
+if test $REPLACE_CALLOC_FOR_CALLOC_POSIX = 1; then
AC_LIBOBJ([calloc])
fi
gl_STDLIB_MODULE_INDICATOR([calloc-posix])
diff --git a/modules/stdlib b/modules/stdlib
index ed7912b9ff..63e600d132 100644
--- a/modules/stdlib
+++ b/modules/stdlib
@@ -37,6 +37,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
-e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GNULIB_ALIGNED_ALLOC)/g' \
-e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
+ -e 's/@''GNULIB_CALLOC_GNU''@/$(GNULIB_CALLOC_GNU)/g' \
-e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
-e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \
@@ -125,7 +126,8 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
-e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
- -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
+ -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
-e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \