summaryrefslogtreecommitdiff
path: root/extra/cairo/cairo-1.12.16-lto-optional.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extra/cairo/cairo-1.12.16-lto-optional.patch')
-rw-r--r--extra/cairo/cairo-1.12.16-lto-optional.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/extra/cairo/cairo-1.12.16-lto-optional.patch b/extra/cairo/cairo-1.12.16-lto-optional.patch
new file mode 100644
index 000000000..8e3c6186c
--- /dev/null
+++ b/extra/cairo/cairo-1.12.16-lto-optional.patch
@@ -0,0 +1,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"
+
+