-dnl temporary set the CFLAGS for configure tests (e.g. inline keyword)
-dnl we set it properly at the end of this file
+dnl Set optimization and debugging for all architectures and systems.
+dnl NOTE: Setting the CFLAGS/CXXFLAGS only works before calling AC_PROG_CC/AC_PROG_CXX.
+if test x"$CFLAGS" = "x"; then
+ OPT_CFLAGS="-g -O0"
+else
+ OPT_CFLAGS=$CFLAGS
+fi
+
+if test x"$CXXFLAGS" = "x"; then
+ OPT_CXXFLAGS="-g -O0"
+else
+ OPT_CXXFLAGS=$CXXFLAGS
+fi
+
+dnl Check for compiler.
+AC_PROG_CC
+AC_PROG_CXX
+
+dnl Check compiler vendor.
+AX_COMPILER_VENDOR
+
+dnl Set compiler flags depending on the compiler vendor.
+case "$ax_cv_c_compiler_vendor" in
+gnu )
+ CC_FLAGS="-std=c99 -pedantic -Wall -Wno-long-long $CC_FLAGS"
+ CXX_FLAGS="-std=c++98 -pedantic -Wall -Wno-long-long $CXX_FLAGS"
+ ;;
+
+sun )
+ CC_FLAGS="-xc99 $CC_FLAGS"
+ CXX_FLAGS="$CXX_FLAGS"
+ ;;
+
+* )
+ AC_MSG_ERROR([$ax_cv_c_compiler_vendor compilers are currently not supported.])
+ ;;
+esac
+
+dnl Temporary set the CFLAGS for configure tests (e.g. inline keyword)
+dnl we set it properly at the end of this file.