commit 65904c8ab2862ea1225cbcbee09e14c748d3ea95
Author: Jim Meyering <meyering(a)redhat.com>
Date: Mon May 9 17:54:40 2011 +0200
maint: customize to enable/accommodate tight-scope syntax check
* cfg.mk (_gl_TS_dir): Define.
Define other _gl_TS* variables to detect/exempt globals.
* Makefile.am (iwhd_SOURCES): Move .h file names from here to ...
(noinst_HEADERS): ...here.
For convenience, since the tight-scope rule uses $(noinst_HEADERS).
Makefile.am | 18 ++++++++++--------
cfg.mk | 22 ++++++++++++++++++++++
2 files changed, 32 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index a0a3c52..76a1c64 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,22 +39,24 @@ MAINTAINERCLEANFILES =
iwhd_SOURCES = \
auto.c \
backend.c \
- backend.h \
- gc-wrap.h \
- iwh.h \
meta.cpp \
- meta.h \
mpipe.c \
- mpipe.h \
replica.c \
- replica.h \
qparser.y \
- query.h \
rest.c \
setup.c \
+ template.c
+
+noinst_HEADERS = \
+ backend.h \
+ gc-wrap.h \
+ iwh.h \
+ meta.h \
+ mpipe.h \
+ query.h \
+ replica.h \
setup.h \
state_defs.h \
- template.c \
template.h
EXTRA_iwhd_SOURCES = qlexer.l
diff --git a/cfg.mk b/cfg.mk
index a13d933..5554fee 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -78,3 +78,25 @@ url_dir_list =
http://people.redhat.com/$(USER)/$(PACKAGE)
# Make the distcheck-emitted gnupload command use the right URL.
gnu_rel_host =
people.redhat.com
upload_dest_dir_ = public_html/$(PACKAGE)
+
+# Tell the tight_scope rule that sources are in ".".
+export _gl_TS_dir = .
+
+# Tell the tight_scope rule that yacc-related yy* names
+# and "_Z"-prefixed C++ mangled names are all "extern".
+export _gl_TS_unmarked_extern_functions = main usage yy.* _Z.*
+
+# Also deduce that "verbose" is global.
+# It's declared/defined via this: GLOBAL(int, verbose, 0);
+export _gl_TS_var_match = \
+ /^(?:extern|XTERN) .*?\**(\w+)(\[.*?\])?;/ || /\bGLOBAL\(.*?,\s*(.*?),/
+
+# List these _tbl variables, to exempt them for now.
+export _gl_TS_unmarked_extern_vars = version_etc_copyright \
+ bad_func_tbl \
+ cf_func_tbl \
+ curl_func_tbl \
+ fs_condor_func_tbl \
+ fs_func_tbl \
+ fs_rhevm_func_tbl \
+ s3_func_tbl