From f87a7d9b96057c05927160c6b4e612b1ee1c2bd5 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Wed, 31 May 2006 03:28:15 +0000
Subject: [PATCH] Always link with -pthread on FreeBSD and OpenBSD... this
 fixes crashes. with single-thread programs which use SDL audio.

Someone should test tone under Linux with SDL audio...
---
 src/build/Common.gmake | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/build/Common.gmake b/src/build/Common.gmake
index 51daa651da..32f020cdf9 100644
--- a/src/build/Common.gmake
+++ b/src/build/Common.gmake
@@ -281,14 +281,17 @@ ifeq ($(os),linux)    # Linux
  endif
 endif
 MT_CFLAGS    += -D_THREAD_SAFE -D_REENTRANT
+CFLAGS    += -D_THREAD_SAFE -D_REENTRANT
 ifeq ($(os),freebsd)    # FreeBSD
  MT_CFLAGS    += -DUSE_XP_SEMAPHORES
  MT_LDFLAGS    +=    -pthread
+ LDFLAGS    +=    -pthread
  XP_SEM    :=    1
 else
  ifeq ($(os),openbsd)    # OpenBSD
   MT_CFLAGS    += -DUSE_XP_SEMAPHORES
   MT_LDFLAGS    +=    -pthread
+  LDFLAGS    +=    -pthread
   XP_SEM    :=    1
  else
   ifeq ($(os),netbsd)    # NetBSD
-- 
GitLab