1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
6 Makefile.am: Makefile.am.in
8 sed -n '1,/^##m4-files-begin/p' $< > $@t
9 ((echo EXTRA_DIST = README jm-glibc-io.m4n Makefile.am.in|tr '\012' @);\
10 (echo *.m4|tr ' ' @) ) \
11 |sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
13 sed -n '/^##m4-files-end/,$$p' $< >> $@t
15 echo all-local: jm-glibc-io.m4 >> $@t
19 unlocked_functions = \
20 clearerr_unlocked feof_unlocked ferror_unlocked \
21 fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked \
22 fread_unlocked fwrite_unlocked getc_unlocked getchar_unlocked \
23 putc_unlocked putchar_unlocked
25 comma_separated = $(shell echo $(unlocked_functions)|tr -s ' ' ,)
26 base_functions = $(patsubst %_unlocked,%,$(unlocked_functions))
27 jm-glibc-io.m4: jm-glibc-io.m4n Makefile
28 echo 'dnl This file is automatically generated from $<' > $@t
31 -e 's/@space_separated@/$(unlocked_functions)/g' \
32 -e 's/@comma_separated@/$(comma_separated)/g' \
36 unlocked-io.h: unlocked-io.hin Makefile.am.in
39 for f in $(base_functions); do \
40 u=`echo $$f|tr '[:lower:]' '[:upper:]'`; \
41 echo "# if HAVE_$${u}_UNLOCKED" >> $$tmp; \
42 echo "# undef $$f" >> $$tmp; \
43 echo "# define $$f(S) $${f}_unlocked (S)" >> $$tmp; \
44 echo '#endif' >> $$tmp; \
46 sed "/^@replace_this@$$/r$$tmp" $< \
47 | sed "/^@replace_this@$$/d" \