build/autoconf/lto.m4
author Matheus Kerschbaum <matjk7@gmail.com>
Sat, 05 Nov 2011 10:32:52 +0000
changeset 81191 8248dbffd64534fb6c65ad3d757b795119e783c6
parent 74938 f95d2c738d5254cfd16fae4b8115478b2138b0af
child 98529 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Bug 698630 - Remove --disable-smil build option; r=dholbert

dnl check if the build is using lto. This is really primitive and only detects llvm based
dnl compilers right now.
AC_DEFUN([MOZ_DOING_LTO],
[
  cat > conftest.c <<EOF
                  int foo = 1;
EOF
  $1=no
  if ${CC-cc} ${CFLAGS} -S conftest.c -o conftest.s >/dev/null 2>&1; then
    if grep '^target triple =' conftest.s; then
      $1=yes
    fi
  fi
  rm -f conftest.[cs]
])