summaryrefslogtreecommitdiff
blob: 70dd46a113f2f5c203c5147f94747477a2d04de7 (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
From c6a2f41369bb4549bfaadf1120ccacd884b0b70f Mon Sep 17 00:00:00 2001
From: Conrad Kostecki <ck@bl4ckb0x.de>
Date: Sun, 22 Nov 2020 00:55:36 +0100
Subject: [PATCH] Add support for setting AR

By default, the command 'ar' is called. Is should be possible, as with
'CC', to override that value and set an own AR.

Signed-off-by: Conrad Kostecki <conrad@kostecki.com>
---
 configure       | 11 +++++++++++
 src/Makefile.in |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 1b85d113..78535332 100755
--- a/configure
+++ b/configure
@@ -146,6 +146,7 @@ generate_stdout()
 	echo "           SRC_DIR = $BUILD_DIR"
 	echo "            SYSTEM = $SYSTEM"
 	echo "           PROFILE = $PROFILE"
+	echo "                AR = $AR"
 	echo "                CC = $CC"
 	echo "          COMPILER = $COMPILER"
 	echo "            CFLAGS = $CFLAGS"
@@ -215,6 +216,7 @@ for option; do
 		echo "  --cores=N                Specify number of cores available on target machine"
 		echo
 		echo "The following environment variables may be used:"
+		echo "   AR       AR archiver command"
 		echo "   CC       C compiler command"
 		echo "   CFLAGS   C compiler flags"
 		echo "   LDFLAGS  Linker flags"
@@ -645,6 +647,15 @@ if test ! -x "${CC}"; then
 fi
 assert "$CC" "not found"
 
+printf "Finding suitable archiver........"
+if test ! -x "${AR}"; then
+	AR=`pathsearch "${AR:-ar}"`
+	if test -z "$AR" -o ! -x "$AR"; then
+		AR=`pathsearch "${AR:-ar}"`
+	fi
+fi
+assert "$AR" "not found"
+
 cat << EOF > .1.c
 #include <stdio.h>
 int main(void) {
diff --git a/src/Makefile.in b/src/Makefile.in
index 0b7ae7b6..73788497 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -25,7 +25,7 @@ libck.so: $(OBJECTS)
 	$(LD) $(LDFLAGS) -o $(TARGET_DIR)/libck.so $(OBJECTS)
 
 libck.a: $(OBJECTS)
-	ar rcs $(TARGET_DIR)/libck.a $(OBJECTS)
+	$(AR) rcs $(TARGET_DIR)/libck.a $(OBJECTS)
 
 ck_array.o: $(INCLUDE_DIR)/ck_array.h $(SDIR)/ck_array.c
 	$(CC) $(CFLAGS) -c -o $(TARGET_DIR)/ck_array.o $(SDIR)/ck_array.c
From 866c2af332a075cc83af78b184be0d5e6152de13 Mon Sep 17 00:00:00 2001
From: Olivier Houchard <cognet@ci0.org>
Date: Sun, 22 Nov 2020 01:16:10 +0100
Subject: [PATCH] build: Make the lookup for an archiver report success.

Move the code looking for ar outside the compiler checking code, and make
it report success if found.
---
 configure | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 78535332..16a8f64f 100755
--- a/configure
+++ b/configure
@@ -647,15 +647,6 @@ if test ! -x "${CC}"; then
 fi
 assert "$CC" "not found"
 
-printf "Finding suitable archiver........"
-if test ! -x "${AR}"; then
-	AR=`pathsearch "${AR:-ar}"`
-	if test -z "$AR" -o ! -x "$AR"; then
-		AR=`pathsearch "${AR:-ar}"`
-	fi
-fi
-assert "$AR" "not found"
-
 cat << EOF > .1.c
 #include <stdio.h>
 int main(void) {
@@ -736,6 +727,17 @@ else
 	assert "" "unknown compiler"
 fi
 
+printf "Finding suitable archiver........"
+if test ! -x "${AR}"; then
+	AR=`pathsearch "${AR:-ar}"`
+	if test -z "$AR" -o ! -x "$AR"; then
+		AR=`pathsearch "${AR:-ar}"`
+	else
+		echo "success [$AR]"
+	fi
+fi
+assert "$AR" "not found"
+
 printf "Detecting VMA bits..............."
 VMA="unknown"
 if test "$VMA_BITS" = "unknown"; then