Commit d71f5b06 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make sure we use the correct compiler flags with clang when a given architecture is detected.

parent b4ee1bf7
......@@ -146,6 +146,23 @@ if test "$ac_test_CFLAGS" != "set"; then
fi
;;
clang)
# default optimization flags for clang on all systems
CFLAGS="-O3 -fomit-frame-pointer"
# -malign-double for x86 systems
AX_CHECK_COMPILE_FLAG(-malign-double, CFLAGS="$CFLAGS -malign-double")
AX_CHECK_COMPILE_FLAG(-fstrict-aliasing, CFLAGS="$CFLAGS -fstrict-aliasing")
# note that we enable "unsafe" fp optimization with other compilers, too
AX_CHECK_COMPILE_FLAG(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
# not all codes will benefit from this.
AX_CHECK_COMPILE_FLAG(-funroll-loops, CFLAGS="$CFLAGS -funroll-loops")
AX_GCC_ARCHFLAG($acx_maxopt_portable)
;;
gnu)
# default optimization flags for gcc on all systems
CFLAGS="-O3 -fomit-frame-pointer"
......@@ -155,7 +172,7 @@ if test "$ac_test_CFLAGS" != "set"; then
# -fstrict-aliasing for gcc-2.95+
AX_CHECK_COMPILE_FLAG(-fstrict-aliasing,
CFLAGS="$CFLAGS -fstrict-aliasing")
CFLAGS="$CFLAGS -fstrict-aliasing")
# note that we enable "unsafe" fp optimization with other compilers, too
AX_CHECK_COMPILE_FLAG(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment