[Libreoffice-commits] core.git: config_host.mk.in configure.ac

Luke Deller luke at deller.id.au
Thu Dec 1 16:49:19 UTC 2016


 config_host.mk.in |    1 +
 configure.ac      |   15 +++++++++++++++
 2 files changed, 16 insertions(+)

New commits:
commit d6a1ba29a512aec9b4aa3d0ab4bd6b92aea7fef4
Author: Luke Deller <luke at deller.id.au>
Date:   Wed Jan 14 23:48:36 2015 +1100

    enable optimization (-Og) with --enable-debug
    
    gcc-4.8 introduced a new optimization level -Og which enables
    optimizations that do not interfere with debugging.
    
    When configured with --enable-debug, use -Og rather than -O0
    if available.
    
    Change-Id: Iff3f98d736681ae34e49b96510228a14ce456b34
    Reviewed-on: https://gerrit.libreoffice.org/31333
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index 9bf9d69..9181748 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -244,6 +244,7 @@ export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
 export HAVE_GCC_FNO_INLINE=@HAVE_GCC_FNO_INLINE@
 export HAVE_GCC_FNO_SIZED_DEALLOCATION=@HAVE_GCC_FNO_SIZED_DEALLOCATION@
 export HAVE_GCC_GGDB2=@HAVE_GCC_GGDB2@
+export HAVE_GCC_OG=@HAVE_GCC_OG@
 export HAVE_GCC_PRAGMA_OPERATOR=@HAVE_GCC_PRAGMA_OPERATOR@
 export HAVE_GNUMAKE_FILE_FUNC=@HAVE_GNUMAKE_FILE_FUNC@
 export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
diff --git a/configure.ac b/configure.ac
index 77fefaa1..082b311 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3733,6 +3733,7 @@ fi
 HAVE_GCC_GGDB2=
 HAVE_GCC_FINLINE_LIMIT=
 HAVE_GCC_FNO_INLINE=
+HAVE_GCC_OG=
 if test "$GCC" = "yes"; then
     AC_MSG_CHECKING([whether $CC supports -ggdb2])
     if test -n "$CLANGVER" -a 0"$CLANGVER" -le 30100; then
@@ -3782,10 +3783,24 @@ if test "$GCC" = "yes"; then
     else
         AC_MSG_RESULT([no])
     fi
+
+    AC_MSG_CHECKING([whether $CC supports -Og])
+    # Note that clang-3.1 reports a real error for this option
+    # so we do not need a special case for clang<=3.1 as above.
+    save_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS -Werror -Og"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_OG=TRUE ],[])
+    CFLAGS=$save_CFLAGS
+    if test "$HAVE_GCC_OG" = "TRUE"; then
+        AC_MSG_RESULT([yes])
+    else
+        AC_MSG_RESULT([no])
+    fi
 fi
 AC_SUBST(HAVE_GCC_GGDB2)
 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
 AC_SUBST(HAVE_GCC_FNO_INLINE)
+AC_SUBST(HAVE_GCC_OG)
 
 dnl ===================================================================
 dnl  Test the gcc version


More information about the Libreoffice-commits mailing list