+2022-01-03 Bruno Haible <bruno@clisp.org>
+
+ fopen-gnu: Allow use as dependency from test modules.
+ * m4/fopen.m4 (gl_FUNC_FOPEN_GNU): Set REPLACE_FOPEN_FOR_FOPEN_GNU
+ instead of REPLACE_FOPEN.
+ * m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize the fopen-gnu
+ module indicator.
+ (gl_STDIO_H_DEFAULTS): Initialize REPLACE_FOPEN_FOR_FOPEN_GNU.
+ * modules/stdio (Makefile.am): Substitute GNULIB_FOPEN_GNU,
+ REPLACE_FOPEN_FOR_FOPEN_GNU.
+ * modules/fopen-gnu (Depends-on): Add more dependencies.
+ (configure.ac): Test REPLACE_FOPEN_FOR_FOPEN_GNU instead of
+ REPLACE_FOPEN.
+ * lib/stdio.in.h (fopen): Test REPLACE_FOPEN,
+ REPLACE_FOPEN_FOR_FOPEN_GNU, and the respective module indicators
+ instead of just REPLACE_FOPEN.
+
2022-01-03 Bruno Haible <bruno@clisp.org>
realloc-gnu: Allow use as dependency from test modules.
#endif
#if @GNULIB_FOPEN@
-# if @REPLACE_FOPEN@
+# if (@GNULIB_FOPEN@ && @REPLACE_FOPEN@) \
+ || (@GNULIB_FOPEN_GNU@ && @REPLACE_FOPEN_FOR_FOPEN_GNU@)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef fopen
# define fopen rpl_fopen
-# fopen.m4 serial 12
+# fopen.m4 serial 13
dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
])
rm -f conftest.x
])
+ REPLACE_FOPEN_FOR_FOPEN_GNU="$REPLACE_FOPEN"
case "$gl_cv_func_fopen_mode_x" in
- *no) REPLACE_FOPEN=1 ;;
+ *no) REPLACE_FOPEN_FOR_FOPEN_GNU=1 ;;
esac
case "$gl_cv_func_fopen_mode_e" in
- *no) REPLACE_FOPEN=1 ;;
+ *no) REPLACE_FOPEN_FOR_FOPEN_GNU=1 ;;
esac
])
-# stdio_h.m4 serial 56
+# stdio_h.m4 serial 57
dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETC])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETS])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN_GNU])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF_POSIX])
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPURGE])
REPLACE_FDOPEN=0; AC_SUBST([REPLACE_FDOPEN])
REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
+ REPLACE_FOPEN_FOR_FOPEN_GNU=0; AC_SUBST([REPLACE_FOPEN_FOR_FOPEN_GNU])
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
REPLACE_FPURGE=0; AC_SUBST([REPLACE_FPURGE])
REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
Depends-on:
fopen
-open [test $REPLACE_FOPEN = 1]
+open [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
+fcntl-h [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
+stdbool [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
+unistd [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
+close [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
+fstat [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
configure.ac:
gl_FUNC_FOPEN_GNU
-if test $REPLACE_FOPEN = 1; then
+if test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1; then
AC_LIBOBJ([fopen])
gl_PREREQ_FOPEN
fi
-e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
-e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
-e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+ -e 's/@''GNULIB_FOPEN_GNU''@/$(GNULIB_FOPEN_GNU)/g' \
-e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
-e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
-e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
-e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
-e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
-e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
+ -e 's|@''REPLACE_FOPEN_FOR_FOPEN_GNU''@|$(REPLACE_FOPEN_FOR_FOPEN_GNU)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
-e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \