Skip to content

Commit

Permalink
Cleanup: only use gcc-specific flags if gcc is used to compile Calf.
Browse files Browse the repository at this point in the history
  • Loading branch information
kfoltman committed Aug 2, 2019
1 parent a64edc8 commit 55150be
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions configure.ac
Expand Up @@ -15,6 +15,7 @@ if test "x$prefix" = "xNONE"; then
fi

# Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL

############################################################################################
Expand Down Expand Up @@ -150,6 +151,14 @@ AC_ARG_ENABLE(sse,
[set_enable_sse="no"])
AC_MSG_RESULT($set_enable_sse)

AC_MSG_CHECKING([whether the C++ compiler is gcc])
if $CXX -v 2>&1 | grep -q 'gcc version'; then
is_compiler_gcc="yes"
else
is_compiler_gcc="no"
fi
AC_MSG_RESULT($is_compiler_gcc)

############################################################################################
# Compute status shell variables

Expand All @@ -164,8 +173,11 @@ fi
if test "$set_enable_debug" = "yes"; then
CXXFLAGS="$CXXFLAGS -O0 -g -Wall"
else
# TODO: remove -finline options if clang is used
CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -finline-limit=80 -Wall"
if test "$is_compiler_gcc" = "yes"; then
CXXFLAGS="$CXXFLAGS -O3 -finline-functions -finline-functions-called-once -finline-limit=80 -Wall"
else
CXXFLAGS="$CXXFLAGS -O3 -Wall"
fi
fi

if test "$set_enable_sse" = "yes"; then
Expand Down

0 comments on commit 55150be

Please sign in to comment.