aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0001-fix-Makefile-so-make-install-works-before-include-bi.patch
blob: c34d8c31d5d7a33108b510b72551c5d472159487 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 997d58d8052fb9f8374afd2fb456785f53217f50 Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Mon, 1 Jul 2013 13:43:43 -0400
Subject: [PATCH 01/10] fix Makefile so "make install" works before
 include/bits symlink exists

previously, determination of the list of header files for installation
depended on the include/bits symlink (to the arch-specific files)
already having been created. in other words, running "make install"
immediately after configure without first running "make" caused the
bits headers not to be installed.

the solution I have applied is to pull the list of headers directly
from arch/$(ARCH)/bits rather than include/bits, and likewise to
install directly from arch/$(ARCH)/bits rather than via the symlink.

at this point, the only purpose served by keeping the symlink around
is that it enables use of the in-tree headers and libs directly via -I
and -L, which can be useful when testing against a new version of the
library before installing it. on the other hand, removing the bits
symlink would be beneficial if we ever want to support building
multiple archs in the same source tree.
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 997c5bb..6a86211 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,8 @@ CFLAGS_ALL_SHARED = $(CFLAGS_ALL) -fPIC -DSHARED
 AR      = $(CROSS_COMPILE)ar
 RANLIB  = $(CROSS_COMPILE)ranlib
 
-ALL_INCLUDES = $(sort $(wildcard include/*.h include/*/*.h) $(GENH))
+ARCH_INCLUDES = $(wildcard arch/$(ARCH)/bits/*.h)
+ALL_INCLUDES = $(sort $(wildcard include/*.h include/*/*.h) $(GENH) $(ARCH_INCLUDES:arch/$(ARCH)/%=include/%))
 
 EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
 EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
@@ -124,6 +125,9 @@ $(DESTDIR)$(libdir)/%.so: lib/%.so
 $(DESTDIR)$(libdir)/%: lib/%
 	install -D -m 644 $< $@
 
+$(DESTDIR)$(includedir)/bits/%: arch/$(ARCH)/bits/%
+	install -D -m 644 $< $@
+
 $(DESTDIR)$(includedir)/%: include/%
 	install -D -m 644 $< $@
 
-- 
1.8.3.2