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

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.