# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Sep 30 02:04:24 EET DST 1998 [metaconfig 3.0 PL70]
+# Generated on Wed Oct 14 17:00:29 EET DST 1998 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by jhi@iki.fi)
cat >/tmp/c1$$ <<EOF
d_portable=''
d_pthread_yield=''
d_sched_yield=''
+sched_yield=''
d_pthreads_created_joinable=''
d_readdir=''
d_rewinddir=''
loclibpth=''
plibpth=''
xlibpth=''
+ignore_versioned_solibs=''
libs=''
lns=''
lseeksize=''
privlib=''
privlibexp=''
prototype=''
+pthread_setdetachstate_pointer=''
ptrsize=''
drand01=''
randbits=''
: machines, like the mips. Usually, it should be empty.
plibpth=''
-: default library list
-libswanted=''
: Possible local include directories to search.
: Set locincpth to "" in a hint file to defeat local include searches.
locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
: Extra object files, if any, needed on this platform.
archobjs=''
groupstype=''
+: default library list
+libswanted=''
+ignore_versioned_solibs=''
: full support for void wanted by default
defvoidused=15
ABC.XYZ
EOT
cd ..
-echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+if test ! -f cppstdin; then
+ echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+else
+ echo "Keeping your $hint cppstdin wrapper."
+fi
chmod 755 cppstdin
wrapper=`pwd`/cppstdin
ok='false'
esac
for thislib in $libswanted; do
- if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
+ if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
+ $test -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
echo "Found -l$thislib (shared)."
case " $dflt " in
*"-l$thislib "*);;
set poll d_poll
eval $inlibc
-
-: see whether the various POSIXish _yields exist within given cccmd
-$cat >try.c <<EOP
-#include <pthread.h>
-main() {
- YIELD();
- exit(0);
-}
-EOP
-: see if pthread_yield exists within given cccmd,
-: if we do not usethreads this may well end up undef.
-set try -DYIELD=pthread_yield
-if eval $compile; then
- val="$define"
- echo 'pthread_yield() found.' >&4
-else
- val="$undef"
- echo 'pthread_yield() NOT found.' >&4
-fi
-set d_pthread_yield
-eval $setvar
-
-: see if sched_yield exists within given cccmd,
-: if we do not usethreads this may well end up undef.
-set try -DYIELD=sched_yield
-if eval $compile; then
- val="$define"
- echo 'sched_yield() found.' >&4
-else
- val="$undef"
- echo 'sched_yield() NOT found.' >&4
-fi
-set d_sched_yield
-eval $setvar
-$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
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
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
: The first arg can be int, unsigned, or size_t
: The last arg may or may not be 'const'
val=''
- for xxx in 'fd_set *' 'int *'; do
- for nfd in 'int' 'size_t' 'unsigned' ; do
+ for xxx in 'fd_set *' 'int *' 'void *'; do
+ for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
for tmo in 'struct timeval *' 'const struct timeval *'; do
case "$val" in
'') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
#include <sys/select.h>
#endif
#include <stdio.h>
-#define S sizeof($selecttype)
+$selecttype b;
+#define S sizeof(*(b))
#define MINBITS 64
#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
#define NBITS (NBYTES * 8)
int main() {
char s[NBYTES];
- $selecttype b;
struct timeval t;
int i;
FILE* fp;
if eval $compile_ok; then
selectminbits=`./try`
case "$selectminbits" in
+ '') cat >&4 <<EOM
+Cannot figure out on how many bits at a time your select() operates.
+I'll play safe and guess it is 32 bits.
+EOM
+ selectminbits=32
+ bits="32 bits"
+ ;;
1) bits="1 bit" ;;
*) bits="$selectminbits bits" ;;
esac
i_varargs='$i_varargs'
i_varhdr='$i_varhdr'
i_vfork='$i_vfork'
+ignore_versioned_solibs='$ignore_versioned_solibs'
incpath='$incpath'
inews='$inews'
installarchlib='$installarchlib'
privlib='$privlib'
privlibexp='$privlibexp'
prototype='$prototype'
+pthread_setdetachstate_pointer='$pthread_setdetachstate_pointer'
ptrsize='$ptrsize'
randbits='$randbits'
randfunc='$randfunc'
rm='$rm'
rmail='$rmail'
runnm='$runnm'
+sched_yield='$sched_yield'
scriptdir='$scriptdir'
scriptdirexp='$scriptdirexp'
sed='$sed'