build/autoconf/frameptr.m4
author David Zbarsky <dzbarsky@gmail.com>
Sun, 23 Dec 2012 03:22:22 -0500
changeset 126045 9f3051733fec0917d7d4bc30e4a8e7aaca4d7362
parent 98529 f4157e8c410708d76703f19e4dfb61859bfe32d8
child 144931 ad98a8e66316577a9af9b59f3c9c615b9d6bc27d
permissions -rw-r--r--
Bug 823394 Part 1:Merge nsSVGStylableElement/nsSVGElement and nsIDOMSVGStylable/nsIDOMSVGElement r=bz

dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.

dnl Set MOZ_FRAMEPTR_FLAGS to the flags that should be used for enabling or
dnl disabling frame pointers in this architecture based on the configure
dnl options

AC_DEFUN([MOZ_SET_FRAMEPTR_FLAGS], [
  case "$target" in
  *android*)
    unwind_tables="-funwind-tables"
    ;;
  esac
  if test "$GNU_CC"; then
    MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer $unwind_tables"
    MOZ_DISABLE_FRAME_PTR="-fomit-frame-pointer"
  else
    case "$target" in
    *-mingw*)
      MOZ_ENABLE_FRAME_PTR="-Oy-"
      MOZ_DISABLE_FRAME_PTR="-Oy"
    ;;
    esac
  fi

  # if we are debugging or profiling, we want a frame pointer.
  if test -z "$MOZ_OPTIMIZE" -o \
          -n "$MOZ_PROFILING" -o -n "$MOZ_DEBUG"; then
    MOZ_FRAMEPTR_FLAGS="$MOZ_ENABLE_FRAME_PTR"
  else
    MOZ_FRAMEPTR_FLAGS="$MOZ_DISABLE_FRAME_PTR"
  fi
])