21
21
22
22
# This is reported not to work with make-3.79.1
23
23
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
24
- ME := $( _build -aux) /syntax-check.mk
24
+ ME := build -aux/syntax-check.mk
25
25
26
26
# These variables ought to be defined through the configure.ac section
27
27
# of the module description. But some packages import this file directly,
@@ -42,29 +42,29 @@ _equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
42
42
GIT = git
43
43
VC = $(GIT )
44
44
45
- VC_LIST = $(srcdir ) / $( _build -aux) /vc-list-files -C $(srcdir )
45
+ VC_LIST = $(top_srcdir ) /build -aux/vc-list-files -C $(top_srcdir )
46
46
47
47
# You can override this variable in syntax-check.mk to set your own regexp
48
48
# matching files to ignore.
49
49
VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
50
50
51
51
# This is to preprocess robustly the output of $(VC_LIST), so that even
52
- # when $(srcdir ) is a pathological name like "....", the leading sed command
52
+ # when $(top_srcdir ) is a pathological name like "....", the leading sed command
53
53
# removes only the intended prefix.
54
- _dot_escaped_srcdir = $(subst .,\.,$(srcdir ) )
55
- _dot_escaped_builddir = $(subst .,\.,$(builddir ) )
54
+ _dot_escaped_srcdir = $(subst .,\.,$(top_srcdir ) )
55
+ _dot_escaped_builddir = $(subst .,\.,$(top_builddir ) )
56
56
57
- # Post-process $(VC_LIST) output, prepending $(srcdir )/, but only
58
- # when $(srcdir ) is not ".".
59
- ifeq ($(srcdir ) ,.)
57
+ # Post-process $(VC_LIST) output, prepending $(top_srcdir )/, but only
58
+ # when $(top_srcdir ) is not ".".
59
+ ifeq ($(top_srcdir ) ,.)
60
60
_prepend_srcdir_prefix =
61
61
else
62
- _prepend_srcdir_prefix = | $(SED ) 's|^|$(srcdir ) /|'
62
+ _prepend_srcdir_prefix = | $(SED ) 's|^|$(top_srcdir ) /|'
63
63
endif
64
64
65
65
# In order to be able to consistently filter "."-relative names,
66
- # (i.e., with no $(srcdir ) prefix), this definition is careful to
67
- # remove any $(srcdir ) prefix, and to restore what it removes.
66
+ # (i.e., with no $(top_srcdir ) prefix), this definition is careful to
67
+ # remove any $(top_srcdir ) prefix, and to restore what it removes.
68
68
_sc_excl = \
69
69
$(or $(exclude_file_name_regexp--$@ ) ,^$$)
70
70
VC_LIST_EXCEPT = \
@@ -84,11 +84,11 @@ export LC_ALL = C
84
84
# # Sanity checks. ##
85
85
# # --------------- ##
86
86
87
- _cfg_mk := $(wildcard $(srcdir ) / $( _build -aux) /syntax-check.mk)
87
+ _cfg_mk := $(wildcard $(top_srcdir ) /build -aux/syntax-check.mk)
88
88
89
89
# Collect the names of rules starting with 'sc_'.
90
90
syntax-check-rules := $(sort $(shell $(SED ) -n \
91
- 's/^\(sc_[a-zA-Z0-9_-]* \) :.* /\1/p' $(srcdir ) /$(ME ) $(_cfg_mk ) ) )
91
+ 's/^\(sc_[a-zA-Z0-9_-]* \) :.* /\1/p' $(top_srcdir ) /$(ME ) $(_cfg_mk ) ) )
92
92
.PHONY : $(syntax-check-rules )
93
93
94
94
ifeq ($(shell $(VC_LIST ) >/dev/null 2>&1; echo $$? ) ,0)
@@ -333,11 +333,11 @@ sc_flags_debug:
333
333
# than d). The existence of long long, and of documentation about
334
334
# flags, makes the regex in the third test slightly harder.
335
335
sc_flags_usage :
336
- @test " $$ (cat $( srcdir ) /include/libvirt/libvirt-domain.h \
337
- $(srcdir ) /include/libvirt/virterror.h \
338
- $(srcdir ) /include/libvirt/libvirt-qemu.h \
339
- $(srcdir ) /include/libvirt/libvirt-lxc.h \
340
- $(srcdir ) /include/libvirt/libvirt-admin.h \
336
+ @test " $$ (cat $( top_srcdir ) /include/libvirt/libvirt-domain.h \
337
+ $(top_srcdir ) /include/libvirt/virterror.h \
338
+ $(top_srcdir ) /include/libvirt/libvirt-qemu.h \
339
+ $(top_srcdir ) /include/libvirt/libvirt-lxc.h \
340
+ $(top_srcdir ) /include/libvirt/libvirt-admin.h \
341
341
| $(GREP ) -c ' \(long\|unsigned\) flags' )" != 4 && \
342
342
{ echo ' $(ME): new API should use "unsigned int flags"' 1>&2 ; \
343
343
exit 1; } || :
@@ -496,7 +496,7 @@ sc_prohibit_PATH_MAX:
496
496
halt=' dynamically allocate paths, do not use PATH_MAX' \
497
497
$(_sc_search_regexp )
498
498
499
- include $(srcdir ) /Makefile.nonreentrant
499
+ include $(top_srcdir ) /build-aux /Makefile.nonreentrant
500
500
sc_prohibit_nonreentrant :
501
501
@prohibit=" \\ <(${NON_REENTRANT_RE} ) *\\ (" \
502
502
halt=" use re-entrant functions (usually ending with _r)" \
@@ -833,7 +833,7 @@ sc_prohibit_gettext_markup:
833
833
834
834
# Our code is divided into modular subdirectories for a reason, and
835
835
# lower-level code must not include higher-level headers.
836
- cross_dirs =$(patsubst $(srcdir ) /src/% .,% ,$(wildcard $(srcdir ) /src/* /.) )
836
+ cross_dirs =$(patsubst $(top_srcdir ) /src/% .,% ,$(wildcard $(top_srcdir ) /src/* /.) )
837
837
cross_dirs_re =($(subst / ,/|,$(cross_dirs ) ) )
838
838
mid_dirs =access|admin|conf|cpu|locking|logging|rpc|security
839
839
sc_prohibit_cross_inclusion :
@@ -1177,7 +1177,7 @@ sc_prohibit_dirent_d_type:
1177
1177
# grep-E-style regexp selecting the files to check. For in_vc_files,
1178
1178
# the regexp is used to select matching files from the list of all
1179
1179
# version-controlled files; for in_files, it's from the names printed
1180
- # by "find $(srcdir )". When neither is specified, use all files that
1180
+ # by "find $(top_srcdir )". When neither is specified, use all files that
1181
1181
# are under version control.
1182
1182
#
1183
1183
# containing | non_containing
@@ -1249,7 +1249,7 @@ define _sc_search_regexp
1249
1249
\
1250
1250
: Filter by file name; \
1251
1251
if test -n "$$in_files"; then \
1252
- files=$$(find $(srcdir ) | $(GREP ) -E "$$in_files" \
1252
+ files=$$(find $(top_srcdir ) | $(GREP ) -E "$$in_files" \
1253
1253
| $(GREP ) -Ev '$(_sc_excl ) ' ) ; \
1254
1254
else \
1255
1255
files=$$($(VC_LIST_EXCEPT ) ) ; \
@@ -1293,7 +1293,7 @@ sc_avoid_if_before_free:
1293
1293
@$(VC_LIST_EXCEPT ) \
1294
1294
| $(GREP ) -v useless-if-before-free \
1295
1295
| xargs \
1296
- $(srcdir ) / $( _build -aux) /useless-if-before-free \
1296
+ $(top_srcdir ) /build -aux/useless-if-before-free \
1297
1297
$(useless_free_options ) \
1298
1298
&& { printf ' $(ME): found useless "if"' \
1299
1299
' before "free" above\n' 1>&2 ; \
@@ -1781,9 +1781,6 @@ sc_const_long_option:
1781
1781
halt= ' add "const" to the above declarations' \
1782
1782
$( _sc_search_regexp)
1783
1783
1784
- gen_source_files:
1785
- $( MAKE) -C src generated-sources
1786
-
1787
1784
fix_po_file_diag = \
1788
1785
' you have changed the set of files with translatable diagnostics;\n\
1789
1786
apply the above patch\n'
@@ -1805,26 +1802,26 @@ perl_translatable_files_list_ = \
1805
1802
1806
1803
# Verify that all source files using _() (more specifically, files that
1807
1804
# match $(_gl_translatable_string_re)) are listed in po/POTFILES.in.
1808
- po_file ? = $( srcdir ) /po/POTFILES.in
1805
+ po_file ? = $( top_srcdir ) /po/POTFILES.in
1809
1806
1810
1807
# List of additional files that we want to pick up in our POTFILES.in
1811
1808
# This is all generated files for RPC code.
1812
1809
generated_files = \
1813
- $( builddir ) /src/* .[ch] \
1814
- $( builddir ) /src/* /* .[ch]
1810
+ $( top_builddir ) /src/* .[ch] \
1811
+ $( top_builddir ) /src/* /* .[ch]
1815
1812
1816
1813
_gl_translatable_string_re ? = \b (N? _| gettext * )\( [^)" ]*(" | $$ )
1817
1814
1818
1815
# sc_po_check can fail if generated files are not built first
1819
- sc_po_check: gen_source_files
1816
+ sc_po_check:
1820
1817
@if test -f $( po_file) ; then \
1821
1818
$( GREP) -E -v ' ^(#|$$)' $( po_file) \
1822
1819
| $( GREP) -v ' ^src/false\.c$$' | sort > $@ -1; \
1823
1820
{ $( VC_LIST_EXCEPT) ; echo $( generated_files) ; } \
1824
1821
| xargs perl $( perl_translatable_files_list_) \
1825
1822
| xargs $( GREP) -E -l ' $(_gl_translatable_string_re)' \
1826
- | $( SED) ' s|^$(_dot_escaped_srcdir)/|@SRCDIR@|' \
1827
1823
| $( SED) ' s|^$(_dot_escaped_builddir)/|@BUILDDIR@|' \
1824
+ | $( SED) ' s|^$(_dot_escaped_srcdir)/|@SRCDIR@|' \
1828
1825
| sort -u > $@ -2; \
1829
1826
diff -u -L $( po_file) -L $( po_file) $@ -1 $@ -2 \
1830
1827
|| { printf ' $(ME): ' $( fix_po_file_diag) 1>&2 ; exit 1; }; \
@@ -2074,3 +2071,6 @@ exclude_file_name_regexp--sc_prohibit_backslash_alignment = \
2074
2071
2075
2072
exclude_file_name_regexp--sc_prohibit_select = \
2076
2073
^build-aux/syntax-check\. mk| src/util/vireventglibwatch\. c$$
2074
+
2075
+ exclude_file_name_regexp--sc_prohibit_config_h_in_headers = \
2076
+ ^config\. h$$
0 commit comments