summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rw-r--r--bgpd/rfp-example/rfptest/subdir.am5
-rw-r--r--bgpd/subdir.am7
-rwxr-xr-xconfigure.ac21
-rw-r--r--isisd/subdir.am2
-rw-r--r--ldpd/subdir.am2
-rw-r--r--lib/subdir.am12
-rw-r--r--ospf6d/subdir.am2
-rw-r--r--ospfd/subdir.am2
-rw-r--r--pathd/subdir.am2
-rw-r--r--pceplib/subdir.am2
-rw-r--r--pceplib/test/subdir.am4
-rw-r--r--ripd/subdir.am2
-rw-r--r--tests/subdir.am1
-rw-r--r--zebra/subdir.am2
15 files changed, 36 insertions, 31 deletions
diff --git a/Makefile.am b/Makefile.am
index 87ba4aff9..f6b1dcf32 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,7 @@ AUTOMAKE_OPTIONS = subdir-objects 1.12
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = \
+ $(AC_CFLAGS) \
$(LIBYANG_CFLAGS) \
$(SQLITE3_CFLAGS) \
$(UNWIND_CFLAGS) \
diff --git a/bgpd/rfp-example/rfptest/subdir.am b/bgpd/rfp-example/rfptest/subdir.am
index 9f6d33a85..1b5024a30 100644
--- a/bgpd/rfp-example/rfptest/subdir.am
+++ b/bgpd/rfp-example/rfptest/subdir.am
@@ -6,7 +6,10 @@ if ENABLE_BGP_VNC
noinst_PROGRAMS += bgpd/rfp-example/rfptest/rfptest
endif
-bgpd_rfp_example_rfptest_rfptest_CFLAGS = -I$(top_srcdir)/bgpd/rfapi
+bgpd_rfp_example_rfptest_rfptest_CFLAGS = \
+ $(AM_CFLAGS) \
+ -I$(top_srcdir)/bgpd/rfapi \
+ # end
bgpd_rfp_example_rfptest_rfptest_SOURCES = \
bgpd/rfp-example/rfptest/rfptest.c \
# end
diff --git a/bgpd/subdir.am b/bgpd/subdir.am
index 07e71ba60..2c73f1459 100644
--- a/bgpd/subdir.am
+++ b/bgpd/subdir.am
@@ -211,20 +211,17 @@ noinst_HEADERS += \
bgpd_bgpd_SOURCES = bgpd/bgp_main.c
bgpd_bgp_btoa_SOURCES = bgpd/bgp_btoa.c
-bgpd_bgpd_CFLAGS = $(AM_CFLAGS)
-bgpd_bgp_btoa_CFLAGS = $(AM_CFLAGS)
-
# RFPLDADD is set in bgpd/rfp-example/librfp/subdir.am
bgpd_bgpd_LDADD = bgpd/libbgp.a $(RFPLDADD) lib/libfrr.la $(LIBCAP) $(LIBM) $(UST_LIBS)
bgpd_bgp_btoa_LDADD = bgpd/libbgp.a $(RFPLDADD) lib/libfrr.la $(LIBCAP) $(LIBM) $(UST_LIBS)
bgpd_bgpd_snmp_la_SOURCES = bgpd/bgp_snmp.c bgpd/bgp_mplsvpn_snmp.c
-bgpd_bgpd_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+bgpd_bgpd_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
bgpd_bgpd_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
bgpd_bgpd_snmp_la_LIBADD = lib/libfrrsnmp.la
bgpd_bgpd_rpki_la_SOURCES = bgpd/bgp_rpki.c
-bgpd_bgpd_rpki_la_CFLAGS = $(WERROR) $(RTRLIB_CFLAGS)
+bgpd_bgpd_rpki_la_CFLAGS = $(AM_CFLAGS) $(RTRLIB_CFLAGS)
bgpd_bgpd_rpki_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
bgpd_bgpd_rpki_la_LIBADD = $(RTRLIB_LIBS)
diff --git a/configure.ac b/configure.ac
index f9516e559..1016c7f99 100755
--- a/configure.ac
+++ b/configure.ac
@@ -205,6 +205,7 @@ AC_SUBST([SED])
dnl try and enable CFLAGS that are useful for FRR
dnl - specifically, options to control warnings
+AC_SUBST([AC_CFLAGS])
AC_USE_SYSTEM_EXTENSIONS
AC_DEFUN([AC_C_FLAG], [{
m4_pushdef([cachename],[m4_translit([frr_cv_$1],[ =-+/{}$],[________])])
@@ -223,7 +224,7 @@ AC_DEFUN([AC_C_FLAG], [{
AC_LANG_POP([C])
])
if test "$cachename" = "yes"; then
- m4_if([$3], [], [CFLAGS="$CFLAGS $1"], [$3])
+ m4_if([$3], [], [AC_CFLAGS="$AC_CFLAGS $1"], [$3])
else
:
$2
@@ -275,7 +276,7 @@ if test "$enable_gcov" = "yes"; then
AC_C_FLAG([-O0])
fi
- LDFLAGS="${LDFLAGS} -lgcov"
+ AC_LDFLAGS="${AC_LDFLAGS} -lgcov"
fi
if test "$enable_clang_coverage" = "yes"; then
@@ -302,17 +303,19 @@ if test "$enable_scripting" = "yes"; then
])
fi
+dnl the following flags go in CFLAGS rather than AC_CFLAGS since they make
+dnl sense to be overridden by the user
if test "$enable_dev_build" = "yes"; then
AC_DEFINE([DEV_BUILD], [1], [Build for development])
if test "$orig_cflags" = ""; then
- AC_C_FLAG([-g3])
- AC_C_FLAG([-O0])
- AC_C_FLAG([-ggdb3])
+ AC_C_FLAG([-O0],,[CFLAGS="$CFLAGS -O0"])
+ AC_C_FLAG([-g3],,[CFLAGS="$CFLAGS -g3"])
+ AC_C_FLAG([-ggdb3],,[CFLAGS="$CFLAGS -ggdb3"])
fi
else
if test "$orig_cflags" = ""; then
- AC_C_FLAG([-g])
- AC_C_FLAG([-O2])
+ AC_C_FLAG([-g],,[CFLAGS="$CFLAGS -g"])
+ AC_C_FLAG([-O2],,[CFLAGS="$CFLAGS -O2"])
fi
fi
@@ -449,7 +452,7 @@ dnl ----------
AX_PTHREAD([
CC="$PTHREAD_CC"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ AC_CFLAGS="$AC_CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
], [
AC_MSG_FAILURE([This FRR version needs pthreads])
@@ -2652,7 +2655,7 @@ FRR version : ${PACKAGE_VERSION}
host operating system : ${host_os}
source code location : ${srcdir}
compiler : ${CC}
-compiler flags : ${CFLAGS} ${SAN_FLAGS}
+compiler flags : ${CFLAGS} ${AC_CFLAGS} ${SAN_FLAGS}
make : ${MAKE-make}
linker flags : ${LDFLAGS} ${SAN_FLAGS} ${LIBS} ${LIBCAP} ${LIBREADLINE} ${LIBM}
state file directory : ${frr_statedir}
diff --git a/isisd/subdir.am b/isisd/subdir.am
index 11bae4165..4243bd60c 100644
--- a/isisd/subdir.am
+++ b/isisd/subdir.am
@@ -138,7 +138,7 @@ nodist_isisd_isisd_SOURCES = \
# end
isisd_isisd_snmp_la_SOURCES = isisd/isis_snmp.c
-isisd_isisd_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+isisd_isisd_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
isisd_isisd_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
isisd_isisd_snmp_la_LIBADD = lib/libfrrsnmp.la
diff --git a/ldpd/subdir.am b/ldpd/subdir.am
index 5fc3847c6..b7e2ab72d 100644
--- a/ldpd/subdir.am
+++ b/ldpd/subdir.am
@@ -64,6 +64,6 @@ ldpd_ldpd_SOURCES = ldpd/ldpd.c
ldpd_ldpd_LDADD = ldpd/libldp.a lib/libfrr.la $(LIBCAP)
ldpd_ldpd_snmp_la_SOURCES = ldpd/ldp_snmp.c
-ldpd_ldpd_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+ldpd_ldpd_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
ldpd_ldpd_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
ldpd_ldpd_snmp_la_LIBADD = lib/libfrrsnmp.la
diff --git a/lib/subdir.am b/lib/subdir.am
index b7efec488..98ba1cf24 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -318,7 +318,7 @@ if SNMP
lib_LTLIBRARIES += lib/libfrrsnmp.la
endif
-lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+lib_libfrrsnmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
lib_libfrrsnmp_la_SOURCES = \
@@ -334,7 +334,7 @@ lib_LTLIBRARIES += lib/libfrrcares.la
pkginclude_HEADERS += lib/resolver.h
endif
-lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
+lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
lib_libfrrcares_la_SOURCES = \
@@ -349,7 +349,7 @@ lib_LTLIBRARIES += lib/libfrrzmq.la
pkginclude_HEADERS += lib/frr_zmq.h
endif
-lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
+lib_libfrrzmq_la_CFLAGS = $(AM_CFLAGS) $(ZEROMQ_CFLAGS)
lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
lib_libfrrzmq_la_SOURCES = \
@@ -363,7 +363,7 @@ if CONFD
module_LTLIBRARIES += lib/confd.la
endif
-lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
+lib_confd_la_CFLAGS = $(AM_CFLAGS) $(CONFD_CFLAGS)
lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
lib_confd_la_SOURCES = lib/northbound_confd.c
@@ -375,7 +375,7 @@ if SYSREPO
module_LTLIBRARIES += lib/sysrepo.la
endif
-lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
+lib_sysrepo_la_CFLAGS = $(AM_CFLAGS) $(SYSREPO_CFLAGS)
lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
@@ -414,7 +414,7 @@ lib_grammar_sandbox_LDADD = \
lib/libfrr.la
lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
-lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
+lib_clippy_CFLAGS = $(AC_CFLAGS) $(PYTHON_CFLAGS)
lib_clippy_LDADD = $(PYTHON_LIBS) $(UST_LIBS) -lelf
lib_clippy_LDFLAGS = -export-dynamic
lib_clippy_SOURCES = \
diff --git a/ospf6d/subdir.am b/ospf6d/subdir.am
index 5ccae5b27..00388afd3 100644
--- a/ospf6d/subdir.am
+++ b/ospf6d/subdir.am
@@ -80,7 +80,7 @@ ospf6d_ospf6d_SOURCES = \
# end
ospf6d_ospf6d_snmp_la_SOURCES = ospf6d/ospf6_snmp.c
-ospf6d_ospf6d_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+ospf6d_ospf6d_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
ospf6d_ospf6d_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
ospf6d_ospf6d_snmp_la_LIBADD = lib/libfrrsnmp.la
diff --git a/ospfd/subdir.am b/ospfd/subdir.am
index f592a9eec..574e0e3bd 100644
--- a/ospfd/subdir.am
+++ b/ospfd/subdir.am
@@ -115,7 +115,7 @@ ospfd_ospfd_LDADD = ospfd/libfrrospf.a lib/libfrr.la $(LIBCAP) $(LIBM)
ospfd_ospfd_SOURCES = ospfd/ospf_main.c
ospfd_ospfd_snmp_la_SOURCES = ospfd/ospf_snmp.c
-ospfd_ospfd_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+ospfd_ospfd_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
ospfd_ospfd_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
ospfd_ospfd_snmp_la_LIBADD = lib/libfrrsnmp.la
diff --git a/pathd/subdir.am b/pathd/subdir.am
index 4eabdd2ac..0666e8d3c 100644
--- a/pathd/subdir.am
+++ b/pathd/subdir.am
@@ -75,5 +75,5 @@ pathd_pathd_pcep_la_LIBADD =
endif
-pathd_pathd_pcep_la_CFLAGS = $(WERROR)
+#pathd_pathd_pcep_la_CFLAGS = $(AM_CFLAGS)
pathd_pathd_pcep_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
diff --git a/pceplib/subdir.am b/pceplib/subdir.am
index eee2ec28c..2633f678f 100644
--- a/pceplib/subdir.am
+++ b/pceplib/subdir.am
@@ -1,7 +1,7 @@
if PATHD_PCEP
noinst_LTLIBRARIES = pceplib/libpcep_pcc.la pceplib/libsocket_comm_mock.la
-pceplib_libpcep_pcc_la_CFLAGS = -fPIC
+pceplib_libpcep_pcc_la_CFLAGS = $(AM_CFLAGS) -fPIC
pceplib_libpcep_pcc_la_SOURCES = pceplib/pcep_msg_messages.c \
pceplib/pcep_msg_objects.c \
pceplib/pcep_msg_tlvs.c \
diff --git a/pceplib/test/subdir.am b/pceplib/test/subdir.am
index 0ae61d1bc..88af59267 100644
--- a/pceplib/test/subdir.am
+++ b/pceplib/test/subdir.am
@@ -36,7 +36,7 @@ noinst_HEADERS += pceplib/test/pcep_msg_messages_test.h \
pceplib/test/pcep_utils_ordered_list_test.h \
pceplib/test/pcep_utils_queue_test.h
-pceplib_test_pcep_msg_tests_CFLAGS = -I$(top_srcdir)/pceplib
+pceplib_test_pcep_msg_tests_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/pceplib
pceplib_test_pcep_msg_tests_LDADD = $(top_builddir)/pceplib/libpcep_pcc.la lib/libfrr.la -lcunit -lpthread
pceplib_test_pcep_msg_tests_SOURCES = pceplib/test/pcep_msg_messages_test.c \
pceplib/test/pcep_msg_messages_tests.c \
@@ -47,7 +47,7 @@ pceplib_test_pcep_msg_tests_SOURCES = pceplib/test/pcep_msg_messages_test.c \
# The pcc_api_tests and pcep_session_logic_tests use the
# socket_comm_mock, so the LDADD variable needs to be modified
-pceplib_test_pcep_pcc_api_tests_CFLAGS = -I$(top_srcdir)/pceplib
+pceplib_test_pcep_pcc_api_tests_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/pceplib
pceplib_test_pcep_pcc_api_tests_LDADD = $(top_builddir)/pceplib/libsocket_comm_mock.la $(top_builddir)/pceplib/libpcep_pcc.la lib/libfrr.la -lcunit -lpthread
pceplib_test_pcep_pcc_api_tests_SOURCES = pceplib/test/pcep_pcc_api_test.c pceplib/test/pcep_pcc_api_tests.c
diff --git a/ripd/subdir.am b/ripd/subdir.am
index 99979bff0..8de0fc4b5 100644
--- a/ripd/subdir.am
+++ b/ripd/subdir.am
@@ -56,6 +56,6 @@ nodist_ripd_ripd_SOURCES = \
# end
ripd_ripd_snmp_la_SOURCES = ripd/rip_snmp.c
-ripd_ripd_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
+ripd_ripd_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
ripd_ripd_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
ripd_ripd_snmp_la_LIBADD = lib/libfrrsnmp.la
diff --git a/tests/subdir.am b/tests/subdir.am
index 370e6a49a..ec0a154a2 100644
--- a/tests/subdir.am
+++ b/tests/subdir.am
@@ -148,6 +148,7 @@ TESTS_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(top_builddir)/tests/helpers/c \
# end
TESTS_CFLAGS = \
+ $(AC_CFLAGS) \
$(LIBYANG_CFLAGS) \
$(SAN_FLAGS) \
# end
diff --git a/zebra/subdir.am b/zebra/subdir.am
index f0d1c5844..6fc8ef0df 100644
--- a/zebra/subdir.am
+++ b/zebra/subdir.am
@@ -193,7 +193,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) -std=gnu11
+zebra_zebra_snmp_la_CFLAGS = $(AM_CFLAGS) $(SNMP_CFLAGS) -std=gnu11
zebra_zebra_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
zebra_zebra_snmp_la_LIBADD = lib/libfrrsnmp.la