diff mbox series

[v4,30/31] tools/libs: add option for library names not starting with libxen

Message ID 20200828150747.25305-31-jgross@suse.com (mailing list archive)
State Superseded
Headers show
Series tools: move most libraries into tools/libs | expand

Commit Message

Jürgen Groß Aug. 28, 2020, 3:07 p.m. UTC
libxlutil doesn't follow the standard name pattern of all other Xen
libraries, so add another make variable which can be used to allow
other names.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/Rules.mk     |  3 ++-
 tools/libs/libs.mk | 41 +++++++++++++++++++++--------------------
 2 files changed, 23 insertions(+), 21 deletions(-)

Comments

Wei Liu Aug. 28, 2020, 4 p.m. UTC | #1
On Fri, Aug 28, 2020 at 05:07:46PM +0200, Juergen Gross wrote:
> libxlutil doesn't follow the standard name pattern of all other Xen
> libraries, so add another make variable which can be used to allow
> other names.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Is this still needed?

Wei.
Jürgen Groß Aug. 29, 2020, 4:38 a.m. UTC | #2
On 28.08.20 18:00, Wei Liu wrote:
> On Fri, Aug 28, 2020 at 05:07:46PM +0200, Juergen Gross wrote:
>> libxlutil doesn't follow the standard name pattern of all other Xen
>> libraries, so add another make variable which can be used to allow
>> other names.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Is this still needed?

Yes. Its for the installed files, as those need to stay as they are
today.


Juergen
Wei Liu Oct. 1, 2020, 10:46 a.m. UTC | #3
On Sat, Aug 29, 2020 at 06:38:40AM +0200, Jürgen Groß wrote:
> On 28.08.20 18:00, Wei Liu wrote:
> > On Fri, Aug 28, 2020 at 05:07:46PM +0200, Juergen Gross wrote:
> > > libxlutil doesn't follow the standard name pattern of all other Xen
> > > libraries, so add another make variable which can be used to allow
> > > other names.
> > > 
> > > Signed-off-by: Juergen Gross <jgross@suse.com>
> > 
> > Is this still needed?
> 
> Yes. Its for the installed files, as those need to stay as they are
> today.

Acked-by: Wei Liu <wl@xen.org>
diff mbox series

Patch

diff --git a/tools/Rules.mk b/tools/Rules.mk
index 9b9db62fe5..5ad17b313b 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -87,10 +87,11 @@  endif
 # $(SHLIB_libfoo)
 
 define LIB_defs =
+ FILENAME_$(1) ?= xen$(1)
  XEN_libxen$(1) = $$(XEN_ROOT)/tools/libs/$(1)
  CFLAGS_libxen$(1) = -I$$(XEN_libxen$(1))/include $$(CFLAGS_xeninclude)
  SHDEPS_libxen$(1) = $$(foreach use,$$(USELIBS_$(1)),$$(SHLIB_libxen$$(use)))
- LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/libxen$(1)$$(libextension)
+ LDLIBS_libxen$(1) = $$(SHDEPS_libxen$(1)) $$(XEN_libxen$(1))/lib$$(FILENAME_$(1))$$(libextension)
  SHLIB_libxen$(1) = $$(SHDEPS_libxen$(1)) -Wl,-rpath-link=$$(XEN_libxen$(1))
 endef
 
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index 9d0ed08846..325b7b7cea 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -20,20 +20,21 @@  LDUSELIBS = $(foreach lib, $(USELIBS_$(LIBNAME)), $(LDLIBS_libxen$(lib)))
 LIB_OBJS := $(SRCS-y:.c=.o)
 PIC_OBJS := $(SRCS-y:.c=.opic)
 
-LIB := libxen$(LIBNAME).a
+LIB_FILE_NAME = $(FILENAME_$(LIBNAME))
+LIB := lib$(LIB_FILE_NAME).a
 ifneq ($(nosharedlibs),y)
-LIB += libxen$(LIBNAME).so
+LIB += lib$(LIB_FILE_NAME).so
 endif
 
 comma:= ,
 empty:=
 space:= $(empty) $(empty)
-PKG_CONFIG ?= xen$(LIBNAME).pc
+PKG_CONFIG ?= $(LIB_FILE_NAME).pc
 PKG_CONFIG_NAME ?= Xen$(LIBNAME)
 PKG_CONFIG_DESC ?= The $(PKG_CONFIG_NAME) library for Xen hypervisor
 PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
 PKG_CONFIG_USELIBS := $(SHLIB_libxen$(LIBNAME))
-PKG_CONFIG_LIB := xen$(LIBNAME)
+PKG_CONFIG_LIB := $(LIB_FILE_NAME)
 PKG_CONFIG_REQPRIV := $(subst $(space),$(comma),$(strip $(foreach lib,$(patsubst ctrl,control,$(USELIBS_$(LIBNAME))),xen$(lib))))
 
 ifneq ($(CONFIG_LIBXC_MINIOS),y)
@@ -45,7 +46,7 @@  endif
 
 PKG_CONFIG_LOCAL := $(PKG_CONFIG_DIR)/$(PKG_CONFIG)
 
-LIBHEADER ?= xen$(LIBNAME).h
+LIBHEADER ?= $(LIB_FILE_NAME).h
 LIBHEADERS = $(foreach h, $(LIBHEADER), include/$(h))
 LIBHEADERSGLOB = $(foreach h, $(LIBHEADER), $(XEN_ROOT)/tools/include/$(h))
 
@@ -81,36 +82,36 @@  libxen$(LIBNAME).map:
 $(LIBHEADERSGLOB): $(LIBHEADERS)
 	for i in $(realpath $(LIBHEADERS)); do ln -sf $$i $(XEN_ROOT)/tools/include; done
 
-libxen$(LIBNAME).a: $(LIB_OBJS)
+lib$(LIB_FILE_NAME).a: $(LIB_OBJS)
 	$(AR) rc $@ $^
 
-libxen$(LIBNAME).so: libxen$(LIBNAME).so.$(MAJOR)
+lib$(LIB_FILE_NAME).so: lib$(LIB_FILE_NAME).so.$(MAJOR)
 	$(SYMLINK_SHLIB) $< $@
-libxen$(LIBNAME).so.$(MAJOR): libxen$(LIBNAME).so.$(MAJOR).$(MINOR)
+lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
 	$(SYMLINK_SHLIB) $< $@
 
-libxen$(LIBNAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
-	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxen$(LIBNAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
+lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
+	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
 
 .PHONY: install
 install: build
 	$(INSTALL_DIR) $(DESTDIR)$(libdir)
 	$(INSTALL_DIR) $(DESTDIR)$(includedir)
-	$(INSTALL_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
-	$(INSTALL_DATA) libxen$(LIBNAME).a $(DESTDIR)$(libdir)
-	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR)
-	$(SYMLINK_SHLIB) libxen$(LIBNAME).so.$(MAJOR) $(DESTDIR)$(libdir)/libxen$(LIBNAME).so
+	$(INSTALL_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) lib$(LIB_FILE_NAME).a $(DESTDIR)$(libdir)
+	$(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
+	$(SYMLINK_SHLIB) lib$(LIB_FILE_NAME).so.$(MAJOR) $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
 	for i in $(LIBHEADERS); do $(INSTALL_DATA) $$i $(DESTDIR)$(includedir); done
 	$(INSTALL_DATA) $(PKG_CONFIG) $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: uninstall
 uninstall:
-	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/xen$(LIBNAME).pc
+	rm -f $(DESTDIR)$(PKG_INSTALLDIR)/$(LIB_FILE_NAME).pc
 	for i in $(LIBHEADER); do rm -f $(DESTDIR)$(includedir)/$(LIBHEADER); done
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR)
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).so.$(MAJOR).$(MINOR)
-	rm -f $(DESTDIR)$(libdir)/libxen$(LIBNAME).a
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR)
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
+	rm -f $(DESTDIR)$(libdir)/lib$(LIB_FILE_NAME).a
 
 .PHONY: TAGS
 TAGS:
@@ -119,7 +120,7 @@  TAGS:
 .PHONY: clean
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
-	rm -f libxen$(LIBNAME).so.$(MAJOR).$(MINOR) libxen$(LIBNAME).so.$(MAJOR)
+	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
 	rm -f headers.chk
 	rm -f $(PKG_CONFIG)
 	rm -f $(LIBHEADERSGLOB)