summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-03-26 22:05:21 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-03-26 22:05:21 +0000
commit1053bcd3c1bf402654645f34252db51a781b5af2 (patch)
tree4e9c153e2b2051f920eef1790c7f0dfc00adccfa
parent34508fc3cdd73ddb7a9532e434af4a561404507f (diff)
downloadnetsurf-1053bcd3c1bf402654645f34252db51a781b5af2.tar.gz
netsurf-1053bcd3c1bf402654645f34252db51a781b5af2.tar.bz2
Makefile: Add STMTEXPR detection for wapcaplet
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index f8b5e9ca4..ae1325fb9 100644
--- a/Makefile
+++ b/Makefile
@@ -600,6 +600,13 @@ CXXFLAGS += -DNETSURF_BUILTIN_LOG_FILTER=\"$(NETSURF_BUILTIN_LOG_FILTER)\"
CFLAGS += -DNETSURF_BUILTIN_VERBOSE_FILTER=\"$(NETSURF_BUILTIN_VERBOSE_FILTER)\"
CXXFLAGS += -DNETSURF_BUILTIN_VERBOSE_FILTER=\"$(NETSURF_BUILTIN_VERBOSE_FILTER)\"
+# Determine if the C compiler supports statement expressions
+# This is needed to permit certain optimisations in our library headers
+ifneq ($(shell $(CC) -dM -E - < /dev/null | grep __GNUC__),)
+CFLAGS += -DSTMTEXPR=1
+CXXFLAGS += -DSTMTEXPR=1
+endif
+
# ----------------------------------------------------------------------------
# General make rules
# ----------------------------------------------------------------------------