Bug 680277 - Add missing file.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Thu, 01 Sep 2011 16:17:50 -0400
changeset 76413 e3626f903f9f03ac2f65922f4613f12e05b0b0c8
parent 76412 11247af82311ed6d6fc2bc19782fc978ee0aca48
child 76414 7ee51f8ea94042c4b5748765539b5dbaae23693d
push idunknown
push userunknown
push dateunknown
bugs680277
milestone9.0a1
Bug 680277 - Add missing file. CLOSED TREE
build/autoconf/frameptr.m4
new file mode 100644
--- /dev/null
+++ b/build/autoconf/frameptr.m4
@@ -0,0 +1,25 @@
+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], [
+  if test "$GNU_CC"; then
+    MOZ_ENABLE_FRAME_PTR="-fno-omit-frame-pointer"
+    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
+])