Here is the same stuff updated for the current version of gnulib-tool,
there were quite a lot of changes since I made the patch!
Paolo
Index: gnulib-tool
===================================================================
RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v
retrieving revision 1.174
diff -u -b -r1.174 gnulib-tool
--- gnulib-tool 26 Sep 2006 21:01:42 -0000 1.174
+++ gnulib-tool 27 Sep 2006 11:50:03 -0000
@@ -1403,7 +1403,8 @@
fi
# Append the cached and the specified module names. So that
# "gnulib-tool --import foo" means to add the module foo.
- specified_modules="$cached_specified_modules $1"
+ new_modules="$1"
+ specified_modules="$cached_specified_modules $new_modules"
# Append the cached and the specified avoidlist. This is probably better
# than dropping the cached one when --avoid is specified at least once.
avoidlist=`echo $cached_avoidlist $avoidlist`
@@ -1989,12 +1990,13 @@
fi
echo "Finished."
+ if test -n "$new_modules"; then
echo
echo "You may need to add #include directives for the following .h files."
# First the #include <...> directives without #ifs, sorted for convenience,
# then the #include "..." directives without #ifs, sorted for convenience,
# then the #include directives that are surrounded by #ifs. Not sorted.
- for module in $modules; do
+ for module in $new_modules; do
include_directive=`func_get_include_directive "$module"`
case "$nl$include_directive" in
*"$nl#if"*)
@@ -2012,36 +2014,48 @@
cat "$tmp"/include-if
) | sed -e '/^$/d' -e 's/^/ /'
rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if
+ fi
+ header_printed=false
+ func_echo_header () {
+ $header_printed || {
echo
echo "Don't forget to"
+ header_printed=:
+ }
+ }
+
+ if test "$makefile_am" != "$cached_makefile_name"; then
if test "$makefile_am" = Makefile.am; then
- echo " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in
$configure_ac,"
+ func_echo_header " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in
$configure_ac,"
else
- echo " - \"include $makefile_name\" from within
\"$sourcebase/Makefile.am\","
+ func_echo_header " - \"include $makefile_name\" from within
\"$sourcebase/Makefile.am\","
fi
if test -n "$inctests"; then
if test "$makefile_am" = Makefile.am; then
- echo " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in
$configure_ac,"
+ func_echo_header " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES
in $configure_ac,"
else
- echo " - \"include $makefile_name\" from within
\"$testsbase/Makefile.am\","
+ func_echo_header " - \"include $makefile_name\" from within
\"$testsbase/Makefile.am\","
fi
fi
if test "$makefile_am" = Makefile.am; then
sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'`
sourcebase_base=`basename "$sourcebase"`
- echo " - mention \"${sourcebase_base}\" in SUBDIRS in
${sourcebase_dir}Makefile.am,"
+ func_echo_header " - mention \"${sourcebase_base}\" in SUBDIRS in
${sourcebase_dir}Makefile.am,"
fi
if test -n "$inctests"; then
if test "$makefile_am" = Makefile.am; then
testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'`
testsbase_base=`basename "$testsbase"`
- echo " - mention \"${testsbase_base}\" in SUBDIRS in
${testsbase_dir}Makefile.am,"
+ func_echo_header " - mention \"${testsbase_base}\" in SUBDIRS in
${testsbase_dir}Makefile.am,"
+ fi
+ fi
fi
+ if test -z "$cached_specified_modules"; then
+ func_echo_header " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in
Makefile.am,"
+ func_echo_header " - invoke ${macro_prefix}_EARLY in $configure_ac, right
after AC_PROG_CC,"
+ func_echo_header " - invoke ${macro_prefix}_INIT in $configure_ac."
fi
- echo " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in Makefile.am,"
- echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after
AC_PROG_CC,"
- echo " - invoke ${macro_prefix}_INIT in $configure_ac."
}
# func_create_testdir testdir modules
2006-09-25 Paolo Bonzini <[EMAIL PROTECTED]>
* gnulib-tool (func_import): Save the new_modules into a variable.
Omit #include directives part for old modules. Omit makefile blurb
unless makefile name change, and configure.ac blurb unless this
is the first run of gnulib-tool --import.
Index: gnulib-tool
===================================================================
RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v
retrieving revision 1.174
diff -u -r1.174 gnulib-tool
--- gnulib-tool 26 Sep 2006 21:01:42 -0000 1.174
+++ gnulib-tool 27 Sep 2006 11:50:41 -0000
@@ -1403,7 +1403,8 @@
fi
# Append the cached and the specified module names. So that
# "gnulib-tool --import foo" means to add the module foo.
- specified_modules="$cached_specified_modules $1"
+ new_modules="$1"
+ specified_modules="$cached_specified_modules $new_modules"
# Append the cached and the specified avoidlist. This is probably better
# than dropping the cached one when --avoid is specified at least once.
avoidlist=`echo $cached_avoidlist $avoidlist`
@@ -1989,59 +1990,72 @@
fi
echo "Finished."
- echo
- echo "You may need to add #include directives for the following .h files."
- # First the #include <...> directives without #ifs, sorted for convenience,
- # then the #include "..." directives without #ifs, sorted for convenience,
- # then the #include directives that are surrounded by #ifs. Not sorted.
- for module in $modules; do
- include_directive=`func_get_include_directive "$module"`
- case "$nl$include_directive" in
- *"$nl#if"*)
- echo "$include_directive" 1>&5
- ;;
- *)
- echo "$include_directive" | grep -v 'include "' 1>&6
- echo "$include_directive" | grep 'include "' 1>&7
- ;;
- esac
- done 5> "$tmp"/include-if 6> "$tmp"/include-angles 7> "$tmp"/include-quotes
- (
- LC_ALL=C sort -u "$tmp"/include-angles
- LC_ALL=C sort -u "$tmp"/include-quotes
- cat "$tmp"/include-if
- ) | sed -e '/^$/d' -e 's/^/ /'
- rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if
-
- echo
- echo "Don't forget to"
- if test "$makefile_am" = Makefile.am; then
- echo " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in
$configure_ac,"
- else
- echo " - \"include $makefile_name\" from within
\"$sourcebase/Makefile.am\","
- fi
- if test -n "$inctests"; then
+ if test -n "$new_modules"; then
+ echo
+ echo "You may need to add #include directives for the following .h files."
+ # First the #include <...> directives without #ifs, sorted for convenience,
+ # then the #include "..." directives without #ifs, sorted for convenience,
+ # then the #include directives that are surrounded by #ifs. Not sorted.
+ for module in $new_modules; do
+ include_directive=`func_get_include_directive "$module"`
+ case "$nl$include_directive" in
+ *"$nl#if"*)
+ echo "$include_directive" 1>&5
+ ;;
+ *)
+ echo "$include_directive" | grep -v 'include "' 1>&6
+ echo "$include_directive" | grep 'include "' 1>&7
+ ;;
+ esac
+ done 5> "$tmp"/include-if 6> "$tmp"/include-angles 7> "$tmp"/include-quotes
+ (
+ LC_ALL=C sort -u "$tmp"/include-angles
+ LC_ALL=C sort -u "$tmp"/include-quotes
+ cat "$tmp"/include-if
+ ) | sed -e '/^$/d' -e 's/^/ /'
+ rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if
+ fi
+
+ header_printed=false
+ func_echo_header () {
+ $header_printed || {
+ echo
+ echo "Don't forget to"
+ header_printed=:
+ }
+ }
+
+ if test "$makefile_am" != "$cached_makefile_name"; then
if test "$makefile_am" = Makefile.am; then
- echo " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in
$configure_ac,"
+ func_echo_header " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in
$configure_ac,"
else
- echo " - \"include $makefile_name\" from within
\"$testsbase/Makefile.am\","
+ func_echo_header " - \"include $makefile_name\" from within
\"$sourcebase/Makefile.am\","
+ fi
+ if test -n "$inctests"; then
+ if test "$makefile_am" = Makefile.am; then
+ func_echo_header " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES
in $configure_ac,"
+ else
+ func_echo_header " - \"include $makefile_name\" from within
\"$testsbase/Makefile.am\","
+ fi
fi
- fi
- if test "$makefile_am" = Makefile.am; then
- sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'`
- sourcebase_base=`basename "$sourcebase"`
- echo " - mention \"${sourcebase_base}\" in SUBDIRS in
${sourcebase_dir}Makefile.am,"
- fi
- if test -n "$inctests"; then
if test "$makefile_am" = Makefile.am; then
- testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'`
- testsbase_base=`basename "$testsbase"`
- echo " - mention \"${testsbase_base}\" in SUBDIRS in
${testsbase_dir}Makefile.am,"
+ sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'`
+ sourcebase_base=`basename "$sourcebase"`
+ func_echo_header " - mention \"${sourcebase_base}\" in SUBDIRS in
${sourcebase_dir}Makefile.am,"
+ fi
+ if test -n "$inctests"; then
+ if test "$makefile_am" = Makefile.am; then
+ testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'`
+ testsbase_base=`basename "$testsbase"`
+ func_echo_header " - mention \"${testsbase_base}\" in SUBDIRS in
${testsbase_dir}Makefile.am,"
+ fi
fi
fi
- echo " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in Makefile.am,"
- echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after
AC_PROG_CC,"
- echo " - invoke ${macro_prefix}_INIT in $configure_ac."
+ if test -z "$cached_specified_modules"; then
+ func_echo_header " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in
Makefile.am,"
+ func_echo_header " - invoke ${macro_prefix}_EARLY in $configure_ac, right
after AC_PROG_CC,"
+ func_echo_header " - invoke ${macro_prefix}_INIT in $configure_ac."
+ fi
}
# func_create_testdir testdir modules