X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=gnulib-tool;h=46c3d2fc4ff505f1c75b304362353802ddac02f2;hb=dc970941f3b440c7372218f172a303dfb4129b6e;hp=47974e697fd08bd74f1f9c7dd530ee3f213c3bb9;hpb=1d19f103323b9ad6c43a27049f5ce7c4a586d989;p=gnulib.git diff --git a/gnulib-tool b/gnulib-tool index 47974e697..46c3d2fc4 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -410,7 +410,7 @@ func_gnulib_dir () * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;; esac done - gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` + gnulib_dir=/usr/share/gnulib } # func_tmpdir @@ -2976,11 +2976,20 @@ func_emit_tests_Makefile_am () } > "$tmp"/amsnippet # Skip the contents if it's entirely empty. if grep '[^ ]' "$tmp"/amsnippet > /dev/null ; then - echo "## begin gnulib module $module" - echo - cat "$tmp"/amsnippet - echo "## end gnulib module $module" - echo + # Mention long-running tests at the end. + ofd=3 + for word in `func_get_status "$module"`; do + if test "$word" = 'longrunning-test'; then + ofd=4 + break + fi + done + { echo "## begin gnulib module $module" + echo + cat "$tmp"/amsnippet + echo "## end gnulib module $module" + echo + } >&$ofd fi rm -f "$tmp"/amsnippet # Test whether there are some source files in subdirectories. @@ -2994,7 +3003,7 @@ func_emit_tests_Makefile_am () done fi done - } > "$tmp"/allsnippets + } 3> "$tmp"/main_snippets 4> "$tmp"/longrunning_snippets # Generate dependencies here, since it eases the debugging of test failures. # If there are source files in subdirectories, prevent collision of the # object files (example: hash.c and libxml/hash.c). @@ -3011,7 +3020,7 @@ func_emit_tests_Makefile_am () # Nothing is being added to SUBDIRS; nevertheless the existence of this # variable is needed to avoid an error from automake: # "AM_GNU_GETTEXT used but SUBDIRS not defined" - echo "SUBDIRS =" + echo "SUBDIRS = ." echo "TESTS =" echo "XFAIL_TESTS =" echo "TESTS_ENVIRONMENT =" @@ -3030,7 +3039,7 @@ func_emit_tests_Makefile_am () fi # Automake versions < 1.9b create an empty pkgdatadir at installation time # if you specify pkgdata_DATA to empty. This is a workaround. - if grep '^pkgdata_DATA *+=' "$tmp"/allsnippets > /dev/null; then + if grep '^pkgdata_DATA *+=' "$tmp"/main_snippets "$tmp"/longrunning_snippets > /dev/null; then echo "pkgdata_DATA =" fi echo "EXTRA_DIST =" @@ -3096,7 +3105,7 @@ func_emit_tests_Makefile_am () # srcdir is defined by autoconf and automake. echo "TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='\$(srcdir)'" echo - cat "$tmp"/allsnippets \ + cat "$tmp"/main_snippets "$tmp"/longrunning_snippets \ | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g' echo "# Clean up after Solaris cc." echo "clean-local:" @@ -3109,7 +3118,7 @@ func_emit_tests_Makefile_am () echo " fi; \\" echo " done; \\" echo " :" - rm -f "$tmp"/allsnippets + rm -f "$tmp"/main_snippets "$tmp"/longrunning_snippets } # func_emit_initmacro_start macro_prefix @@ -4328,6 +4337,7 @@ s,//*$,/,' else sed_replace_build_aux="$sed_noop" fi + echo " gl_m4_base='$m4base'" func_emit_initmacro_start $macro_prefix echo " gl_source_base='$sourcebase'" for module in $main_modules; do @@ -4355,7 +4365,9 @@ s,//*$,/,' # Define a tests witness macro that depends on the package. # PACKAGE is defined by AM_INIT_AUTOMAKE, PACKAGE_TARNAME is defined by AC_INIT. # See . - echo " ${macro_prefix}tests_WITNESS=IN_\`echo \"\${PACKAGE-\$PACKAGE_TARNAME}\" | LC_ALL=C tr 'a-z' 'A-Z' | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'\`_GNULIB_TESTS" + echo "changequote(,)dnl" + echo " ${macro_prefix}tests_WITNESS=IN_\`echo \"\${PACKAGE-\$PACKAGE_TARNAME}\" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'\`_GNULIB_TESTS" + echo "changequote([, ])dnl" echo " AC_SUBST([${macro_prefix}tests_WITNESS])" echo " gl_module_indicator_condition=\$${macro_prefix}tests_WITNESS" echo " m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [\$gl_module_indicator_condition])" @@ -4901,6 +4913,7 @@ func_create_testdir () s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| ba }' + echo "gl_m4_base='../$m4base'" func_emit_initmacro_start $macro_prefix # We don't have explicit ordering constraints between the various # autoconf snippets. It's cleanest to put those of the library before @@ -5030,6 +5043,7 @@ func_create_testdir () else sed_replace_build_aux="$sed_noop" fi + echo "gl_m4_base='$m4base'" func_emit_initmacro_start $macro_prefix echo "gl_source_base='$sourcebase'" for module in $modules; do @@ -5117,13 +5131,13 @@ func_create_testdir () fi # Need to run configure and make once, to create built files that are to be # distributed (such as getdate.c). + sed_remove_make_variables='s,[$]([A-Za-z0-9_]*),,g' # Extract the value of "CLEANFILES += ..." and "MOSTLYCLEANFILES += ...". cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$sourcebase/Makefile.am" \ | sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p' -e 's,^MOSTLYCLEANFILES[ ]*+=\([^#]*\).*$,\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"` @@ -5133,14 +5147,44 @@ func_create_testdir () *) echo $file ;; esac; done` - if test -n "$distributed_built_sources"; then + tests_distributed_built_sources= + if test -n "$inctests"; then + # Likewise for built files in the $testsbase directory. + tests_cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$testsbase/Makefile.am" \ + | sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p' -e 's,^MOSTLYCLEANFILES[ ]*+=\([^#]*\).*$,\1,p'` + tests_cleaned_files=`for file in $tests_cleaned_files; do echo " $file "; done` + tests_built_sources=`sed -e "$sed_remove_backslash_newline" < "$testdir/$testsbase/Makefile.am" \ + | sed -n -e 's,^BUILT_SOURCES[ ]*+=\([^#]*\).*$,\1,p' \ + | sed -e "$sed_remove_make_variables"` + tests_distributed_built_sources=`for file in $tests_built_sources; do + case "$tests_cleaned_files" in + *" "$file" "*) ;; + *) echo $file ;; + esac; + done` + fi + if test -n "$distributed_built_sources" || test -n "$tests_distributed_built_sources"; then (cd "$testdir" ./configure || func_exit 1 - cd "$sourcebase" - echo 'built_sources: $(BUILT_SOURCES)' >> Makefile - $MAKE built_sources || func_exit 1 - cd .. - $MAKE distclean || func_exit 1 + if test -n "$distributed_built_sources"; then + cd "$sourcebase" + echo 'built_sources: $(BUILT_SOURCES)' >> Makefile + $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ + built_sources \ + || func_exit 1 + cd .. + fi + if test -n "$tests_distributed_built_sources"; then + cd "$testsbase" + echo 'built_sources: $(BUILT_SOURCES)' >> Makefile + $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ + built_sources \ + || func_exit 1 + cd .. + fi + $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ + distclean \ + || func_exit 1 ) || func_exit 1 fi }