Change the way symbols_list2.h is built to avoid some race conditions.

This commit is contained in:
Juan Jose Garcia Ripoll 2010-12-12 19:21:51 +01:00
parent 760a644292
commit 45089744a8

View file

@ -113,11 +113,18 @@ $(DPP): $(srcdir)/dpp.c $(srcdir)/symbols_list2.h
if test -f ../CROSS-DPP; then touch dpp; else \
$(TRUE_CC) -I$(srcdir) -I@true_builddir@ -I./ $(srcdir)/dpp.c @CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ -o $@ ; \
fi
#
# symbols_list2.h is built this way to allow for an atomic replacement of
# the file. Otherwise we have problem when doing concurrent builds with
# rsync updates of the source tree.
#
$(srcdir)/symbols_list2.h: $(srcdir)/symbols_list.h Makefile
cat $(srcdir)/symbols_list.h | \
sed -e 's%{\([A-Z ]*.*".*"\),[^,]*,[ ]*NULL,.*}%{\1,NULL}%g' \
-e 's%{\([A-Z ]*.*".*"\),[^,]*,[ ]*\([^,]*\),.*}%{\1,"\2"}%g' \
-e 's%{NULL.*%{NULL,NULL}};%' > $@
-e 's%{NULL.*%{NULL,NULL}};%' > tmp.h
mv tmp.h $@
#
# GCC might break this code