blob: 325ffe491fe7ef27e0443ddf38c351eef4dd5244 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From d3b9fc523fc11260ced890c35bc5c9e6391c8656 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 14 Dec 2015 14:19:49 +0200
4Subject: [PATCH] Append the user provided flags to the auto-detected ones.
5
6Upstream-Status: Inappropriate
7Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
9---
10 configure.ac | 14 ++++++++++----
11 1 file changed, 10 insertions(+), 4 deletions(-)
12
13diff --git a/configure.ac b/configure.ac
14index 9cedfeb..87caee5 100644
15--- a/configure.ac
16+++ b/configure.ac
17@@ -1921,8 +1921,12 @@ cclist=$cclist
18 EOF
19
20
21-test_CFLAGS=${CFLAGS+set}
22-test_CPPFLAGS=${CPPFLAGS+set}
23+test_CFLAGS=
24+test_CPPFLAGS=
25+
26+user_CFLAGS=$CFLAGS
27+user_CPPFLAGS=$CPPFLAGS
28+user_CXXFLAGS=$CXXFLAGS
29
30 for abi in $abilist; do
31 abi_last="$abi"
32@@ -2353,7 +2357,7 @@ AC_SUBST(CCAS)
33 # The C++ compiler, if desired.
34 want_cxx=no
35 if test $enable_cxx != no; then
36- test_CXXFLAGS=${CXXFLAGS+set}
37+ test_CXXFLAGS=
38 AC_PROG_CXX
39
40 echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
41@@ -2381,7 +2385,7 @@ if test $enable_cxx != no; then
42 # Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
43 #
44 for cxxflags_choice in $cxxflags_list; do
45- eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
46+ eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice $user_CXXFLAGS\"
47 GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
48 [want_cxx=yes
49 break])
50@@ -2477,6 +2481,8 @@ if test "$enable_assembly" = "no"; then
51 # done
52 fi
53
54+CFLAGS="$CFLAGS $user_CFLAGS"
55+CPPFLAGS="$CPPFLAGS $user_CPPFLAGS"
56
57 cat >&AC_FD_CC <<EOF
58 Decided:
59--
602.6.2
61