mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
Currently shared libraries are automatically installed into /usr/lib or /usr/lib64, depending on the supplied --prefix value and $(XEN_TARGET_ARCH). Some systems, like recent Debian and Ubuntu releases, do not use /usr/lib64, but instead /usr/lib/x86_64-linux-gnu. With this change, packagers can supply the desired location for shared libraries on the ./configure command line. Packagers need to note that the default behaviour on 64-bit Linux systems will be to install shared libraries in /usr/lib, not /usr/lib64, unless a --libdir value is provided to ./configure. Additionally, the libfsimage plugins are now loaded explicitly from $LIBDIR/fs, removing platform-based decision trees in code. Signed-off-by: Matt Wilson <msw@amazon.com> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- resolve rejects in configure by rerunning autogen.sh. Dropped changes to remove m4/default_lib.m4 and update m4/pkg.m4 since they cause LIBDIR=/lib instead of /usr/lib. Reran ./autogen.sh after that too ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
47 lines
1.3 KiB
Makefile
47 lines
1.3 KiB
Makefile
XEN_ROOT = $(CURDIR)/../../..
|
|
include $(XEN_ROOT)/tools/libfsimage/Rules.mk
|
|
|
|
MAJOR = 1.0
|
|
MINOR = 0
|
|
|
|
LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
|
|
LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
|
|
LDFLAGS = $(LDFLAGS-y)
|
|
|
|
CFLAGS += $(PTHREAD_CFLAGS)
|
|
LDFLAGS += $(PTHREAD_LDFLAGS)
|
|
|
|
LIB_SRCS-y = fsimage.c fsimage_plugin.c fsimage_grub.c
|
|
|
|
PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
|
|
|
|
LIB = libfsimage.so libfsimage.so.$(MAJOR) libfsimage.so.$(MAJOR).$(MINOR)
|
|
|
|
.PHONY: all
|
|
all: $(LIB)
|
|
|
|
.PHONY: install
|
|
install: all
|
|
$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
|
|
$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
|
|
$(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
|
|
ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libfsimage.so.$(MAJOR)
|
|
ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libfsimage.so
|
|
$(INSTALL_DATA) fsimage.h $(DESTDIR)$(INCLUDEDIR)
|
|
$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(INCLUDEDIR)
|
|
$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
clean distclean:
|
|
rm -f $(PIC_OBJS) $(LIB) $(DEPS)
|
|
|
|
libfsimage.so: libfsimage.so.$(MAJOR)
|
|
ln -sf $< $@
|
|
libfsimage.so.$(MAJOR): libfsimage.so.$(MAJOR).$(MINOR)
|
|
ln -sf $< $@
|
|
|
|
libfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
|
|
$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS)
|
|
|
|
-include $(DEPS)
|
|
|