From patchwork Mon Jun 13 07:49:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 9172239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DA495604DB for ; Mon, 13 Jun 2016 07:51:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC7F220499 for ; Mon, 13 Jun 2016 07:51:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C12E327AC2; Mon, 13 Jun 2016 07:51:30 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E558520499 for ; Mon, 13 Jun 2016 07:51:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCMcd-0005wT-Lp; Mon, 13 Jun 2016 07:49:23 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCMcb-0005tn-KI for xen-devel@lists.xenproject.org; Mon, 13 Jun 2016 07:49:21 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id 75/4A-12215-0856E575; Mon, 13 Jun 2016 07:49:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXitHSDvW5Daly 4waaf4hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bN5Z9ZCzYJVRx5sJqpgfEZfxcjJ4eEgL/E 26UzGEFsNgFliZ+dvWwgtoiAnkTTgedgcWaBTIlpn06ygNjCAlYSl5sXsoPYLAKqEnMvLwaL8 wo4S9x+/pARYqacxPnjP5m7GDk4OAVcJJ68MwcJCwGVNMw6zAxhK0h0TD/GBNEqKHFy5hMWiF USEgdfvGCGGMMtcfv0VOYJjHyzkJTNQlK2gJFpFaNGcWpRWWqRrqGJXlJRZnpGSW5iZo6uoYG pXm5qcXFiempOYlKxXnJ+7iZGYEgxAMEOxrOnPQ8xSnIwKYnySvjEhQvxJeWnVGYkFmfEF5Xm pBYfYpTh4FCS4N2aDJQTLEpNT61Iy8wBBjdMWoKDR0mEVzgFKM1bXJCYW5yZDpE6xajLseHBg 7VMQix5+XmpUuK8j0BmCIAUZZTmwY2ARdolRlkpYV5GoKOEeApSi3IzS1DlXzGKczAqCfOaga ziycwrgdv0CugIJqAjOPZFgxxRkoiQkmpgFNunyvp67XHLh9eXJswWzZQL9HLJS5orKVogb35 nrpZR7VylbTl/VnVG+riuZYxjW3vnhOar+VeyI2vcTTY59oj++sB/8djKHelHJ07+JNZlzvx6 z6LYE7E3nLuLKuwPrJRbz/rjpoiF0nKjO9ufNAa97r2x8eYNLb3dF3s/rrVyXzvZ63VyvxJLc UaioRZzUXEiAPIiIjGvAgAA X-Env-Sender: prvs=9655a08af=wei.liu2@citrix.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1465804158!28491092!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52720 invoked from network); 13 Jun 2016 07:49:20 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-2.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 13 Jun 2016 07:49:20 -0000 X-IronPort-AV: E=Sophos;i="5.26,466,1459814400"; d="scan'208";a="366840724" From: Wei Liu To: Xen-devel Date: Mon, 13 Jun 2016 08:49:00 +0100 Message-ID: <1465804155-14469-3-git-send-email-wei.liu2@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465804155-14469-1-git-send-email-wei.liu2@citrix.com> References: <1465804155-14469-1-git-send-email-wei.liu2@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Jackson , Wei Liu , David Scot Subject: [Xen-devel] [PATCH 02/17] oxenstored: generate a paths module X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP That file includes all paths generated by configure. It will be used to get rid of hard-coded paths in code. Signed-off-by: Wei Liu Acked-by: David Scot --- Cc: Ian Jackson Cc: David Scot --- .gitignore | 1 + tools/ocaml/Makefile.rules | 11 +++++++++++ tools/ocaml/xenstored/Makefile | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 39deb2d..e4afda3 100644 --- a/.gitignore +++ b/.gitignore @@ -347,6 +347,7 @@ tools/ocaml/libs/xentoollog/xentoollog.ml tools/ocaml/libs/xentoollog/xentoollog.mli tools/ocaml/xenstored/oxenstored tools/ocaml/xenstored/oxenstored.conf +tools/ocaml/xenstored/paths.ml tools/ocaml/test/xtl tools/ocaml/test/send_debug_keys tools/ocaml/test/list_domains diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules index 1796060..a893c42 100644 --- a/tools/ocaml/Makefile.rules +++ b/tools/ocaml/Makefile.rules @@ -95,3 +95,14 @@ $(foreach lib,$(OCAML_LIBRARY),$(eval $(call OCAML_LIBRARY_template,$(lib)))) $(foreach lib,$(OCAML_NOC_LIBRARY),$(eval $(call OCAML_NOC_LIBRARY_template,$(lib)))) $(foreach p,$(OCAML_PROGRAM),$(eval $(call OCAML_PROGRAM_template,$(p)))) $(foreach p,$(C_PROGRAM),$(eval $(call C_PROGRAM_template,$(p)))) + +buildmakevars2module = $(eval $(call buildmakevars2module-closure,$(1))) +define buildmakevars2module-closure + $(1): .phony + rm -f $(1).tmp; \ + $(foreach var, $(BUILD_MAKE_VARS), \ + printf "let %s = \"%s\";;\n" \ + $(shell echo $(var) | tr '[:upper:]' '[:lower:]') \ + $($(var)) >>$(1).tmp;) \ + $(call move-if-changed,$(1).tmp,$(1)) +endef diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile index dce9e70..939dcaa 100644 --- a/tools/ocaml/xenstored/Makefile +++ b/tools/ocaml/xenstored/Makefile @@ -32,7 +32,8 @@ OCAML_LIBRARY += systemd LIBS_systemd += $(LDFLAGS-y) -OBJS = define \ +OBJS = paths \ + define \ stdext \ trie \ config \ @@ -87,3 +88,8 @@ install: all $(INSTALL_DATA) oxenstored.conf $(DESTDIR)$(XEN_CONFIG_DIR) include $(OCAML_TOPLEVEL)/Makefile.rules + +genpath-target = $(call buildmakevars2module,paths.ml) +$(eval $(genpath-target)) + +GENERATED_FILES += paths.ml