1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/build/autoconf/lto.m4 Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,19 @@ 1.4 +dnl This Source Code Form is subject to the terms of the Mozilla Public 1.5 +dnl License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +dnl check if the build is using lto. This is really primitive and only detects llvm based 1.9 +dnl compilers right now. 1.10 +AC_DEFUN([MOZ_DOING_LTO], 1.11 +[ 1.12 + cat > conftest.c <<EOF 1.13 + int foo = 1; 1.14 +EOF 1.15 + $1=no 1.16 + if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then 1.17 + if grep '^target triple =' conftest.s; then 1.18 + $1=yes 1.19 + fi 1.20 + fi 1.21 + rm -f conftest.[cs] 1.22 +])