changeset 18137:a99bbbcf743c stable

Fix race condition when building in cruft directory (bug #40901). * liboctave/cruft/ranlib/module.mk: Create ranlib in build directory if it does not exist. * liboctave/cruft/slatec-fn/module.mk: Create slatec-fn in build directory if it does not exist.
author Rik <rik@octave.org>
date Sun, 15 Dec 2013 19:31:18 -0800
parents 285b2dc3ddfa
children 7721e78b1337 5e72998000fb
files liboctave/cruft/ranlib/module.mk liboctave/cruft/slatec-fn/module.mk
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/cruft/ranlib/module.mk	Sun Dec 15 21:07:55 2013 +0100
+++ b/liboctave/cruft/ranlib/module.mk	Sun Dec 15 19:31:18 2013 -0800
@@ -53,7 +53,11 @@
 ranlib_libranlib_la_DEPENDENCIES = ranlib/ranlib.def
 
 ## Special rules for files which must be built before compilation
+## ranlib directory may not exist in VPATH build; create it if necessary.
 ranlib/ranlib.def: $(RANLIB_SRC) mkf77def
+	@-if ! test -d ranlib; then \
+		mkdir ranlib ; \
+	fi
 	chmod a+rx mkf77def
 	./mkf77def $(srcdir) $(RANLIB_SRC) > $@-t
 	mv $@-t $@
--- a/liboctave/cruft/slatec-fn/module.mk	Sun Dec 15 21:07:55 2013 +0100
+++ b/liboctave/cruft/slatec-fn/module.mk	Sun Dec 15 19:31:18 2013 -0800
@@ -71,11 +71,19 @@
   slatec-fn/derfc.f \
   slatec-fn/erfc.f
 
+## slatec-fn directory may not exist in VPATH build; create it if necessary.
+
 slatec-fn/erfc.f: slatec-fn/erfc.in.f Makefile
+	@-if ! test -d slatec-fn; then \
+		mkdir slatec-fn ; \
+	fi
 	$(SED) -e "${F77_ISNAN_MACRO}" < $< > $@-t
 	mv $@-t $@
 
 slatec-fn/derfc.f: slatec-fn/derfc.in.f Makefile
+	@-if ! test -d slatec-fn; then \
+		mkdir slatec-fn ; \
+	fi
 	$(SED) -e "${F77_ISNAN_MACRO}" < $< > $@-t
 	mv $@-t $@