]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
fix build on m68k with uclibc
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Wed, 24 Apr 2019 17:14:29 +0000 (19:14 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 26 Aug 2019 08:15:43 +0000 (10:15 +0200)
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 <fontaine.fabrice@gmail.com>
configure.ac
src/threads.h

index 411f702763ecbcb48c803707b4a7494d814acc83..ad14f66dfe792cdb7f9cd1ed2f8175632bf76a0e 100644 (file)
         exit 1
     fi
 
+    AC_CHECK_FUNCS([pthread_spin_unlock])
+
   # libjansson
     AC_ARG_WITH(libjansson_includes,
             [  --with-libjansson-includes=DIR  libjansson include directory],
index 4e6f6113448b57a5d9e88423f5419e809a8e0641..4eb1a73606dacaec642feb75cab10cb64c67bed1 100644 (file)
@@ -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))