summaryrefslogtreecommitdiff
blob: d4688b84d2efe526f9dc2717f2015294764196bf (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
From 58fe40daf3e082d9e63d689d795a3bbecf72fedb Mon Sep 17 00:00:00 2001
From: Joseph Benden <joe@benden.us>
Date: Mon, 16 Apr 2018 11:26:23 -0700
Subject: [PATCH] autotools: The flag --without-opt should skip stack protector
 flags. (#1864)

---
 build/m4/aircrack_ng_compiler.m4 | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/build/m4/aircrack_ng_compiler.m4 b/build/m4/aircrack_ng_compiler.m4
index 0fb19726..8a973dbf 100644
--- a/build/m4/aircrack_ng_compiler.m4
+++ b/build/m4/aircrack_ng_compiler.m4
@@ -108,19 +108,23 @@ case "$ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor" in
             CYGWIN*|MSYS*|cygwin*|msys*)
                 ;;
             *)
-                AS_IF([test "x$gcc_over49" = "xno"], [
-                    AS_IF([test "x$gcc_over41" = "xyes"], [
-                        AX_CHECK_COMPILE_FLAG([-fstack-protector], [
-                            AX_APPEND_FLAG(-fstack-protector, [opt_[]_AC_LANG_ABBREV[]flags])
-                        ])
-                    ], [])
-                ], [])
+                case $with_opt in
+                    yes | "")
+                        AS_IF([test "x$gcc_over49" = "xno"], [
+                            AS_IF([test "x$gcc_over41" = "xyes"], [
+                                AX_CHECK_COMPILE_FLAG([-fstack-protector], [
+                                    AX_APPEND_FLAG(-fstack-protector, [opt_[]_AC_LANG_ABBREV[]flags])
+                                ])
+                            ], [])
+                        ], [])
 
-                AS_IF([test "x$gcc_over49" = "xyes"], [
-                    AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [
-                        AX_APPEND_FLAG(-fstack-protector-strong, [opt_[]_AC_LANG_ABBREV[]flags])
-                    ])
-                ], [])
+                        AS_IF([test "x$gcc_over49" = "xyes"], [
+                            AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [
+                                AX_APPEND_FLAG(-fstack-protector-strong, [opt_[]_AC_LANG_ABBREV[]flags])
+                            ])
+                        ], [])
+                        ;;
+                esac
                 ;;
         esac
         ;;