From 63f92dcaab740ff0102ce778f4e8cbe21a268ebb Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 26 Jun 2012 17:15:01 -0400 Subject: [PATCH] build: libebook: Fix race condition in gen-western-table.py In a parallel build, the normal compiler process will race with the process writing to the table header. Depending on timing, it may or may not work. Fix this in two ways: * Write the file atomically, so #include either gets the whole thing, or nothing. * Add it to BUILT_SOURCES so automake knows to build it first. --- addressbook/libebook/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addressbook/libebook/Makefile.am b/addressbook/libebook/Makefile.am index 41f89f8..0205b0e 100644 --- a/addressbook/libebook/Makefile.am +++ b/addressbook/libebook/Makefile.am @@ -1,4 +1,5 @@ CLEANFILES= +BUILT_SOURCES= include $(top_srcdir)/glib-gen.mak glib_enum_headers=e-book-types.h @@ -83,7 +84,9 @@ libebookinclude_HEADERS = \ cp $< $@ e-name-western-tables.h: e-name-western-tables.h.in - ${srcdir}/gen-western-table.py < $< > $@ + (${srcdir}/gen-western-table.py < $< > $@.tmp && mv $@.tmp $@) || rm -f $@.tmp + +BUILT_SOURCES += e-name-western-tables.h pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libebook-$(API_VERSION).pc -- 2.7.4