From nobody Sun Feb 8 05:40:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570549739; cv=none; d=zoho.com; s=zohoarc; b=gB1I3fJ8EWdYiNHrDbvDis1jEYyKglTDywUyTg6eibsWMk+1SuKEpSTs5KHh+nw+L23BF5/DW8t6OxKCqHSOnKAxHafdi02KY60BrFA081Oj4AhoieHf1iqEYOLLfFHKLyUkSU+4Zd8F/47bKrE8dSSWCEhXOE7UqMpGM3gsikg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570549739; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JEh6aTHUIsTX4EynMzSbI6YdNjHiED7FIrGWL0YNxP4=; b=TOyLhr7OV2lywk7YADOBdXyOXnaO8fvoPyUn7lwBoHLnIgnH4VufcWihGoNH4WVTGIZmd/W3MW7zjkTsiZjyqTXtQfGTays3jcPYZ7gaE7iiaYRhTj+HbOkX7kVdxerw/KBQbn4AAPUOE1uEwO1hDiEt0qOF/j6gomePly07w/I= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 157054973965136.24297239002283; Tue, 8 Oct 2019 08:48:59 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26925C05686D; Tue, 8 Oct 2019 15:48:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0B8E60605; Tue, 8 Oct 2019 15:48:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D64F34EE6A; Tue, 8 Oct 2019 15:48:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x98Fms46006485 for ; Tue, 8 Oct 2019 11:48:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id AEF585C231; Tue, 8 Oct 2019 15:48:54 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id F40C35C1D4; Tue, 8 Oct 2019 15:48:53 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Tue, 8 Oct 2019 16:48:41 +0100 Message-Id: <20191008154844.29327-3-berrange@redhat.com> In-Reply-To: <20191008154844.29327-1-berrange@redhat.com> References: <20191008154844.29327-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Michal Privoznik Subject: [libvirt] [PATCH v2 2/5] build: move syntax-check code into build-aux directory X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 08 Oct 2019 15:48:58 +0000 (UTC) The syntax-check rules are the one bit of make usage that will stay around for a while after the meson conversion. Move them into the build-aux directory in preparation for refactoring to make them independent from automake. Signed-off-by: Daniel P. Berrang=C3=A9 --- GNUmakefile | 23 ++++++----------- Makefile.am | 4 +-- cfg.mk =3D> build-aux/cfg.mk | 45 ++++++++++++++++++++-------------- maint.mk =3D> build-aux/maint.mk | 18 ++++++-------- 4 files changed, 44 insertions(+), 46 deletions(-) rename cfg.mk =3D> build-aux/cfg.mk (96%) rename maint.mk =3D> build-aux/maint.mk (99%) diff --git a/GNUmakefile b/GNUmakefile index da25113fc3..728f4a9ae8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -20,6 +20,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . =20 +_build-aux ?=3D build-aux +_autoreconf ?=3D autoreconf -v + # If the user runs GNU make but has not yet run ./configure, # give them a diagnostic. _gl-Makefile :=3D $(wildcard [M]akefile) @@ -32,15 +35,8 @@ export TAR_OPTIONS =3D --owner=3D0 --group=3D0 --numeric= -owner ALL_RECURSIVE_TARGETS =3D =20 include Makefile - -# Some projects override e.g., _autoreconf here. --include $(srcdir)/cfg.mk - -# Allow cfg.mk to override these. -_build-aux ?=3D build-aux -_autoreconf ?=3D autoreconf -v - -include $(srcdir)/maint.mk +include $(srcdir)/$(_build-aux)/cfg.mk +include $(srcdir)/$(_build-aux)/maint.mk =20 # Ensure that $(VERSION) is up to date for dist-related targets, but not # for others: rerunning autoreconf and recompiling everything isn't cheap. @@ -90,13 +86,8 @@ else srcdir =3D . =20 # The package can override .DEFAULT_GOAL to run actions like autoreconf. --include ./cfg.mk - -# Allow cfg.mk to override these. -_build-aux ?=3D build-aux -_autoreconf ?=3D autoreconf -v - -include ./maint.mk +include $(srcdir)/$(_build-aux)/cfg.mk +include $(srcdir)/$(_build-aux)/maint.mk =20 ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile) $(MAKECMDGOALS): abort-due-to-no-makefile diff --git a/Makefile.am b/Makefile.am index c91e7c55a5..a569a4260a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,15 +41,15 @@ EXTRA_DIST =3D \ libvirt-admin.pc.in \ Makefile.nonreentrant \ autogen.sh \ - cfg.mk \ GNUmakefile \ - maint.mk \ run.in \ README.md \ AUTHORS.in \ build-aux/augeas-gentest.pl \ + build-aux/cfg.mk \ build-aux/check-spacing.pl \ build-aux/header-ifdef.pl \ + build-aux/maint.mk \ build-aux/minimize-po.pl \ build-aux/mock-noinline.pl \ build-aux/prohibit-duplicate-header.pl \ diff --git a/cfg.mk b/build-aux/cfg.mk similarity index 96% rename from cfg.mk rename to build-aux/cfg.mk index 2224d4da25..31c0d68a81 100644 --- a/cfg.mk +++ b/build-aux/cfg.mk @@ -1206,13 +1206,13 @@ exclude_file_name_regexp--sc_bindtextdomain =3D .* exclude_file_name_regexp--sc_gettext_init =3D ^((tests|examples)/|tools/vi= rt-login-shell.c) =20 exclude_file_name_regexp--sc_copyright_format =3D \ - ^cfg\.mk$$ + ^build-aux/cfg\.mk$$ =20 exclude_file_name_regexp--sc_copyright_usage =3D \ - ^(COPYING(|\.LESSER))|maint\.mk$$ + ^COPYING(|\.LESSER)|build-aux/maint.mk$$ =20 exclude_file_name_regexp--sc_flags_usage =3D \ - ^(cfg\.mk|docs/|src/util/virnetdevtap\.c$$|tests/((vir(cgroup|pci|test|u= sb)|nss|qemuxml2argv|qemusecurity)mock|virfilewrapper)\.c$$) + ^(build-aux/cfg\.mk|docs/|src/util/virnetdevtap\.c$$|tests/((vir(cgroup|= pci|test|usb)|nss|qemuxml2argv|qemusecurity)mock|virfilewrapper)\.c$$) =20 exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics =3D \ ^(src/rpc/gendispatch\.pl$$|tests/) @@ -1220,16 +1220,22 @@ exclude_file_name_regexp--sc_libvirt_unmarked_diagn= ostics =3D \ exclude_file_name_regexp--sc_po_check =3D ^(docs/|src/rpc/gendispatch\.pl$= $) =20 exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY =3D \ - ^(cfg\.mk|include/libvirt/virterror\.h|src/remote/remote_daemon_dispatch= \.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$ + ^(build-aux/cfg\.mk|include/libvirt/virterror\.h|src/remote/remote_daemo= n_dispatch\.c|src/util/virerror\.c|docs/internals/oomtesting\.html\.in)$$ + +exclude_file_name_regexp--sc_makefile_TAB_only_indentation =3D \ + ^build-aux/maint\.mk$$ + +exclude_file_name_regexp--sc_makefile_at_at_check =3D \ + ^build-aux/maint\.mk$$ =20 exclude_file_name_regexp--sc_prohibit_PATH_MAX =3D \ - ^cfg\.mk$$ + ^build-aux/(cfg|maint)\.mk$$ =20 exclude_file_name_regexp--sc_prohibit_access_xok =3D \ - ^(cfg\.mk|src/util/virutil\.c)$$ + ^(build-aux/cfg\.mk|src/util/virutil\.c)$$ =20 exclude_file_name_regexp--sc_prohibit_asprintf =3D \ - ^(cfg\.mk|bootstrap.conf$$|examples/|src/util/virstring\.[ch]$$|tests/vi= rcgroupmock\.c|tools/virt-login-shell\.c|tools/nss/libvirt_nss\.c$$) + ^(build-aux/cfg\.mk|bootstrap.conf$$|examples/|src/util/virstring\.[ch]$= $|tests/vircgroupmock\.c|tools/virt-login-shell\.c|tools/nss/libvirt_nss\.c= $$) =20 exclude_file_name_regexp--sc_prohibit_strdup =3D \ ^(docs/|examples/|src/util/virstring\.c|tests/vir(netserverclient|cgroup= )mock.c|tests/commandhelper\.c|tools/nss/libvirt_nss_(leases|macs)\.c$$) @@ -1259,13 +1265,13 @@ exclude_file_name_regexp--sc_prohibit_nonreentrant = =3D \ ^((po|tests|examples)/|docs/.*(py|js|html\.in)|run.in$$|tools/wireshark/= util/genxdrstub\.pl|tools/virt-login-shell\.c$$) =20 exclude_file_name_regexp--sc_prohibit_select =3D \ - ^cfg\.mk$$ + ^build-aux/cfg\.mk$$ =20 exclude_file_name_regexp--sc_prohibit_canonicalize_file_name =3D \ - ^(cfg\.mk|tests/virfilemock\.c)$$ + ^(build-aux/cfg\.mk|tests/virfilemock\.c)$$ =20 exclude_file_name_regexp--sc_prohibit_raw_allocation =3D \ - ^(docs/hacking\.html\.in|src/util/viralloc\.[ch]|examples/.*|tests/(secu= rityselinuxhelper|(vircgroup|nss)mock|commandhelper)\.c|tools/wireshark/src= /packet-libvirt\.c|tools/nss/libvirt_nss(_leases|_macs)?\.c)$$ + ^(docs/hacking\.html\.in|src/util/viralloc\.[ch]|examples/.*|tests/(secu= rityselinuxhelper|(vircgroup|nss)mock|commandhelper)\.c|tools/wireshark/src= /packet-libvirt\.c|tools/nss/libvirt_nss(_leases|_macs)?\.c|build-aux/usele= ss-if-before-free)$$ =20 exclude_file_name_regexp--sc_prohibit_readlink =3D \ ^src/(util/virutil|lxc/lxc_container)\.c$$ @@ -1273,7 +1279,7 @@ exclude_file_name_regexp--sc_prohibit_readlink =3D \ exclude_file_name_regexp--sc_prohibit_setuid =3D ^src/util/virutil\.c|tool= s/virt-login-shell\.c$$ =20 exclude_file_name_regexp--sc_prohibit_sprintf =3D \ - ^(cfg\.mk|docs/hacking\.html\.in|.*\.stp|.*\.pl)$$ + ^(build-aux/cfg\.mk|docs/hacking\.html\.in|.*\.stp|.*\.pl)$$ =20 exclude_file_name_regexp--sc_prohibit_strncpy =3D ^src/util/virstring\.c$$ =20 @@ -1283,7 +1289,7 @@ exclude_file_name_regexp--sc_prohibit_xmlGetProp =3D = ^src/util/virxml\.c$$ =20 exclude_file_name_regexp--sc_prohibit_xmlURI =3D ^src/util/viruri\.c$$ =20 -exclude_file_name_regexp--sc_prohibit_return_as_function =3D \.py$$ +exclude_file_name_regexp--sc_prohibit_return_as_function =3D \.py|build-au= x/useless-if-before-free$$ =20 exclude_file_name_regexp--sc_require_config_h =3D \ ^(examples/|tools/virsh-edit\.c$$|tests/virmockstathelpers.c) @@ -1297,7 +1303,7 @@ exclude_file_name_regexp--sc_trailing_blank =3D \ exclude_file_name_regexp--sc_unmarked_diagnostics =3D \ ^(docs/apibuild.py|tests/virt-aa-helper-test|docs/js/.*\.js)$$ =20 -exclude_file_name_regexp--sc_size_of_brackets =3D cfg.mk +exclude_file_name_regexp--sc_size_of_brackets =3D build-aux/cfg\.mk =20 exclude_file_name_regexp--sc_correct_id_types =3D \ (^src/locking/lock_protocol.x$$) @@ -1311,7 +1317,7 @@ exclude_file_name_regexp--sc_prohibit_include_public_= headers_brackets =3D \ ^(tools/|examples/|include/libvirt/(virterror|libvirt(-(admin|qemu|lxc))= ?)\.h$$) =20 exclude_file_name_regexp--sc_prohibit_int_ijk =3D \ - ^(src/remote_protocol-structs|src/remote/remote_protocol\.x|cfg\.mk|incl= ude/libvirt/libvirt.+|src/admin_protocol-structs|src/admin/admin_protocol\.= x)$$ + ^(src/remote_protocol-structs|src/remote/remote_protocol\.x|build-aux/cf= g\.mk|include/libvirt/libvirt.+|src/admin_protocol-structs|src/admin/admin_= protocol\.x)$$ =20 exclude_file_name_regexp--sc_prohibit_unsigned_pid =3D \ ^(include/libvirt/.*\.h|src/(qemu/qemu_driver\.c|driver-hypervisor\.h|li= bvirt(-[a-z]*)?\.c|.*\.x|util/vir(polkit|systemd)\.c)|tests/virpolkittest\.= c|tools/virsh-domain\.c)$$ @@ -1329,16 +1335,16 @@ exclude_file_name_regexp--sc_prohibit_useless_trans= lation =3D \ ^tests/virpolkittest.c =20 exclude_file_name_regexp--sc_prohibit_devname =3D \ - ^(tools/virsh.pod|cfg.mk|docs/.*)$$ + ^(tools/virsh.pod|build-aux/cfg\.mk|docs/.*)$$ =20 exclude_file_name_regexp--sc_prohibit_virXXXFree =3D \ - ^(docs/|tests/|examples/|tools/|cfg.mk|src/test/test_driver.c|src/libvir= t_public.syms|include/libvirt/libvirt-(domain|network|nodedev|storage|strea= m|secret|nwfilter|interface|domain-snapshot).h|src/libvirt-(domain|qemu|net= work|nodedev|storage|stream|secret|nwfilter|interface|domain-snapshot).c$$) + ^(docs/|tests/|examples/|tools/|build-aux/cfg\.mk|src/test/test_driver.c= |src/libvirt_public.syms|include/libvirt/libvirt-(domain|network|nodedev|st= orage|stream|secret|nwfilter|interface|domain-snapshot).h|src/libvirt-(doma= in|qemu|network|nodedev|storage|stream|secret|nwfilter|interface|domain-sna= pshot).c$$) =20 exclude_file_name_regexp--sc_prohibit_sysconf_pagesize =3D \ - ^(cfg\.mk|src/util/virutil\.c)$$ + ^(build-aux/cfg\.mk|src/util/virutil\.c)$$ =20 exclude_file_name_regexp--sc_prohibit_pthread_create =3D \ - ^(cfg\.mk|src/util/virthread\.c|tests/.*)$$ + ^(build-aux/cfg\.mk|src/util/virthread\.c|tests/.*)$$ =20 exclude_file_name_regexp--sc_prohibit_always-defined_macros =3D \ ^tests/virtestmock.c$$ @@ -1354,3 +1360,6 @@ exclude_file_name_regexp--sc_prohibit_dirent_d_type = =3D \ =20 exclude_file_name_regexp--sc_prohibit_strcmp =3D \ ^(tools/nss/libvirt_nss.*\.c|tools/virt-login-shell\.c) + +exclude_file_name_regexp--sc_prohibit_backslash_alignment =3D \ + ^build-aux/maint\.mk$$ diff --git a/maint.mk b/build-aux/maint.mk similarity index 99% rename from maint.mk rename to build-aux/maint.mk index 16e936022c..e570e45462 100644 --- a/maint.mk +++ b/build-aux/maint.mk @@ -19,7 +19,7 @@ =20 # This is reported not to work with make-3.79.1 # ME :=3D $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) -ME :=3D maint.mk +ME :=3D $(_build-aux)/maint.mk =20 # These variables ought to be defined through the configure.ac section # of the module description. But some packages import this file directly, @@ -159,8 +159,7 @@ export LC_ALL =3D C ## Sanity checks. ## ## --------------- ## =20 -ifneq ($(_gl-Makefile),) -_cfg_mk :=3D $(wildcard $(srcdir)/cfg.mk) +_cfg_mk :=3D $(wildcard $(srcdir)/$(_build-aux)/cfg.mk) =20 # Collect the names of rules starting with 'sc_'. syntax-check-rules :=3D $(sort $(shell $(SED) -n \ @@ -201,7 +200,6 @@ local-check :=3D \ $(filter-out $(local-checks-to-skip), $(local-checks-available))) =20 syntax-check: $(local-check) -endif =20 # _sc_search_regexp # @@ -906,7 +904,7 @@ endef # Don't define macros that we already get from gnulib header files. sc_prohibit_always-defined_macros: @if test -d $(gnulib_dir); then \ - case $$(echo all: | $(GREP) -l -f - Makefile) in Makefile);; *) \ + case $$(echo all: | $(GREP) -l -f - $(abs_top_builddir)/Makefile) in $(= abs_top_builddir)/Makefile);; *) \ echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \ esac; \ regex=3D$$($(def_sym_regex)); export regex; \ @@ -1429,7 +1427,7 @@ announcement: NEWS ChangeLog $(rel-files) release-commit: $(AM_V_GEN)cd $(srcdir) \ && $(_build-aux)/do-release-commit-and-tag \ - -C $(abs_builddir) $(RELEASE) + -C $(abs_top_builddir) $(RELEASE) =20 ## ---------------- ## ## Updating files. ## @@ -1551,7 +1549,7 @@ web-manual: && { echo define manual_title in cfg.mk 1>&2; exit 1; } || : $(AM_V_at)cd '$(srcdir)/doc'; \ $(SHELL) ../$(_build-aux)/gendocs.sh $(gendocs_options_) \ - -o '$(abs_builddir)/doc/manual' \ + -o '$(abs_top_builddir)/doc/manual' \ --email $(PACKAGE_BUGREPORT) $(PACKAGE) \ "$(PACKAGE_NAME) - $(manual_title)" $(AM_V_at)echo " *** Upload the doc/manual directory to web-cvs." @@ -1559,7 +1557,7 @@ web-manual: .PHONY: web-manual-update web-manual-update: $(AM_V_GEN)cd $(srcdir) \ - && $(_build-aux)/gnu-web-doc-update -C $(abs_builddir) + && $(_build-aux)/gnu-web-doc-update -C $(abs_top_builddir) =20 =20 # Code Coverage @@ -1662,7 +1660,7 @@ _gl_TS_dir ?=3D src ALL_RECURSIVE_TARGETS +=3D sc_tight_scope sc_tight_scope: tight-scope.mk @fail=3D0; \ - if ! $(GREP) '^ *export _gl_TS_headers *=3D' $(srcdir)/cfg.mk \ + if ! $(GREP) '^ *export _gl_TS_headers *=3D' $(_build-aux)/cfg.mk \ > /dev/null \ && ! $(GREP) -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \ > /dev/null 2>&1; then \ @@ -1670,7 +1668,7 @@ sc_tight_scope: tight-scope.mk else \ $(MAKE) -s -C $(_gl_TS_dir) \ -f Makefile \ - -f $(abs_top_srcdir)/cfg.mk \ + -f $(_build-aux)/cfg.mk \ -f $(abs_top_builddir)/$< \ _gl_tight_scope \ || fail=3D1; \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list