Skip to content
Snippets Groups Projects
Commit 5126b8ed authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'autotools-update' into 'master'

Add compiler flags that should show inlined functions when enabling debug

Should work with Intel ICC and GCC.

See merge request !261
parents c19566e0 9e30ee24
No related branches found
No related tags found
1 merge request!261Add compiler flags that should show inlined functions when enabling debug
...@@ -155,6 +155,16 @@ LT_INIT ...@@ -155,6 +155,16 @@ LT_INIT
AC_PROG_CC_C99 AC_PROG_CC_C99
AC_C_INLINE AC_C_INLINE
# If debugging try to show inlined functions.
if test "x$enable_debug" = "xyes"; then
# Show inlined functions.
if test "$ax_cv_c_compiler_vendor" = "gnu"; then
CFLAGS="$CFLAGS -gdwarf -fvar-tracking-assignments"
elif test "$ax_cv_c_compiler_vendor" = "intel"; then
CFLAGS="$CFLAGS -debug inline-debug-info"
fi
fi
# Define HAVE_POSIX_MEMALIGN if it works. # Define HAVE_POSIX_MEMALIGN if it works.
AX_FUNC_POSIX_MEMALIGN AX_FUNC_POSIX_MEMALIGN
...@@ -451,7 +461,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM( ...@@ -451,7 +461,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM(
AC_MSG_RESULT($rtc_ok) AC_MSG_RESULT($rtc_ok)
# Add warning flags by default, if these can be used. Option =error adds # Add warning flags by default, if these can be used. Option =error adds
# -Werror to GCC, clang and Intel. Note do this last as compiler tests may # -Werror to GCC, clang and Intel. Note do this last as compiler tests may
# become errors, if that's an issue don't use CFLAGS for these, use an AC_SUBST(). # become errors, if that's an issue don't use CFLAGS for these, use an AC_SUBST().
AC_ARG_ENABLE([compiler-warnings], AC_ARG_ENABLE([compiler-warnings],
[AS_HELP_STRING([--enable-compiler-warnings], [AS_HELP_STRING([--enable-compiler-warnings],
...@@ -461,7 +471,7 @@ AC_ARG_ENABLE([compiler-warnings], ...@@ -461,7 +471,7 @@ AC_ARG_ENABLE([compiler-warnings],
[enable_warn="error"] [enable_warn="error"]
) )
if test "$enable_warn" != "no"; then if test "$enable_warn" != "no"; then
# AX_CFLAGS_WARN_ALL does not give good warning flags for the Intel compiler # AX_CFLAGS_WARN_ALL does not give good warning flags for the Intel compiler
# We will do this by hand instead and only default to the macro for unknown compilers # We will do this by hand instead and only default to the macro for unknown compilers
case "$ax_cv_c_compiler_vendor" in case "$ax_cv_c_compiler_vendor" in
...@@ -475,7 +485,7 @@ if test "$enable_warn" != "no"; then ...@@ -475,7 +485,7 @@ if test "$enable_warn" != "no"; then
AX_CFLAGS_WARN_ALL AX_CFLAGS_WARN_ALL
;; ;;
esac esac
# Add a "choke on warning" flag if it exists # Add a "choke on warning" flag if it exists
if test "$enable_warn" = "error"; then if test "$enable_warn" = "error"; then
case "$ax_cv_c_compiler_vendor" in case "$ax_cv_c_compiler_vendor" in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment