Skip to content

Commit

Permalink
configure script: fix recursive mutex test on Linux systems (thanks, …
Browse files Browse the repository at this point in the history
…Ozkan!).
  • Loading branch information
icculus committed Mar 24, 2015
1 parent c76130c commit ac2bb3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions configure
Expand Up @@ -21916,6 +21916,7 @@ $as_echo_n "checking for recursive mutexes... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#define _GNU_SOURCE 1
#include <pthread.h>

int
Expand All @@ -21929,20 +21930,22 @@ main ()
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :

has_recursive_mutexes=yes

$as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1" >>confdefs.h


fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
if test x$has_recursive_mutexes = xno; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#define _GNU_SOURCE 1
#include <pthread.h>

int
Expand All @@ -21956,15 +21959,16 @@ main ()
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :

has_recursive_mutexes=yes

$as_echo "#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1" >>confdefs.h


fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_recursive_mutexes" >&5
$as_echo "$has_recursive_mutexes" >&6; }
Expand Down
6 changes: 4 additions & 2 deletions configure.in
Expand Up @@ -2424,7 +2424,8 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]])
AC_MSG_CHECKING(for recursive mutexes)
has_recursive_mutexes=no
if test x$has_recursive_mutexes = xno; then
AC_TRY_COMPILE([
AC_TRY_LINK([
#define _GNU_SOURCE 1
#include <pthread.h>
],[
pthread_mutexattr_t attr;
Expand All @@ -2435,7 +2436,8 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [[default=yes]]])
])
fi
if test x$has_recursive_mutexes = xno; then
AC_TRY_COMPILE([
AC_TRY_LINK([
#define _GNU_SOURCE 1
#include <pthread.h>
],[
pthread_mutexattr_t attr;
Expand Down

0 comments on commit ac2bb3f

Please sign in to comment.