Skip to content
Snippets Groups Projects
configure 237 KiB
Newer Older
  • Learn to ignore specific revisions
  • echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    
    echo "configure:4003: checking for $ac_func" >&5
    
    if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    /* System header to define __stub macros and hopefully few prototypes,
        which can conflict with char $ac_func(); below.  */
    #include <assert.h>
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
        builtin and then its argument prototype would still apply.  */
    char $ac_func();
    
    int main() {
    
    /* 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_$ac_func) || defined (__stub___$ac_func)
    choke me
    #else
    $ac_func();
    #endif
    
    ; return 0; }
    EOF
    
    if { (eval echo configure:4031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      eval "ac_cv_func_$ac_func=yes"
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_func_$ac_func=no"
    fi
    rm -f conftest*
    fi
    
    if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_func 1
    EOF
     
    
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    
    						for ac_func in \
    				pthread_setconcurrency \
    				thr_setconcurrency \
    			
    do
    echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    
    echo "configure:4062: checking for $ac_func" >&5
    
    if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    /* System header to define __stub macros and hopefully few prototypes,
        which can conflict with char $ac_func(); below.  */
    #include <assert.h>
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
        builtin and then its argument prototype would still apply.  */
    char $ac_func();
    
    int main() {
    
    /* 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_$ac_func) || defined (__stub___$ac_func)
    choke me
    #else
    $ac_func();
    #endif
    
    ; return 0; }
    EOF
    
    if { (eval echo configure:4090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      eval "ac_cv_func_$ac_func=yes"
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_func_$ac_func=no"
    fi
    rm -f conftest*
    fi
    
    if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_func 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    
    
    			echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
    
    echo "configure:4116: checking if pthread_create() works" >&5
    
    			if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      
    			if test "$cross_compiling" = yes; then
      				ol_cv_pthread_create_works=yes
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    
    #include <pthread.h>
    
    #ifndef NULL
    #define NULL (void*)0
    #endif
    
    static void *task(p)
    	void *p;
    {
    	return (void *) (p == NULL);
    
    }
    
    int main(argc, argv)
    	int argc;
    	char **argv;
    {
    	pthread_t t;
    
    	exit(pthread_create(&t, NULL, task, NULL));
    
    if { (eval echo configure:4148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    
    then
      ol_cv_pthread_create_works=yes
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -fr conftest*
      ol_cv_pthread_create_works=no
    fi
    rm -fr conftest*
    fi
    
    fi
    
    			echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
    
    			if test $ol_cv_pthread_create_works = no ; then
    				{ echo "configure: error: pthread.h and pthread_create are not compatible" 1>&2; exit 1; }
    			fi
    
    
    						if test $ol_with_yielding_select = auto ; then
    
    				echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
    
    echo "configure:4170: checking if select yields when using pthreads" >&5
    
    				if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      
    
    				if test "$cross_compiling" = yes; then
      
    
    				{ echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
    
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    
    #include <sys/types.h>
    #include <sys/time.h>
    #include <unistd.h>
    #include <pthread.h>
    #ifndef NULL
    
    #define NULL (void*) 0
    
    static int fildes[2];
    
    static void *task(p)
    	void *p;
    
    	struct timeval tv;
    
    
    	tv.tv_usec=0;
    
    
    	FD_ZERO(&rfds);
    	FD_SET(fildes[0], &rfds);
    
    
    	/* we're not interested in any fds */
    
    	i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    		exit(10);
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    	exit(0); /* if we exit here, the select blocked the whole process */
    
    int main(argc, argv)
    	int argc;
    	char **argv;
    
    {
    	pthread_t t;
    
    	/* create a pipe to select */
    	if(pipe(&fildes[0])) {
    		perror("select");
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    		exit(1);
    
    #ifdef HAVE_PTHREAD_SETCONCURRENCY
    	(void) pthread_setconcurrency(2);
    
    #else
    #ifdef HAVE_THR_SETCONCURRENCY
    
    	/* Set Solaris LWP concurrency to 2 */
    	thr_setconcurrency(2);
    
    	pthread_create(&t, NULL, task, NULL);
    
    
    #if HAVE_SCHED_YIELD
    	sched_yield();	/* make sure task runs first */
    #else
    
    #ifdef HAVE_PTHREAD_YIELD
    
    	pthread_yield();	/* make sure task runs first */
    #endif
    #endif
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    
    	exit(2);
    
    if { (eval echo configure:4252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
      ol_cv_pthread_select_yields=no
    
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -fr conftest*
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
      ol_cv_pthread_select_yields=yes
    
    fi
    rm -fr conftest*
    fi
    
    
    fi
    
    				echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
    
    				if test $ol_cv_pthread_select_yields = yes ; then
    
    				fi
    			fi
    
    						CPPFLAGS="$save_CPPFLAGS"
    			LIBS="$save_LIBS"
    		else
    			{ echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
    		fi
    	fi
    
    	if test $ol_with_threads = posix ; then
    		{ echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
    	fi
    fi
    
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    if test $ol_with_threads = auto -o $ol_with_threads = yes \
    	-o $ol_with_threads = mach ; then
    
    
    		for ac_hdr in mach/cthreads.h
    do
    ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    
    echo "configure:4292: checking for $ac_hdr" >&5
    
    if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <$ac_hdr>
    EOF
    ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    
    { (eval echo configure:4302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    
    ac_err=`grep -v '^ *+' conftest.out`
    if test -z "$ac_err"; then
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=yes"
    else
      echo "$ac_err" >&5
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=no"
    fi
    rm -f conftest*
    fi
    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_hdr 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    
    	if test $ac_cv_header_mach_cthreads_h = yes ; then
    		ol_with_threads=found
    
    				echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
    
    echo "configure:4332: checking for cthread_fork" >&5
    
    if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
    
      echo $ac_n "(cached) $ac_c" 1>&6
    else
    
    #include "confdefs.h"
    
    /* System header to define __stub macros and hopefully few prototypes,
        which can conflict with char cthread_fork(); below.  */
    #include <assert.h>
    
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
        builtin and then its argument prototype would still apply.  */
    char cthread_fork();
    
    int main() {
    
    
    /* 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_cthread_fork) || defined (__stub___cthread_fork)
    choke me
    #else
    cthread_fork();
    #endif
    
    
    ; return 0; }
    EOF
    
    if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
    
      eval "ac_cv_func_cthread_fork=yes"
    
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
    
      eval "ac_cv_func_cthread_fork=no"
    
    fi
    rm -f conftest*
    fi
    
    
    if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
    
      echo "$ac_t""yes" 1>&6
    
    else
      echo "$ac_t""no" 1>&6
    fi
    
    
    
    		if test $ol_link_threads = no ; then
    									echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
    
    echo "configure:4382: checking for cthread_fork with -all_load" >&5
    
    if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      
    								save_LIBS="$LIBS"
    				LIBS="-all_load $LIBS"
    				cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <mach/cthreads.h>
    int main() {
    
    					cthread_fork((void *)0, (void *)0);
    					
    ; return 0; }
    
    if { (eval echo configure:4399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      ol_cv_cthread_all_load=yes
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      ol_cv_cthread_all_load=no
    fi
    rm -f conftest*
    								LIBS="$save_LIBS"
    			
    fi
    
    echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
    
    			if test $ol_cv_cthread_all_load = yes ; then
    				LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
    				ol_link_threads=mach
    			fi
    		fi
    
    		if test $ol_link_threads != no ; then
    			: check for cthread specific functionality here
    
    			cat >> confdefs.h <<\EOF
    #define HAVE_MACH_CTHREADS 1
    EOF
    
    
    		else
    			{ echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
    
    
    	if test $ol_with_threads = mach ; then
    		{ echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
    	fi
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    if test $ol_with_threads = auto -o $ol_with_threads = yes \
    	-o $ol_with_threads = lwp ; then
    
    
    		for ac_hdr in thread.h synch.h
    do
    ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    
    echo "configure:4444: checking for $ac_hdr" >&5
    
    if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <$ac_hdr>
    EOF
    ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    
    { (eval echo configure:4454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    
    ac_err=`grep -v '^ *+' conftest.out`
    if test -z "$ac_err"; then
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=yes"
    else
      echo "$ac_err" >&5
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=no"
    fi
    rm -f conftest*
    fi
    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_hdr 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    
    	if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
    
    		echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
    
    echo "configure:4482: checking for thr_create in -lthread" >&5
    
    ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
    if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      ac_save_LIBS="$LIBS"
    LIBS="-lthread  $LIBS"
    cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
        builtin and then its argument prototype would still apply.  */
    char thr_create();
    
    int main() {
    thr_create()
    ; return 0; }
    EOF
    
    if { (eval echo configure:4501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      eval "ac_cv_lib_$ac_lib_var=yes"
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_lib_$ac_lib_var=no"
    fi
    rm -f conftest*
    LIBS="$ac_save_LIBS"
    
    fi
    if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
      echo "$ac_t""yes" 1>&6
    
    else
      echo "$ac_t""no" 1>&6
    
    		if test $have_thr = yes ; then
    
    			cat >> confdefs.h <<\EOF
    #define HAVE_THR 1
    EOF
    
    
    			LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
    
    			ol_link_threads=thr
    
    			if test $ol_with_yielding_select = auto ; then
    				ol_with_yielding_select=yes
    
    			fi
    		fi
    	fi
    
    		for ac_hdr in lwp/lwp.h
    do
    ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    
    echo "configure:4541: checking for $ac_hdr" >&5
    
    if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <$ac_hdr>
    EOF
    ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    
    { (eval echo configure:4551: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    
    ac_err=`grep -v '^ *+' conftest.out`
    if test -z "$ac_err"; then
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=yes"
    else
      echo "$ac_err" >&5
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=no"
    fi
    rm -f conftest*
    fi
    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_hdr 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    
    	if test $ac_cv_header_lwp_lwp_h = yes ; then
    
    		echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
    
    echo "configure:4579: checking for lwp_create in -llwp" >&5
    
    ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
    if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      ac_save_LIBS="$LIBS"
    LIBS="-llwp  $LIBS"
    cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
        builtin and then its argument prototype would still apply.  */
    char lwp_create();
    
    int main() {
    lwp_create()
    ; return 0; }
    EOF
    
    if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      eval "ac_cv_lib_$ac_lib_var=yes"
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_lib_$ac_lib_var=no"
    fi
    rm -f conftest*
    LIBS="$ac_save_LIBS"
    
    fi
    if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
      echo "$ac_t""yes" 1>&6
      have_lwp=yes
    else
      echo "$ac_t""no" 1>&6
    have_lwp=no
    fi
    
    
    		if test $have_lwp = yes ; then
    			cat >> confdefs.h <<\EOF
    #define HAVE_LWP 1
    EOF
    
    			LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
    
    			ol_link_threads=lwp
    
    			if test $ol_with_yielding_select = auto ; then
    				ol_with_yielding_select=no
    
    if test $ol_with_yielding_select = yes ; then
    
    	cat >> confdefs.h <<\EOF
    
    #define HAVE_YIELDING_SELECT 1
    
    EOF
    
    fi
    
    if test $ol_with_threads = manual ; then
    
    		ol_link_threads=yes
    
    
    	echo "configure: warning: thread defines and link options must be set manually" 1>&2
    
    	for ac_hdr in pthread.h sched.h
    do
    ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    
    echo "configure:4651: checking for $ac_hdr" >&5
    
    if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <$ac_hdr>
    EOF
    ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    
    { (eval echo configure:4661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    
    ac_err=`grep -v '^ *+' conftest.out`
    if test -z "$ac_err"; then
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=yes"
    else
      echo "$ac_err" >&5
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=no"
    fi
    rm -f conftest*
    fi
    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_hdr 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    	for ac_func in sched_yield pthread_yield
    do
    echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    
    echo "configure:4690: checking for $ac_func" >&5
    
    if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    /* System header to define __stub macros and hopefully few prototypes,
        which can conflict with char $ac_func(); below.  */
    #include <assert.h>
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
        builtin and then its argument prototype would still apply.  */
    char $ac_func();
    
    int main() {
    
    /* 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_$ac_func) || defined (__stub___$ac_func)
    choke me
    #else
    $ac_func();
    #endif
    
    ; return 0; }
    EOF
    
    if { (eval echo configure:4718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      eval "ac_cv_func_$ac_func=yes"
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_func_$ac_func=no"
    fi
    rm -f conftest*
    fi
    
    if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_func 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    	
    echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
    
    echo "configure:4744: checking for LinuxThreads" >&5
    
    if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      
    	res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
    	if test "$res" -gt 0 ; then
    		ol_cv_linux_threads=yes
    	else
    		ol_cv_linux_threads=no
    	fi
    
    fi
    
    echo "$ac_t""$ol_cv_linux_threads" 1>&6
    
    
    	for ac_hdr in mach/cthreads.h
    do
    ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    
    echo "configure:4765: checking for $ac_hdr" >&5
    
    if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <$ac_hdr>
    EOF
    ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    
    { (eval echo configure:4775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    
    ac_err=`grep -v '^ *+' conftest.out`
    if test -z "$ac_err"; then
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=yes"
    else
      echo "$ac_err" >&5
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=no"
    fi
    rm -f conftest*
    fi
    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_hdr 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    	for ac_hdr in lwp/lwp.h
    do
    ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    
    echo "configure:4805: checking for $ac_hdr" >&5
    
    if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <$ac_hdr>
    EOF
    ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    
    { (eval echo configure:4815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    
    ac_err=`grep -v '^ *+' conftest.out`
    if test -z "$ac_err"; then
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=yes"
    else
      echo "$ac_err" >&5
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=no"
    fi
    rm -f conftest*
    fi
    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_hdr 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    	for ac_hdr in thread.h synch.h
    do
    ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    
    echo "configure:4845: checking for $ac_hdr" >&5
    
    if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    #include <$ac_hdr>
    EOF
    ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    
    { (eval echo configure:4855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    
    ac_err=`grep -v '^ *+' conftest.out`
    if test -z "$ac_err"; then
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=yes"
    else
      echo "$ac_err" >&5
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      eval "ac_cv_header_$ac_safe=no"
    fi
    rm -f conftest*
    fi
    if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
      echo "$ac_t""yes" 1>&6
        ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
      cat >> confdefs.h <<EOF
    #define $ac_tr_hdr 1
    EOF
     
    else
      echo "$ac_t""no" 1>&6
    fi
    done
    
    fi
    
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    if test $ol_link_threads != no ; then  
    
    			cat >> confdefs.h <<\EOF
    
    #define REENTRANT 1
    EOF
    
    	cat >> confdefs.h <<\EOF
    
    EOF
    
    	cat >> confdefs.h <<\EOF
    #define THREAD_SAFE 1
    
    EOF
    
    	cat >> confdefs.h <<\EOF
    #define THREADSAFE 1
    
    EOF
    
    	cat >> confdefs.h <<\EOF
    #define _THREADSAFE 1
    
    
    					echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
    
    echo "configure:4910: checking for thread specific errno" >&5
    
    if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      
    		cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    
    #include <errno.h>
    			
    int main() {
    
    int x = errno;
    			
    ; return 0; }
    EOF
    
    if { (eval echo configure:4927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      ol_cv_errno_thread_specific=yes
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*
      ol_cv_errno_thread_specific=no
    
    rm -f conftest*
    	
    fi
    
    echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
    
    	if test $ol_cv_errno_thread_specific != yes ; then
    		LIBS="$LTHREAD_LIBS $LIBS"
    		LTHREAD_LIBS=""
    	fi
    
    if test $ol_link_threads = no ; then
    	if test $ol_with_threads = yes ; then
    		{ echo "configure: error: no suitable thread support" 1>&2; exit 1; }
    	fi
    
    	if test $ol_with_threads = auto ; then
    		echo "configure: warning: no suitable thread support, disabling threads" 1>&2
    
    Kurt Zeilenga's avatar
    Kurt Zeilenga committed
    		ol_with_threads=no
    
    	fi
    
    	cat >> confdefs.h <<\EOF
    #define NO_THREADS 1
    EOF
    
    	LTHREAD_LIBS=""
    fi
    
    ol_link_ldbm=no 
    if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
    	echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
    
    echo "configure:4970: checking for DB2 library" >&5
    
    if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      	ol_LIBS="$LIBS"
    	echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
    
    echo "configure:4976: checking for db_open in -ldb" >&5
    
    ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
    if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
      echo $ac_n "(cached) $ac_c" 1>&6
    else
      ac_save_LIBS="$LIBS"
    LIBS="-ldb  $LIBS"
    cat > conftest.$ac_ext <<EOF
    
    #include "confdefs.h"
    /* Override any gcc2 internal prototype to avoid an error.  */
    /* We use char because int might match the return type of a gcc2
        builtin and then its argument prototype would still apply.  */
    char db_open();
    
    int main() {
    db_open()
    ; return 0; }
    EOF
    
    if { (eval echo configure:4995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    
      rm -rf conftest*
      eval "ac_cv_lib_$ac_lib_var=yes"
    else
      echo "configure: failed program was:" >&5
      cat conftest.$ac_ext >&5
      rm -rf conftest*