diff options
| author | Emil Renner Berthing <esmil@mailme.dk> | 2012-12-08 21:59:00 +0100 | 
|---|---|---|
| committer | Emil Renner Berthing <esmil@mailme.dk> | 2012-12-11 11:22:49 +0100 | 
| commit | f351a72d2d2872adc942d90bcdf36b046b2ed88f (patch) | |
| tree | ca49604a460b8ef89123d7121a6d1427b87aaaa5 | |
| parent | 9789e25f981eee1d166f628d12bdd6c57aea7db4 (diff) | |
| download | lem-f351a72d2d2872adc942d90bcdf36b046b2ed88f.tar.gz lem-f351a72d2d2872adc942d90bcdf36b046b2ed88f.tar.xz lem-f351a72d2d2872adc942d90bcdf36b046b2ed88f.zip | |
configure: check for pthreads
| -rwxr-xr-x | configure | 62 | ||||
| -rw-r--r-- | configure.ac | 5 | 
2 files changed, 64 insertions, 3 deletions
| @@ -3706,8 +3706,66 @@ case "x$target_os" in #(       ;;  esac -# Checks for Lua. +# Check for pthread library + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 +$as_echo_n "checking for library containing pthread_create... " >&6; } +if ${ac_cv_search_pthread_create+:} false; then : +  $as_echo_n "(cached) " >&6 +else +  ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h.  */ + +/* Override any GCC internal prototype to avoid an error. +   Use char because int might match the return type of a GCC +   builtin and then its argument prototype would still apply.  */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_create (); +int +main () +{ +return pthread_create (); +  ; +  return 0; +} +_ACEOF +for ac_lib in '' pthread; do +  if test -z "$ac_lib"; then +    ac_res="none required" +  else +    ac_res=-l$ac_lib +    LIBS="-l$ac_lib  $ac_func_search_save_LIBS" +  fi +  if ac_fn_c_try_link "$LINENO"; then : +  ac_cv_search_pthread_create=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ +    conftest$ac_exeext +  if ${ac_cv_search_pthread_create+:} false; then : +  break +fi +done +if ${ac_cv_search_pthread_create+:} false; then : +else +  ac_cv_search_pthread_create=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5 +$as_echo "$ac_cv_search_pthread_create" >&6; } +ac_res=$ac_cv_search_pthread_create +if test "$ac_res" != no; then : +  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +# Checks for Lua.  ac_ext=c  ac_cpp='$CPP $CPPFLAGS'  ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4668,7 +4726,7 @@ fi  fi  # Checks for header files. -for ac_header in stddef.h stdlib.h string.h unistd.h time.h +for ac_header in stddef.h stdlib.h string.h unistd.h sys/time.h time.h pthread.h  do :    as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`  ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.ac b/configure.ac index 889cdc3..f78c395 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,9 @@ AS_CASE(["x$target_os"],    [SHARED='-dynamiclib -Wl,-undefined,dynamic_lookup']    [STRIP="$STRIP -x"]) +# Check for pthread library +AC_SEARCH_LIBS([pthread_create], [pthread]) +  # Checks for Lua.  AS_CASE(["x$with_lua"],    [xcheck], @@ -90,7 +93,7 @@ AS_IF([test "x$with_lua" = 'xbuiltin'],    [AS_IF([test "x$cmoddir" = 'x'], [cmoddir="\${libdir}/lua/$builtin_lua_version"])])  # Checks for header files. -AC_CHECK_HEADERS([stddef.h stdlib.h string.h unistd.h time.h]) +AC_CHECK_HEADERS([stddef.h stdlib.h string.h unistd.h sys/time.h time.h pthread.h])  AC_CHECK_HEADERS([sys/eventfd.h sys/epoll.h sys/event.h])  #  [AC_RUN_IFELSE([AC_LANG_PROGRAM([ | 
