2008-08-27 20:38:55 +00:00
|
|
|
dnl
|
2010-04-06 12:46:19 +00:00
|
|
|
dnl Debugging, profiling and optimization options
|
2008-08-27 20:38:55 +00:00
|
|
|
dnl
|
2010-08-10 20:27:12 +00:00
|
|
|
|
|
|
|
AC_ARG_ENABLE([debug],
|
2010-04-06 12:46:19 +00:00
|
|
|
AC_HELP_STRING([--enable-debug],[compile with debug information (no)]),
|
2010-08-10 20:27:12 +00:00
|
|
|
[],
|
|
|
|
[enable_debug=no])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([profiling],
|
2010-04-06 12:46:19 +00:00
|
|
|
AC_HELP_STRING([--enable-profiling],[compile with profiling information (no)]),
|
2010-08-10 20:27:12 +00:00
|
|
|
[],
|
|
|
|
[enable_profiling=no])
|
|
|
|
|
2010-08-21 11:53:20 +00:00
|
|
|
AC_ARG_ENABLE([optimization],
|
|
|
|
AC_HELP_STRING([--enable-optimization],[compile with optimization: -O3 (yes)]),
|
|
|
|
[],
|
|
|
|
[if test x"$enable_debug" = xyes ; then
|
|
|
|
enable_optimization=no
|
|
|
|
else
|
|
|
|
enable_optimization=yes
|
|
|
|
fi])
|
|
|
|
|
|
|
|
DEBUG_CFLAGS=""
|
|
|
|
OPTIMIZATION_CFLAGS=""
|
|
|
|
PROFILING_CFLAGS=""
|
|
|
|
PROFILING_LIBS=""
|
|
|
|
|
2010-08-10 20:27:12 +00:00
|
|
|
if test x"$enable_debug" = xyes ; then
|
|
|
|
DEBUG_CFLAGS="-g -DDEBUG"
|
2013-01-15 19:47:09 +00:00
|
|
|
opt_features_yes="$opt_features_yes\n * debugging information"
|
|
|
|
else
|
|
|
|
opt_features_no="$opt_features_no\n * debugging information"
|
2010-08-10 20:27:12 +00:00
|
|
|
fi
|
|
|
|
|
2010-08-21 11:53:20 +00:00
|
|
|
if test x"$enable_optimization" = xyes; then
|
2012-09-02 11:25:57 +00:00
|
|
|
if test x"$ac_cv_compiler_is_clang" = xyes; then
|
|
|
|
opt_features_no="$opt_features_no\n * full optimization: due to bug 11962 in LLVM/clang only -O1 will be used for optimization"
|
2015-02-12 12:33:28 +00:00
|
|
|
opt_features_yes="$opt_features_yes\n * compiler optimizations (-O1)"
|
2012-09-02 11:25:57 +00:00
|
|
|
OPTIMIZATION_CFLAGS="-O1"
|
|
|
|
else
|
|
|
|
OPTIMIZATION_CFLAGS="-O3"
|
2015-02-12 12:33:28 +00:00
|
|
|
opt_features_yes="$opt_features_yes\n * compiler optimizations (-O3)"
|
2012-09-02 11:25:57 +00:00
|
|
|
fi
|
2013-01-15 19:47:09 +00:00
|
|
|
else
|
|
|
|
opt_features_no="$opt_features_no\n * compiler optimizations"
|
2010-08-10 20:27:12 +00:00
|
|
|
fi
|
|
|
|
|
2010-08-16 21:51:52 +00:00
|
|
|
if test x"$enable_profiling" = xyes ; then
|
2010-08-10 20:27:12 +00:00
|
|
|
PROFILING_CFLAGS="-pg"
|
|
|
|
PROFILING_LIBS="-pg"
|
2013-01-15 19:47:09 +00:00
|
|
|
opt_features_yes="$opt_features_yes\n * profiling support"
|
|
|
|
else
|
|
|
|
opt_features_no="$opt_features_no\n * profiling support"
|
2010-08-10 20:27:12 +00:00
|
|
|
fi
|
2008-08-27 20:38:55 +00:00
|
|
|
|
|
|
|
AC_SUBST(DEBUG_CFLAGS)
|
|
|
|
AC_SUBST(PROFILING_CFLAGS)
|
|
|
|
AC_SUBST(PROFILING_LIBS)
|
|
|
|
AC_SUBST(OPTIMIZATION_CFLAGS)
|