From dbd10c03e81ca616936ee34fc3aac6c6762b02f7 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 22 Jan 2019 17:50:02 +0100 Subject: [PATCH 1/5] Fix 'make clean' os Mac OS The find command on Mac OS needs a path as first argument, or else it outputs: find -name __pycache__ -o -name .pytest_cache | xargs rm -rf find: illegal option -- n usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression] find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression] find -name "*.pyc" -o -name "*_clippy.c" | xargs rm -f find: illegal option -- n usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression] find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression] Signed-off-by: Ruben Kerkhof --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index c56a551aa5..7f7d7d6236 100644 --- a/Makefile.am +++ b/Makefile.am @@ -226,8 +226,8 @@ noinst_HEADERS += defaults.h clean-local: clean-python .PHONY: clean-python clean-python: - find -name __pycache__ -o -name .pytest_cache | xargs rm -rf - find -name "*.pyc" -o -name "*_clippy.c" | xargs rm -f + find . -name __pycache__ -o -name .pytest_cache | xargs rm -rf + find . -name "*.pyc" -o -name "*_clippy.c" | xargs rm -f redistclean: $(MAKE) distclean CONFIG_CLEAN_FILES="$(filter-out $(EXTRA_DIST), $(CONFIG_CLEAN_FILES))" From a64c953a907b52312cd152b963ac49a97e2fc914 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 22 Jan 2019 17:55:31 +0100 Subject: [PATCH 2/5] Fix compile error on Mac OS CC lib/frr_pthread.lo lib/frr_pthread.c:128:40: error: too many arguments to function call, expected 1, have 3 ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL); ~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/pthread.h:512:1: note: 'pthread_setname_np' declared here __API_AVAILABLE(macos(10.6), ios(3.2)) Mac OS does have pthread_setname_np, but we can't use it here since it only accepts a single argument, the thread name, and thus only works for the current thread. Signed-off-by: Ruben Kerkhof --- lib/frr_pthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/frr_pthread.c b/lib/frr_pthread.c index d5a2007c4d..674e9b10e3 100644 --- a/lib/frr_pthread.c +++ b/lib/frr_pthread.c @@ -124,7 +124,7 @@ int frr_pthread_set_name(struct frr_pthread *fpt) #ifdef HAVE_PTHREAD_SETNAME_NP # ifdef GNU_LINUX ret = pthread_setname_np(fpt->thread, fpt->os_name); -# else /* NetBSD */ +# elif defined(__NetBSD__) ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL); # endif #elif defined(HAVE_PTHREAD_SET_NAME_NP) From 23e6726e0b9fb5e777bf66a1076f3d382dbf7041 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 22 Jan 2019 18:29:29 +0100 Subject: [PATCH 3/5] Redirect output of $AR check to /dev/null ./configure logs this on Mac OS: checking whether ar supports D option... /Library/Developer/CommandLineTools/usr/bin/ar: illegal option -- D usage: ar -d [-TLsv] archive file ... ar -m [-TLsv] archive file ... ar -m [-abiTLsv] position archive file ... ar -p [-TLsv] archive [file ...] ar -q [-cTLsv] archive file ... ar -r [-cuTLsv] archive file ... ar -r [-abciuTLsv] position archive file ... ar -t [-TLsv] archive [file ...] ar -x [-ouTLsv] archive [file ...] no This is quite noisy and we're only interested in the result of the check, not the output. Signed-off-by: Ruben Kerkhof --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7f08e8e764..0636177e85 100755 --- a/configure.ac +++ b/configure.ac @@ -346,7 +346,7 @@ AM_CONDITIONAL([STATIC_BIN], [test "x$enable_static_bin" = "xyes"]) dnl $AR and $RANLIB are set by LT_INIT above AC_MSG_CHECKING([whether $AR supports D option]) -if $AR crD conftest.a; then +if $AR crD conftest.a >/dev/null 2>/dev/null; then AC_MSG_RESULT([yes]) dnl ARFLAGS is for automake, AR_FLAGS for libtool m-( ARFLAGS="crD" From 29d46e4bb6584d763487cf53fdc89f76d1cb2b00 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 22 Jan 2019 18:32:08 +0100 Subject: [PATCH 4/5] Redirect output of ranlib to /dev/null ./configure on Mac OS logs: checking whether ranlib supports D option... error: /Library/Developer/CommandLineTools/usr/bin/ranlib: unknown option character `D' in: -D Usage: /Library/Developer/CommandLineTools/usr/bin/ranlib [-sactfqLT] [-] archive [...] no This is quite noisy. Signed-off-by: Ruben Kerkhof --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0636177e85..1e34546329 100755 --- a/configure.ac +++ b/configure.ac @@ -360,7 +360,7 @@ AC_SUBST([ARFLAGS]) AC_SUBST([AR_FLAGS]) AC_MSG_CHECKING([whether $RANLIB supports D option]) -if $RANLIB -D conftest.a; then +if $RANLIB -D conftest.a >/dev/null 2>/dev/null; then AC_MSG_RESULT([yes]) RANLIB="$RANLIB -D" else From 1b68b1cdd3f0898e513ca929529cbf79f6b37870 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Tue, 22 Jan 2019 18:39:47 +0100 Subject: [PATCH 5/5] Only check for .interp when we have objcopy On Mac OS, where we don't have objcopy, ./configure logs: checking for objcopy... no checking for .interp value to use... ./configure: line 22174: conftest.interp: No such file or directory Signed-off-by: Ruben Kerkhof --- configure.ac | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 1e34546329..cb7f58d196 100755 --- a/configure.ac +++ b/configure.ac @@ -817,15 +817,17 @@ fi AM_CONDITIONAL([GIT_VERSION], [test "x$with_pkg_git_version" = "xyes"]) AC_CHECK_TOOL([OBJCOPY], [objcopy], [:]) -AC_CACHE_CHECK([for .interp value to use], [frr_cv_interp], [ - frr_cv_interp="" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], [ - if $OBJCOPY -j.interp -Obinary conftest conftest.interp; then - frr_cv_interp="`xargs -0 echo < conftest.interp`" - fi - test -f conftest.interp && rm conftest.interp +if test "x${OBJCOPY}" != "x:"; then + AC_CACHE_CHECK([for .interp value to use], [frr_cv_interp], [ + frr_cv_interp="" + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], [ + if $OBJCOPY -j.interp -Obinary conftest conftest.interp; then + frr_cv_interp="`xargs -0 echo < conftest.interp`" + fi + test -f conftest.interp && rm conftest.interp + ]) ]) -]) +fi if test -n "$frr_cv_interp"; then AC_DEFINE_UNQUOTED([INTERP], ["$frr_cv_interp"], [.interp value]) fi