summaryrefslogtreecommitdiff
path: root/extra/cairo/cairo-1.12.16-lto-optional.patch
blob: 8e3c6186cde4c934fca8252c58cbea07b6f02c9b (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
diff --git a/build/configure.ac.warnings b/build/configure.ac.warnings
index f984eb2..15b3da2 100644
--- a/build/configure.ac.warnings
+++ b/build/configure.ac.warnings
@@ -38,13 +38,18 @@ dnl options.  Namely, the following:
 
 dnl -flto working really needs a test link, not just a compile
 
-safe_MAYBE_WARN="$MAYBE_WARN"
-MAYBE_WARN="$MAYBE_WARN -flto"
-AC_TRY_LINK([],[
+AC_ARG_ENABLE(lto,
+  AS_HELP_STRING([--disable-lto],
+                 [Do not try to use Link-Time Optimization]))
+if test "x$enable_lto" != "xno"; then
+  safe_MAYBE_WARN="$MAYBE_WARN"
+  MAYBE_WARN="$MAYBE_WARN -flto"
+  AC_TRY_LINK([],[
 	int main(int argc, char **argv) { return 0; }
-],[],[
+  ],[],[
 	MAYBE_WARN="$safe_MAYBE_WARN"
-])
+  ])
+fi
 
 MAYBE_WARN="$MAYBE_WARN -fno-strict-aliasing -fno-common"