From 9c1be10509882ded41279d327c144106a30c06b1 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 16 Jan 2020 20:23:23 +0100 Subject: [PATCH 1/3] build: fix shell == mis-use The "test" program uses =, not ==. A lot of shells accept == as an extension, but not all do and it's technically out of spec. Signed-off-by: David Lamparter --- configure.ac | 2 +- m4/ax_python.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 4158fdec30..1e79c3c2e8 100755 --- a/configure.ac +++ b/configure.ac @@ -30,7 +30,7 @@ build_clippy="true" dnl case 1: external clippy if test -n "$with_clippy" -a "$with_clippy" != "no" -a "$with_clippy" != "yes"; then - if test "$enable_clippy_only" == "yes"; then + if test "$enable_clippy_only" = "yes"; then AC_MSG_ERROR([--enable-clippy-only does not make sense with --with-clippy]) fi diff --git a/m4/ax_python.m4 b/m4/ax_python.m4 index 66338511a3..69809184ee 100644 --- a/m4/ax_python.m4 +++ b/m4/ax_python.m4 @@ -186,7 +186,7 @@ AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_MSG_RESULT([yes]) PYTHON_CFLAGS="`\"$pycfg\" --includes`" - if test x"${py_ver}" == x"3.8" || test x"{py_ver}" == x"3.9"; then + if test x"${py_ver}" = x"3.8" || test x"{py_ver}" = x"3.9"; then PYTHON_LIBS="`\"$pycfg\" --ldflags --embed`" else PYTHON_LIBS="`\"$pycfg\" --ldflags`" From d60693fdf82c8c8d6d7923ea3b2c1326ece6216d Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 17 Jan 2020 13:57:15 +0100 Subject: [PATCH 2/3] build: accept libunwind without pkg-config NetBSD installs LLVM's libunwind without a pkg-config file, but it works perfectly fine. Signed-off-by: David Lamparter --- configure.ac | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1e79c3c2e8..c8371f304e 100755 --- a/configure.ac +++ b/configure.ac @@ -2113,6 +2113,19 @@ if test x"${enable_backtrace}" != x"no" ; then AC_DEFINE([HAVE_LIBUNWIND], [1], [libunwind]) backtrace_ok=yes ], [ + true + ]) + + if test "$backtrace_ok" = "no"; then + AC_CHECK_HEADER([unwind.h], [ + AC_SEARCH_LIBS([unw_getcontext], [unwind], [ + AC_DEFINE([HAVE_LIBUNWIND], [1], [libunwind]) + backtrace_ok=yes + ]) + ]) + fi + + if test "$backtrace_ok" = "no"; then case "$host_os" in sunos* | solaris2*) AC_CHECK_FUNCS([printstack], [ @@ -2129,7 +2142,7 @@ if test x"${enable_backtrace}" != x"no" ; then ],, [-lm]) ]) fi - ]) + fi if test x"${enable_backtrace}" = x"yes" -a x"${backtrace_ok}" = x"no"; then dnl user explicitly requested backtrace but we failed to find support From 7fb434ef85846a9c893cf5d428b19150467892dd Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 17 Jan 2020 15:53:47 +0100 Subject: [PATCH 3/3] build: fix auto git ID length This script was written back when `git describe` would abbreviate to 7-char commit IDs; they're longer now and we're grabbing the tail end... Signed-off-by: David Lamparter --- lib/gitversion.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitversion.pl b/lib/gitversion.pl index 2718046d0b..dd25c8976a 100644 --- a/lib/gitversion.pl +++ b/lib/gitversion.pl @@ -6,7 +6,7 @@ chdir $dir || die "$dir: $!\n"; my $gitdesc = `git describe --always --first-parent --tags --dirty --match 'frr-*' || echo -- \"0-gUNKNOWN\"`; chomp $gitdesc; -my $gitsuffix = ($gitdesc =~ /([0-9a-fA-F]{7}(-dirty)?)$/) ? "-g$1" : "-gUNKNOWN"; +my $gitsuffix = ($gitdesc =~ /-g([0-9a-fA-F]+(-dirty)?)$/) ? "-g$1" : "-gUNKNOWN"; printf STDERR "git suffix: %s\n", $gitsuffix; printf "#define GIT_SUFFIX \"%s\"\n", $gitsuffix;