From 7c1b1cfef96c32eac3e70ac6d6eba999a6e084f8 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 26 Feb 2019 04:26:21 +0000 Subject: [PATCH] Fix installation of shared vs static libraries Origin: vendor Forwarded: no Last-Update: 2007-09-11 Gbp-Pq: Name 02_libdevdir.patch --- Makefile | 10 +++++++++- src/Makefile | 12 +++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c1fb831..3ebfed0 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,11 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE)) TAG = $(NAME)-$(VERSION) RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm") +DESTDIR= prefix=/usr includedir=$(prefix)/include libdir=$(prefix)/lib +libdevdir=$(libdir) default: all @@ -14,7 +16,13 @@ all: @$(MAKE) -C src install: - @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir) + @$(MAKE) -C src install \ + DESTDIR=$(DESTDIR) \ + prefix=$(prefix) \ + includedir=$(includedir) \ + libdir=$(libdir) \ + libdevdir=$(libdevdir) \ + $(nil) check: @$(MAKE) -C harness check diff --git a/src/Makefile b/src/Makefile index 37ae219..5b393ce 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,8 @@ +DESTDIR= prefix=/usr includedir=$(prefix)/include libdir=$(prefix)/lib +libdevdir=$(libdir) CFLAGS ?= -g -fomit-frame-pointer -O2 CFLAGS += -Wall -I. -fPIC @@ -58,12 +60,12 @@ $(libname): $(libaio_sobjs) libaio.map $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS) install: $(all_targets) - install -D -m 644 libaio.h $(includedir)/libaio.h - install -D -m 644 libaio.a $(libdir)/libaio.a + install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h + install -D -m 644 libaio.a $(DESTDIR)$(libdevdir)/libaio.a ifeq ($(ENABLE_SHARED),1) - install -D -m 755 $(libname) $(libdir)/$(libname) - ln -sf $(libname) $(libdir)/$(soname) - ln -sf $(libname) $(libdir)/libaio.so + install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname) + ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname) + ln -sf $(libname) $(DESTDIR)$(libdevdir)/libaio.so endif $(libaio_objs): libaio.h -- 2.30.2