summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2020-05-13 14:39:00 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2020-05-13 14:40:36 +0100
commit82cf14abe544503869560ce2c2075a3148e89115 (patch)
treeca14e702b637c168cf154f4412673f1de9f96d45 /build-aux
parentf108548291f5be2325fb46cbd70f35e051d3dd1f (diff)
downloadlibosinfo-82cf14abe544503869560ce2c2075a3148e89115.tar.gz
build-aux: merge cfg.mk into maint.mk
Since we took full ownership of a cut down maint.mk there's no need to keep local additions separately in cfg.mk This fixes a bug which caused the contents of cfg.mk to be skipped since the moving of files into the build-aux dir and switch to meson. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/GNUmakefile1
-rw-r--r--build-aux/cfg.mk86
-rw-r--r--build-aux/maint.mk73
3 files changed, 70 insertions, 90 deletions
diff --git a/build-aux/GNUmakefile b/build-aux/GNUmakefile
index 308f4db..4e87546 100644
--- a/build-aux/GNUmakefile
+++ b/build-aux/GNUmakefile
@@ -45,7 +45,6 @@ ALL_RECURSIVE_TARGETS =
_build-aux ?= build-aux
_autoreconf ?= autoreconf -v
-include $(srcdir)/$(_build-aux)/cfg.mk
include $(srcdir)/$(_build-aux)/maint.mk
# Ensure that $(VERSION) is up to date for dist-related targets, but not
diff --git a/build-aux/cfg.mk b/build-aux/cfg.mk
deleted file mode 100644
index 3e71f7b..0000000
--- a/build-aux/cfg.mk
+++ /dev/null
@@ -1,86 +0,0 @@
-# Customize Makefile.maint. -*- makefile -*-
-# Copyright (C) 2008-2012 Red Hat, Inc.
-# Copyright (C) 2003-2008 Free Software Foundation, Inc.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Files that should never cause syntax check failures.
-VC_LIST_ALWAYS_EXCLUDE_REGEX = \
- (^HACKING|\.po|maint.mk)$$
-
-# Tweak how some of the syntax check rules work
-_gl_translatable_string_re = \
- (\b(N?_|gettext *)\([^)"]*("|$$))|(<(_[a-zA-Z]*).*/\5>)
-
-# Functions like free() that are no-ops on NULL arguments.
-useless_free_options = \
- --name=g_free \
- --name=xmlBufferFree \
- --name=xmlFree \
- --name=xmlFreeDoc \
- --name=xmlXPathFreeContext \
- --name=xmlXPathFreeObject
-
-# Ensure that no C source file, docs, or rng schema uses TABs for
-# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
-# files in gnulib, since they're imported.
-space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py)|(daemon|tools)/.*\.in)
-sc_TAB_in_indentation:
- @prohibit='^ * ' \
- in_vc_files='$(space_indent_files)$$' \
- halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \
- $(_sc_search_regexp)
-
-# G_GNUC_UNUSED should only be applied in implementations, not
-# header declarations
-sc_avoid_attribute_unused_in_header:
- @prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \
- in_vc_files='\.h$$' \
- halt='use G_GNUC_UNUSED in .c rather than .h files' \
- $(_sc_search_regexp)
-
-# Enforce recommended preprocessor indentation style.
-sc_preprocessor_indentation:
- @if cppi --version >/dev/null 2>&1; then \
- $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
- || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
- exit 1; }; \
- else \
- echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
- fi
-
-sc_copyright_format:
- @require='Copyright .*Red 'Hat', Inc\.' \
- containing='Copyright .*Red 'Hat \
- halt='Red Hat copyright is missing Inc.' \
- $(_sc_search_regexp)
- @prohibit='Copyright [^(].*Red 'Hat \
- halt='consistently use (C) in Red Hat copyright' \
- $(_sc_search_regexp)
- @prohibit='\<Red''Hat\>' \
- halt='spell Red Hat as two words' \
- $(_sc_search_regexp)
-
-sc_bracket_spacing_check:
- $(AM_V_GEN)files=`$(VC_LIST) | grep '\.c$$'`; \
- $(PERL) $(top_srcdir)/build-aux/bracket-spacing.pl $$files || \
- { echo '$(ME): incorrect whitespace' 1>&2; \
- exit 1; }
-
-# We don't use this feature of maint.mk.
-prev_version_file = /dev/null
-
-exclude_file_name_regexp--sc_trailing_blank = docs/object-model.fig
-
-exclude_file_name_regexp--sc_bindtextdomain = ^tests/.*.c
diff --git a/build-aux/maint.mk b/build-aux/maint.mk
index 64171b9..4ec21a7 100644
--- a/build-aux/maint.mk
+++ b/build-aux/maint.mk
@@ -76,6 +76,23 @@ VC_LIST_EXCEPT = \
| $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
$(_prepend_srcdir_prefix)
+# Files that should never cause syntax check failures.
+VC_LIST_ALWAYS_EXCLUDE_REGEX = \
+ (^HACKING|\.po|maint.mk)$$
+
+# Tweak how some of the syntax check rules work
+_gl_translatable_string_re = \
+ (\b(N?_|gettext *)\([^)"]*("|$$))|(<(_[a-zA-Z]*).*/\5>)
+
+# Functions like free() that are no-ops on NULL arguments.
+useless_free_options = \
+ --name=g_free \
+ --name=xmlBufferFree \
+ --name=xmlFree \
+ --name=xmlFreeDoc \
+ --name=xmlXPathFreeContext \
+ --name=xmlXPathFreeObject
+
# Prevent programs like 'sort' from considering distinct strings to be equal.
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
export LC_ALL = C
@@ -84,11 +101,9 @@ export LC_ALL = C
## Sanity checks. ##
## --------------- ##
-_cfg_mk := $(wildcard $(srcdir)/cfg.mk)
-
# Collect the names of rules starting with 'sc_'.
syntax-check-rules := $(sort $(shell $(SED) -n \
- 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME) $(_cfg_mk)))
+ 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME)))
.PHONY: $(syntax-check-rules)
ifeq ($(shell $(VC_LIST) >/dev/null 2>&1; echo $$?),0)
@@ -829,3 +844,55 @@ sc_prohibit_path_max_allocation:
@prohibit='(\balloca *\([^)]*|\[[^]]*)\bPATH_MAX' \
halt='Avoid stack allocations of size PATH_MAX' \
$(_sc_search_regexp)
+
+# Ensure that no C source file, docs, or rng schema uses TABs for
+# indentation. Also match *.h.in files, to get libvirt.h.in. Exclude
+# files in gnulib, since they're imported.
+space_indent_files=(\.(rng|s?[ch](\.in)?|html.in|py)|(daemon|tools)/.*\.in)
+sc_TAB_in_indentation:
+ @prohibit='^ * ' \
+ in_vc_files='$(space_indent_files)$$' \
+ halt='indent with space, not TAB, in C, sh, html, py, and RNG schemas' \
+ $(_sc_search_regexp)
+
+# G_GNUC_UNUSED should only be applied in implementations, not
+# header declarations
+sc_avoid_attribute_unused_in_header:
+ @prohibit='^[^#]*G_GNUC_UNUSED([^:]|$$)' \
+ in_vc_files='\.h$$' \
+ halt='use G_GNUC_UNUSED in .c rather than .h files' \
+ $(_sc_search_regexp)
+
+# Enforce recommended preprocessor indentation style.
+sc_preprocessor_indentation:
+ @if cppi --version >/dev/null 2>&1; then \
+ $(VC_LIST_EXCEPT) | grep '\.[ch]$$' | xargs cppi -a -c \
+ || { echo '$(ME): incorrect preprocessor indentation' 1>&2; \
+ exit 1; }; \
+ else \
+ echo '$(ME): skipping test $@: cppi not installed' 1>&2; \
+ fi
+
+sc_copyright_format:
+ @require='Copyright .*Red 'Hat', Inc\.' \
+ containing='Copyright .*Red 'Hat \
+ halt='Red Hat copyright is missing Inc.' \
+ $(_sc_search_regexp)
+ @prohibit='Copyright [^(].*Red 'Hat \
+ halt='consistently use (C) in Red Hat copyright' \
+ $(_sc_search_regexp)
+ @prohibit='\<Red''Hat\>' \
+ halt='spell Red Hat as two words' \
+ $(_sc_search_regexp)
+
+sc_bracket_spacing_check:
+ @files=`$(VC_LIST) | grep '\.c$$'`; \
+ $(PERL) $(top_srcdir)/build-aux/bracket-spacing.pl $$files || \
+ { echo '$(ME): incorrect whitespace' 1>&2; \
+ exit 1; }
+
+exclude_file_name_regexp--sc_trailing_blank = docs/object-model.fig
+
+exclude_file_name_regexp--sc_bindtextdomain = ^tests/.*.c
+
+exclude_file_name_regexp--sc_avoid_attribute_unused_in_header = osinfo/osinfo_macros.h