Mercurial > hg > octave-nkf > gnulib-hg
changeset 6756:4d481eff340f
Sort the #include directives more carefully.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 25 Apr 2006 12:01:00 +0000 |
parents | ac1a29f7e8d8 |
children | 65db5948a6f1 |
files | ChangeLog gnulib-tool |
diffstat | 2 files changed, 31 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-04-25 Bruno Haible <bruno@clisp.org> + + * gnulib-tool (func_import): Output the include directives in three + blocks, sorted separately. + Reported by Ben Pfaff <blp@cs.stanford.edu>. + 2006-04-23 Bruno Haible <bruno@clisp.org> * modules/copy-file: Depend on unistd.
--- a/gnulib-tool +++ b/gnulib-tool @@ -22,7 +22,7 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2006-04-24 11:35:07 $' +cvsdatestamp='$Date: 2006-04-25 12:01:00 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` @@ -1453,9 +1453,30 @@ echo "Finished." echo echo "You may need to add #include directives for the following .h files." - for module in $modules; do - func_get_include_directive "$module" - done | LC_ALL=C sort -u | sed -e '/^$/d;' -e 's/^/ /' + ( + # First the #include <...> directives without #ifs, sorted for convenience. + for module in $modules; do + if func_get_include_directive "$module" | grep '^#if' >/dev/null; then + : + else + func_get_include_directive "$module" | grep -v 'include "' + fi + done | LC_ALL=C sort -u + # Then the #include "..." directives without #ifs, sorted for convenience. + for module in $modules; do + if func_get_include_directive "$module" | grep '^#if' >/dev/null; then + : + else + func_get_include_directive "$module" | grep 'include "' + fi + done | LC_ALL=C sort -u + # Then the #include directives that are surrounded by #ifs. Not sorted. + for module in $modules; do + if func_get_include_directive "$module" | grep '^#if' >/dev/null; then + func_get_include_directive "$module" + fi + done + ) | sed -e '/^$/d;' -e 's/^/ /' echo echo "Don't forget to" echo " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in $configure_ac,"