diff options
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 194 |
1 files changed, 93 insertions, 101 deletions
@@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed Oct 14 17:00:29 EET DST 1998 [metaconfig 3.0 PL70] +# Generated on Thu Oct 22 10:24:53 EET DST 1998 [metaconfig 3.0 PL70] # (with additional metaconfig patches by jhi@iki.fi) cat >/tmp/c1$$ <<EOF @@ -701,7 +701,6 @@ installprivlib='' privlib='' privlibexp='' prototype='' -pthread_setdetachstate_pointer='' ptrsize='' drand01='' randbits='' @@ -2114,6 +2113,9 @@ EOM bsd386) osname=bsd386 osvers=`$uname -r` ;; + POSIX-BC | posix-bc ) osname=posix-bc + osvers="$3" + ;; powerux | power_ux | powermax_os | powermaxos | \ powerunix | power_unix) osname=powerux osvers="$3" @@ -7838,7 +7840,7 @@ case "$use64bits" in #ifdef I_INTTYPES #include <inttypes.h> #endif -int64_t foo() { int64_t x; x = 7; return x; }' +int64_t foo() { int64_t x; x = 7; return x; } EOCP if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then val="$define" @@ -8160,6 +8162,78 @@ eval $inlibc set poll d_poll eval $inlibc + +: see whether the various POSIXish _yields exist +$cat >try.c <<EOP +#include <pthread.h> +#include <stdio.h> +main() { +#ifdef SCHED_YIELD + sched_yield(); +#else +#ifdef PTHREAD_YIELD + pthread_yield(); +#else +#ifdef PTHREAD_YIELD_NULL + pthread_yield(NULL); +#endif +#endif +#endif +} +EOP +: see if sched_yield exists +set try -DSCHED_YIELD +if eval $compile; then + val="$define" + sched_yield='sched_yield()' +else + val="$undef" +fi +case "$usethreads" in +$define) + case "$val" in + $define) echo 'sched_yield() found.' >&4 ;; + *) echo 'sched_yield() NOT found.' >&4 ;; + esac +esac +set d_sched_yield +eval $setvar + +: see if pthread_yield exists +set try -DPTHREAD_YIELD +if eval $compile; then + val="$define" + case "$sched_yield" in + '') sched_yield='pthread_yield()' ;; + esac +else + set try -DPTHREAD_YIELD_NULL + if eval $compile; then + val="$define" + case "$sched_yield" in + '') sched_yield='pthread_yield(NULL)' ;; + esac + else + val="$undef" + fi +fi +case "$usethreads" in +$define) + case "$val" in + $define) echo 'pthread_yield() found.' >&4 ;; + *) echo 'pthread_yield() NOT found.' >&4 ;; + esac + ;; +esac +set d_pthread_yield +eval $setvar + +case "$sched_yield" in +'') sched_yield=undef ;; +esac + +$rm -f try try.* + : test whether pthreads are created in joinable -- aka undetached -- state if test "X$usethreads" = "X$define"; then echo $n "Checking whether pthreads are created joinable. $c" >&4 @@ -8171,7 +8245,11 @@ int main() { int detachstate; printf("%s\n", pthread_attr_init(&attr) == 0 && +#if PTHREAD_ATTR_GETDETACHSTATE_INT + pthread_attr_getdetachstate(&attr) == 0 && +#else pthread_attr_getdetachstate(&attr, &detachstate) == 0 && +#endif detachstate == PTHREAD_CREATE_DETACHED ? "detached" : "joinable"); exit(0); @@ -8185,9 +8263,18 @@ EOCP *) echo "Yup, they are." >&4 ;; esac else - echo " " - echo "(I can't execute the test program--assuming they are.)" >&4 - yyy=joinable + set try -DPTHREAD_ATTR_GETDETACHSTATE_INT + if eval $compile; then + yyy=`./try` + case "$yyy" in + detached) echo "Nope, they aren't." >&4 ;; + *) echo "Yup, they are." >&4 ;; + esac + else + echo " " + echo "(I can't execute the test program--assuming they are.)" >&4 + yyy=joinable + fi fi $rm -f try try.* case "$yyy" in @@ -10525,37 +10612,6 @@ rp="What is the type of process ids on this system?" set pid_t pidtype int stdio.h sys/types.h eval $typedef_ask - -: see whether the state of pthread_attr_setdetachstate is an int pointer -$cat >try.c <<EOP -#include <pthread.h> -main() { - pthread_attr_t attr; - int state = 0; - pthread_attr_init(&attr); -#ifdef POINTER - pthread_attr_setdetachstate(&attr, &state); -#else - pthread_attr_setdetachstate(&attr, state); -#endif -} -EOP -set try -if eval $compile; then - val="$undef" -else - set try -DPOINTER - if eval $compile; then - val="$define" - else - val="$undef" - fi -fi -set pthread_setdetachstate_pointer -eval $setvar - -$rm -f try try.* - : check for length of pointer echo " " case "$ptrsize" in @@ -10632,69 +10688,6 @@ else fi $rm -f foo* bar* - -: see whether the various POSIXish _yields exist within given cccmd -$cat >try.c <<EOP -#include <pthread.h> -#include <stdio.h> -main() { -#ifdef SCHED_YIELD - sched_yield(); -#else -#ifdef PTHREAD_YIELD - pthread_yield(); -#else -#ifdef PTHREAD_YIELD_NULL - pthread_yield(NULL); -#endif -#endif -#endif -} -EOP -: see if sched_yield exists -set try -DSCHED_YIELD -if eval $compile; then - val="$define" - echo 'sched_yield() found.' >&4 - sched_yield='sched_yield()' -else - val="$undef" - echo 'sched_yield() NOT found.' >&4 -fi -set d_sched_yield -eval $setvar - -: see if pthread_yield exists -set try -DPTHREAD_YIELD -if eval $compile; then - val="$define" - case "$sched_yield" in - '') sched_yield='pthread_yield()' ;; - esac -else - set try -DPTHREAD_YIELD_NULL - if eval $compile; then - val="$define" - case "$sched_yield" in - '') sched_yield='pthread_yield(NULL)' ;; - esac - else - val="$undef" - fi -fi -case "$val" in -$define) echo 'pthread_yield() found.' >&4 ;; -*) echo 'pthread_yield() NOT found.' >&4 ;; -esac -set d_pthread_yield -eval $setvar - -case "$sched_yield" in -'') sched_yield=undef ;; -esac - -$rm -f try try.* - : see if sys/select.h has to be included set sys/select.h i_sysselct eval $inhdr @@ -12636,7 +12629,6 @@ prefixexp='$prefixexp' privlib='$privlib' privlibexp='$privlibexp' prototype='$prototype' -pthread_setdetachstate_pointer='$pthread_setdetachstate_pointer' ptrsize='$ptrsize' randbits='$randbits' randfunc='$randfunc' |