aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-11-28 11:04:03 +0100
committerLukas Larsson <[email protected]>2018-12-03 14:41:13 +0100
commitcc21219185d7ff90b5d3d09cae896082d7627ea9 (patch)
tree594e7cb32a2ea3627a8cad5d75374fff056316d9
parent892409dd4a517f2a6d75db13384c468519df899f (diff)
downloadotp-cc21219185d7ff90b5d3d09cae896082d7627ea9.tar.gz
otp-cc21219185d7ff90b5d3d09cae896082d7627ea9.tar.bz2
otp-cc21219185d7ff90b5d3d09cae896082d7627ea9.zip
erts: Add check that a -O flag is present in CFLAGS
There have been too many times when users have needed to enable something through CFLAGS but forgotten to add the '-O2 -g' flags.
-rw-r--r--erts/configure.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 4a27b532de..1074aab2c2 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -589,6 +589,17 @@ else
WFLAGS=""
WERRORFLAGS=""
fi
+
+AC_MSG_CHECKING([CFLAGS for -O switch])
+case "$CFLAGS" in
+ *-O*) AC_MSG_RESULT([yes]) ;;
+ *)
+ AC_MSG_ERROR([
+ CFLAGS must contain a -O flag. If you need to edit the CFLAGS you probably
+ also want to add the default CFLAGS. The default CFLAGS are "-O2 -g".
+ If you want to build erts without any optimization, pass -O0 to CFLAGS.]) ;;
+esac
+
dnl DEBUG_FLAGS is obsolete (I hope)
AC_SUBST(DEBUG_FLAGS)
AC_SUBST(DEBUG_CFLAGS)