aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorwsnipex <wsnipex@a1.net>2016-10-19 15:00:20 +0200
committerwsnipex <wsnipex@a1.net>2016-10-20 11:48:56 +0200
commitced6a816f5cbd5df72c76488e63fdff68dc30e48 (patch)
treef5ea128b10d3a06375d849b6aea45af4ada3683e /tools
parentf4cb6526fd08a404f9a2d6fbac7f5a89657d0633 (diff)
[depends] add --enable-debug switch to configure
Diffstat (limited to 'tools')
-rw-r--r--tools/depends/configure.ac29
1 files changed, 25 insertions, 4 deletions
diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
index f6f9fc3682..a0bc386284 100644
--- a/tools/depends/configure.ac
+++ b/tools/depends/configure.ac
@@ -5,9 +5,18 @@ AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_FILES([target/config.site native/config.site.native Makefile.include target/Toolchain.cmake
target/config-binaddons.site target/Toolchain_binaddons.cmake])
AC_CANONICAL_HOST
+
+# save flags before autotools checks the compiler, since
+# it will automatically include -g in c/cxxflags
+passed_cflags="$CFLAGS"
+passed_ldflags="$LDFLAGS"
+passed_cxxflags="$CXXFLAGS"
+
m4_include([../../m4/xbmc_arch.m4])
m4_include([../../m4/ax_cxx_compile_stdcxx_11.m4])
-AX_CXX_COMPILE_STDCXX_11(,[optional])
+AX_CXX_COMPILE_STDCXX_11(,[mandatory])
+c11_flags="$CFLAGS"
+cxx11_flags="$CXXFLAGS"
# check for not same cpu value
AC_DEFUN([MC_CHECK_NOT_CPU],
@@ -22,6 +31,12 @@ AC_DEFUN([MC_CHECK_NOT_CPU],
esac
])
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [enable debugging information (default is yes)])],
+ [use_debug=$enableval],
+ [use_debug=yes])
+
AC_ARG_WITH([toolchain],
[AS_HELP_STRING([--with-toolchain],
[specify path to toolchain. Required for android. Defaults to xcode root for darwin, /usr for linux])],
@@ -101,9 +116,6 @@ deps_dir=$use_host
tool_dir=$build_cpu-$build_os-native
cross_compiling="yes"
-passed_cflags="$CFLAGS"
-passed_ldflags="$LDFLAGS"
-passed_cxxflags="$CXXFLAGS"
platform_cc=gcc
platform_cxx=g++
@@ -568,6 +580,15 @@ if test "$platform_os" == "android"; then
fi
fi
+if test "$use_debug" = "yes"; then
+ DEBUG_FLAGS="-g -D_DEBUG"
+else
+ DEBUG_FLAGS="-DNDEBUG=1"
+fi
+platform_cflags+="$c11_flags $DEBUG_FLAGS"
+platform_cxxflags+="$cxx11_flags $DEBUG_FLAGS"
+
+
if test "$platform_os" == "android"; then
echo -e
AC_SUBST(use_sdk_path)