From ac2bb3f200b9d765e2e41f0d9532b41e75e82381 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 23 Mar 2015 20:07:24 -0400 Subject: [PATCH] configure script: fix recursive mutex test on Linux systems (thanks, Ozkan!). --- configure | 12 ++++++++---- configure.in | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 81e6b24b2..e220948ad 100755 --- a/configure +++ b/configure @@ -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 int @@ -21929,7 +21930,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : has_recursive_mutexes=yes @@ -21937,12 +21938,14 @@ $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 int @@ -21956,7 +21959,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : has_recursive_mutexes=yes @@ -21964,7 +21967,8 @@ $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; } diff --git a/configure.in b/configure.in index a2ad20a67..6e3878247 100644 --- a/configure.in +++ b/configure.in @@ -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_mutexattr_t attr; @@ -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_mutexattr_t attr;