aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2021-03-11 15:54:16 +0200
committerPetri Savolainen <petri.savolainen@nokia.com>2021-03-18 16:49:33 +0200
commit4e38278d13ab7305554ab5c08296a9385c1cb98d (patch)
treebfdde7960d146c2f83b0f83dd9e28e27c3536a89 /configure.ac
parente49797af6fc00c1c231cb650af7736a35b0e44e9 (diff)
configure: allow user to override *FLAGS
Place user provided options at the end of CFLAGS, CXXFLAGS and LDFLAGS, so that they override other options. This way we also don't have to refrain from using the -march option just because user has provided some CFLAGS. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 5 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 29a839e99..24fb8b8b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,11 +240,10 @@ AC_ARG_ENABLE([abi-compat],
ODP_LIBSO_VERSION=0:0:0
# do not use -march=native with clang (due to possible failures on
- # clang optimizations) or when user have defined CFLAGS (may contain
- # another -march option).
+ # clang optimizations).
$CC --version | grep -q clang
- if test $? -ne 0 -a $user_cflags -eq 0; then
+ if test $? -ne 0; then
ODP_CHECK_CFLAG([-march=native])
fi
fi])
@@ -443,9 +442,9 @@ DX_INIT_DOXYGEN($PACKAGE_NAME,
##########################################################################
# Default include setup
##########################################################################
-CFLAGS="$CFLAGS $ODP_CFLAGS"
-CXXFLAGS="$CXXFLAGS $ODP_CXXFLAGS"
-LDFLAGS="$LDFLAGS $ODP_LTO_FLAGS"
+CFLAGS="$ODP_CFLAGS $CFLAGS"
+CXXFLAGS="$ODP_CXXFLAGS $CXXFLAGS"
+LDFLAGS="$ODP_LTO_FLAGS $LDFLAGS"
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([include/Makefile