From eddfbed43ef2a83fa1d27bc1e990c6b145492d9d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 14 Jan 2007 20:45:45 +0000 Subject: [PATCH] Don't unnecessarily run configure and make. --- ChangeLog | 7 +++++++ gnulib-tool | 22 ++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e29999cc..c243c51cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-01-14 Bruno Haible + * gnulib-tool (func_create_testdir): Don't unnecessarily run configure + and make. + Reported by Simon Josefsson in + + +2007-01-14 Bruno Haible + * modules/allocsa-tests: New file. * tests/test-allocsa.c: New file. diff --git a/gnulib-tool b/gnulib-tool index 412cd9e48..147190fda 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -22,7 +22,7 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2007-01-11 13:28:50 $' +cvsdatestamp='$Date: 2007-01-14 20:45:45 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` nl=' @@ -2659,7 +2659,25 @@ func_create_testdir () ${AUTOMAKE} --add-missing --copy || func_exit 1 ) || func_exit 1 fi - if grep '^BUILT_SOURCES *+=' "$testdir/$sourcebase/Makefile.am" > /dev/null; then + # Need to run configure and make once, to create built files that are to be + # distributed (such as getdate.c). + # Extract the value of "CLEANFILES += ...". + cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$sourcebase/Makefile.am" \ + | sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p'` + cleaned_files=" "`for file in $cleaned_files; do echo "$file"; done`" " + # Extract the value of "BUILT_SOURCES += ...". Remove variable references + # such $(FOO_H) because they don't refer to distributed files. + sed_remove_make_variables='s,[$]([A-Za-z0-9_]*),,g' + built_sources=`sed -e "$sed_remove_backslash_newline" < "$testdir/$sourcebase/Makefile.am" \ + | sed -n -e 's,^BUILT_SOURCES[ ]*+=\([^#]*\).*$,\1,p' \ + | sed -e "$sed_remove_make_variables"` + distributed_built_sources=`for file in $built_sources; do + case "$cleaned_files" in + *" "$file" "*) ;; + *) echo $file ;; + esac; + done` + if test -n "$distributed_built_sources"; then (cd "$testdir" ./configure || func_exit 1 cd "$sourcebase" -- 2.11.0