diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2018-06-02 22:00:32 -0300 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2018-06-02 22:12:57 -0300 | 
| commit | 7aad159464b3a31a42789594e6efd4bd2fceb644 (patch) | |
| tree | 3cf525e5f29b859b2fa728e35bb2dcc834d01556 /ospf6d | |
| parent | ebb46153b06a48fa5402b850ad8041a469f1a26d (diff) | |
build: append -std=gnu99 after SNMP_CFLAGS
Programs that link to libnetsnmp must be compiled using a special set
of flags as specified by the "net-snmp-config --base-cflags" command
(whose output is stored in the SNMP_CFLAGS variable). The problem is
that "net-snmp-config --base-cflags" can output -std=c99 in addition to
other compiler flags in some platforms, and this breaks the build since
FRR souce code makes use of some GNU compiler extensions (e.g. allow
trailing commas in function parameter lists). In order to solve this
problem, append -std=gnu99 after SNMP_CFLAGS in all makefiles where this
variable is used. This way the -std=c99 flag will be overwritten when it's
present. Source files that don't link to libnetsnmp will be compiled using
either -std=gnu99 or -std=gnu11 depending on the compiler availability.
Fixes #1617.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ospf6d')
| -rw-r--r-- | ospf6d/subdir.am | 2 | 
1 files changed, 1 insertions, 1 deletions
diff --git a/ospf6d/subdir.am b/ospf6d/subdir.am index 76a64cd637..8a6c4a5ccf 100644 --- a/ospf6d/subdir.am +++ b/ospf6d/subdir.am @@ -61,6 +61,6 @@ ospf6d_ospf6d_SOURCES = \  	# end  ospf6d_ospf6d_snmp_la_SOURCES = ospf6d/ospf6_snmp.c -ospf6d_ospf6d_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) +ospf6d_ospf6d_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99  ospf6d_ospf6d_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic  ospf6d_ospf6d_snmp_la_LIBADD = lib/libfrrsnmp.la  | 
