Skip to content

Commit

Permalink
libxl: provide xenlight.pc
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Wei Liu <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Ian Jackson <[email protected]>
Acked-by: Ian Campbell <[email protected]>
[ ijc -- ran autogen.sh ]
  • Loading branch information
Wei Liu authored and Ian Campbell committed Jan 19, 2015
1 parent 8ff0798 commit babeca3
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,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
Expand Down
2 changes: 1 addition & 1 deletion config/Paths.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
4 changes: 4 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ SHAREDIR
XEN_LIB_STORED
XEN_LOG_DIR
XEN_RUN_DIR
XENFIRMWAREDIR
LIBEXEC_BIN
CONFIG_LEAF_DIR
host_os
Expand Down Expand Up @@ -1930,6 +1931,9 @@ libexecdir=`eval echo $libexecdir`
LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`


XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`


XEN_RUN_DIR=$localstatedir/run/xen


Expand Down
3 changes: 3 additions & 0 deletions m4/paths.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion tools/configure
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ SHAREDIR
XEN_LIB_STORED
XEN_LOG_DIR
XEN_RUN_DIR
XENFIRMWAREDIR
LIBEXEC_BIN
CONFIG_LEAF_DIR
FILE_OFFSET_BITS
Expand Down Expand Up @@ -2273,7 +2274,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-init-dom0.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup hotplug/Linux/xen-backend.rules hotplug/Linux/xen-hotplug-common.sh hotplug/Linux/xendomains hotplug/NetBSD/rc.d/xencommons"
ac_config_files="$ac_config_files ../config/Tools.mk hotplug/FreeBSD/rc.d/xencommons hotplug/Linux/init.d/sysconfig.xencommons hotplug/Linux/init.d/xen-watchdog hotplug/Linux/init.d/xencommons hotplug/Linux/init.d/xendomains hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xen-init-dom0.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xen-watchdog.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored_ro.socket hotplug/Linux/vif-setup 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="$ac_config_headers config.h"
Expand Down Expand Up @@ -3767,6 +3768,9 @@ libexecdir=`eval echo $libexecdir`
LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
XENFIRMWAREDIR=`eval echo $libexecdir/$PACKAGE_TARNAME/boot`
XEN_RUN_DIR=$localstatedir/run/xen
Expand Down Expand Up @@ -9559,6 +9563,7 @@ do
"hotplug/Linux/xen-hotplug-common.sh") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xen-hotplug-common.sh" ;;
"hotplug/Linux/xendomains") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/xendomains" ;;
"hotplug/NetBSD/rc.d/xencommons") CONFIG_FILES="$CONFIG_FILES hotplug/NetBSD/rc.d/xencommons" ;;
"libxl/xenlight.pc.in") CONFIG_FILES="$CONFIG_FILES libxl/xenlight.pc.in" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
Expand Down
1 change: 1 addition & 0 deletions tools/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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([../])
Expand Down
11 changes: 10 additions & 1 deletion tools/libxl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -248,13 +250,18 @@ 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)
$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(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)
Expand All @@ -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 libxlutil.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

Expand Down
11 changes: 11 additions & 0 deletions tools/libxl/xenlight.pc.in.in
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit babeca3

Please sign in to comment.