kumquat-buildroot/package/bird/bird.mk

48 lines
1.3 KiB
Makefile
Raw Normal View History

################################################################################
#
# bird
#
################################################################################
BIRD_VERSION = 2.0.10
BIRD_SITE = https://bird.network.cz/download
BIRD_LICENSE = GPL-2.0+
BIRD_LICENSE_FILES = README
BIRD_CPE_ID_VENDOR = nic
BIRD_SELINUX_MODULES = bird
BIRD_DEPENDENCIES = host-flex host-bison
package/bird: fix build with autoconf >= 2.70 Fix the following build failure raised since bump of autoconf to version 2.71 in commit ecd54b65c1f998a7ccd91f7c523e4ff38c4781da: checking for glob.h... no configure: error: glob.h not found. configure:5207: checking for glob.h configure:5230: /data/buildroot-autobuilder/instance-0/output-1/host/bin/mips64el-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -pthread -fno-strict-aliasing -fno-strict-overflow -flto -Wall -Wextra -Wstrict-prototypes -Wno-parentheses -Wno-pointer-sign -Wno-missing-field-initializers -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pthread -flto=4 -g conftest.c >&5 /data/buildroot-autobuilder/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/8.4.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: /tmp/ccDboxph.ltrans0.ltrans.o:(.debug_info+0x2a): undefined reference to `conftest.c.0943dc99' /data/buildroot-autobuilder/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/8.4.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: /tmp/ccDboxph.ltrans0.ltrans.o:(.debug_info+0x2f): undefined reference to `conftest.c.0943dc99' This is the same problem that we tried to fix in 03c148c8dec4e8c3fa13fcde4a730b3ab97f3f10 by adding AUTORECONF = YES. The analysis made back then is probably not entirely correct - the issue only seems to occur with GCC8, not with any earlier or later version, which hints at a compiler bug. Since the error involves some LTO-generated functions, the trigger is probably the -flto=4. Whatever the exact issue is, it is avoided if we make sure that our CFLAGS replace the default ones instead of being added to them. Currently, they are added because the configure script doesn't properly detect that CFLAGS was set. Add a patch (sent upstream months ago, but it didn't appear in the release that has been done since then) that makes sure CFLAGS is properly detected. Fixes: - http://autobuild.buildroot.org/results/d7aab7df196e0f6d6389b87ff29da7c2971e6b6d Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-11-05 21:12:57 +01:00
# 0001-configure.ac-fix-build-with-autoconf-2.70.patch
package/bird: needs autoreconf Since the bump to version 2.0.8 in commit f5906644b45269b1a5fe109cb64fad837e4fbff2, bird uses a home-grown "GNU Autoconf 2.69e" instead of standard autoconf 2.69 to generate the configure script. This fork seems to generate incorrect code: it uses ac_test_CFLAGS=${CFLAGS+y} to remember if CFLAGS was saved, while standard autoconf uses ac_test_CFLAGS=${CFLAGS+set} The configure.ac code itself, however, uses if test "$ac_test_CFLAGS" != set ; then to check if CFLAGS was overridden. Thus, Buildroot's CFLAGS are not taken into account and this leads to the following build failure: checking for glob.h... no configure: error: glob.h not found. This build failure is raised because -g0 and -g are both passed to gcc: configure:5207: checking for glob.h configure:5230: /data/buildroot-autobuilder/instance-0/output-1/host/bin/mips64el-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -pthread -fno-strict-aliasing -fno-strict-overflow -flto -Wall -Wextra -Wstrict-prototypes -Wno-parentheses -Wno-pointer-sign -Wno-missing-field-initializers -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pthread -flto=4 -g conftest.c >&5 /data/buildroot-autobuilder/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/8.4.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: /tmp/ccDboxph.ltrans0.ltrans.o:(.debug_info+0x2a): undefined reference to `conftest.c.0943dc99' /data/buildroot-autobuilder/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/8.4.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: /tmp/ccDboxph.ltrans0.ltrans.o:(.debug_info+0x2f): undefined reference to `conftest.c.0943dc99' -g0 is passed by buildroot and -g is passed by bird if $ac_test_CFLAGS" != set (since version 2.0.7 and https://gitlab.nic.cz/labs/bird/-/commit/cc95b4594ac924b40325a4f1adcae5312179db40) To fix this, we can simply run autoreconf and generate a correct configure script. Fixes: - http://autobuild.buildroot.org/results/1d2acc9f6b8830adc8b62d6b2e55837abae561a9 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-07-25 11:16:22 +02:00
BIRD_AUTORECONF = YES
ifeq ($(BR2_PACKAGE_BIRD_CLIENT),y)
BIRD_CONF_OPTS += --enable-client
BIRD_DEPENDENCIES += ncurses readline
else
BIRD_CONF_OPTS += --disable-client
endif
ifeq ($(BR2_PACKAGE_LIBSSH),y)
BIRD_CONF_OPTS += --enable-libssh
BIRD_DEPENDENCIES += libssh
else
BIRD_CONF_OPTS += --disable-libssh
endif
BIRD_PROTOCOLS = \
$(if $(BR2_PACKAGE_BIRD_BFD),bfd) \
$(if $(BR2_PACKAGE_BIRD_BABEL),babel) \
$(if $(BR2_PACKAGE_BIRD_BGP),bgp) \
$(if $(BR2_PACKAGE_BIRD_MRT),mrt) \
$(if $(BR2_PACKAGE_BIRD_OSPF),ospf) \
$(if $(BR2_PACKAGE_BIRD_PERF),perf) \
$(if $(BR2_PACKAGE_BIRD_PIPE),pipe) \
$(if $(BR2_PACKAGE_BIRD_RADV),radv) \
$(if $(BR2_PACKAGE_BIRD_RIP),rip) \
$(if $(BR2_PACKAGE_BIRD_RPKI),rpki) \
$(if $(BR2_PACKAGE_BIRD_STATIC),static)
BIRD_CONF_OPTS += --with-protocols=$(subst $(space),$(comma),$(strip $(BIRD_PROTOCOLS)))
$(eval $(autotools-package))