# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Apr 2 15:40:35 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Fri May 14 00:11:18 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
newsh=/usr/bin/bsh
fi
fi
+if test -f /osf_boot -a -f /usr/sbin/setld; then
+ if test X`/usr/bin/uname -s` = XOSF1; then
+ avoidksh="to avoid Digital UNIX' ksh"
+ newsh=/bin/sh
+ unset BIN_SH # if this is 'xpg4' sh will start up ksh
+ fi
+fi
case "$inksh/$needksh" in
/[a-z]*)
ENV=''
d_mblen=''
d_mbstowcs=''
d_mbtowc=''
+d_memchr=''
d_memcmp=''
d_memcpy=''
d_memmove=''
usedl=''
doublesize=''
ebcdic=''
+fflushNULL=''
+fflushall=''
fpostype=''
gidtype=''
groupstype=''
i_ndbm=''
i_netdb=''
i_neterrno=''
+i_netinettcp=''
i_niin=''
i_sysin=''
i_poll=''
selectminbits=''
selecttype=''
sh=''
+sig_count=''
sig_name=''
sig_name_init=''
sig_num=''
d_ftell64=''
d_ftello64=''
d_tmpfile64=''
+stdio_stream_array=''
sysman=''
trnl=''
uidtype=''
$startsh
wanted=\$1
name=''
-if test -f $usrinc/\$wanted; then
- echo "$usrinc/\$wanted"
- exit 0
-fi
+for usrincdir in $usrinc
+do
+ if test -f \$usrincdir/\$wanted; then
+ echo "\$usrincdir/\$wanted"
+ exit 0
+ fi
+done
awkprg='{ print \$$fieldn }'
echo "#include <\$wanted>" > foo\$\$.c
$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
while read cline; do
name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
case "\$name" in
- */\$wanted) echo "\$name"; exit 0;;
+ *[/\\\\]\$wanted) echo "\$name"; exit 0;;
+ *[\\\\/]\$wanted) echo "\$name"; exit 0;;
*) name='';;
esac;
done;
beos)
# beos doesn't like the default, either.
;;
+ hpux*)
+ # hpux doesn't like the default, either.
+ tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
+ ;;
*)
tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
;;
echo $n "Checking to see if your system supports off64_t...$c" >&4
$cat >try.c <<EOCP
#include <sys/types.h>
-#include <stdio.h>
+#include <unistd.h>
off64_t foo() { off64_t x; x = 7; return x; }'
EOCP
if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
echo $n "Checking to see if your system supports offset_t...$c" >&4
$cat >try.c <<EOCP
#include <sys/types.h>
-#include <stdio.h>
+#include <unistd.h>
offset_t foo() { offset_t x; x = 7; return x; }'
EOCP
if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
set mbtowc d_mbtowc
eval $inlibc
+: see if memchr exists
+set memchr d_memchr
+eval $inlibc
+
: see if memcmp exists
set memcmp d_memcmp
eval $inlibc
set ebcdic
eval $setvar
+$cat >&4 <<EOM
+Checking how to access stdio streams by file descriptor number...
+EOM
+case "$stdio_stream_array" in
+'') $cat >try.c <<EOCP
+#include <stdio.h>
+int main() {
+ if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
+ printf("yes\n");
+}
+EOCP
+ for s in _iob __iob __sF
+ do
+ set try -DSTDIO_STREAM_ARRAY=$s
+ if eval $compile_ok; then
+ case "`./try$exe_ext`" in
+ yes) stdio_stream_array=$s; break ;;
+ esac
+ fi
+ done
+ $rm -f try.* try$exe_ext
+esac
+case "$stdio_stream_array" in
+'') $cat >&4 <<EOM
+I can't figure out how to access stdio streams by file descriptor number.
+EOM
+ ;;
+*) $cat >&4 <<EOM
+You can access stdio streams by file descriptor number by using $stdio_stream_array.
+EOM
+ ;;
+esac
+
+# SunOS has a <unistd.h> which we generally avoid, but need for this test.
+# For everyone else, we'll trust i_unistd.
+t_unistd=$i_unistd
+case "$osname" in
+sunos) $test -f /usr/include/unistd.h && t_unistd=$define ;;
+esac
+$cat >&4 <<EOM
+Checking how to flush all pending stdio output...
+EOM
+$cat >try.c <<EOCP
+#include <stdio.h>
+#$t_unistd I_UNISTD
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+#$d_sysconf HAS_SYSCONF
+int main() {
+ FILE* p = fopen("try.out", "w");
+#ifdef TRY_FPUTC
+ fputc('x', p);
+#else
+# ifdef TRY_FPRINTF
+ fprintf(p, "x");
+# endif
+#endif
+#ifdef TRY_FFLUSH_NULL
+ fflush(NULL);
+#endif
+#ifdef TRY_FFLUSH_ALL
+ {
+ long open_max = -1;
+# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
+ open_max = sysconf(_SC_OPEN_MAX);
+# else
+# ifdef FOPEN_MAX
+# open_max = FOPEN_MAX;
+# else
+# ifdef OPEN_MAX
+# open_max = OPEN_MAX;
+# else
+# ifdef _NFILE
+# open_max = _NFILE;
+# endif
+# endif
+# endif
+# endif
+ if (open_max > 0) {
+ long i;
+ for (i = 0; i < open_max; i++)
+ fflush(&$stdio_stream_array[i]);
+ }
+ }
+#endif
+ _exit(42);
+}
+EOCP
+: first we have to find out how _not_ to flush
+if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
+ output=''
+ set try -DTRY_FPUTC
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test ! -s try.out -a "X$?" = X42; then
+ output=-DTRY_FPUTC
+ fi
+ fi
+ case "$output" in
+ '')
+ set try -DTRY_FPRINTF
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test ! -s try.out -a "X$?" = X42; then
+ output=-DTRY_FPRINTF
+ fi
+ fi
+ ;;
+ esac
+fi
+: check for fflush NULL behaviour
+case "$fflushNULL" in
+'') set try -DTRY_FFLUSH_NULL $output
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test -s try.out -a "X$?" = X42; then
+ fflushNULL="`$cat try.out`"
+ fi
+ fi
+ $rm -f core try.core core.try.*
+ case "$fflushNULL" in
+ x) $cat >&4 <<EOM
+Your fflush(NULL) works okay.
+EOM
+ fflushNULL=define
+ ;;
+ '') $cat >&4 <<EOM
+Your fflush(NULL) isn't working (contrary to ANSI C).
+EOM
+ fflushNULL=undef
+ ;;
+ *) $cat >&4 <<EOM
+Cannot figure out whether your fflush(NULL) works or not.
+I'm assuming it doesn't (contrary to ANSI C).
+EOM
+ fflushNULL=undef
+ ;;
+ esac
+ ;;
+$define|true|[yY]*)
+ fflushNULL=define
+ ;;
+*)
+ fflushNULL=undef
+ ;;
+esac
+: check for fflush all behaviour
+case "$fflushall" in
+'') set try -DTRY_FFLUSH_ALL $output
+ $rm -f try.out
+ if eval $compile; then
+ ./try$exe_ext 2>/dev/null
+ if $test -s try.out -a "X$?" = X42; then
+ fflushall="`$cat try.out`"
+ fi
+ fi
+ $rm -f core try.core core.try.*
+ case "$fflushall" in
+ x) $cat >&4 <<EOM
+Flushing explicitly all the stdio streams works.
+EOM
+ fflushall=define
+ ;;
+ '') $cat >&4 <<EOM
+Flushing explicitly all the stdio streams doesn't work.
+EOM
+ fflushall=undef
+ ;;
+ *) $cat >&4 <<EOM
+Cannot figure out whether flushing stdio streams explicitly works or not.
+I'm assuming it doesn't.
+EOM
+ fflushall=undef
+ ;;
+ esac
+ case "$fflushall$fflushNULL" in
+ undefdefine)
+ $cat >&4 <<EOM
+(That's ok. I'll use fflush(NULL) instead.)
+EOM
+ ;;
+ esac
+ ;;
+$define|true|[yY]*)
+ fflushall=define
+ ;;
+*)
+ fflushall=undef
+ ;;
+esac
+case "$fflushNULL$fflushall" in
+undefundef)
+ $cat <<EOM
+I cannot figure out how to flush pending stdio output.
+EOM
+ ;;
+esac
+$rm -f try.* try$exe_ext
+
: see what type file positions are declared as in the library
rp="What is the type for file position used by fsetpos()?"
set fpos_t fpostype long stdio.h sys/types.h
: Trace out the files included by signal.h, then look for SIGxxx names.
: Remove SIGARRAYSIZE used by HPUX.
+: Remove SIGSTKSIZE used by Linux.
+: Remove SIGSTKSZ used by Posix.
: Remove SIGTYP void lines used by OS2.
xxx=`echo '#include <signal.h>' |
$cppstdin $cppminus $cppflags 2>/dev/null |
'') xxxfiles=`./findhdr signal.h` ;;
esac
xxx=`awk '
-$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $3 !~ /void/ {
+$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
print substr($2, 4, 20)
}
$1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
sig_name[$2] = $1
sig_num[$2] = $2
}
-
}
END {
- if (nsig == 0) { nsig = maxsig + 1 }
- for (n = 1; n < nsig; n++) {
- if (sig_name[n]) {
- printf("%s %d\n", sig_name[n], sig_num[n])
- }
- else {
- printf("NUM%d %d\n", n, n)
- }
+ if (nsig == 0) {
+ nsig = maxsig + 1
+ }
+ printf("NSIG %d\n", nsig);
+ for (n = 1; n < nsig; n++) {
+ if (sig_name[n]) {
+ printf("%s %d\n", sig_name[n], sig_num[n])
}
+ else {
+ printf("NUM%d %d\n", n, n)
+ }
+ }
for (n = 0; n < ndups; n++) {
- printf("%s %d\n", dup_name[n], dup_num[n])
+ printf("%s %d\n", dup_name[n], dup_num[n])
}
}
EOP
0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
esac
echo $@ | $tr ' ' $trnl | \
- $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
+ $awk '{ printf "%s %d\n", $1, ++s; }
+ END { printf "NSIG %d\n", ++s }' >signal.lst
fi
$rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
EOS
yes)
echo "Generating a list of signal names and numbers..." >&4
. ./signal_cmd
- sig_name=`$awk '{printf "%s ", $1}' signal.lst`
- sig_name="ZERO $sig_name"
- sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
- { printf "\"%s\", ", $1 }
- END { printf "0\n" }' signal.lst`
- sig_num=`$awk '{printf "%d ", $2}' signal.lst`
- sig_num="0 $sig_num"
- sig_num_init=`$awk 'BEGIN { printf "0, " }
- { printf "%d, ", $2}
- END { printf "0\n"}' signal.lst`
- ;;
-esac
-echo "The following signals are available:"
+ sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
+ sig_name=`$awk 'BEGIN { printf "ZERO " }
+ !/^NSIG/ { printf "%s ", $1 }' signal.lst`
+ sig_num=`$awk 'BEGIN { printf "0 " }
+ !/^NSIG/ { printf "%d ", $2 }' signal.lst`
+ sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
+ !/^NSIG/ { printf "\"%s\", ", $1 }
+ END { printf "0\n" }' signal.lst`
+ sig_num_init=`$awk 'BEGIN { printf "0, " }
+ !/^NSIG/ { printf "%d, ", $2}
+ END { printf "0\n"}' signal.lst`
+ ;;
+esac
+echo "The following $sig_count signals are available:"
echo " "
echo $sig_name | $awk \
'BEGIN { linelen = 0 }
set i_neterrno
eval $setvar
+: see if netinet/tcp.h is available
+set netinet/tcp.h i_netinettcp
+eval $inhdr
+
: see if this is a poll.h system
set poll.h i_poll
eval $inhdr
d_mblen='$d_mblen'
d_mbstowcs='$d_mbstowcs'
d_mbtowc='$d_mbtowc'
+d_memchr='$d_memchr'
d_memcmp='$d_memcmp'
d_memcpy='$d_memcpy'
d_memmove='$d_memmove'
exe_ext='$exe_ext'
expr='$expr'
extensions='$extensions'
+fflushNULL='$fflushNULL'
+fflushall='$fflushall'
find='$find'
firstmakefile='$firstmakefile'
flex='$flex'
i_ndbm='$i_ndbm'
i_netdb='$i_netdb'
i_neterrno='$i_neterrno'
+i_netinettcp='$i_netinettcp'
i_niin='$i_niin'
i_poll='$i_poll'
i_pthread='$i_pthread'
shortsize='$shortsize'
shrpenv='$shrpenv'
shsharp='$shsharp'
+sig_count='$sig_count'
sig_name='$sig_name'
sig_name_init='$sig_name_init'
sig_num='$sig_num'
stdio_cnt='$stdio_cnt'
stdio_filbuf='$stdio_filbuf'
stdio_ptr='$stdio_ptr'
+stdio_stream_array='$stdio_stream_array'
strings='$strings'
submit='$submit'
subversion='$subversion'