Develop and Download Open Source Software

Browse CVS Repository

Diff of /satellite/satellite4/configure

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.16 by orrisroot, Sun Oct 30 09:54:48 2005 UTC revision 1.17 by orrisroot, Sun Oct 30 19:09:51 2005 UTC
# Line 467  ac_includes_default="\ Line 467  ac_includes_default="\
467  # include <unistd.h>  # include <unistd.h>
468  #endif"  #endif"
469    
470  ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar sl4includedir sl4libdir sl4libexecdir docdir sl4docdir sl4sharedir examplesdir moduledir systemrcdir modulercdir CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP LN_S RANLIB ac_ct_RANLIB YACC EGREP ECHO AR ac_ct_AR CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LEX LEXLIB LEX_OUTPUT_ROOT SHLIBPATH_VAR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT PTHREAD_CFLAGS PTHREAD_LIBS TERMCAP_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XPM_CFLAGS XPM_LIBS XTOOLKIT_CFLAGS XTOOLKIT_LIBS LIBOBJS POW_LIB LTLIBOBJS'  ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar sl4includedir sl4libdir sl4libexecdir docdir sl4docdir sl4sharedir examplesdir moduledir systemrcdir modulercdir CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP LN_S RANLIB ac_ct_RANLIB YACC EGREP ECHO AR ac_ct_AR CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LEX LEXLIB LEX_OUTPUT_ROOT SHLIBPATH_VAR MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS TERMCAP_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XPM_CFLAGS XPM_LIBS XTOOLKIT_CFLAGS XTOOLKIT_LIBS LIBOBJS POW_LIB LTLIBOBJS'
471  ac_subst_files=''  ac_subst_files=''
472    
473  # Initialize some variables set by options.  # Initialize some variables set by options.
# Line 20577  fi Line 20577  fi
20577    
20578    
20579  # check pthread library  # check pthread library
 # define pthread_test() program  
20580    
20581    
   PTHREAD_LIBS=""  
   PTHREAD_CFLAGS=""  
 # checking header  
   have_pthreads=no  
   if test "${ac_cv_header_pthread_h+set}" = set; then  
   echo "$as_me:$LINENO: checking for pthread.h" >&5  
 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6  
 if test "${ac_cv_header_pthread_h+set}" = set; then  
   echo $ECHO_N "(cached) $ECHO_C" >&6  
 fi  
 echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5  
 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6  
 else  
   # Is the header compilable?  
 echo "$as_me:$LINENO: checking pthread.h usability" >&5  
 echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6  
 cat >conftest.$ac_ext <<_ACEOF  
 /* confdefs.h.  */  
 _ACEOF  
 cat confdefs.h >>conftest.$ac_ext  
 cat >>conftest.$ac_ext <<_ACEOF  
 /* end confdefs.h.  */  
 $ac_includes_default  
 #include <pthread.h>  
 _ACEOF  
 rm -f conftest.$ac_objext  
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5  
   (eval $ac_compile) 2>conftest.er1  
   ac_status=$?  
   grep -v '^ *+' conftest.er1 >conftest.err  
   rm -f conftest.er1  
   cat conftest.err >&5  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } &&  
          { ac_try='test -z "$ac_c_werror_flag"  
                          || test ! -s conftest.err'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; } &&  
          { ac_try='test -s conftest.$ac_objext'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; }; then  
   ac_header_compiler=yes  
 else  
   echo "$as_me: failed program was:" >&5  
 sed 's/^/| /' conftest.$ac_ext >&5  
   
 ac_header_compiler=no  
 fi  
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext  
 echo "$as_me:$LINENO: result: $ac_header_compiler" >&5  
 echo "${ECHO_T}$ac_header_compiler" >&6  
   
 # Is the header present?  
 echo "$as_me:$LINENO: checking pthread.h presence" >&5  
 echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6  
 cat >conftest.$ac_ext <<_ACEOF  
 /* confdefs.h.  */  
 _ACEOF  
 cat confdefs.h >>conftest.$ac_ext  
 cat >>conftest.$ac_ext <<_ACEOF  
 /* end confdefs.h.  */  
 #include <pthread.h>  
 _ACEOF  
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5  
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1  
   ac_status=$?  
   grep -v '^ *+' conftest.er1 >conftest.err  
   rm -f conftest.er1  
   cat conftest.err >&5  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } >/dev/null; then  
   if test -s conftest.err; then  
     ac_cpp_err=$ac_c_preproc_warn_flag  
     ac_cpp_err=$ac_cpp_err$ac_c_werror_flag  
   else  
     ac_cpp_err=  
   fi  
 else  
   ac_cpp_err=yes  
 fi  
 if test -z "$ac_cpp_err"; then  
   ac_header_preproc=yes  
 else  
   echo "$as_me: failed program was:" >&5  
 sed 's/^/| /' conftest.$ac_ext >&5  
   
   ac_header_preproc=no  
 fi  
 rm -f conftest.err conftest.$ac_ext  
 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5  
 echo "${ECHO_T}$ac_header_preproc" >&6  
   
 # So?  What about this header?  
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in  
   yes:no: )  
     { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5  
 echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}  
     { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5  
 echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}  
     ac_header_preproc=yes  
     ;;  
   no:yes:* )  
     { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5  
 echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}  
     { echo "$as_me:$LINENO: WARNING: pthread.h:     check for missing prerequisite headers?" >&5  
 echo "$as_me: WARNING: pthread.h:     check for missing prerequisite headers?" >&2;}  
     { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5  
 echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}  
     { echo "$as_me:$LINENO: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&5  
 echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&2;}  
     { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5  
 echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}  
     { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5  
 echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}  
     (  
       cat <<\_ASBOX  
 ## ---------------------------------------- ##  
 ## Report this to okumura@brain.riken.go.jp ##  
 ## ---------------------------------------- ##  
 _ASBOX  
     ) |  
       sed "s/^/$as_me: WARNING:     /" >&2  
     ;;  
 esac  
 echo "$as_me:$LINENO: checking for pthread.h" >&5  
 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6  
 if test "${ac_cv_header_pthread_h+set}" = set; then  
   echo $ECHO_N "(cached) $ECHO_C" >&6  
 else  
   ac_cv_header_pthread_h=$ac_header_preproc  
 fi  
 echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5  
 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6  
   
 fi  
 if test $ac_cv_header_pthread_h = yes; then  
   have_pthreads=yes  
 fi  
20582    
20583    
20584    if test "x$have_pthreads" = xno; then  ac_ext=c
20585      { { echo "$as_me:$LINENO: error: *** Unable to locate working posix thread library ***" >&5  ac_cpp='$CPP $CPPFLAGS'
20586  echo "$as_me: error: *** Unable to locate working posix thread library ***" >&2;}  ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
20587     { (exit 1); exit 1; }; }  ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
20588    fi  ac_compiler_gnu=$ac_cv_c_compiler_gnu
 # checking -pthread or -pthreads trick  
   pthread_trick=""  
   for flag in pthread pthreads; do  
     ac_save_cflags="$CFLAGS"  
     CFLAGS="$CFLAGS -$flag"  
     if test "$cross_compiling" = yes; then  
   cat >conftest.$ac_ext <<_ACEOF  
   
   #include <pthread.h>  
   static int n;  
   void *func(void *data){ n=1234; return (void*)&n; }  
   int main(){  
     pthread_t t;  
     void *ret;  
     pthread_create(&t, NULL, func, 0);  
     pthread_join(t,&ret);  
     exit(n!=1234 || ret!=(void*)&n);  
   }  
 _ACEOF  
 rm -f conftest.$ac_objext conftest$ac_exeext  
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5  
   (eval $ac_link) 2>conftest.er1  
   ac_status=$?  
   grep -v '^ *+' conftest.er1 >conftest.err  
   rm -f conftest.er1  
   cat conftest.err >&5  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } &&  
          { ac_try='test -z "$ac_c_werror_flag"  
                          || test ! -s conftest.err'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; } &&  
          { ac_try='test -s conftest$ac_exeext'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; }; then  
   pthread_flag_works=yes  
 else  
   echo "$as_me: failed program was:" >&5  
 sed 's/^/| /' conftest.$ac_ext >&5  
   
 pthread_flag_works=no  
 fi  
 rm -f conftest.err conftest.$ac_objext \  
       conftest$ac_exeext conftest.$ac_ext  
 else  
   cat >conftest.$ac_ext <<_ACEOF  
 /* confdefs.h.  */  
 _ACEOF  
 cat confdefs.h >>conftest.$ac_ext  
 cat >>conftest.$ac_ext <<_ACEOF  
 /* end confdefs.h.  */  
20589    
20590    #include <pthread.h>  acx_pthread_ok=no
   static int n;  
   void *func(void *data){ n=1234; return (void*)&n; }  
   int main(){  
     pthread_t t;  
     void *ret;  
     pthread_create(&t, NULL, func, 0);  
     pthread_join(t,&ret);  
     exit(n!=1234 || ret!=(void*)&n);  
   }  
 _ACEOF  
 rm -f conftest$ac_exeext  
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5  
   (eval $ac_link) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; }; then  
   pthread_flag_works=yes  
 else  
   echo "$as_me: program exited with status $ac_status" >&5  
 echo "$as_me: failed program was:" >&5  
 sed 's/^/| /' conftest.$ac_ext >&5  
20591    
20592  ( exit $ac_status )  # We used to check for pthread.h first, but this fails if pthread.h
20593  pthread_flag_works=no  # requires special compiler flags (e.g. on True64 or Sequent).
20594  fi  # It gets checked for in the link test anyway.
20595  rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext  
20596  fi  # First of all, check if the user has set any of the PTHREAD_LIBS,
20597      CFLAGS="$ac_save_cflags"  # etcetera environment variables, and if threads linking works using
20598      if test $pthread_flag_works = yes; then  # them:
20599         pthread_trick=-$flag  if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
20600      fi          save_CFLAGS="$CFLAGS"
20601    done          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
20602  # checking libs          save_LIBS="$LIBS"
20603    ac_save_libs="$LIBS"          LIBS="$PTHREAD_LIBS $LIBS"
20604    LIBS="$pthread_trick $LIBS"          echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
20605    PTHREAD_LIBS=error  echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6
20606    echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthread" >&5          cat >conftest.$ac_ext <<_ACEOF
 echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6  
 if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then  
   echo $ECHO_N "(cached) $ECHO_C" >&6  
 else  
   ac_check_lib_save_LIBS=$LIBS  
 LIBS="-lpthread  $LIBS"  
 cat >conftest.$ac_ext <<_ACEOF  
20607  /* confdefs.h.  */  /* confdefs.h.  */
20608  _ACEOF  _ACEOF
20609  cat confdefs.h >>conftest.$ac_ext  cat confdefs.h >>conftest.$ac_ext
# Line 20851  extern "C" Line 20616  extern "C"
20616  #endif  #endif
20617  /* We use char because int might match the return type of a gcc2  /* We use char because int might match the return type of a gcc2
20618     builtin and then its argument prototype would still apply.  */     builtin and then its argument prototype would still apply.  */
20619  char pthread_attr_init ();  char pthread_join ();
20620  int  int
20621  main ()  main ()
20622  {  {
20623  pthread_attr_init ();  pthread_join ();
20624    ;    ;
20625    return 0;    return 0;
20626  }  }
# Line 20882  if { (eval echo "$as_me:$LINENO: \"$ac_l Line 20647  if { (eval echo "$as_me:$LINENO: \"$ac_l
20647    ac_status=$?    ac_status=$?
20648    echo "$as_me:$LINENO: \$? = $ac_status" >&5    echo "$as_me:$LINENO: \$? = $ac_status" >&5
20649    (exit $ac_status); }; }; then    (exit $ac_status); }; }; then
20650    ac_cv_lib_pthread_pthread_attr_init=yes    acx_pthread_ok=yes
20651  else  else
20652    echo "$as_me: failed program was:" >&5    echo "$as_me: failed program was:" >&5
20653  sed 's/^/| /' conftest.$ac_ext >&5  sed 's/^/| /' conftest.$ac_ext >&5
20654    
 ac_cv_lib_pthread_pthread_attr_init=no  
20655  fi  fi
20656  rm -f conftest.err conftest.$ac_objext \  rm -f conftest.err conftest.$ac_objext \
20657        conftest$ac_exeext conftest.$ac_ext        conftest$ac_exeext conftest.$ac_ext
20658  LIBS=$ac_check_lib_save_LIBS          echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
20659  fi  echo "${ECHO_T}$acx_pthread_ok" >&6
20660  echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_attr_init" >&5          if test x"$acx_pthread_ok" = xno; then
20661  echo "${ECHO_T}$ac_cv_lib_pthread_pthread_attr_init" >&6                  PTHREAD_LIBS=""
20662  if test $ac_cv_lib_pthread_pthread_attr_init = yes; then                  PTHREAD_CFLAGS=""
20663    PTHREAD_LIBS="-lpthread"          fi
20664            LIBS="$save_LIBS"
20665            CFLAGS="$save_CFLAGS"
20666  fi  fi
20667    
20668    if test "x$PTHREAD_LIBS" = xerror; then  # We must check for the threads library under a number of different
20669      echo "$as_me:$LINENO: checking for pthread_attr_init in -lpthreads" >&5  # names; the ordering is very important because some systems
20670  echo $ECHO_N "checking for pthread_attr_init in -lpthreads... $ECHO_C" >&6  # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
20671  if test "${ac_cv_lib_pthreads_pthread_attr_init+set}" = set; then  # libraries is broken (non-POSIX).
20672    
20673    # Create a list of thread flags to try.  Items starting with a "-" are
20674    # C compiler flags, and other items are library names, except for "none"
20675    # which indicates that we try without any flags at all, and "pthread-config"
20676    # which is a program returning the flags for the Pth emulation library.
20677    
20678    acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
20679    
20680    # The ordering *is* (sometimes) important.  Some notes on the
20681    # individual items follow:
20682    
20683    # pthreads: AIX (must check this before -lpthread)
20684    # none: in case threads are in libc; should be tried before -Kthread and
20685    #       other compiler flags to prevent continual compiler warnings
20686    # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
20687    # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
20688    # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
20689    # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
20690    # -pthreads: Solaris/gcc
20691    # -mthreads: Mingw32/gcc, Lynx/gcc
20692    # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
20693    #      doesn't hurt to check since this sometimes defines pthreads too;
20694    #      also defines -D_REENTRANT)
20695    #      ... -mt is also the pthreads flag for HP/aCC
20696    # pthread: Linux, etcetera
20697    # --thread-safe: KAI C++
20698    # pthread-config: use pthread-config program (for GNU Pth library)
20699    
20700    case "${host_cpu}-${host_os}" in
20701            *solaris*)
20702    
20703            # On Solaris (at least, for some versions), libc contains stubbed
20704            # (non-functional) versions of the pthreads routines, so link-based
20705            # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
20706            # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
20707            # a function called by this macro, so we could check for that, but
20708            # who knows whether they'll stub that too in a future libc.)  So,
20709            # we'll just look for -pthreads and -lpthread first:
20710    
20711            acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
20712            ;;
20713    esac
20714    
20715    if test x"$acx_pthread_ok" = xno; then
20716    for flag in $acx_pthread_flags; do
20717    
20718            case $flag in
20719                    none)
20720                    echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5
20721    echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6
20722                    ;;
20723    
20724                    -*)
20725                    echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5
20726    echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6
20727                    PTHREAD_CFLAGS="$flag"
20728                    ;;
20729    
20730                    pthread-config)
20731                    # Extract the first word of "pthread-config", so it can be a program name with args.
20732    set dummy pthread-config; ac_word=$2
20733    echo "$as_me:$LINENO: checking for $ac_word" >&5
20734    echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20735    if test "${ac_cv_prog_acx_pthread_config+set}" = set; then
20736    echo $ECHO_N "(cached) $ECHO_C" >&6    echo $ECHO_N "(cached) $ECHO_C" >&6
20737  else  else
20738    ac_check_lib_save_LIBS=$LIBS    if test -n "$acx_pthread_config"; then
20739  LIBS="-lpthreads  $LIBS"    ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test.
 cat >conftest.$ac_ext <<_ACEOF  
 /* confdefs.h.  */  
 _ACEOF  
 cat confdefs.h >>conftest.$ac_ext  
 cat >>conftest.$ac_ext <<_ACEOF  
 /* end confdefs.h.  */  
   
 /* Override any gcc2 internal prototype to avoid an error.  */  
 #ifdef __cplusplus  
 extern "C"  
 #endif  
 /* We use char because int might match the return type of a gcc2  
    builtin and then its argument prototype would still apply.  */  
 char pthread_attr_init ();  
 int  
 main ()  
 {  
 pthread_attr_init ();  
   ;  
   return 0;  
 }  
 _ACEOF  
 rm -f conftest.$ac_objext conftest$ac_exeext  
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5  
   (eval $ac_link) 2>conftest.er1  
   ac_status=$?  
   grep -v '^ *+' conftest.er1 >conftest.err  
   rm -f conftest.er1  
   cat conftest.err >&5  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } &&  
          { ac_try='test -z "$ac_c_werror_flag"  
                          || test ! -s conftest.err'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; } &&  
          { ac_try='test -s conftest$ac_exeext'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; }; then  
   ac_cv_lib_pthreads_pthread_attr_init=yes  
20740  else  else
20741    echo "$as_me: failed program was:" >&5  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
20742  sed 's/^/| /' conftest.$ac_ext >&5  for as_dir in $PATH
20743    do
20744      IFS=$as_save_IFS
20745      test -z "$as_dir" && as_dir=.
20746      for ac_exec_ext in '' $ac_executable_extensions; do
20747      if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
20748        ac_cv_prog_acx_pthread_config="yes"
20749        echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
20750        break 2
20751      fi
20752    done
20753    done
20754    
20755  ac_cv_lib_pthreads_pthread_attr_init=no    test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no"
20756  fi  fi
 rm -f conftest.err conftest.$ac_objext \  
       conftest$ac_exeext conftest.$ac_ext  
 LIBS=$ac_check_lib_save_LIBS  
20757  fi  fi
20758  echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_attr_init" >&5  acx_pthread_config=$ac_cv_prog_acx_pthread_config
20759  echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_attr_init" >&6  if test -n "$acx_pthread_config"; then
20760  if test $ac_cv_lib_pthreads_pthread_attr_init = yes; then    echo "$as_me:$LINENO: result: $acx_pthread_config" >&5
20761    PTHREAD_LIBS="-lpthreads"  echo "${ECHO_T}$acx_pthread_config" >&6
20762    else
20763      echo "$as_me:$LINENO: result: no" >&5
20764    echo "${ECHO_T}no" >&6
20765  fi  fi
20766    
20767    fi                  if test x"$acx_pthread_config" = xno; then continue; fi
20768    if test "x$PTHREAD_LIBS" = xerror; then                  PTHREAD_CFLAGS="`pthread-config --cflags`"
20769      echo "$as_me:$LINENO: checking for pthread_attr_init in -lthread" >&5                  PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
20770  echo $ECHO_N "checking for pthread_attr_init in -lthread... $ECHO_C" >&6                  ;;
20771  if test "${ac_cv_lib_thread_pthread_attr_init+set}" = set; then  
20772    echo $ECHO_N "(cached) $ECHO_C" >&6                  *)
20773  else                  echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5
20774    ac_check_lib_save_LIBS=$LIBS  echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6
20775  LIBS="-lthread  $LIBS"                  PTHREAD_LIBS="-l$flag"
20776  cat >conftest.$ac_ext <<_ACEOF                  ;;
20777            esac
20778    
20779            save_LIBS="$LIBS"
20780            save_CFLAGS="$CFLAGS"
20781            LIBS="$PTHREAD_LIBS $LIBS"
20782            CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
20783    
20784            # Check for various functions.  We must include pthread.h,
20785            # since some functions may be macros.  (On the Sequent, we
20786            # need a special flag -Kthread to make this header compile.)
20787            # We check for pthread_join because it is in -lpthread on IRIX
20788            # while pthread_create is in libc.  We check for pthread_attr_init
20789            # due to DEC craziness with -lpthreads.  We check for
20790            # pthread_cleanup_push because it is one of the few pthread
20791            # functions on Solaris that doesn't have a non-functional libc stub.
20792            # We try pthread_create on general principles.
20793            cat >conftest.$ac_ext <<_ACEOF
20794  /* confdefs.h.  */  /* confdefs.h.  */
20795  _ACEOF  _ACEOF
20796  cat confdefs.h >>conftest.$ac_ext  cat confdefs.h >>conftest.$ac_ext
20797  cat >>conftest.$ac_ext <<_ACEOF  cat >>conftest.$ac_ext <<_ACEOF
20798  /* end confdefs.h.  */  /* end confdefs.h.  */
20799    #include <pthread.h>
 /* Override any gcc2 internal prototype to avoid an error.  */  
 #ifdef __cplusplus  
 extern "C"  
 #endif  
 /* We use char because int might match the return type of a gcc2  
    builtin and then its argument prototype would still apply.  */  
 char pthread_attr_init ();  
20800  int  int
20801  main ()  main ()
20802  {  {
20803  pthread_attr_init ();  pthread_t th; pthread_join(th, 0);
20804                         pthread_attr_init(0); pthread_cleanup_push(0, 0);
20805                         pthread_create(0,0,0,0); pthread_cleanup_pop(0);
20806    ;    ;
20807    return 0;    return 0;
20808  }  }
# Line 21021  if { (eval echo "$as_me:$LINENO: \"$ac_l Line 20829  if { (eval echo "$as_me:$LINENO: \"$ac_l
20829    ac_status=$?    ac_status=$?
20830    echo "$as_me:$LINENO: \$? = $ac_status" >&5    echo "$as_me:$LINENO: \$? = $ac_status" >&5
20831    (exit $ac_status); }; }; then    (exit $ac_status); }; }; then
20832    ac_cv_lib_thread_pthread_attr_init=yes    acx_pthread_ok=yes
20833  else  else
20834    echo "$as_me: failed program was:" >&5    echo "$as_me: failed program was:" >&5
20835  sed 's/^/| /' conftest.$ac_ext >&5  sed 's/^/| /' conftest.$ac_ext >&5
20836    
 ac_cv_lib_thread_pthread_attr_init=no  
20837  fi  fi
20838  rm -f conftest.err conftest.$ac_objext \  rm -f conftest.err conftest.$ac_objext \
20839        conftest$ac_exeext conftest.$ac_ext        conftest$ac_exeext conftest.$ac_ext
20840  LIBS=$ac_check_lib_save_LIBS  
20841  fi          LIBS="$save_LIBS"
20842  echo "$as_me:$LINENO: result: $ac_cv_lib_thread_pthread_attr_init" >&5          CFLAGS="$save_CFLAGS"
20843  echo "${ECHO_T}$ac_cv_lib_thread_pthread_attr_init" >&6  
20844  if test $ac_cv_lib_thread_pthread_attr_init = yes; then          echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5
20845    PTHREAD_LIBS="-lthread"  echo "${ECHO_T}$acx_pthread_ok" >&6
20846            if test "x$acx_pthread_ok" = xyes; then
20847                    break;
20848            fi
20849    
20850            PTHREAD_LIBS=""
20851            PTHREAD_CFLAGS=""
20852    done
20853  fi  fi
20854    
20855    fi  # Various other checks:
20856    if test "x$PTHREAD_LIBS" = xerror; then  if test "x$acx_pthread_ok" = xyes; then
20857      echo "$as_me:$LINENO: checking for pthread_attr_init in -lc_r" >&5          save_LIBS="$LIBS"
20858  echo $ECHO_N "checking for pthread_attr_init in -lc_r... $ECHO_C" >&6          LIBS="$PTHREAD_LIBS $LIBS"
20859  if test "${ac_cv_lib_c_r_pthread_attr_init+set}" = set; then          save_CFLAGS="$CFLAGS"
20860    echo $ECHO_N "(cached) $ECHO_C" >&6          CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
20861  else  
20862    ac_check_lib_save_LIBS=$LIBS          # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
20863  LIBS="-lc_r  $LIBS"          echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5
20864  cat >conftest.$ac_ext <<_ACEOF  echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6
20865            attr_name=unknown
20866            for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
20867                cat >conftest.$ac_ext <<_ACEOF
20868  /* confdefs.h.  */  /* confdefs.h.  */
20869  _ACEOF  _ACEOF
20870  cat confdefs.h >>conftest.$ac_ext  cat confdefs.h >>conftest.$ac_ext
20871  cat >>conftest.$ac_ext <<_ACEOF  cat >>conftest.$ac_ext <<_ACEOF
20872  /* end confdefs.h.  */  /* end confdefs.h.  */
20873    #include <pthread.h>
 /* Override any gcc2 internal prototype to avoid an error.  */  
 #ifdef __cplusplus  
 extern "C"  
 #endif  
 /* We use char because int might match the return type of a gcc2  
    builtin and then its argument prototype would still apply.  */  
 char pthread_attr_init ();  
20874  int  int
20875  main ()  main ()
20876  {  {
20877  pthread_attr_init ();  int attr=$attr; return attr;
20878    ;    ;
20879    return 0;    return 0;
20880  }  }
# Line 21091  if { (eval echo "$as_me:$LINENO: \"$ac_l Line 20901  if { (eval echo "$as_me:$LINENO: \"$ac_l
20901    ac_status=$?    ac_status=$?
20902    echo "$as_me:$LINENO: \$? = $ac_status" >&5    echo "$as_me:$LINENO: \$? = $ac_status" >&5
20903    (exit $ac_status); }; }; then    (exit $ac_status); }; }; then
20904    ac_cv_lib_c_r_pthread_attr_init=yes    attr_name=$attr; break
20905  else  else
20906    echo "$as_me: failed program was:" >&5    echo "$as_me: failed program was:" >&5
20907  sed 's/^/| /' conftest.$ac_ext >&5  sed 's/^/| /' conftest.$ac_ext >&5
20908    
 ac_cv_lib_c_r_pthread_attr_init=no  
20909  fi  fi
20910  rm -f conftest.err conftest.$ac_objext \  rm -f conftest.err conftest.$ac_objext \
20911        conftest$ac_exeext conftest.$ac_ext        conftest$ac_exeext conftest.$ac_ext
20912  LIBS=$ac_check_lib_save_LIBS          done
20913  fi          echo "$as_me:$LINENO: result: $attr_name" >&5
20914  echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_attr_init" >&5  echo "${ECHO_T}$attr_name" >&6
20915  echo "${ECHO_T}$ac_cv_lib_c_r_pthread_attr_init" >&6          if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
 if test $ac_cv_lib_c_r_pthread_attr_init = yes; then  
   PTHREAD_LIBS="-lc_r"  
 fi  
20916    
20917    fi  cat >>confdefs.h <<_ACEOF
20918    if test "x$PTHREAD_LIBS" = xerror; then  #define PTHREAD_CREATE_JOINABLE $attr_name
     echo "$as_me:$LINENO: checking for pthread_attr_init" >&5  
 echo $ECHO_N "checking for pthread_attr_init... $ECHO_C" >&6  
 if test "${ac_cv_func_pthread_attr_init+set}" = set; then  
   echo $ECHO_N "(cached) $ECHO_C" >&6  
 else  
   cat >conftest.$ac_ext <<_ACEOF  
 /* confdefs.h.  */  
20919  _ACEOF  _ACEOF
 cat confdefs.h >>conftest.$ac_ext  
 cat >>conftest.$ac_ext <<_ACEOF  
 /* end confdefs.h.  */  
 /* Define pthread_attr_init to an innocuous variant, in case <limits.h> declares pthread_attr_init.  
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */  
 #define pthread_attr_init innocuous_pthread_attr_init  
20920    
20921  /* System header to define __stub macros and hopefully few prototypes,          fi
     which can conflict with char pthread_attr_init (); below.  
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since  
     <limits.h> exists even on freestanding compilers.  */  
   
 #ifdef __STDC__  
 # include <limits.h>  
 #else  
 # include <assert.h>  
 #endif  
20922    
20923  #undef pthread_attr_init          echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5
20924    echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6
20925            flag=no
20926            case "${host_cpu}-${host_os}" in
20927                *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
20928                *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
20929            esac
20930            echo "$as_me:$LINENO: result: ${flag}" >&5
20931    echo "${ECHO_T}${flag}" >&6
20932            if test "x$flag" != xno; then
20933                PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
20934            fi
20935    
20936  /* Override any gcc2 internal prototype to avoid an error.  */          LIBS="$save_LIBS"
20937  #ifdef __cplusplus          CFLAGS="$save_CFLAGS"
 extern "C"  
 {  
 #endif  
 /* We use char because int might match the return type of a gcc2  
    builtin and then its argument prototype would still apply.  */  
 char pthread_attr_init ();  
 /* The GNU C library defines this for functions which it implements  
     to always fail with ENOSYS.  Some functions are actually named  
     something starting with __ and the normal name is an alias.  */  
 #if defined (__stub_pthread_attr_init) || defined (__stub___pthread_attr_init)  
 choke me  
 #else  
 char (*f) () = pthread_attr_init;  
 #endif  
 #ifdef __cplusplus  
 }  
 #endif  
20938    
20939  int          # More AIX lossage: must compile with cc_r
20940  main ()          # Extract the first word of "cc_r", so it can be a program name with args.
20941  {  set dummy cc_r; ac_word=$2
20942  return f != pthread_attr_init;  echo "$as_me:$LINENO: checking for $ac_word" >&5
20943    ;  echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20944    return 0;  if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then
20945  }    echo $ECHO_N "(cached) $ECHO_C" >&6
 _ACEOF  
 rm -f conftest.$ac_objext conftest$ac_exeext  
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5  
   (eval $ac_link) 2>conftest.er1  
   ac_status=$?  
   grep -v '^ *+' conftest.er1 >conftest.err  
   rm -f conftest.er1  
   cat conftest.err >&5  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } &&  
          { ac_try='test -z "$ac_c_werror_flag"  
                          || test ! -s conftest.err'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; } &&  
          { ac_try='test -s conftest$ac_exeext'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; }; then  
   ac_cv_func_pthread_attr_init=yes  
20946  else  else
20947    echo "$as_me: failed program was:" >&5    if test -n "$PTHREAD_CC"; then
20948  sed 's/^/| /' conftest.$ac_ext >&5    ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
20949    else
20950    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
20951    for as_dir in $PATH
20952    do
20953      IFS=$as_save_IFS
20954      test -z "$as_dir" && as_dir=.
20955      for ac_exec_ext in '' $ac_executable_extensions; do
20956      if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
20957        ac_cv_prog_PTHREAD_CC="cc_r"
20958        echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
20959        break 2
20960      fi
20961    done
20962    done
20963    
20964  ac_cv_func_pthread_attr_init=no    test -z "$ac_cv_prog_PTHREAD_CC" && ac_cv_prog_PTHREAD_CC="${CC}"
20965  fi  fi
 rm -f conftest.err conftest.$ac_objext \  
       conftest$ac_exeext conftest.$ac_ext  
20966  fi  fi
20967  echo "$as_me:$LINENO: result: $ac_cv_func_pthread_attr_init" >&5  PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
20968  echo "${ECHO_T}$ac_cv_func_pthread_attr_init" >&6  if test -n "$PTHREAD_CC"; then
20969  if test $ac_cv_func_pthread_attr_init = yes; then    echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5
20970    PTHREAD_LIBS=""  echo "${ECHO_T}$PTHREAD_CC" >&6
20971    else
20972      echo "$as_me:$LINENO: result: no" >&5
20973    echo "${ECHO_T}no" >&6
20974  fi  fi
20975    
   fi  
   if test "x$PTHREAD_LIBS" = xerror; then  
     { { echo "$as_me:$LINENO: error: *** Unable to locate working posix thread library ***" >&5  
 echo "$as_me: error: *** Unable to locate working posix thread library ***" >&2;}  
    { (exit 1); exit 1; }; }  
   fi  
   LIBS="$ac_save_libs"  
 # checking cflags  
   PTHREAD_CFLAGS="-D_REENTRANT"  
   case "$target" in  
     *-*-bsdi*)  
       PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"  
       ;;  
     *-*-darwin*)  
       PTHREAD_CFLAGS="-D_THREAD_SAFE"  
 # causes Carbon.p complaints?  
 #     PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE"  
       ;;  
     *-*-freebsd*)  
       PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"  
       ;;  
     *-*-netbsd*)  
       PTHREAD_CFLAGS="$PTHREAD_CFLAGS -I/usr/pkg/include"  
       PTHREAD_LIBS="-L/usr/pkg/lib -lpthread -lsem"  
       ;;  
     *-*-openbsd*)  
       PTHREAD_LIBS="-pthread"  
       ;;  
     *-*-solaris*)  
       if test x"$PTHREAD_LIBS" = x"-lpthread"; then  
         ac_save_libs="$LIBS"  
         LIBS="$pthread_trick $LIBS $PTHREAD_LIBS"  
         echo "$as_me:$LINENO: checking for pthread_attr_init in -lposix4" >&5  
 echo $ECHO_N "checking for pthread_attr_init in -lposix4... $ECHO_C" >&6  
 if test "${ac_cv_lib_posix4_pthread_attr_init+set}" = set; then  
   echo $ECHO_N "(cached) $ECHO_C" >&6  
20976  else  else
20977    ac_check_lib_save_LIBS=$LIBS          PTHREAD_CC="$CC"
20978  LIBS="-lposix4  $LIBS"  fi
 cat >conftest.$ac_ext <<_ACEOF  
 /* confdefs.h.  */  
 _ACEOF  
 cat confdefs.h >>conftest.$ac_ext  
 cat >>conftest.$ac_ext <<_ACEOF  
 /* end confdefs.h.  */  
20979    
 /* Override any gcc2 internal prototype to avoid an error.  */  
 #ifdef __cplusplus  
 extern "C"  
 #endif  
 /* We use char because int might match the return type of a gcc2  
    builtin and then its argument prototype would still apply.  */  
 char pthread_attr_init ();  
 int  
 main ()  
 {  
 pthread_attr_init ();  
   ;  
   return 0;  
 }  
 _ACEOF  
 rm -f conftest.$ac_objext conftest$ac_exeext  
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5  
   (eval $ac_link) 2>conftest.er1  
   ac_status=$?  
   grep -v '^ *+' conftest.er1 >conftest.err  
   rm -f conftest.er1  
   cat conftest.err >&5  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } &&  
          { ac_try='test -z "$ac_c_werror_flag"  
                          || test ! -s conftest.err'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; } &&  
          { ac_try='test -s conftest$ac_exeext'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; }; then  
   ac_cv_lib_posix4_pthread_attr_init=yes  
 else  
   echo "$as_me: failed program was:" >&5  
 sed 's/^/| /' conftest.$ac_ext >&5  
20980    
 ac_cv_lib_posix4_pthread_attr_init=no  
 fi  
 rm -f conftest.err conftest.$ac_objext \  
       conftest$ac_exeext conftest.$ac_ext  
 LIBS=$ac_check_lib_save_LIBS  
 fi  
 echo "$as_me:$LINENO: result: $ac_cv_lib_posix4_pthread_attr_init" >&5  
 echo "${ECHO_T}$ac_cv_lib_posix4_pthread_attr_init" >&6  
 if test $ac_cv_lib_posix4_pthread_attr_init = yes; then  
   PTHREAD_LIBS="$PTHREAD_LIBS -lposix4"  
 fi  
20981    
         LIBS="$ac_save_libs"  
       fi  
       PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE"  
       ;;  
     *-*-sysv5*)  
       PTHREAD_CFLAGS="$PTHREAD_CFLAGS -Kthread"  
       ;;  
     *-*-irix*)  
       PTHREAD_CFLAGS="-D_SGI_MP_SOURCE"  
       ;;  
     *-*-aix*)  
       PTHREAD_CFLAGS="$PTHREAD_CFLAGS -mthreads"  
       ;;  
     *-*-hpux11*)  
       PTHREAD_LIBS="-L/usr/lib -lpthread"  
       ;;  
     *-*-qnx*)  
       PTHREAD_CFLAGS=""  
       PTHREAD_LIBS=""  
       ;;  
     *)  
       ;;  
   esac  
   PTHREAD_LIBS="$pthread_trick $PTHREAD_LIBS"  
   # Save the original compiler flags and libraries  
   ac_save_cflags="$CFLAGS"; ac_save_libs="$LIBS"  
   # Add the pthread compiler flags and libraries  
   CFLAGS="$CFLAGS $PTHREAD_CFLAGS";  
   LIBS="$LIBS $PTHREAD_LIBS"  
   # Check to see if we have pthread support on this system  
   echo "$as_me:$LINENO: checking for pthreads" >&5  
 echo $ECHO_N "checking for pthreads... $ECHO_C" >&6  
   if test "$cross_compiling" = yes; then  
   { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling  
 See \`config.log' for more details." >&5  
 echo "$as_me: error: cannot run test program while cross compiling  
 See \`config.log' for more details." >&2;}  
    { (exit 1); exit 1; }; }  
 else  
   cat >conftest.$ac_ext <<_ACEOF  
 /* confdefs.h.  */  
 _ACEOF  
 cat confdefs.h >>conftest.$ac_ext  
 cat >>conftest.$ac_ext <<_ACEOF  
 /* end confdefs.h.  */  
20982    
20983    #include <pthread.h>  
20984    static int n;  # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
20985    void *func(void *data){ n=1234; return (void*)&n; }  if test x"$acx_pthread_ok" = xyes; then
20986    int main(){  
20987      pthread_t t;  cat >>confdefs.h <<\_ACEOF
20988      void *ret;  #define HAVE_PTHREAD 1
     pthread_create(&t, NULL, func, 0);  
     pthread_join(t,&ret);  
     exit(n!=1234 || ret!=(void*)&n);  
   }  
20989  _ACEOF  _ACEOF
20990  rm -f conftest$ac_exeext  
20991  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5          :
   (eval $ac_link) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'  
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5  
   (eval $ac_try) 2>&5  
   ac_status=$?  
   echo "$as_me:$LINENO: \$? = $ac_status" >&5  
   (exit $ac_status); }; }; then  
   working_pthreads=yes  
20992  else  else
20993    echo "$as_me: program exited with status $ac_status" >&5          acx_pthread_ok=no
 echo "$as_me: failed program was:" >&5  
 sed 's/^/| /' conftest.$ac_ext >&5  
20994    
 ( exit $ac_status )  
 working_pthreads=no  
 fi  
 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext  
20995  fi  fi
20996    echo "$as_me:$LINENO: result: $working_pthreads" >&5  ac_ext=c
20997  echo "${ECHO_T}$working_pthreads" >&6  ac_cpp='$CPP $CPPFLAGS'
20998    # Restore the compiler flags and libraries  ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
20999    CFLAGS="$ac_save_cflags"; LIBS="$ac_save_libs"  ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
21000    if test x"$working_pthreads" = x"no" ; then  ac_compiler_gnu=$ac_cv_c_compiler_gnu
     { { echo "$as_me:$LINENO: error: *** Unable to locate working posix thread library ***" >&5  
 echo "$as_me: error: *** Unable to locate working posix thread library ***" >&2;}  
    { (exit 1); exit 1; }; }  
   fi  
   
21001    
21002    
21003  # check termcap library  # check termcap library
# Line 24210  fi Line 23815  fi
23815    
23816    
23817    
23818    # added pthread flags
23819    CC="$PTHREAD_CC"
23820    CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
23821    CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
23822    LIBS="$PTHREAD_LIBS $LIBS"
23823    
23824  # FIXME: Replace `main' with a function in `-lsatellite':  # FIXME: Replace `main' with a function in `-lsatellite':
23825  #AC_CHECK_LIB([satellite], [main])  #AC_CHECK_LIB([satellite], [main])
23826  # FIXME: Replace `main' with a function in `-lslshell':  # FIXME: Replace `main' with a function in `-lslshell':
# Line 29005  s,@SHLIBPATH_VAR@,$SHLIBPATH_VAR,;t t Line 28616  s,@SHLIBPATH_VAR@,$SHLIBPATH_VAR,;t t
28616  s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t  s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
28617  s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t  s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
28618  s,@MAINT@,$MAINT,;t t  s,@MAINT@,$MAINT,;t t
28619  s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t  s,@acx_pthread_config@,$acx_pthread_config,;t t
28620    s,@PTHREAD_CC@,$PTHREAD_CC,;t t
28621  s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t  s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t
28622    s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t
28623  s,@TERMCAP_LIBS@,$TERMCAP_LIBS,;t t  s,@TERMCAP_LIBS@,$TERMCAP_LIBS,;t t
28624  s,@X_CFLAGS@,$X_CFLAGS,;t t  s,@X_CFLAGS@,$X_CFLAGS,;t t
28625  s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t  s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26