recipes: Preserve warnings flags appending the C flags in some (specific) recipes
[dragora.git] / patches / libaio / 0009-build-Fix-DESTDIR-handling.patch
blobfed806c979e5928abacf6097cec124d64635165e
1 From d4ec369c6457cca55db5297701ddd5d9d3ff5ae0 Mon Sep 17 00:00:00 2001
2 From: Guillem Jover <guillem@hadrons.org>
3 Date: Sun, 12 Apr 2020 03:58:12 +0200
4 Subject: [PATCH libaio 09/11] build: Fix DESTDIR handling
6 The convention for DESTDIR is that it is only prefixed during the
7 install target. In this case we postpone that to the inner Makefile
8 so that it can be invoked directly while preserving the expected
9 semantics.
11 Signed-off-by: Guillem Jover <guillem@hadrons.org>
12 ---
13 Makefile | 8 +++++++-
14 src/Makefile | 11 ++++++-----
15 2 files changed, 13 insertions(+), 6 deletions(-)
17 diff --git a/Makefile b/Makefile
18 index c1fb831..e48b520 100644
19 --- a/Makefile
20 +++ b/Makefile
21 @@ -4,6 +4,7 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
22 TAG = $(NAME)-$(VERSION)
23 RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
25 +DESTDIR=
26 prefix=/usr
27 includedir=$(prefix)/include
28 libdir=$(prefix)/lib
29 @@ -14,7 +15,12 @@ all:
30 @$(MAKE) -C src
32 install:
33 - @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
34 + @$(MAKE) -C src install \
35 + DESTDIR=$(DESTDIR) \
36 + prefix=$(prefix) \
37 + includedir=$(includedir) \
38 + libdir=$(libdir) \
39 + $(nil)
41 check:
42 @$(MAKE) -C harness check
43 diff --git a/src/Makefile b/src/Makefile
44 index 37ae219..a53c43c 100644
45 --- a/src/Makefile
46 +++ b/src/Makefile
47 @@ -1,3 +1,4 @@
48 +DESTDIR=
49 prefix=/usr
50 includedir=$(prefix)/include
51 libdir=$(prefix)/lib
52 @@ -58,12 +59,12 @@ $(libname): $(libaio_sobjs) libaio.map
53 $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
55 install: $(all_targets)
56 - install -D -m 644 libaio.h $(includedir)/libaio.h
57 - install -D -m 644 libaio.a $(libdir)/libaio.a
58 + install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
59 + install -D -m 644 libaio.a $(DESTDIR)$(libdir)/libaio.a
60 ifeq ($(ENABLE_SHARED),1)
61 - install -D -m 755 $(libname) $(libdir)/$(libname)
62 - ln -sf $(libname) $(libdir)/$(soname)
63 - ln -sf $(libname) $(libdir)/libaio.so
64 + install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
65 + ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname)
66 + ln -sf $(libname) $(DESTDIR)$(libdir)/libaio.so
67 endif
69 $(libaio_objs): libaio.h
70 --
71 2.26.0.292.g33ef6b2f38