summaryrefslogtreecommitdiffstats
path: root/zebra/subdir.am
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-06-03 03:00:32 +0200
committerRenato Westphal <renato@opensourcerouting.org>2018-06-03 03:12:57 +0200
commit7aad159464b3a31a42789594e6efd4bd2fceb644 (patch)
tree3cf525e5f29b859b2fa728e35bb2dcc834d01556 /zebra/subdir.am
parentMerge pull request #2245 from donaldsharp/type_4 (diff)
downloadfrr-7aad159464b3a31a42789594e6efd4bd2fceb644.tar.xz
frr-7aad159464b3a31a42789594e6efd4bd2fceb644.zip
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 '')
-rw-r--r--zebra/subdir.am2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/subdir.am b/zebra/subdir.am
index 45e285a9e..d3abcef6d 100644
--- a/zebra/subdir.am
+++ b/zebra/subdir.am
@@ -127,7 +127,7 @@ zebra_zebra_irdp_la_SOURCES = \
zebra_zebra_irdp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
zebra_zebra_snmp_la_SOURCES = zebra/zebra_snmp.c
-zebra_zebra_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS)
+zebra_zebra_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
zebra_zebra_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
zebra_zebra_snmp_la_LIBADD = lib/libfrrsnmp.la