All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxl: provide xenlight.pc
@ 2015-01-09 14:32 Wei Liu
  2015-01-13 12:11 ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Liu @ 2015-01-09 14:32 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, jfehlig, Wei Liu, Ian Campbell

A pkg-config file for libxl. It also contains two variables
(xenfirmwaredir and libexec_bin) so that tools that are very keen on
knowing the locations of Xen binaries (say, libvirt) can use them to
determine the location of the binaries.

Please rerun autogen.sh after applying this patch.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
---
 .gitignore                    |    2 ++
 config/Paths.mk.in            |    2 +-
 m4/paths.m4                   |    3 +++
 tools/configure.ac            |    1 +
 tools/libxl/Makefile          |   11 ++++++++++-
 tools/libxl/xenlight.pc.in.in |   11 +++++++++++
 6 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 tools/libxl/xenlight.pc.in.in

diff --git a/.gitignore b/.gitignore
index 8c8c06f..21f0ca6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -158,6 +158,8 @@ tools/include/xen/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
 tools/libxl/libxlu_cfg_y.output
+tools/libxl/xenlight.pc
+tools/libxl/xenlight.pc.in
 tools/libxl/xl
 tools/libxl/testenum
 tools/libxl/testenum.c
diff --git a/config/Paths.mk.in b/config/Paths.mk.in
index fe10f76..150bae7 100644
--- a/config/Paths.mk.in
+++ b/config/Paths.mk.in
@@ -57,7 +57,7 @@ BASH_COMPLETION_DIR      := $(CONFIG_DIR)/bash_completion.d
 XEN_LOCK_DIR             := @XEN_LOCK_DIR@
 XEN_PAGING_DIR           := @XEN_PAGING_DIR@
 
-XENFIRMWAREDIR           := $(LIBEXEC)/boot
+XENFIRMWAREDIR           := @XENFIRMWAREDIR@
 
 XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
 XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
diff --git a/m4/paths.m4 b/m4/paths.m4
index 7ede5bd..db74f55 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -77,6 +77,9 @@ dnl This variable will be substituted in various .in files
 LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
 AC_SUBST(LIBEXEC_BIN)
 
+XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
+AC_SUBST(XENFIRMWAREDIR)
+
 XEN_RUN_DIR=$localstatedir/run/xen
 AC_SUBST(XEN_RUN_DIR)
 
diff --git a/tools/configure.ac b/tools/configure.ac
index 1ac63a3..741c36c 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -27,6 +27,7 @@ hotplug/Linux/xen-backend.rules
 hotplug/Linux/xen-hotplug-common.sh
 hotplug/Linux/xendomains
 hotplug/NetBSD/rc.d/xencommons
+libxl/xenlight.pc.in
 ])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index df08c8a..b6d5d22 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -143,13 +143,15 @@ $(XEN_INIT_DOM0_OBJS): CFLAGS += $(CFLAGS_libxenstore)
 SAVE_HELPER_OBJS = libxl_save_helper.o _libxl_save_msgs_helper.o
 $(SAVE_HELPER_OBJS): CFLAGS += $(CFLAGS_libxenctrl)
 
+PKG_CONFIG = xenlight.pc
+
 testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight)
 testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS)
 	$(PYTHON) gentest.py libxl_types.idl testidl.c.new
 	mv testidl.c.new testidl.c
 
 .PHONY: all
-all: $(CLIENTS) $(TEST_PROGS) \
+all: $(CLIENTS) $(TEST_PROGS) $(PKG_CONFIG) \
 		libxenlight.so libxenlight.a libxlutil.so libxlutil.a \
 	$(AUTOSRCS) $(AUTOINCS)
 
@@ -248,6 +250,10 @@ 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_libxenctrl) $(APPEND_LDFLAGS)
 
+xenlight.pc: xenlight.pc.in Makefile
+	@sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < xenlight.pc.in > $@.new
+	@mv -f $@.new $@
+
 .PHONY: install
 install: all
 	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
@@ -255,6 +261,7 @@ install: all
 	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DIR) $(DESTDIR)$(BASH_COMPLETION_DIR)
 	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+	$(INSTALL_DIR) $(DESTDIR)$(SHAREDIR)/pkgconfig
 	$(INSTALL_PROG) xl $(DESTDIR)$(SBINDIR)
 	$(INSTALL_PROG) xen-init-dom0 $(DESTDIR)$(LIBEXEC_BIN)
 	$(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
@@ -268,12 +275,14 @@ install: all
 	$(INSTALL_DATA) libxlutil.a $(DESTDIR)$(LIBDIR)
 	$(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
+	$(INSTALL_DATA) xenlight.pc $(DESTDIR)$(SHAREDIR)/pkgconfig/
 
 .PHONY: clean
 clean:
 	$(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
 	$(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check
 	$(RM) -f testidl.c.new testidl.c *.api-ok
+	$(RM) -f xenlight.pc xenlight.pc.in
 
 distclean: clean
 
diff --git a/tools/libxl/xenlight.pc.in.in b/tools/libxl/xenlight.pc.in.in
new file mode 100644
index 0000000..c27872e
--- /dev/null
+++ b/tools/libxl/xenlight.pc.in.in
@@ -0,0 +1,11 @@
+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
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: provide xenlight.pc
  2015-01-09 14:32 [PATCH] libxl: provide xenlight.pc Wei Liu
@ 2015-01-13 12:11 ` Ian Campbell
  2015-01-13 12:19   ` Olaf Hering
  2015-01-14 16:58   ` Ian Jackson
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Campbell @ 2015-01-13 12:11 UTC (permalink / raw)
  To: Wei Liu; +Cc: jfehlig, Ian Jackson, xen-devel

On Fri, 2015-01-09 at 14:32 +0000, Wei Liu wrote:
> A pkg-config file for libxl. It also contains two variables
> (xenfirmwaredir and libexec_bin) so that tools that are very keen on
> knowing the locations of Xen binaries (say, libvirt) can use them to
> determine the location of the binaries.
> 
> Please rerun autogen.sh after applying this patch.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>

This seems like a reasonable thing to provide and the manner which you
do so seems sane. I've not actually read any pkg-config specs to check
the content, but it looks plausible:

Acked-by: Ian Campbell <ian.campbell@citrix.com>

We ought to consider if there are any other libraries we should do this
for, I think non-stable API ones like libxenctrl/guest should be
explicitly excluded.

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: provide xenlight.pc
  2015-01-13 12:11 ` Ian Campbell
@ 2015-01-13 12:19   ` Olaf Hering
  2015-01-13 12:56     ` Wei Liu
  2015-01-14 16:58   ` Ian Jackson
  1 sibling, 1 reply; 8+ messages in thread
From: Olaf Hering @ 2015-01-13 12:19 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian Jackson, jfehlig, Wei Liu, xen-devel

On Tue, Jan 13, Ian Campbell wrote:

> On Fri, 2015-01-09 at 14:32 +0000, Wei Liu wrote:
> > A pkg-config file for libxl. It also contains two variables
> > (xenfirmwaredir and libexec_bin) so that tools that are very keen on
> > knowing the locations of Xen binaries (say, libvirt) can use them to
> > determine the location of the binaries.
> > 
> > Please rerun autogen.sh after applying this patch.

Forgot to reply to this earlier:

Should there really be another file.in.in.in.in mess? I think the
major/minor values could be placed into some m4 file so that they can be
substituted properly by configure.

Olaf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: provide xenlight.pc
  2015-01-13 12:19   ` Olaf Hering
@ 2015-01-13 12:56     ` Wei Liu
  2015-01-13 14:25       ` Ian Campbell
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Liu @ 2015-01-13 12:56 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Ian Jackson, jfehlig, Wei Liu, Ian Campbell, xen-devel

On Tue, Jan 13, 2015 at 01:19:05PM +0100, Olaf Hering wrote:
> On Tue, Jan 13, Ian Campbell wrote:
> 
> > On Fri, 2015-01-09 at 14:32 +0000, Wei Liu wrote:
> > > A pkg-config file for libxl. It also contains two variables
> > > (xenfirmwaredir and libexec_bin) so that tools that are very keen on
> > > knowing the locations of Xen binaries (say, libvirt) can use them to
> > > determine the location of the binaries.
> > > 
> > > Please rerun autogen.sh after applying this patch.
> 
> Forgot to reply to this earlier:
> 
> Should there really be another file.in.in.in.in mess? I think the
> major/minor values could be placed into some m4 file so that they can be
> substituted properly by configure.
> 

I was two minded when I wrote this path. On one hand I didn't want to
place a m4 file here, on the other I didn't want to leak library version
numbers to top level m4 directory. Finally I decided to do the .in.in
trick.

So if you have an argument for either of these please convince me...
Or you have other idea about file placement please tell me.

Wei.


> Olaf

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: provide xenlight.pc
  2015-01-13 12:56     ` Wei Liu
@ 2015-01-13 14:25       ` Ian Campbell
  0 siblings, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2015-01-13 14:25 UTC (permalink / raw)
  To: Wei Liu; +Cc: Olaf Hering, Ian Jackson, jfehlig, xen-devel

On Tue, 2015-01-13 at 12:56 +0000, Wei Liu wrote:
> On Tue, Jan 13, 2015 at 01:19:05PM +0100, Olaf Hering wrote:
> > On Tue, Jan 13, Ian Campbell wrote:
> > 
> > > On Fri, 2015-01-09 at 14:32 +0000, Wei Liu wrote:
> > > > A pkg-config file for libxl. It also contains two variables
> > > > (xenfirmwaredir and libexec_bin) so that tools that are very keen on
> > > > knowing the locations of Xen binaries (say, libvirt) can use them to
> > > > determine the location of the binaries.
> > > > 
> > > > Please rerun autogen.sh after applying this patch.
> > 
> > Forgot to reply to this earlier:
> > 
> > Should there really be another file.in.in.in.in mess? I think the
> > major/minor values could be placed into some m4 file so that they can be
> > substituted properly by configure.
> > 
> 
> I was two minded when I wrote this path. On one hand I didn't want to
> place a m4 file here, on the other I didn't want to leak library version
> numbers to top level m4 directory. Finally I decided to do the .in.in
> trick.
> 
> So if you have an argument for either of these please convince me...
> Or you have other idea about file placement please tell me.

I think the library SONAME belongs in the relevant Makefile, not hidden
in the m4 somewhere. Which I think necessitates .in.in. I think we can
live with that.

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: provide xenlight.pc
  2015-01-13 12:11 ` Ian Campbell
  2015-01-13 12:19   ` Olaf Hering
@ 2015-01-14 16:58   ` Ian Jackson
  2015-01-15  9:33     ` Ian Campbell
  2015-01-19 17:00     ` Ian Campbell
  1 sibling, 2 replies; 8+ messages in thread
From: Ian Jackson @ 2015-01-14 16:58 UTC (permalink / raw)
  To: Ian Campbell; +Cc: jfehlig, Wei Liu, xen-devel

Ian Campbell writes ("Re: [PATCH] libxl: provide xenlight.pc"):
> On Fri, 2015-01-09 at 14:32 +0000, Wei Liu wrote:
> > A pkg-config file for libxl. It also contains two variables
> > (xenfirmwaredir and libexec_bin) so that tools that are very keen on
> > knowing the locations of Xen binaries (say, libvirt) can use them to
> > determine the location of the binaries.
...
> This seems like a reasonable thing to provide and the manner which you
> do so seems sane. I've not actually read any pkg-config specs to check
> the content, but it looks plausible:

Thanks, Ian.  (I haven't checked the supplied .pc file.)

> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> We ought to consider if there are any other libraries we should do this
> for, I think non-stable API ones like libxenctrl/guest should be
> explicitly excluded.

The obvious one is xenstore.  I'm not sure how much we want to
consider that to have a stable API.

Also, what about libxl users who want to use xentoollog ?

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: provide xenlight.pc
  2015-01-14 16:58   ` Ian Jackson
@ 2015-01-15  9:33     ` Ian Campbell
  2015-01-19 17:00     ` Ian Campbell
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2015-01-15  9:33 UTC (permalink / raw)
  To: Ian Jackson; +Cc: jfehlig, Wei Liu, xen-devel

On Wed, 2015-01-14 at 16:58 +0000, Ian Jackson wrote:
> Ian Campbell writes ("Re: [PATCH] libxl: provide xenlight.pc"):
> > On Fri, 2015-01-09 at 14:32 +0000, Wei Liu wrote:
> > > A pkg-config file for libxl. It also contains two variables
> > > (xenfirmwaredir and libexec_bin) so that tools that are very keen on
> > > knowing the locations of Xen binaries (say, libvirt) can use them to
> > > determine the location of the binaries.
> ...
> > This seems like a reasonable thing to provide and the manner which you
> > do so seems sane. I've not actually read any pkg-config specs to check
> > the content, but it looks plausible:
> 
> Thanks, Ian.  (I haven't checked the supplied .pc file.)
> 
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > We ought to consider if there are any other libraries we should do this
> > for, I think non-stable API ones like libxenctrl/guest should be
> > explicitly excluded.
> 
> The obvious one is xenstore.  I'm not sure how much we want to
> consider that to have a stable API.
> 
> Also, what about libxl users who want to use xentoollog ?

I think both of those should be candidates for a .pc file, but that
needn't block this patch IMHO.

xentoollog could do with moving out of tools/libxc, but ISTR trying that
years ago and it turned into a yakk of some sort.

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] libxl: provide xenlight.pc
  2015-01-14 16:58   ` Ian Jackson
  2015-01-15  9:33     ` Ian Campbell
@ 2015-01-19 17:00     ` Ian Campbell
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Campbell @ 2015-01-19 17:00 UTC (permalink / raw)
  To: Ian Jackson; +Cc: jfehlig, Wei Liu, xen-devel

On Wed, 2015-01-14 at 16:58 +0000, Ian Jackson wrote:
> Ian Campbell writes ("Re: [PATCH] libxl: provide xenlight.pc"):
> > On Fri, 2015-01-09 at 14:32 +0000, Wei Liu wrote:
> > > A pkg-config file for libxl. It also contains two variables
> > > (xenfirmwaredir and libexec_bin) so that tools that are very keen on
> > > knowing the locations of Xen binaries (say, libvirt) can use them to
> > > determine the location of the binaries.
> ...
> > This seems like a reasonable thing to provide and the manner which you
> > do so seems sane. I've not actually read any pkg-config specs to check
> > the content, but it looks plausible:
> 
> Thanks, Ian.  (I haven't checked the supplied .pc file.)
> 
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>

Applied, thanks.

> > We ought to consider if there are any other libraries we should do this
> > for, I think non-stable API ones like libxenctrl/guest should be
> > explicitly excluded.
> 
> The obvious one is xenstore.  I'm not sure how much we want to
> consider that to have a stable API.
> 
> Also, what about libxl users who want to use xentoollog ?

I figured there was no point waiting for these, they can happen as and
when.

Ian.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-19 17:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-09 14:32 [PATCH] libxl: provide xenlight.pc Wei Liu
2015-01-13 12:11 ` Ian Campbell
2015-01-13 12:19   ` Olaf Hering
2015-01-13 12:56     ` Wei Liu
2015-01-13 14:25       ` Ian Campbell
2015-01-14 16:58   ` Ian Jackson
2015-01-15  9:33     ` Ian Campbell
2015-01-19 17:00     ` Ian Campbell

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.