summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-01-30 18:11:54 +0100
committerDavid Lamparter <equinox@diac24.net>2019-01-30 19:13:51 +0100
commitfdbd8086b1e1c4844570d902ce093ce73c524664 (patch)
treec70c224a77272fd310789e73e7d04b244605931f
parentbuild, lib/yang: bake in extensions if possible (v2) (diff)
downloadfrr-fdbd8086b1e1c4844570d902ce093ce73c524664.tar.xz
frr-fdbd8086b1e1c4844570d902ce093ce73c524664.zip
build: fix a whole bunch of *FLAGS
- some target_CFLAGS that needed to include AM_CFLAGS didn't do so - libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all - consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@ - 2 dependencies were missing for clippy Signed-off-by: David Lamparter <equinox@diac24.net>
-rw-r--r--Makefile.am3
-rw-r--r--babeld/subdir.am2
-rw-r--r--bgpd/subdir.am8
-rwxr-xr-xconfigure.ac11
-rw-r--r--eigrpd/subdir.am2
-rw-r--r--isisd/subdir.am2
-rw-r--r--ldpd/subdir.am2
-rw-r--r--lib/subdir.am16
-rw-r--r--nhrpd/subdir.am4
-rw-r--r--ospf6d/subdir.am2
-rw-r--r--ospfclient/subdir.am2
-rw-r--r--ospfd/subdir.am2
-rw-r--r--pbrd/subdir.am2
-rw-r--r--pimd/subdir.am2
-rw-r--r--ripd/subdir.am2
-rw-r--r--ripngd/subdir.am2
-rw-r--r--sharpd/subdir.am2
-rw-r--r--staticd/subdir.am2
-rw-r--r--tests/subdir.am7
-rw-r--r--tools/subdir.am4
-rw-r--r--vtysh/subdir.am2
-rw-r--r--watchfrr/subdir.am2
-rw-r--r--yang/libyang_plugins/subdir.am2
23 files changed, 47 insertions, 38 deletions
diff --git a/Makefile.am b/Makefile.am
index 7f7d7d623..9e6c53d87 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,8 @@ AUTOMAKE_OPTIONS = subdir-objects 1.12
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = \
+ $(LIBYANG_CFLAGS) \
+ $(SQLITE3_CFLAGS) \
$(UNWIND_CFLAGS) \
$(SAN_FLAGS) \
$(WERROR) \
@@ -17,7 +19,6 @@ AM_LDFLAGS = \
$(SAN_FLAGS) \
# end
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE)
-LIBCAP = @LIBCAP@
AR_FLAGS = @AR_FLAGS@
ARFLAGS = @ARFLAGS@
diff --git a/babeld/subdir.am b/babeld/subdir.am
index e1f2cb0a0..7081c730a 100644
--- a/babeld/subdir.am
+++ b/babeld/subdir.am
@@ -51,4 +51,4 @@ noinst_HEADERS += \
# end
babeld_babeld_SOURCES = babeld/babel_main.c
-babeld_babeld_LDADD = babeld/libbabel.a lib/libfrr.la @LIBCAP@
+babeld_babeld_LDADD = babeld/libbabel.a lib/libfrr.la $(LIBCAP)
diff --git a/bgpd/subdir.am b/bgpd/subdir.am
index 7dd1d73f6..40ea97663 100644
--- a/bgpd/subdir.am
+++ b/bgpd/subdir.am
@@ -193,15 +193,15 @@ bgpd_bgp_btoa_SOURCES = bgpd/bgp_btoa.c
if ENABLE_BGP_VNC
bgpd_bgpd_SOURCES += bgpd/rfapi/rfapi_descriptor_rfp_utils.c
-bgpd_bgpd_CFLAGS = -Irfapi -I@top_srcdir@/$(RFPINC)
+bgpd_bgpd_CFLAGS = $(AM_CFLAGS) -Irfapi -I@top_srcdir@/$(RFPINC)
bgpd_bgp_btoa_SOURCES += bgpd/rfapi/rfapi_descriptor_rfp_utils.c
-bgpd_bgp_btoa_CFLAGS = -Irfapi -I@top_srcdir@/$(RFPINC)
+bgpd_bgp_btoa_CFLAGS = $(AM_CFLAGS) -Irfapi -I@top_srcdir@/$(RFPINC)
endif
# RFPLDADD is set in bgpd/rfp-example/librfp/subdir.am
-bgpd_bgpd_LDADD = bgpd/libbgp.a $(RFPLDADD) lib/libfrr.la @LIBCAP@ @LIBM@
-bgpd_bgp_btoa_LDADD = bgpd/libbgp.a $(RFPLDADD) lib/libfrr.la @LIBCAP@ @LIBM@
+bgpd_bgpd_LDADD = bgpd/libbgp.a $(RFPLDADD) lib/libfrr.la $(LIBCAP) $(LIBM)
+bgpd_bgp_btoa_LDADD = bgpd/libbgp.a $(RFPLDADD) lib/libfrr.la $(LIBCAP) $(LIBM)
bgpd_bgpd_snmp_la_SOURCES = bgpd/bgp_snmp.c
bgpd_bgpd_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
diff --git a/configure.ac b/configure.ac
index 97482dbd1..0c15b501f 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1600,18 +1600,21 @@ AC_SUBST([SNMP_CFLAGS])
dnl ---------------
dnl libyang
dnl ---------------
-PKG_CHECK_MODULES([libyang], [libyang >= 0.16.7], , [
+PKG_CHECK_MODULES([LIBYANG], [libyang >= 0.16.7], , [
AC_MSG_ERROR([libyang (>= 0.16.7) was not found on your system.])
])
+ac_cflags_save="$CFLAGS"
+CFLAGS="$CFLAGS $LIBYANG_CFLAGS"
AC_CHECK_MEMBER([struct lyd_node.priv], [], [
AC_MSG_ERROR([m4_normalize([
libyang needs to be compiled with ENABLE_LYD_PRIV=ON.
See http://docs.frrouting.org/projects/dev-guide/en/latest/building-libyang.html for details.])
])
], [[#include <libyang/libyang.h>]])
+CFLAGS="$ac_cflags_save"
ac_libs_save="$LIBS"
-LIBS="$LIBS $libyang_LIBS"
+LIBS="$LIBS $LIBYANG_LIBS"
AC_CHECK_FUNC([ly_register_types], [
libyang_ext_builtin=true
AC_DEFINE([LIBYANG_EXT_BUILTIN], [1], [have ly_register_types()])
@@ -1633,7 +1636,7 @@ dnl configuration rollbacks
dnl ---------------
SQLITE3=false
if test "$enable_config_rollbacks" = "yes"; then
- PKG_CHECK_MODULES([sqlite3], [sqlite3], [
+ PKG_CHECK_MODULES([SQLITE3], [sqlite3], [
AC_DEFINE([HAVE_CONFIG_ROLLBACKS], [1], [Enable configuration rollbacks])
AC_DEFINE([HAVE_SQLITE3], [1], [Enable sqlite3 database])
SQLITE3=true
@@ -1661,7 +1664,7 @@ dnl ---------------
dnl sysrepo
dnl ---------------
if test "$enable_sysrepo" = "yes"; then
- PKG_CHECK_MODULES([sysrepo], [libsysrepo],
+ PKG_CHECK_MODULES([SYSREPO], [libsysrepo],
[AC_DEFINE([HAVE_SYSREPO], [1], [Enable sysrepo integration])
SYSREPO=true],
[SYSREPO=false
diff --git a/eigrpd/subdir.am b/eigrpd/subdir.am
index d532afbbe..4503030fd 100644
--- a/eigrpd/subdir.am
+++ b/eigrpd/subdir.am
@@ -65,4 +65,4 @@ noinst_HEADERS += \
# end
eigrpd_eigrpd_SOURCES = eigrpd/eigrp_main.c
-eigrpd_eigrpd_LDADD = eigrpd/libeigrp.a lib/libfrr.la @LIBCAP@
+eigrpd_eigrpd_LDADD = eigrpd/libeigrp.a lib/libfrr.la $(LIBCAP)
diff --git a/isisd/subdir.am b/isisd/subdir.am
index c5b9b31a4..4371d5993 100644
--- a/isisd/subdir.am
+++ b/isisd/subdir.am
@@ -98,7 +98,7 @@ ISIS_SOURCES = \
isisd/isis_pfpacket.c \
# end
-ISIS_LDADD_COMMON = lib/libfrr.la @LIBCAP@
+ISIS_LDADD_COMMON = lib/libfrr.la $(LIBCAP)
# Building isisd
diff --git a/ldpd/subdir.am b/ldpd/subdir.am
index 24e738d62..42c5ad024 100644
--- a/ldpd/subdir.am
+++ b/ldpd/subdir.am
@@ -55,4 +55,4 @@ noinst_HEADERS += \
# end
ldpd_ldpd_SOURCES = ldpd/ldpd.c
-ldpd_ldpd_LDADD = ldpd/libldp.a lib/libfrr.la @LIBCAP@
+ldpd_ldpd_LDADD = ldpd/libldp.a lib/libfrr.la $(LIBCAP)
diff --git a/lib/subdir.am b/lib/subdir.am
index ccbe13bca..f245560c4 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -3,7 +3,7 @@
#
lib_LTLIBRARIES += lib/libfrr.la
lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
-lib_libfrr_la_LIBADD = @LIBCAP@ $(UNWIND_LIBS) -lyang
+lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS)
lib_libfrr_la_SOURCES = \
lib/agg_table.c \
@@ -116,7 +116,7 @@ vtysh_scan += \
vtysh_scan += $(top_srcdir)/lib/agentx.c
if SQLITE3
-lib_libfrr_la_LIBADD += -lsqlite3
+lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
lib_libfrr_la_SOURCES += lib/db.c
endif
@@ -289,7 +289,7 @@ endif
lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
-lib_confd_la_LIBADD = lib/libfrr.la -lconfd
+lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
lib_confd_la_SOURCES = lib/northbound_confd.c
#
@@ -299,9 +299,9 @@ if SYSREPO
module_LTLIBRARIES += lib/sysrepo.la
endif
-lib_sysrepo_la_CFLAGS = $(WERROR)
+lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
-lib_sysrepo_la_LIBADD = lib/libfrr.la -lsysrepo
+lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
#
@@ -387,11 +387,13 @@ lib/command_lex.h: lib/command_lex.c
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
lib/command_lex.lo: lib/command_parse.h
lib/command_parse.lo: lib/command_lex.h
+lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
+lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
- @PERL@ $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
+ $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
DISTCLEANFILES += lib/route_types.h
if GIT_VERSION
@@ -405,7 +407,7 @@ PHONY_GITVERSION=lib/gitversion.h.tmp
.SILENT: lib/gitversion.h lib/gitversion.h.tmp
GITH=lib/gitversion.h
lib/gitversion.h.tmp: $(top_srcdir)/.git
- @PERL@ $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
+ $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
lib/gitversion.h: lib/gitversion.h.tmp
{ test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
diff --git a/nhrpd/subdir.am b/nhrpd/subdir.am
index 758c22e2b..6e2b91780 100644
--- a/nhrpd/subdir.am
+++ b/nhrpd/subdir.am
@@ -8,8 +8,8 @@ vtysh_scan += $(top_srcdir)/nhrpd/nhrp_vty.c
man8 += $(MANBUILD)/nhrpd.8
endif
-nhrpd_nhrpd_LDADD = lib/libfrr.la @LIBCAP@ @CARES_LIBS@
-nhrpd_nhrpd_CFLAGS = $(AM_CFLAGS) @CARES_CFLAGS@
+nhrpd_nhrpd_LDADD = lib/libfrr.la $(LIBCAP) $(CARES_LIBS)
+nhrpd_nhrpd_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
nhrpd_nhrpd_SOURCES = \
nhrpd/linux.c \
nhrpd/netlink_arp.c \
diff --git a/ospf6d/subdir.am b/ospf6d/subdir.am
index d9c29f265..eac0eee45 100644
--- a/ospf6d/subdir.am
+++ b/ospf6d/subdir.am
@@ -73,7 +73,7 @@ noinst_HEADERS += \
ospf6d/ospf6d.h \
# end
-ospf6d_ospf6d_LDADD = ospf6d/libospf6.a lib/libfrr.la @LIBCAP@
+ospf6d_ospf6d_LDADD = ospf6d/libospf6.a lib/libfrr.la $(LIBCAP)
ospf6d_ospf6d_SOURCES = \
ospf6d/ospf6_main.c \
# end
diff --git a/ospfclient/subdir.am b/ospfclient/subdir.am
index c05d920d5..94d489358 100644
--- a/ospfclient/subdir.am
+++ b/ospfclient/subdir.am
@@ -23,7 +23,7 @@ endif
ospfclient_ospfclient_LDADD = \
ospfclient/libfrrospfapiclient.la \
- @LIBCAP@ \
+ $(LIBCAP) \
# end
if STATIC_BIN
diff --git a/ospfd/subdir.am b/ospfd/subdir.am
index 3ad1b870b..48dd741b2 100644
--- a/ospfd/subdir.am
+++ b/ospfd/subdir.am
@@ -98,7 +98,7 @@ noinst_HEADERS += \
ospfd/ospf_zebra.h \
# end
-ospfd_ospfd_LDADD = ospfd/libfrrospf.a lib/libfrr.la @LIBCAP@ @LIBM@
+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
diff --git a/pbrd/subdir.am b/pbrd/subdir.am
index 794755903..0f2e7ad8b 100644
--- a/pbrd/subdir.am
+++ b/pbrd/subdir.am
@@ -38,5 +38,5 @@ pbrd/pbr_debug_clippy.c: $(CLIPPY_DEPS)
pbrd/pbr_debug.$(OBJEXT): pbrd/pbr_debug_clippy.c
pbrd_pbrd_SOURCES = pbrd/pbr_main.c
-pbrd_pbrd_LDADD = pbrd/libpbr.a lib/libfrr.la @LIBCAP@
+pbrd_pbrd_LDADD = pbrd/libpbr.a lib/libfrr.la $(LIBCAP)
diff --git a/pimd/subdir.am b/pimd/subdir.am
index fef8e3657..99701430c 100644
--- a/pimd/subdir.am
+++ b/pimd/subdir.am
@@ -115,7 +115,7 @@ noinst_HEADERS += \
pimd/mtracebis_routeget.h \
# end
-pimd_pimd_LDADD = pimd/libpim.a lib/libfrr.la @LIBCAP@
+pimd_pimd_LDADD = pimd/libpim.a lib/libfrr.la $(LIBCAP)
pimd_pimd_SOURCES = pimd/pim_main.c
pimd_test_igmpv3_join_LDADD = lib/libfrr.la
diff --git a/ripd/subdir.am b/ripd/subdir.am
index 1c2f8d64c..2a63cc522 100644
--- a/ripd/subdir.am
+++ b/ripd/subdir.am
@@ -44,7 +44,7 @@ noinst_HEADERS += \
ripd/ripd.h \
# end
-ripd_ripd_LDADD = ripd/librip.a lib/libfrr.la @LIBCAP@
+ripd_ripd_LDADD = ripd/librip.a lib/libfrr.la $(LIBCAP)
ripd_ripd_SOURCES = \
ripd/rip_main.c \
# end
diff --git a/ripngd/subdir.am b/ripngd/subdir.am
index d401e9bbf..ea0ccf148 100644
--- a/ripngd/subdir.am
+++ b/ripngd/subdir.am
@@ -40,7 +40,7 @@ noinst_HEADERS += \
ripngd/ripngd.h \
# end
-ripngd_ripngd_LDADD = ripngd/libripng.a lib/libfrr.la @LIBCAP@
+ripngd_ripngd_LDADD = ripngd/libripng.a lib/libfrr.la $(LIBCAP)
ripngd_ripngd_SOURCES = \
ripngd/ripng_main.c \
# end
diff --git a/sharpd/subdir.am b/sharpd/subdir.am
index 2a34aecfb..c00d90ea0 100644
--- a/sharpd/subdir.am
+++ b/sharpd/subdir.am
@@ -24,5 +24,5 @@ sharpd/sharp_vty_clippy.c: $(CLIPPY_DEPS)
sharpd/sharp_vty.$(OBJEXT): sharpd/sharp_vty_clippy.c
sharpd_sharpd_SOURCES = sharpd/sharp_main.c
-sharpd_sharpd_LDADD = sharpd/libsharp.a lib/libfrr.la @LIBCAP@
+sharpd_sharpd_LDADD = sharpd/libsharp.a lib/libfrr.la $(LIBCAP)
diff --git a/staticd/subdir.am b/staticd/subdir.am
index 33cc0e205..17c4536fe 100644
--- a/staticd/subdir.am
+++ b/staticd/subdir.am
@@ -32,4 +32,4 @@ staticd/static_vty_clippy.c: $(CLIPPY_DEPS)
staticd/static_vty.$(OBJEXT): staticd/static_vty_clippy.c
staticd_staticd_SOURCES = staticd/static_main.c
-staticd_staticd_LDADD = staticd/libstatic.a lib/libfrr.la @LIBCAP@
+staticd_staticd_LDADD = staticd/libstatic.a lib/libfrr.la $(LIBCAP)
diff --git a/tests/subdir.am b/tests/subdir.am
index 7d2800a3a..42730cb83 100644
--- a/tests/subdir.am
+++ b/tests/subdir.am
@@ -112,10 +112,13 @@ TESTS_CPPFLAGS = $(AM_CPPFLAGS) \
-I$(top_srcdir)/tests/helpers/c \
-I$(top_builddir)/tests/helpers/c \
# end
-TESTS_CFLAGS = $(SAN_FLAGS)
+TESTS_CFLAGS = \
+ $(LIBYANG_CFLAGS) \
+ $(SAN_FLAGS) \
+ # end
# note no -Werror
-ALL_TESTS_LDADD = lib/libfrr.la @LIBCAP@
+ALL_TESTS_LDADD = lib/libfrr.la $(LIBCAP)
BGP_TEST_LDADD = bgpd/libbgp.a $(RFPLDADD) $(ALL_TESTS_LDADD) -lm
ISISD_TEST_LDADD = isisd/libisis.a $(ALL_TESTS_LDADD)
OSPF6_TEST_LDADD = ospf6d/libospf6.a $(ALL_TESTS_LDADD)
diff --git a/tools/subdir.am b/tools/subdir.am
index ff41fe2c6..7713bb1ad 100644
--- a/tools/subdir.am
+++ b/tools/subdir.am
@@ -23,10 +23,10 @@ tools_permutations_SOURCES = tools/permutations.c
tools_permutations_LDADD = lib/libfrr.la
tools_gen_northbound_callbacks_SOURCES = tools/gen_northbound_callbacks.c
-tools_gen_northbound_callbacks_LDADD = lib/libfrr.la -lyang
+tools_gen_northbound_callbacks_LDADD = lib/libfrr.la $(LIBYANG_LIBS)
tools_gen_yang_deviations_SOURCES = tools/gen_yang_deviations.c
-tools_gen_yang_deviations_LDADD = lib/libfrr.la -lyang
+tools_gen_yang_deviations_LDADD = lib/libfrr.la $(LIBYANG_LIBS)
tools_ssd_SOURCES = tools/start-stop-daemon.c
diff --git a/vtysh/subdir.am b/vtysh/subdir.am
index c9cdb5854..74595788b 100644
--- a/vtysh/subdir.am
+++ b/vtysh/subdir.am
@@ -24,7 +24,7 @@ noinst_HEADERS += \
vtysh/vtysh_user.h \
# end
-vtysh_vtysh_LDADD = lib/libfrr.la @LIBCAP@ @LIBREADLINE@ @LIBS@ @LIBPAM@
+vtysh_vtysh_LDADD = lib/libfrr.la $(LIBCAP) $(LIBREADLINE) $(LIBS) $(LIBPAM)
AM_V_EXTRACT = $(am__v_EXTRACT_$(V))
am__v_EXTRACT_ = $(am__v_EXTRACT_$(AM_DEFAULT_VERBOSITY))
diff --git a/watchfrr/subdir.am b/watchfrr/subdir.am
index f0b49c9a8..c27491e55 100644
--- a/watchfrr/subdir.am
+++ b/watchfrr/subdir.am
@@ -13,7 +13,7 @@ noinst_HEADERS += \
watchfrr/watchfrr_errors.h \
# end
-watchfrr_watchfrr_LDADD = lib/libfrr.la @LIBCAP@
+watchfrr_watchfrr_LDADD = lib/libfrr.la $(LIBCAP)
watchfrr_watchfrr_SOURCES = \
watchfrr/watchfrr.c \
watchfrr/watchfrr_errors.c \
diff --git a/yang/libyang_plugins/subdir.am b/yang/libyang_plugins/subdir.am
index 716478908..fe5f34a28 100644
--- a/yang/libyang_plugins/subdir.am
+++ b/yang/libyang_plugins/subdir.am
@@ -8,7 +8,7 @@ else
libyang_plugins_LTLIBRARIES += yang/libyang_plugins/frr_user_types.la
endif
-yang_libyang_plugins_frr_user_types_la_CFLAGS = $(WERROR)
+yang_libyang_plugins_frr_user_types_la_CFLAGS = $(WERROR) $(LIBYANG_CFLAGS)
yang_libyang_plugins_frr_user_types_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
yang_libyang_plugins_frr_user_types_la_LIBADD =
yang_libyang_plugins_frr_user_types_la_SOURCES = yang/libyang_plugins/frr_user_types.c