]> git.saurik.com Git - bison.git/commitdiff
maint: address sc_bindtextdomain, sc_program_name and sc_prohibit_HAVE_MBRTOWC.
authorAkim Demaille <demaille@gostai.com>
Sun, 19 Feb 2012 10:13:04 +0000 (11:13 +0100)
committerAkim Demaille <demaille@gostai.com>
Sun, 19 Feb 2012 11:31:10 +0000 (12:31 +0100)
* bootstrap.conf (gnulib_modules): Require progname.
* src/complain.c, src/getargs.c, src/getargs.h, src/main.c: Use it.
* cfg.mk (exclude): New.
Use it.
Skip lib/main.c for bindtextdomain and set_program_name.

bootstrap.conf
cfg.mk
lib/.gitignore
src/complain.c
src/getargs.c
src/getargs.h
src/main.c

index c8aac8dd86836db668641500c5577c3d4cfe0612..cb3fc870e42b11483a445409c6f6ebee98d6ea3a 100644 (file)
@@ -22,7 +22,8 @@ gnulib_modules='
   gettext git-version-gen gitlog-to-changelog
   gpl-3.0 hash inttypes isnan javacomp-script
   javaexec-script ldexpl maintainer-makefile malloc-gnu mbschr mbsrchr
-  mbswidth obstack perror pipe-posix quote quotearg realloc-posix
+  mbswidth obstack perror pipe-posix progname
+  quote quotearg realloc-posix
   spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
   sysexits
   unistd unistd-safer unlocked-io update-copyright unsetenv verify
diff --git a/cfg.mk b/cfg.mk
index 744fcf00aade28ea56c861cc4101058bc3e11ec8..503dda6af42c7d49e08068434a8d0cb2d25fc221 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -35,9 +35,6 @@ url_dir_list = \
 # Tests not to run as part of "make distcheck".
 local-checks-to-skip =                 \
   sc_immutable_NEWS                    \
-  sc_bindtextdomain                    \
-  sc_program_name                      \
-  sc_prohibit_HAVE_MBRTOWC             \
   sc_prohibit_always-defined_macros    \
   sc_prohibit_always_true_header_tests \
   sc_prohibit_atoi_atof                        \
@@ -58,8 +55,12 @@ update-copyright: update-b4-copyright update-package-copyright-year
 update-copyright-env = \
   UPDATE_COPYRIGHT_FORCE=1 UPDATE_COPYRIGHT_USE_INTERVALS=1
 
-exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^src/parse-gram.h$$
-exclude_file_name_regexp--sc_require_config_h_first = \
-  ^(lib/yyerror|data/(glr|yacc))\.c$$
-exclude_file_name_regexp--sc_space_tab = ^tests/(input|c\+\+)\.at$$
-exclude_file_name_regexp--sc_unmarked_diagnostics = ^djgpp/
+exclude = $(foreach a,$(1),$(eval exclude_file_name_regexp--sc_$(a)))
+$(call exclude,                                                        \
+  bindtextdomain=^lib/main.c$$                                 \
+  program_name=^lib/main.c$$                                   \
+  prohibit_empty_lines_at_EOF=^src/parse-gram.h$$              \
+  require_config_h_first=^(lib/yyerror|data/(glr|yacc))\.c$$   \
+  space_tab=^tests/(input|c\+\+)\.at$$                         \
+  unmarked_diagnostics=^djgpp/                                 \
+)
index 832cab85784a21701ff8becd018f437837744b7b..c1c7c06cd93c0a632480821217f0ee6de7b93a8e 100644 (file)
 /fpending.c
 /fpending.h
 /sysexits.in.h
+/progname.c
+/progname.h
index 95e8a43688efb89bd14c22503dbf961f64882a8b..18432b49ee2cadca2809e6f323af66381e9a91bc 100644 (file)
@@ -23,6 +23,7 @@
 #include "system.h"
 
 #include <stdarg.h>
+#include <progname.h>
 
 #include "complain.h"
 #include "files.h"
index e5d1faa362e06da8fdedf5bcce90f3411468da5d..5e04ab0fcbcad77653435790c0a7e75b47ae4eb1 100644 (file)
@@ -40,6 +40,8 @@
 # undef HACK_FOR___GNU_LIBRARY___PROTOTYPE
 #endif
 
+#include <progname.h>
+
 #include "complain.h"
 #include "files.h"
 #include "getargs.h"
@@ -75,8 +77,6 @@ int language_prio = default_prio;
 struct bison_language const *language = &valid_languages[0];
 const char *include = NULL;
 
-char *program_name;
-
 
 /** Decode an option's set of keys.
  *
index caef2394b8442698302477d75c037e392cdce746..1d8c9d545d7457552a36a5e8df3d5b2ff3c751b4 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "location.h"
 
-extern char *program_name;
 enum { command_line_prio, grammar_prio, default_prio };
 
 /* flags set by % directives */
index 3dbac3a9a92928861f267461c8b369d29a67c1f5..fdb26ac69973fa2cbf476204d544d09b05ee3365 100644 (file)
@@ -24,6 +24,7 @@
 #include <bitset_stats.h>
 #include <bitset.h>
 #include <configmake.h>
+#include <progname.h>
 #include <quotearg.h>
 #include <timevar.h>
 
@@ -57,7 +58,7 @@
 int
 main (int argc, char *argv[])
 {
-  program_name = argv[0];
+  set_program_name (argv[0]);
   setlocale (LC_ALL, "");
   (void) bindtextdomain (PACKAGE, LOCALEDIR);
   (void) bindtextdomain ("bison-runtime", LOCALEDIR);