[Xfce4-commits] <garcon:master> Use Xdt macros for debugging and linker optimizations.

Nick Schermer noreply at xfce.org
Tue Mar 22 23:24:01 CET 2011


Updating branch refs/heads/master
         to 47e3e7d7d8db87c3c78655fc33fc2d0bf3a48569 (commit)
       from f00d733785293126176c3a91d361fb8a5b70f113 (commit)

commit 47e3e7d7d8db87c3c78655fc33fc2d0bf3a48569
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Mar 22 23:22:04 2011 +0100

    Use Xdt macros for debugging and linker optimizations.

 configure.in.in |   72 +-----------------------------------------------------
 1 files changed, 2 insertions(+), 70 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 6bd7fc0..89c2fdf 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -123,80 +123,12 @@ GTK_DOC_CHECK([1.0])
 dnl ***********************************
 dnl *** Check for debugging support ***
 dnl ***********************************
-AC_ARG_ENABLE([debug],
-AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@], [Turn on debugging @<:@default=garcon_debug_default@:>@]),
-  [], [enable_debug=garcon_debug_default])
-AC_MSG_CHECKING([whether to enable debugging support])
-if test x"$enable_debug" = x"yes" -o x"$enable_debug" = x"full"; then
-  dnl Print the result
-  AC_MSG_RESULT([$enable_debug])
-
-  dnl Make sure we detect possible errors (if supported)
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -Wall -Werror"
-  AC_MSG_CHECKING([whether $CC accepts -Wall -Werror])
-  AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
-    AC_MSG_RESULT([yes])
-  ], [
-    CFLAGS="$save_CFLAGS"
-    AC_MSG_RESULT([no])
-  ])
-
-  dnl Paranoia for --enable-debug=full
-  if test x"$enable_debug" = x"full"; then
-    dnl Enable extensive debugging
-    CFLAGS="$CFLAGS -DG_ENABLE_DEBUG"
-
-    dnl Use -O0 -g3 if the compiler supports it
-    save_CFLAGS="$CFLAGS"
-    CFLAGS="$CFLAGS -O0 -g3"
-    AC_MSG_CHECKING([whether $CC accepts -O0 -g3])
-    AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
-      AC_MSG_RESULT([yes])
-    ], [
-      CFLAGS="$save_CFLAGS"
-      AC_MSG_RESULT([no])
-    ])
-  fi
-else
-  dnl Print the result
-  AC_MSG_RESULT([$enable_debug])
-
-  dnl Disable debugging (release build)
-  CFLAGS="$CFLAGS -DNDEBUG"
-
-  dnl Disable object cast checks
-  CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS"
-
-  dnl Disable all checks for --enable-debug=no
-  if test x"$enable_debug" = x"no"; then
-    CFLAGS="$CFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
-  fi
-fi
+XDT_FEATURE_DEBUG([garcon_debug_default])
 
 dnl **************************************
 dnl *** Check for linker optimizations ***
 dnl **************************************
-AC_MSG_CHECKING([whether $LD accepts --as-needed])
-case `$LD --as-needed -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  LDFLAGS="$LDFLAGS -Wl,--as-needed"
-  AC_MSG_RESULT([yes])
-  ;;
-*)
-  AC_MSG_RESULT([no])
-  ;;
-esac
-AC_MSG_CHECKING([whether $LD accepts -O1])
-case `$LD -O1 -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  LDFLAGS="$LDFLAGS -Wl,-O1"
-  AC_MSG_RESULT([yes])
-  ;;
-*)
-  AC_MSG_RESULT([no])
-  ;;
-esac
+XDT_FEATURE_LINKER_OPTS()
 
 AC_OUTPUT([
 Makefile



More information about the Xfce4-commits mailing list