All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	wei.liu2@citrix.com, ian.jackson@eu.citrix.com
Subject: [PATCH 16/16] tools: adapt xenlight.pc and xlutil.pc to new pkg-config scheme
Date: Wed,  8 Mar 2017 15:49:45 +0100	[thread overview]
Message-ID: <20170308144945.8934-17-jgross@suse.com> (raw)
In-Reply-To: <20170308144945.8934-1-jgross@suse.com>

Instead of generating the *.pc.in files at configure time use the new
pkg-config scheme for those files. Add the dependencies to other Xen
libraries as needed.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 .gitignore                    |  1 -
 tools/configure               |  4 +---
 tools/configure.ac            |  2 --
 tools/libxl/Makefile          | 25 ++++++++++++++++++++-----
 tools/libxl/xenlight.pc.in    | 12 ++++++++++++
 tools/libxl/xenlight.pc.in.in | 11 -----------
 tools/libxl/xlutil.pc.in      | 10 ++++++++++
 tools/libxl/xlutil.pc.in.in   |  9 ---------
 8 files changed, 43 insertions(+), 31 deletions(-)
 create mode 100644 tools/libxl/xenlight.pc.in
 delete mode 100644 tools/libxl/xenlight.pc.in.in
 create mode 100644 tools/libxl/xlutil.pc.in
 delete mode 100644 tools/libxl/xlutil.pc.in.in

diff --git a/.gitignore b/.gitignore
index 8606ba1..62012ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -193,7 +193,6 @@ tools/libxc/*.pc
 tools/libxl/_libxl.api-for-check
 tools/libxl/*.api-ok
 tools/libxl/*.pc
-tools/libxl/*.pc.in
 tools/libxl/dsdt*
 tools/libxl/libxlu_cfg_y.output
 tools/libxl/mk_dsdt
diff --git a/tools/configure b/tools/configure
index 851e0f0..7a57e65 100755
--- a/tools/configure
+++ b/tools/configure
@@ -2411,7 +2411,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/FreeBSD/rc.d/xendriverdomain hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/sysconfig.xendomains hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/init.d/xendriverdomain hotplug/Linux/launch-xenstore hotplug/Linux/vif-setup hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons hotplug/NetBSD/rc.d/xendriverdomain libxl/xenlight.pc.in libxl/xlutil.pc.in ocaml/xenstored/oxenstored.conf"
+ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/FreeBSD/rc.d/xendriverdomain hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/sysconfig.xendomains hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/init.d/xendriverdomain hotplug/Linux/launch-xenstore hotplug/Linux/vif-setup hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons hotplug/NetBSD/rc.d/xendriverdomain ocaml/xenstored/oxenstored.conf"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -10415,8 +10415,6 @@ do
     "hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
     "hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
     "hotplug/NetBSD/rc.d/xendriverdomain") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xendriverdomain" ;;
-    "libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
-    "libxl/xlutil.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xlutil.pc.in" ;;
     "ocaml/xenstored/oxenstored.conf") CONFIG_FILES="$CONFIG_FILES ocaml/xenstored/oxenstored.conf" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/proc-xen.mount" ;;
diff --git a/tools/configure.ac b/tools/configure.ac
index 28a539c..307998d 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -21,8 +21,6 @@ hotplug/Linux/xen-hotplug-common.sh
 hotplug/Linux/xendomains
 hotplug/NetBSD/rc.d/xencommons
 hotplug/NetBSD/rc.d/xendriverdomain
-libxl/xenlight.pc.in
-libxl/xlutil.pc.in
 ocaml/xenstored/oxenstored.conf
 ])
 AC_CONFIG_HEADERS([config.h])
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index f00d9ef..2524f57 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -189,6 +189,25 @@ SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
 $(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenevtchn)
 
 PKG_CONFIG = xenlight.pc xlutil.pc
+PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
+
+ifneq ($(CONFIG_LIBXC_MINIOS),y)
+PKG_CONFIG_INST := $(PKG_CONFIG)
+xenlight.pc: PKG_CONFIG_VERSION = $(MAJOR).$(MINOR)
+xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR)
+$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
+$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir)
+$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir)
+endif
+
+PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc))
+
+$(PKG_CONFIG_DIR)/xenlight.pc: PKG_CONFIG_VERSION = $(MAJOR).$(MINOR)
+$(PKG_CONFIG_DIR)/xlutil.pc: PKG_CONFIG_VERSION = $(XLUMAJOR).$(XLUMINOR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
 
 testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
 testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS)
@@ -196,7 +215,7 @@ testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS)
 	mv testidl.c.new testidl.c
 
 .PHONY: all
-all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) \
+all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) $(PKG_CONFIG_LOCAL) \
 		libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
 	$(AUTOSRCS) $(AUTOINCS)
 
@@ -290,10 +309,6 @@ libxl-save-helper: $(SAVE_HELPER_OBJS) libxenlight.so
 testidl: testidl.o libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
 
-$(PKG_CONFIG): % : %.in Makefile
-	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $< > $@.new
-	@mv -f $@.new $@
-
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
diff --git a/tools/libxl/xenlight.pc.in b/tools/libxl/xenlight.pc.in
new file mode 100644
index 0000000..71d093a
--- /dev/null
+++ b/tools/libxl/xenlight.pc.in
@@ -0,0 +1,12 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+xenfirmwaredir=@@firmwaredir@@
+libexec_bin=@@libexecbin@@
+
+Name: Xenlight
+Description: The Xenlight library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir}
+Libs: @@libsflag@@${libdir} -lxenlight
+Requires.private: xentoollog,xenevtchn,xenctrl,xenguest,xenstore,blktapctl
diff --git a/tools/libxl/xenlight.pc.in.in b/tools/libxl/xenlight.pc.in.in
deleted file mode 100644
index c27872e..0000000
--- a/tools/libxl/xenlight.pc.in.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-includedir=@includedir@
-libdir=@libdir@
-xenfirmwaredir=@XENFIRMWAREDIR@
-libexec_bin=@LIBEXEC_BIN@
-
-Name: Xenlight
-Description: The Xenlight library for Xen hypervisor
-Version: @@version@@
-Cflags: -I${includedir}
-Libs: -L${libdir} -lxenlight
diff --git a/tools/libxl/xlutil.pc.in b/tools/libxl/xlutil.pc.in
new file mode 100644
index 0000000..cdd98fb
--- /dev/null
+++ b/tools/libxl/xlutil.pc.in
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xlutil
+Description: The xl utility library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir}
+Libs: @@libsflag@@${libdir} -lxlutil
+Requires.private: xenlight
diff --git a/tools/libxl/xlutil.pc.in.in b/tools/libxl/xlutil.pc.in.in
deleted file mode 100644
index e7dc14d..0000000
--- a/tools/libxl/xlutil.pc.in.in
+++ /dev/null
@@ -1,9 +0,0 @@
-prefix=@prefix@
-includedir=@includedir@
-libdir=@libdir@
-
-Name: Xlutil
-Description: The xl utility library for Xen hypervisor
-Version: @@version@@
-Cflags: -I${includedir}
-Libs: -L${libdir} -lxlutil
-- 
2.10.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-03-08 14:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08 14:49 [PATCH 00/16] tools: provide pkg-config files for all libs Juergen Gross
2017-03-08 14:49 ` [PATCH 01/16] tools: fix typo in tools/Rules.mk Juergen Gross
2017-03-13 16:58   ` Wei Liu
2017-03-08 14:49 ` [PATCH 02/16] tools: add missing library flag definitions Juergen Gross
2017-03-08 14:49 ` [PATCH 03/16] tools, stubdom: set PKG_CONFIG_DIR in main Makefiles Juergen Gross
2017-03-08 14:49 ` [PATCH 04/16] tools: add support for additional items in .pc files for local builds Juergen Gross
2017-03-08 14:49 ` [PATCH 05/16] tools: provide pkg-config file for libxentoollog Juergen Gross
2017-03-08 14:49 ` [PATCH 06/16] tools: provide pkg-config file for libxenevtchn Juergen Gross
2017-03-08 14:49 ` [PATCH 07/16] tools: provide pkg-config file for libxengnttab Juergen Gross
2017-03-08 14:49 ` [PATCH 08/16] tools: provide pkg-config file for libxencall Juergen Gross
2017-03-08 14:49 ` [PATCH 09/16] tools: provide pkg-config file for libxenforeignmemory Juergen Gross
2017-03-08 14:49 ` [PATCH 10/16] tools: provide pkg-config file for libxendevicemodel Juergen Gross
2017-03-08 14:49 ` [PATCH 11/16] tools: provide pkg-config file for libxenguest, update the one for libxenctrl Juergen Gross
2017-03-08 14:49 ` [PATCH 12/16] tools: provide pkg-config file for libxenstore Juergen Gross
2017-03-08 14:49 ` [PATCH 13/16] tools: provide pkg-config file for libxenstat Juergen Gross
2017-03-14 12:08   ` Wei Liu
2017-03-08 14:49 ` [PATCH 14/16] tools: provide pkg-config file for libxenvchan Juergen Gross
2017-03-08 14:49 ` [PATCH 15/16] tools: provide pkg-config file for libxenblktapctl Juergen Gross
2017-03-08 14:49 ` Juergen Gross [this message]
2017-03-14 12:09 ` [PATCH 00/16] tools: provide pkg-config files for all libs Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170308144945.8934-17-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.