PCem
changeset 156:e0714e10b44e
Add check for pthread in configure. Patch from kurumushi.
| author | TomW |
|---|---|
| date | Sun Sep 14 21:40:46 2014 +0100 |
| parents | 6b3e1b9d0220 |
| children | cf4453f069ba |
| files | configure configure.ac |
| diffstat | 2 files changed, 46 insertions(+), 0 deletions(-) [+] |
line diff
1.1 --- a/configure Fri Sep 05 21:40:21 2014 +0100 1.2 +++ b/configure Sun Sep 14 21:40:46 2014 +0100 1.3 @@ -4303,6 +4303,51 @@ 1.4 fi 1.5 1.6 1.7 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 1.8 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } 1.9 +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : 1.10 + $as_echo_n "(cached) " >&6 1.11 +else 1.12 + ac_check_lib_save_LIBS=$LIBS 1.13 +LIBS="-lpthread $LIBS" 1.14 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext 1.15 +/* end confdefs.h. */ 1.16 + 1.17 +/* Override any GCC internal prototype to avoid an error. 1.18 + Use char because int might match the return type of a GCC 1.19 + builtin and then its argument prototype would still apply. */ 1.20 +#ifdef __cplusplus 1.21 +extern "C" 1.22 +#endif 1.23 +char pthread_create (); 1.24 +int 1.25 +main () 1.26 +{ 1.27 +return pthread_create (); 1.28 + ; 1.29 + return 0; 1.30 +} 1.31 +_ACEOF 1.32 +if ac_fn_c_try_link "$LINENO"; then : 1.33 + ac_cv_lib_pthread_pthread_create=yes 1.34 +else 1.35 + ac_cv_lib_pthread_pthread_create=no 1.36 +fi 1.37 +rm -f core conftest.err conftest.$ac_objext \ 1.38 + conftest$ac_exeext conftest.$ac_ext 1.39 +LIBS=$ac_check_lib_save_LIBS 1.40 +fi 1.41 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 1.42 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } 1.43 +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : 1.44 + cat >>confdefs.h <<_ACEOF 1.45 +#define HAVE_LIBPTHREAD 1 1.46 +_ACEOF 1.47 + 1.48 + LIBS="-lpthread $LIBS" 1.49 + 1.50 +fi 1.51 + 1.52 1.53 ac_config_files="$ac_config_files Makefile src/Makefile" 1.54
