From patchwork Tue Jan 15 03:53:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10763963 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72E0491E for ; Tue, 15 Jan 2019 04:06:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 524D82C3A5 for ; Tue, 15 Jan 2019 04:06:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F6B92C808; Tue, 15 Jan 2019 04:06:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 45C732C3A5 for ; Tue, 15 Jan 2019 04:06:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E7AB7211B738A; Mon, 14 Jan 2019 20:06:33 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BAC9D211B5A57 for ; Mon, 14 Jan 2019 20:06:32 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 20:06:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,480,1539673200"; d="scan'208";a="291597733" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga005.jf.intel.com with ESMTP; 14 Jan 2019 20:06:31 -0800 Subject: [ndctl PATCH] ndctl: Introduce ndctl/config.h From: Dan Williams To: linux-nvdimm@lists.01.org Date: Mon, 14 Jan 2019 19:53:55 -0800 Message-ID: <154752443528.1624297.9852799229397528506.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP The AC_DEFINE_QUOTED scheme falls over if the autoconf variable requires expansion. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=385769. Define a config.h file autogenerated by the build system and let 'make' do the variable expansion. Cc: Qi Fuli Signed-off-by: Dan Williams --- .gitignore | 1 + configure.ac | 2 -- ndctl/Makefile.am | 7 +++++++ ndctl/monitor.c | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0baace4b457e..5a3d8e4507e5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ daxctl/lib/libdaxctl.la daxctl/lib/libdaxctl.lo daxctl/lib/libdaxctl.pc *.a +ndctl/config.h ndctl/lib/libndctl.pc ndctl/ndctl rhel/ diff --git a/configure.ac b/configure.ac index aa07ec7bc870..a02a2d80e1d5 100644 --- a/configure.ac +++ b/configure.ac @@ -158,8 +158,6 @@ ndctl_monitorconfdir=${sysconfdir}/ndctl ndctl_monitorconf=monitor.conf AC_SUBST([ndctl_monitorconfdir]) AC_SUBST([ndctl_monitorconf]) -AC_DEFINE_UNQUOTED(NDCTL_CONF_FILE, ["$ndctl_monitorconfdir/$ndctl_monitorconf"], - [default ndctl monitor conf path]) my_CFLAGS="\ -Wall \ diff --git a/ndctl/Makefile.am b/ndctl/Makefile.am index ff01e0688afd..f96f08974aa6 100644 --- a/ndctl/Makefile.am +++ b/ndctl/Makefile.am @@ -2,6 +2,13 @@ include $(top_srcdir)/Makefile.am.in bin_PROGRAMS = ndctl +DISTCLEANFILES = config.h +BUILT_SOURCES = config.h +config.h: Makefile + $(AM_V_GEN) echo "/* Autogenerated by ndctl/Makefile.am */" >$@ + $(AM_V_GEN) echo '#define NDCTL_CONF_FILE \ + "$(ndctl_monitorconfdir)/$(ndctl_monitorconf)"' >>$@ + ndctl_SOURCES = ndctl.c \ bus.c \ create-nfit.c \ diff --git a/ndctl/monitor.c b/ndctl/monitor.c index 233f2bbd9b55..0daba0e96306 100644 --- a/ndctl/monitor.c +++ b/ndctl/monitor.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include