summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-12 15:32:18 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-12 17:12:22 +0300
commitcccd6d9d04e755aa8194ef86d27405021d5a8f4e (patch)
tree2404c4df86177abf68ff43e301e147f7135242b4
parent302aefbd150bd5c26bfd4a0c51f74bbec9c843a3 (diff)
downloadhercules-cccd6d9d04e755aa8194ef86d27405021d5a8f4e.tar.gz
hercules-cccd6d9d04e755aa8194ef86d27405021d5a8f4e.tar.bz2
hercules-cccd6d9d04e755aa8194ef86d27405021d5a8f4e.tar.xz
hercules-cccd6d9d04e755aa8194ef86d27405021d5a8f4e.zip
Add omit frame pointer flag if debug flag enabled.
-rwxr-xr-xconfigure31
-rw-r--r--configure.ac28
2 files changed, 58 insertions, 1 deletions
diff --git a/configure b/configure
index 12860c38d..9b721dec4 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac 6a3c3cc.
+# From configure.ac 302aefb.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@@ -5194,6 +5194,8 @@ fi
+
+
#
# sanitize Support test
#
@@ -6064,6 +6066,33 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fno-omit-frame-pointer" >&5
+$as_echo_n "checking whether $CC supports -fno-omit-frame-pointer... " >&6; }
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fno-omit-frame-pointer"
+ OLD_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -fno-omit-frame-pointer"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
fi
fi
diff --git a/configure.ac b/configure.ac
index 0a86ffb58..e88834722 100644
--- a/configure.ac
+++ b/configure.ac
@@ -789,6 +789,32 @@ AC_DEFUN([AC_CHECK_SANITIZER_FLAG],
]
)
+AC_DEFUN([AC_CHECK_FLAG],
+ [
+ AC_MSG_CHECKING([whether $CC supports $1])
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ OLD_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $1"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([int foo;])],
+ [
+ AC_MSG_RESULT([yes])
+ ],
+ [
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+ ],
+ [
+ AC_MSG_RESULT([guessing no])
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+ ]
+ )
+ ]
+)
+
#
# sanitize Support test
#
@@ -1198,10 +1224,12 @@ case $enable_debug in
"yes")
CFLAGS="$CFLAGS -g"
CPPFLAGS="$CPPFLAGS -DDEBUG"
+ AC_CHECK_FLAG(-fno-omit-frame-pointer)
;;
"gdb")
CFLAGS="$CFLAGS -ggdb"
CPPFLAGS="$CPPFLAGS -DDEBUG"
+ AC_CHECK_FLAG(-fno-omit-frame-pointer)
;;
esac