1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
4 EXTRA_DIST = README jm-glibc-io.m4n Makefile.am.in \
75 Makefile.am: Makefile.am.in
77 sed -n '1,/^##m4-files-begin/p' $< > $@t
78 ((echo EXTRA_DIST = README jm-glibc-io.m4n Makefile.am.in|tr '\012' @);\
79 (echo *.m4|tr ' ' @) ) \
80 |sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
82 sed -n '/^##m4-files-end/,$$p' $< >> $@t
84 echo all-local: jm-glibc-io.m4 >> $@t
88 unlocked_functions = \
89 clearerr_unlocked feof_unlocked ferror_unlocked \
90 fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked \
91 fread_unlocked fwrite_unlocked getc_unlocked getchar_unlocked \
92 putc_unlocked putchar_unlocked
94 comma_separated = $(shell echo $(unlocked_functions)|tr -s ' ' ,)
95 base_functions = $(patsubst %_unlocked,%,$(unlocked_functions))
96 jm-glibc-io.m4: jm-glibc-io.m4n Makefile
97 echo 'dnl This file is automatically generated from $<' > $@t
100 -e 's/@space_separated@/$(unlocked_functions)/g' \
101 -e 's/@comma_separated@/$(comma_separated)/g' \
103 move-if-change $@t $@
105 unlocked-io.h: unlocked-io.hin Makefile.am.in
108 for f in $(base_functions); do \
109 u=`echo $$f|tr '[:lower:]' '[:upper:]'`; \
110 echo "# if HAVE_$${u}_UNLOCKED" >> $$tmp; \
111 echo "# undef $$f" >> $$tmp; \
112 echo "# define $$f(S) $${f}_unlocked (S)" >> $$tmp; \
113 echo '#endif' >> $$tmp; \
115 sed "/^@replace_this@$$/r$$tmp" $< \
116 | sed "/^@replace_this@$$/d" \
121 all-local: jm-glibc-io.m4