2121
2222# This is reported not to work with make-3.79.1
2323# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
24- ME := $( _build -aux) /syntax-check.mk
24+ ME := build -aux/syntax-check.mk
2525
2626# These variables ought to be defined through the configure.ac section
2727# of the module description. But some packages import this file directly,
@@ -42,29 +42,29 @@ _equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
4242GIT = git
4343VC = $(GIT )
4444
45- VC_LIST = $(srcdir ) / $( _build -aux) /vc-list-files -C $(srcdir )
45+ VC_LIST = $(top_srcdir ) /build -aux/vc-list-files -C $(top_srcdir )
4646
4747# You can override this variable in syntax-check.mk to set your own regexp
4848# matching files to ignore.
4949VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$
5050
5151# 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
5353# 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 ) )
5656
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 ) ,.)
6060 _prepend_srcdir_prefix =
6161else
62- _prepend_srcdir_prefix = | $(SED ) 's|^|$(srcdir ) /|'
62+ _prepend_srcdir_prefix = | $(SED ) 's|^|$(top_srcdir ) /|'
6363endif
6464
6565# 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.
6868_sc_excl = \
6969 $(or $(exclude_file_name_regexp--$@ ) ,^$$)
7070VC_LIST_EXCEPT = \
@@ -84,11 +84,11 @@ export LC_ALL = C
8484# # Sanity checks. ##
8585# # --------------- ##
8686
87- _cfg_mk := $(wildcard $(srcdir ) / $( _build -aux) /syntax-check.mk)
87+ _cfg_mk := $(wildcard $(top_srcdir ) /build -aux/syntax-check.mk)
8888
8989# Collect the names of rules starting with 'sc_'.
9090syntax-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 ) ) )
9292.PHONY : $(syntax-check-rules )
9393
9494ifeq ($(shell $(VC_LIST ) >/dev/null 2>&1; echo $$? ) ,0)
@@ -333,11 +333,11 @@ sc_flags_debug:
333333# than d). The existence of long long, and of documentation about
334334# flags, makes the regex in the third test slightly harder.
335335sc_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 \
341341 | $(GREP ) -c ' \(long\|unsigned\) flags' )" != 4 && \
342342 { echo ' $(ME): new API should use "unsigned int flags"' 1>&2 ; \
343343 exit 1; } || :
@@ -496,7 +496,7 @@ sc_prohibit_PATH_MAX:
496496 halt=' dynamically allocate paths, do not use PATH_MAX' \
497497 $(_sc_search_regexp )
498498
499- include $(srcdir ) /Makefile.nonreentrant
499+ include $(top_srcdir ) /build-aux /Makefile.nonreentrant
500500sc_prohibit_nonreentrant :
501501 @prohibit=" \\ <(${NON_REENTRANT_RE} ) *\\ (" \
502502 halt=" use re-entrant functions (usually ending with _r)" \
@@ -833,7 +833,7 @@ sc_prohibit_gettext_markup:
833833
834834# Our code is divided into modular subdirectories for a reason, and
835835# 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/* /.) )
837837cross_dirs_re =($(subst / ,/|,$(cross_dirs ) ) )
838838mid_dirs =access|admin|conf|cpu|locking|logging|rpc|security
839839sc_prohibit_cross_inclusion :
@@ -1177,7 +1177,7 @@ sc_prohibit_dirent_d_type:
11771177# grep-E-style regexp selecting the files to check. For in_vc_files,
11781178# the regexp is used to select matching files from the list of all
11791179# 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
11811181# are under version control.
11821182#
11831183# containing | non_containing
@@ -1249,7 +1249,7 @@ define _sc_search_regexp
12491249 \
12501250 : Filter by file name; \
12511251 if test -n "$$in_files"; then \
1252- files=$$(find $(srcdir ) | $(GREP ) -E "$$in_files" \
1252+ files=$$(find $(top_srcdir ) | $(GREP ) -E "$$in_files" \
12531253 | $(GREP ) -Ev '$(_sc_excl ) ' ) ; \
12541254 else \
12551255 files=$$($(VC_LIST_EXCEPT ) ) ; \
@@ -1293,7 +1293,7 @@ sc_avoid_if_before_free:
12931293 @$(VC_LIST_EXCEPT ) \
12941294 | $(GREP ) -v useless-if-before-free \
12951295 | xargs \
1296- $(srcdir ) / $( _build -aux) /useless-if-before-free \
1296+ $(top_srcdir ) /build -aux/useless-if-before-free \
12971297 $(useless_free_options ) \
12981298 && { printf ' $(ME): found useless "if"' \
12991299 ' before "free" above\n' 1>&2 ; \
@@ -1781,9 +1781,6 @@ sc_const_long_option:
17811781 halt= ' add "const" to the above declarations' \
17821782 $( _sc_search_regexp)
17831783
1784- gen_source_files:
1785- $( MAKE) -C src generated-sources
1786-
17871784fix_po_file_diag = \
17881785' you have changed the set of files with translatable diagnostics;\n\
17891786apply the above patch\n'
@@ -1805,26 +1802,26 @@ perl_translatable_files_list_ = \
18051802
18061803# Verify that all source files using _() (more specifically, files that
18071804# 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
18091806
18101807# List of additional files that we want to pick up in our POTFILES.in
18111808# This is all generated files for RPC code.
18121809generated_files = \
1813- $( builddir ) /src/* .[ch] \
1814- $( builddir ) /src/* /* .[ch]
1810+ $( top_builddir ) /src/* .[ch] \
1811+ $( top_builddir ) /src/* /* .[ch]
18151812
18161813_gl_translatable_string_re ? = \b (N? _| gettext * )\( [^)" ]*(" | $$ )
18171814
18181815# sc_po_check can fail if generated files are not built first
1819- sc_po_check: gen_source_files
1816+ sc_po_check:
18201817 @if test -f $( po_file) ; then \
18211818 $( GREP) -E -v ' ^(#|$$)' $( po_file) \
18221819 | $( GREP) -v ' ^src/false\.c$$' | sort > $@ -1; \
18231820 { $( VC_LIST_EXCEPT) ; echo $( generated_files) ; } \
18241821 | xargs perl $( perl_translatable_files_list_) \
18251822 | xargs $( GREP) -E -l ' $(_gl_translatable_string_re)' \
1826- | $( SED) ' s|^$(_dot_escaped_srcdir)/|@SRCDIR@|' \
18271823 | $( SED) ' s|^$(_dot_escaped_builddir)/|@BUILDDIR@|' \
1824+ | $( SED) ' s|^$(_dot_escaped_srcdir)/|@SRCDIR@|' \
18281825 | sort -u > $@ -2; \
18291826 diff -u -L $( po_file) -L $( po_file) $@ -1 $@ -2 \
18301827 || { printf ' $(ME): ' $( fix_po_file_diag) 1>&2 ; exit 1; }; \
@@ -2074,3 +2071,6 @@ exclude_file_name_regexp--sc_prohibit_backslash_alignment = \
20742071
20752072exclude_file_name_regexp--sc_prohibit_select = \
20762073 ^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