From nobody Sat Feb 7 08:23:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580217127776761.9396953995663; Tue, 28 Jan 2020 05:12:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-7jsmavZLMzmuO9iJsQnLtQ-1; Tue, 28 Jan 2020 08:12:04 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFB071088384; Tue, 28 Jan 2020 13:11: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 C241E1001DD8; Tue, 28 Jan 2020 13:11:57 +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 70A3E870B8; Tue, 28 Jan 2020 13:11:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00SDBliI019099 for ; Tue, 28 Jan 2020 08:11:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id DE68E1001DDE; Tue, 28 Jan 2020 13:11:47 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A88E1001DD8; Tue, 28 Jan 2020 13:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580217126; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pJOm75SBCeTSp0ucIjxL/rGiyAXduCsGA4iOkfHA8hY=; b=St52okwlNcsnl+PrYJVxOf7RtAMu6qn1Y/346JSTz8tRMURsvk0RzJ2uKaWeT0K7dIF2vT /QPrBJ8is56kfkdn9QbmbcoNKsqqN4khiImUB6rqy+8Gn2tNdZB8YyqrvUjMvrNjcLg2lS I6EAJTtBYUaOCuyefS7YZWbTQCiDifQ= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 05/56] build: generate configmake.h in root directory Date: Tue, 28 Jan 2020 13:10:46 +0000 Message-Id: <20200128131137.1762449-6-berrange@redhat.com> In-Reply-To: <20200128131137.1762449-1-berrange@redhat.com> References: <20200128131137.1762449-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Pavel Hrdina 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: 7jsmavZLMzmuO9iJsQnLtQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Currently we rely on gnulib creating configmake.h, but we can easily create it ourselves instead. Reviewed-by: Pavel Hrdina Signed-off-by: Daniel P. Berrang=C3=A9 --- Makefile.am | 44 ++++++++++++++++++++++++++++++++++++++++ configure.ac | 12 +++++------ tools/nss/libvirt_nss.c | 7 +------ tools/virt-login-shell.c | 6 +----- 4 files changed, 51 insertions(+), 18 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8a8eecb697..29501ab40c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -129,6 +129,9 @@ clean-cov: =20 MAINTAINERCLEANFILES =3D .git-module-status =20 +BUILT_SOURCES =3D configmake.h +CLEANFILES =3D configmake.h + distclean-local: clean-GNUmakefile clean-GNUmakefile: test '$(srcdir)' =3D . || rm -f $(top_builddir)/GNUmakefile @@ -154,3 +157,44 @@ gen-AUTHORS: =20 ci-%: $(MAKE) -C $(srcdir)/ci/ $@ + +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+ or 2.70. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + $(AM_V_GEN)rm -f $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#if WIN32'; \ + echo '# include /* avoid mingw pollution on DATADIR */'; \ + echo '#endif'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define RUNSTATEDIR "$(runstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t && \ + mv -f $@-t $@ diff --git a/configure.ac b/configure.ac index 4bdf38ec15..f0d79b95d4 100644 --- a/configure.ac +++ b/configure.ac @@ -132,14 +132,12 @@ AC_PROG_CPP dnl autoconf 2.70 adds a --runstatedir option so that downstreams dnl can point to /run instead of the historic /var/run, but dnl autoconf hasn't had a release since 2012. -dnl -dnl gnulib sets configmake.h to include runstatedir, but sets -dnl it to $localstatedir/run if $runstatedir env var is not set -dnl which is useless for apps that need to use /run without -dnl waiting for autoconf 2.70 -dnl +if test "x$runstatedir" =3D x; then + AC_SUBST([runstatedir], ['${localstatedir}/run']) +fi + dnl we introduce --with-runstatedir and then overwrite the -dnl value of $runstatedir so gnulib's configmake.h becomes useful +dnl value of $runstatedir so configmake.h is more useful AC_ARG_WITH( [runstatedir], [AS_HELP_STRING( diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c index 6e332f7578..3b89f72742 100644 --- a/tools/nss/libvirt_nss.c +++ b/tools/nss/libvirt_nss.c @@ -41,12 +41,7 @@ # include #endif =20 -/* - * This gnulib files is used for its macros only, - * so doesn't introduce a link time dep, which we - * must avoid - */ -#include "gnulib/lib/configmake.h" +#include "configmake.h" =20 #include "libvirt_nss_leases.h" =20 diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c index cf4a249f0a..25449f972d 100644 --- a/tools/virt-login-shell.c +++ b/tools/virt-login-shell.c @@ -28,11 +28,7 @@ #include #include =20 -/* - * These gnulib files are used for their macros only, - * so don't introduce a link time dep, which we must avoid - */ -#include "gnulib/lib/configmake.h" +#include "configmake.h" =20 #define VIR_INT64_STR_BUFLEN 21 =20 --=20 2.24.1