From: Akim Demaille Date: Fri, 28 Jul 2000 07:41:52 +0000 (+0000) Subject: * autoconf.sh (--warnings): Catch `no-category', not `nocategory'. X-Git-Tag: autoconf-2.50~693 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b64f36dee1116b46c5785f99795df22c0079c2f8;p=thirdparty%2Fautoconf.git * autoconf.sh (--warnings): Catch `no-category', not `nocategory'. * autoheader.sh: Likewise. * acgeneral.m4 (_AC_WARNING_IFELSE): Adjust. --- diff --git a/ChangeLog b/ChangeLog index 9336b522f..df37bd7e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-07-28 Akim Demaille + + * autoconf.sh (--warnings): Catch `no-category', not `nocategory'. + * autoheader.sh: Likewise. + * acgeneral.m4 (_AC_WARNING_IFELSE): Adjust. + 2000-07-28 Akim Demaille * doc/autoconf.texi (Installation Directory Variables): New diff --git a/acgeneral.m4 b/acgeneral.m4 index 3e575267d..a2fed1c7b 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -2525,11 +2525,11 @@ define([AC_WARNING_IFELSE], # -------------------------------------------------------------- # Implementation of the loop described above. define([_AC_WARNING_IFELSE], -[ifelse([$4], [$1], [$2], - [$4], [all], [$2], - [$4], [], [$3], - [$4], [none], [$3], - [$4], [no$1], [$3], +[ifelse([$4], [$1], [$2], + [$4], [all], [$2], + [$4], [], [$3], + [$4], [none], [$3], + [$4], [no-$1], [$3], [$0([$1], [$2], [$3], m4_shiftn(4, $@))])]) diff --git a/autoconf.in b/autoconf.in index 1a8f35ebe..041b08783 100644 --- a/autoconf.in +++ b/autoconf.in @@ -41,13 +41,13 @@ Operation modes: -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] Warning categories include: - \`cross' cross compilation issues - \`obsolete' obsolete constructs - \`syntax' dubious syntactic constructs - \`all' all the warnings - \`noCATEGORY' turn off the warnings on CATEGORY - \`none' turn off all the warnings - \`error' warnings are error + \`cross' cross compilation issues + \`obsolete' obsolete constructs + \`syntax' dubious syntactic constructs + \`all' all the warnings + \`no-CATEGORY' turn off the warnings on CATEGORY + \`none' turn off all the warnings + \`error' warnings are error The environment variable \`WARNINGS' is honored. @@ -202,10 +202,7 @@ while test $# -gt 0 ; do shift warnings=$warnings,$1 shift ;; - --warnings=* ) - warnings=$warnings,$optarg - shift ;; - -W* ) # People are used to -Wall, -Werror etc. + --warnings=* | -W* ) warnings=$warnings,$optarg shift ;; diff --git a/autoconf.sh b/autoconf.sh index 1a8f35ebe..041b08783 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -41,13 +41,13 @@ Operation modes: -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] Warning categories include: - \`cross' cross compilation issues - \`obsolete' obsolete constructs - \`syntax' dubious syntactic constructs - \`all' all the warnings - \`noCATEGORY' turn off the warnings on CATEGORY - \`none' turn off all the warnings - \`error' warnings are error + \`cross' cross compilation issues + \`obsolete' obsolete constructs + \`syntax' dubious syntactic constructs + \`all' all the warnings + \`no-CATEGORY' turn off the warnings on CATEGORY + \`none' turn off all the warnings + \`error' warnings are error The environment variable \`WARNINGS' is honored. @@ -202,10 +202,7 @@ while test $# -gt 0 ; do shift warnings=$warnings,$1 shift ;; - --warnings=* ) - warnings=$warnings,$optarg - shift ;; - -W* ) # People are used to -Wall, -Werror etc. + --warnings=* | -W* ) warnings=$warnings,$optarg shift ;; diff --git a/autoheader.in b/autoheader.in index efcf64f2a..8e15597dd 100644 --- a/autoheader.in +++ b/autoheader.in @@ -96,7 +96,8 @@ warning_obsolete=false # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '-[^=]*=\(.*\)'` + optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ + "$1" : '-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; @@ -140,10 +141,10 @@ while test $# -gt 0 ; do --warnings | -W ) test $# = 1 && eval "$exit_missing_arg" shift - warnings="$warnings "`echo $1 | sed -e 's/,/ /g'` + warnings=$warnings,$1 shift ;; --warnings=* | -W*) - warnings="$warnings "`echo "$optarg" | sed -e 's/,/ /g'` + warnings=$warnings,$optarg shift ;; -- ) # Stop option processing @@ -160,11 +161,16 @@ while test $# -gt 0 ; do esac done -# Decode `$warnings'. -for i in :$warnings +# The warnings are the concatenation of 1. application's defaults +# (here, none), 2. $WARNINGS, $3 command line options, in that order. +_ac_warnings= +for warning in `IFS=,; echo $WARNINGS,$warnings | tr 'A-Z' 'a-z'` do - test "$i" = : && continue - eval "warning_$i=:" + case $warning in + '') continue;; + no-*) eval warning_`expr x$warning : 'xno-\(.*\)'`=false;; + *) eval warning_$warning=:;; + esac done # Trap on 0 to stop playing with `rm'. diff --git a/autoheader.sh b/autoheader.sh index efcf64f2a..8e15597dd 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -96,7 +96,8 @@ warning_obsolete=false # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '-[^=]*=\(.*\)'` + optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ + "$1" : '-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; @@ -140,10 +141,10 @@ while test $# -gt 0 ; do --warnings | -W ) test $# = 1 && eval "$exit_missing_arg" shift - warnings="$warnings "`echo $1 | sed -e 's/,/ /g'` + warnings=$warnings,$1 shift ;; --warnings=* | -W*) - warnings="$warnings "`echo "$optarg" | sed -e 's/,/ /g'` + warnings=$warnings,$optarg shift ;; -- ) # Stop option processing @@ -160,11 +161,16 @@ while test $# -gt 0 ; do esac done -# Decode `$warnings'. -for i in :$warnings +# The warnings are the concatenation of 1. application's defaults +# (here, none), 2. $WARNINGS, $3 command line options, in that order. +_ac_warnings= +for warning in `IFS=,; echo $WARNINGS,$warnings | tr 'A-Z' 'a-z'` do - test "$i" = : && continue - eval "warning_$i=:" + case $warning in + '') continue;; + no-*) eval warning_`expr x$warning : 'xno-\(.*\)'`=false;; + *) eval warning_$warning=:;; + esac done # Trap on 0 to stop playing with `rm'. diff --git a/bin/autoconf.in b/bin/autoconf.in index 1a8f35ebe..041b08783 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -41,13 +41,13 @@ Operation modes: -W, --warnings=CATEGORY report the warnings falling in CATEGORY [syntax] Warning categories include: - \`cross' cross compilation issues - \`obsolete' obsolete constructs - \`syntax' dubious syntactic constructs - \`all' all the warnings - \`noCATEGORY' turn off the warnings on CATEGORY - \`none' turn off all the warnings - \`error' warnings are error + \`cross' cross compilation issues + \`obsolete' obsolete constructs + \`syntax' dubious syntactic constructs + \`all' all the warnings + \`no-CATEGORY' turn off the warnings on CATEGORY + \`none' turn off all the warnings + \`error' warnings are error The environment variable \`WARNINGS' is honored. @@ -202,10 +202,7 @@ while test $# -gt 0 ; do shift warnings=$warnings,$1 shift ;; - --warnings=* ) - warnings=$warnings,$optarg - shift ;; - -W* ) # People are used to -Wall, -Werror etc. + --warnings=* | -W* ) warnings=$warnings,$optarg shift ;; diff --git a/bin/autoheader.in b/bin/autoheader.in index efcf64f2a..8e15597dd 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -96,7 +96,8 @@ warning_obsolete=false # Parse command line. while test $# -gt 0 ; do - optarg=`expr "$1" : '-[^=]*=\(.*\)'` + optarg=`expr "$1" : '--[^=]*=\(.*\)' \| \ + "$1" : '-.\(.*\)'` case $1 in --version | --vers* | -V ) echo "$version" ; exit 0 ;; @@ -140,10 +141,10 @@ while test $# -gt 0 ; do --warnings | -W ) test $# = 1 && eval "$exit_missing_arg" shift - warnings="$warnings "`echo $1 | sed -e 's/,/ /g'` + warnings=$warnings,$1 shift ;; --warnings=* | -W*) - warnings="$warnings "`echo "$optarg" | sed -e 's/,/ /g'` + warnings=$warnings,$optarg shift ;; -- ) # Stop option processing @@ -160,11 +161,16 @@ while test $# -gt 0 ; do esac done -# Decode `$warnings'. -for i in :$warnings +# The warnings are the concatenation of 1. application's defaults +# (here, none), 2. $WARNINGS, $3 command line options, in that order. +_ac_warnings= +for warning in `IFS=,; echo $WARNINGS,$warnings | tr 'A-Z' 'a-z'` do - test "$i" = : && continue - eval "warning_$i=:" + case $warning in + '') continue;; + no-*) eval warning_`expr x$warning : 'xno-\(.*\)'`=false;; + *) eval warning_$warning=:;; + esac done # Trap on 0 to stop playing with `rm'. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index b23c1c71c..e08375c25 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -971,7 +971,7 @@ report none @item error treats warnings as errors -@item no@var{category} +@item no-@var{category} disable warnings falling into @var{category} @end table @@ -2150,7 +2150,7 @@ report none @item error treats warnings as errors -@item no@var{category} +@item no-@var{category} disable warnings falling into @var{category} @end table diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 3e575267d..a2fed1c7b 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -2525,11 +2525,11 @@ define([AC_WARNING_IFELSE], # -------------------------------------------------------------- # Implementation of the loop described above. define([_AC_WARNING_IFELSE], -[ifelse([$4], [$1], [$2], - [$4], [all], [$2], - [$4], [], [$3], - [$4], [none], [$3], - [$4], [no$1], [$3], +[ifelse([$4], [$1], [$2], + [$4], [all], [$2], + [$4], [], [$3], + [$4], [none], [$3], + [$4], [no-$1], [$3], [$0([$1], [$2], [$3], m4_shiftn(4, $@))])]) diff --git a/man/autoconf.1 b/man/autoconf.1 index bc26dd031..4400c77d9 100644 --- a/man/autoconf.1 +++ b/man/autoconf.1 @@ -48,7 +48,7 @@ dubious syntactic constructs `all' all the warnings .TP -`noCATEGORY' +`no-CATEGORY' turn off the warnings on CATEGORY .TP `none'