summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-07-02 07:13:33 +0000
committerJim Meyering <jim@meyering.net>2001-07-02 07:13:33 +0000
commit293fbc2d0a9cd6c693e4e18bb1bc4fe43235d411 (patch)
treeb7d4f867386bb5ff3c8a5db6ae9a164ee46d77c7 /m4
parentf7383741d3cf0139ca31bcc42235455c4d4626bf (diff)
downloadcoreutils-293fbc2d0a9cd6c693e4e18bb1bc4fe43235d411.tar.xz
.
Diffstat (limited to 'm4')
-rw-r--r--m4/Makefile.in38
1 files changed, 36 insertions, 2 deletions
diff --git a/m4/Makefile.in b/m4/Makefile.in
index 8b06de353..79543c0cb 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -111,7 +111,7 @@ _am_quote = @_am_quote@
install_sh = @install_sh@
l = @l@
-EXTRA_DIST = README Makefile.am.in \
+EXTRA_DIST = README jm-glibc-io.m4n Makefile.am.in \
afs.m4 \
assert.m4 \
bison.m4 \
@@ -181,6 +181,16 @@ utime.m4 \
utimes.m4 \
xstrtoumax.m4
+
+unlocked_functions = \
+ clearerr_unlocked feof_unlocked ferror_unlocked \
+ fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked \
+ fread_unlocked fwrite_unlocked getc_unlocked getchar_unlocked \
+ putc_unlocked putchar_unlocked
+
+
+comma_separated = $(shell echo $(unlocked_functions)|tr -s ' ' ,)
+base_functions = $(patsubst %_unlocked,%,$(unlocked_functions))
EXEEXT =
OBJEXT = o
subdir = m4
@@ -304,13 +314,37 @@ uninstall-info: uninstall-info-am
Makefile.am: Makefile.am.in
rm -f $@ $@t
sed -n '1,/^##m4-files-begin/p' $< > $@t
- ( (echo EXTRA_DIST = README Makefile.am.in | tr '\012' @); \
+ ((echo EXTRA_DIST = README jm-glibc-io.m4n Makefile.am.in|tr '\012' @);\
(echo *.m4|tr ' ' @) ) \
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
>> $@t
sed -n '/^##m4-files-end/,$$p' $< >> $@t
chmod a-w $@t
mv $@t $@
+jm-glibc-io.m4: jm-glibc-io.m4n Makefile.am.in
+ echo 'dnl This file is automatically generated from $<' > $@t
+ echo '' >> $@t
+ sed \
+ -e 's/@space_separated@/$(unlocked_functions)/g' \
+ -e 's/@comma_separated@/$(comma_separated)/g' \
+ $< >> $@t
+ mv $@t $@
+
+unlocked-io.h: unlocked-io.hin Makefile.am.in
+ tmp=t$$$$; \
+ echo '' > $$tmp; \
+ for f in $(base_functions); do \
+ u=`echo $$f|tr '[:lower:]' '[:upper:]'`; \
+ echo "# if HAVE_$${u}_UNLOCKED" >> $$tmp; \
+ echo "# undef $$f" >> $$tmp; \
+ echo "# define $$f(S) $${f}_unlocked (S)" >> $$tmp; \
+ echo '#endif' >> $$tmp; \
+ done; \
+ sed "/^@replace_this@$$/r$$tmp" $< \
+ | sed "/^@replace_this@$$/d" \
+ $< > $@t; \
+ rm -f $$tmp; \
+ mv $@t $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: