Browse Source

Always link against pthread when using autotools (resolves #1410)

Theoretically I could enable it on a case-by-case basis, but as of now glslang,
physfs and the thread module all require pthread, so I might as well just
always link it in.
Bart van Strien 7 years ago
parent
commit
32da35115c
2 changed files with 4 additions and 0 deletions
  1. 1 0
      platform/unix/configure.ac
  2. 3 0
      platform/unix/deps.m4

+ 1 - 0
platform/unix/configure.ac

@@ -63,6 +63,7 @@ ACLOVE_DEP_LUA
 ACLOVE_DEP_SDL2
 ACLOVE_DEP_LIBM
 ACLOVE_DEP_ZLIB
+ACLOVE_DEP_PTHREAD
 
 # Conditional dependencies
 AS_VAR_IF([enable_module_audio], [yes], [ACLOVE_DEP_OPENAL], [])

+ 3 - 0
platform/unix/deps.m4

@@ -22,6 +22,9 @@ AC_DEFUN([ACLOVE_DEP_LIBM], [
 AC_DEFUN([ACLOVE_DEP_SDL2], [
 	AM_PATH_SDL2([], [], [LOVE_MSG_ERROR([SDL 2])])])
 
+AC_DEFUN([ACLOVE_DEP_PTHREAD], [
+	AC_SEARCH_LIBS([pthread_create], [pthread], [], [LOVE_MSG_ERROR([the POSIX threads library])])])
+
 # does not use pkg-config because of the FILE_OFFSET_BITS.. bit
 AC_DEFUN([ACLOVE_DEP_MPG123], [
 	AC_SEARCH_LIBS([mpg123_open_feed], [mpg123], [],