From: Fabrice Fontaine Date: Wed, 24 Apr 2019 17:14:29 +0000 (+0200) Subject: fix build on m68k with uclibc X-Git-Tag: suricata-5.0.0-rc1~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b05db7db0c3ed4647adbe763f77a5f61b6aefe1;p=thirdparty%2Fsuricata.git fix build on m68k with uclibc uclibc on m68k defines _POSIX_SPIN_LOCKS but does not define pthread_spin_unlock so check for this function before using pthread_spin_xxx functions Fixes: - http://autobuild.buildroot.org/results/ed923bcc1454ce90444b8dac7c064b5f4ea4a0a5 Signed-off-by: Fabrice Fontaine --- diff --git a/configure.ac b/configure.ac index 411f702763..ad14f66dfe 100644 --- a/configure.ac +++ b/configure.ac @@ -869,6 +869,8 @@ exit 1 fi + AC_CHECK_FUNCS([pthread_spin_unlock]) + # libjansson AC_ARG_WITH(libjansson_includes, [ --with-libjansson-includes=DIR libjansson include directory], diff --git a/src/threads.h b/src/threads.h index 4e6f611344..4eb1a73606 100644 --- a/src/threads.h +++ b/src/threads.h @@ -155,7 +155,7 @@ enum { #define SCCtrlCondDestroy pthread_cond_destroy /* spinlocks */ -#if ((_POSIX_SPIN_LOCKS - 200112L) < 0L) || defined HELGRIND +#if ((_POSIX_SPIN_LOCKS - 200112L) < 0L) || defined HELGRIND || !defined(HAVE_PTHREAD_SPIN_UNLOCK) #define SCSpinlock SCMutex #define SCSpinLock(spin) SCMutexLock((spin)) #define SCSpinTrylock(spin) SCMutexTrylock((spin))