From 46f6034c3dcd0cf221914574e4528f25804a5857 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 12 Dec 2011 17:48:38 +0000 Subject: libxl: Provide a version of bsd's queue.h as _libxl_list.h We would like some linked list macros which are (a) well known to be sane and (b) typesafe. BSD's queue.h meets these criteria. We also provide some simple perlery to arrange to add the libxl_ namespace prefix to the macros. This will allow us to #include _libxl_list.h in our public header file without clashing with anyone else who is also using another version of queue.h. (A note on copyright: The FreeBSD files we are adding have an [L]GPL-compatible licence, so there is no need to change our COPYING. Although FreeBSD's queue.3 still contains the advertising clause, this has been withdrawn by UCB as recorded in the FreeBSD COPYRIGHT file, which is included in tools/libxl/external/ for reference.) Signed-off-by: Ian Jackson Acked-by: Ian Campbell Tested-by: Roger Pau Monne Committed-by: Ian Jackson --- tools/libxl/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tools/libxl/Makefile') diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index a7a4625bf6..7a0c03c7bb 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -42,7 +42,7 @@ LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o $(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) -AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h +AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \ libxlu_disk_l.o libxlu_disk.o @@ -55,7 +55,7 @@ $(XL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h $(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight) testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) -testidl.c: libxl_types.idl gentest.py libxl.h +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 @@ -63,7 +63,7 @@ testidl.c: libxl_types.idl gentest.py libxl.h all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \ $(AUTOSRCS) $(AUTOINCS) -$(LIBXLU_OBJS): $(AUTOINCS) +$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS): $(AUTOINCS) %.c %.h: %.y @rm -f $*.[ch] @@ -81,6 +81,10 @@ _libxl_paths.h: genpath rm -f $@.tmp $(call move-if-changed,$@.2.tmp,$@) +_libxl_list.h: bsd-sys-queue-h-seddery external/bsd-sys-queue.h + perl ./$^ --prefix=libxl >$@.new + $(call move-if-changed,$@.new,$@) + libxl_paths.c: _libxl_paths.h libxl.h: _libxl_types.h @@ -143,7 +147,7 @@ install: all ln -sf libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(LIBDIR)/libxlutil.so.$(XLUMAJOR) ln -sf libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(LIBDIR)/libxlutil.so $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(LIBDIR) - $(INSTALL_DATA) libxl.h libxl_json.h _libxl_types.h _libxl_types_json.h libxl_utils.h libxl_uuid.h $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_DATA) libxl.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 .PHONY: clean -- cgit v1.2.3