bug-gnulib
[Top][All Lists]
Advanced

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

gnulib-tool: optimize --create-testdir


From: Bruno Haible
Subject: gnulib-tool: optimize --create-testdir
Date: Sun, 14 Jan 2007 21:41:36 +0100 (MET)
User-agent: KMail/1.5.4

Simon recently reported that --create-testdir was running configure
when it was not necessary. This fixes it.


2007-01-14  Bruno Haible  <address@hidden>

        * gnulib-tool (func_create_testdir): Don't unnecessarily run configure
        and make.
        Reported by Simon Josefsson in
        <http://lists.gnu.org/archive/html/bug-gnulib/2007-01/msg00139.html>

*** gnulib-tool 11 Jan 2007 13:28:50 -0000      1.213
--- gnulib-tool 14 Jan 2007 20:34:58 -0000
***************
*** 2659,2665 ****
       ${AUTOMAKE} --add-missing --copy || func_exit 1
      ) || func_exit 1
    fi
!   if grep '^BUILT_SOURCES *+=' "$testdir/$sourcebase/Makefile.am" > 
/dev/null; then
      (cd "$testdir"
       ./configure || func_exit 1
         cd "$sourcebase"
--- 2659,2683 ----
       ${AUTOMAKE} --add-missing --copy || func_exit 1
      ) || func_exit 1
    fi
!   # 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"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]