blob: cfdfb4ac8a11e5ca3d56c804667518ae112ec731 (
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
|
From 2933af2d8a986430a4fcf2ab4d577e5bb049662a Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Fri, 2 Feb 2024 18:14:59 -0500
Subject: [PATCH] cnf/gac.in: respect $CC and $CXX if they're non-null
This allows the user to override the stored C and C++ compilers
(typically obtained from sysinfo.gap) if desired. This is especially
useful on rolling release and/or source-based distributions where the
"current" compiler can change frequently and without user interaction.
Closes: https://github.com/gap-system/gap/issues/5606
---
cnf/gac.in | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/cnf/gac.in b/cnf/gac.in
index 1faafba820..3a9fc6eb16 100644
--- a/cnf/gac.in
+++ b/cnf/gac.in
@@ -63,6 +63,22 @@ GAP_CFLAGS="${GAP_CFLAGS} ${GAC_CFLAGS}"
GAP_CXXFLAGS="${GAP_CXXFLAGS} ${GAC_CFLAGS}"
GAP_LDFLAGS="${GAP_LDFLAGS} ${GAC_LDFLAGS}"
+# Using the stored C/C++ compilers from sysinfo.gap is sometimes
+# undesirable. For example, if the compiler suite is upgraded or
+# downgraded, the particular executable used to build GAP itself may
+# no longer exist. The CC and CXX environment variables provide a
+# somewhat standard way for the user to indicate which compilers he
+# would like to use. So if those are set, we prefer them to the stored
+# values. This allows people who know what they are doing to override
+# the default behavior, while keeping the defaults safe for normal
+# people.
+if test -n "${CC}"; then
+ c_compiler="${CC}"
+ c_dyn_linker="${CC}"
+fi
+if test -n "${CXX}"; then
+ cxx_compiler="${CXX}"
+fi
# is output going to a terminal?
if test -t 1 && command -v tput >/dev/null 2>&1 ; then
|