From cd881a78e7232e973c3202eef3e8302608ca54f6 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 18 Jul 2001 05:59:07 +0000 Subject: [PATCH] * lib/compile: Change how lockdir is computed. If linking or compiling without `-o', just run the compiler. --- ChangeLog | 3 +++ lib/compile | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd2924c51..ae561879b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-07-18 Tom Tromey + * lib/compile: Change how lockdir is computed. If linking or + compiling without `-o', just run the compiler. + * tests/Makefile.am (TESTS): Added ccnoco.test. (XFAIL_TESTS): Likewise. * tests/ccnoco.test: New file. diff --git a/lib/compile b/lib/compile index 0d11ac557..7370ae595 100755 --- a/lib/compile +++ b/lib/compile @@ -51,21 +51,23 @@ while test $# -gt 0; do shift done -test -z "$ofile" && { - echo "compile: no \`-o' option seen" 1>&2 - exit 1 -} - -test -z "$cfile" && { - echo "compile: no \`.c' file seen" 1>&2 - exit 1 -} +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$prog" $args +fi # Name of file we expect compiler to create. cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. -lockdir=`echo $ofile | sed -e 's|/|_|g'` +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir $lockdir > /dev/null 2>&1; then break -- 2.47.2