configure script: fix recursive mutex test on Linux systems (thanks, Ozkan!).
authorRyan C. Gordon <icculus@icculus.org>
Mon, 23 Mar 2015 20:07:24 -0400
changeset 9424a3344156e514
parent 9423 3df83030dab9
child 9427 eb1bde345c4b
configure script: fix recursive mutex test on Linux systems (thanks, Ozkan!).
configure
configure.in
     1.1 --- a/configure	Mon Mar 23 19:54:33 2015 -0400
     1.2 +++ b/configure	Mon Mar 23 20:07:24 2015 -0400
     1.3 @@ -21916,6 +21916,7 @@
     1.4                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     1.5  /* end confdefs.h.  */
     1.6  
     1.7 +                  #define _GNU_SOURCE 1
     1.8                    #include <pthread.h>
     1.9  
    1.10  int
    1.11 @@ -21929,7 +21930,7 @@
    1.12    return 0;
    1.13  }
    1.14  _ACEOF
    1.15 -if ac_fn_c_try_compile "$LINENO"; then :
    1.16 +if ac_fn_c_try_link "$LINENO"; then :
    1.17  
    1.18                  has_recursive_mutexes=yes
    1.19  
    1.20 @@ -21937,12 +21938,14 @@
    1.21  
    1.22  
    1.23  fi
    1.24 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.25 +rm -f core conftest.err conftest.$ac_objext \
    1.26 +    conftest$ac_exeext conftest.$ac_ext
    1.27              fi
    1.28              if test x$has_recursive_mutexes = xno; then
    1.29                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.30  /* end confdefs.h.  */
    1.31  
    1.32 +                  #define _GNU_SOURCE 1
    1.33                    #include <pthread.h>
    1.34  
    1.35  int
    1.36 @@ -21956,7 +21959,7 @@
    1.37    return 0;
    1.38  }
    1.39  _ACEOF
    1.40 -if ac_fn_c_try_compile "$LINENO"; then :
    1.41 +if ac_fn_c_try_link "$LINENO"; then :
    1.42  
    1.43                  has_recursive_mutexes=yes
    1.44  
    1.45 @@ -21964,7 +21967,8 @@
    1.46  
    1.47  
    1.48  fi
    1.49 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.50 +rm -f core conftest.err conftest.$ac_objext \
    1.51 +    conftest$ac_exeext conftest.$ac_ext
    1.52              fi
    1.53              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_recursive_mutexes" >&5
    1.54  $as_echo "$has_recursive_mutexes" >&6; }
     2.1 --- a/configure.in	Mon Mar 23 19:54:33 2015 -0400
     2.2 +++ b/configure.in	Mon Mar 23 20:07:24 2015 -0400
     2.3 @@ -2424,7 +2424,8 @@
     2.4              AC_MSG_CHECKING(for recursive mutexes)
     2.5              has_recursive_mutexes=no
     2.6              if test x$has_recursive_mutexes = xno; then
     2.7 -                AC_TRY_COMPILE([
     2.8 +                AC_TRY_LINK([
     2.9 +                  #define _GNU_SOURCE 1
    2.10                    #include <pthread.h>
    2.11                  ],[
    2.12                    pthread_mutexattr_t attr;
    2.13 @@ -2435,7 +2436,8 @@
    2.14                  ])
    2.15              fi
    2.16              if test x$has_recursive_mutexes = xno; then
    2.17 -                AC_TRY_COMPILE([
    2.18 +                AC_TRY_LINK([
    2.19 +                  #define _GNU_SOURCE 1
    2.20                    #include <pthread.h>
    2.21                  ],[
    2.22                    pthread_mutexattr_t attr;