[evolution-data-server] build: libebook: Fix race condition in gen-western-table.py



commit 63f92dcaab740ff0102ce778f4e8cbe21a268ebb
Author: Colin Walters <walters verbum org>
Date:   Tue Jun 26 17:15:01 2012 -0400

    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 files changed, 4 insertions(+), 1 deletions(-)
---
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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]