Fix CentOS7 build with GCC 4.8 by specifying C99 standard. (#325)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
+9
-1
@@ -93,10 +93,17 @@ endif
|
||||
BACNET_PORT_DIR = $(realpath ../ports/$(BACNET_PORT))
|
||||
BACNET_SRC_DIR = $(realpath ../src)
|
||||
|
||||
# Compiler flag to set the C Standard level.
|
||||
# c89 - "ANSI" C
|
||||
# gnu89 - c89 plus GCC extensions
|
||||
# c99 - ISO C99 standard (not yet fully implemented)
|
||||
# gnu99 - c99 plus GCC extensions
|
||||
CSTANDARD = -std=gnu99
|
||||
|
||||
#build for release (default) or debug
|
||||
OPTIMIZATION ?= -Os
|
||||
DEBUGGING ?=
|
||||
WARNINGS ?= -Wall -Wmissing-prototypes
|
||||
WARNINGS ?= -Wall -Wmissing-prototypes -Wno-missing-braces
|
||||
# dead code removal
|
||||
ifeq (${BUILD},debug)
|
||||
OPTIMIZATION = -O0
|
||||
@@ -117,6 +124,7 @@ BACNET_DEFINES += -DBACNET_PROTOCOL_REVISION=24
|
||||
# put all the flags together
|
||||
INCLUDES = -I$(BACNET_SRC_DIR) -I$(BACNET_PORT_DIR)
|
||||
CFLAGS += $(WARNINGS) $(DEBUGGING) $(OPTIMIZATION) $(BACNET_DEFINES) $(INCLUDES)
|
||||
CFLAGS += $(CSTANDARD)
|
||||
ifneq (${BACNET_LIB},)
|
||||
LFLAGS += -Wl,$(BACNET_LIB)
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user