3 # Check if the user has requested a debug build.
4 # Sets the DEBUG or NDEBUG variables as appropriate
8 AC_MSG_CHECKING([build target type])
10 AC_ARG_ENABLE([debug],
11 [ --enable-debug build a debug version default=no],
12 [DEBUG=$enableval],[])
14 # cvs builds are always debug
15 test "${VERSION%*cvs}" != "$VERSION" && DEBUG="yes"
17 if test "$DEBUG" = "yes"; then
18 AC_MSG_RESULT([DEBUG])
19 AC_DEFINE([DEBUG], [1], [Creating a debug build])
21 AC_MSG_RESULT([RELEASE])
22 AC_DEFINE([NDEBUG], [1], [Creating a release build])
29 # Check what compiler is being used for compilation.
30 # It sets the CXXFLAGS variable appropriately for the compiler, including flags
32 AC_DEFUN([OB_COMPILER_FLAGS],
34 AC_REQUIRE([AC_PROG_CXXCPP])
35 AC_REQUIRE([AC_PROG_CXX])
39 # Check what compiler we are using
40 AC_MSG_CHECKING([for GNU C++])
41 if test "$GXX" = "yes"; then
45 test "$DEBUG" = "yes" && FLAGS="$FLAGS -g -fno-inline"
47 AC_MSG_RESULT([no, trying other compilers])
48 AC_MSG_CHECKING(for MIPSpro)
49 mips_pro_ver=`$CXX -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
50 if test -z "$mips_pro_ver"; then
53 AC_MSG_RESULT([yes, version $mips_pro_ver.])
54 AC_MSG_CHECKING(for -LANG:std in CXXFLAGS)
55 lang_std_not_set=`echo $CXXFLAGS | grep "\-LANG:std"`
56 if test "x$lang_std_not_set" = "x"; then
57 AC_MSG_RESULT([not set, setting.])
60 AC_MSG_RESULT([already set.])
64 AC_MSG_CHECKING([for compiler specific flags])
65 AC_MSG_RESULT([$FLAGS])
66 CXXFLAGS="$CXXFLAGS $FLAGS"