# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Oct 29 17:37:33 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Sat Oct 30 01:07:44 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
cf_email=''
cf_by=''
cf_time=''
+charsize=''
contains=''
cpp_stuff=''
cpplast=''
ebcdic=''
fflushNULL=''
fflushall=''
+fpossize=''
fpostype=''
gidsign=''
gidsize=''
i_sysstatvfs=''
i_systimes=''
i_systypes=''
-d_iovec_s=''
i_sysuio=''
i_sysun=''
i_sysvfs=''
longsize=''
shortsize=''
d_fpos64_t=''
-d_llseek=''
d_off64_t=''
libc=''
ldlibpthname=''
version=''
perladmin=''
perlpath=''
+i16size=''
+i16type=''
+i32size=''
+i32type=''
+i64size=''
+i64type=''
+i8size=''
+i8type=''
+ivsize=''
+ivtype=''
+nvsize=''
+nvtype=''
+u16size=''
+u16type=''
+u32size=''
+u32type=''
+u64size=''
+u64type=''
+u8size=''
+u8type=''
+uvsize=''
+uvtype=''
+ivdformat=''
+uvoformat=''
+uvuformat=''
+uvxformat=''
pidtype=''
prefix=''
prefixexp=''
esac
fi
-: check for lengths of integral types
-echo " "
-case "$intsize" in
-'')
- echo "Checking to see how big your integers are..." >&4
- $cat >intsize.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("intsize=%d;\n", sizeof(int));
- printf("longsize=%d;\n", sizeof(long));
- printf("shortsize=%d;\n", sizeof(short));
- exit(0);
-}
-EOCP
- set intsize
- if eval $compile_ok && ./intsize > /dev/null; then
- eval `./intsize`
- echo "Your integers are $intsize bytes long."
- echo "Your long integers are $longsize bytes long."
- echo "Your short integers are $shortsize bytes long."
- else
- $cat >&4 <<EOM
-!
-Help! I can't compile and run the intsize test program: please enlighten me!
-(This is probably a misconfiguration in your system or libraries, and
-you really ought to fix it. Still, I'll try anyway.)
-!
-EOM
- dflt=4
- rp="What is the size of an integer (in bytes)?"
- . ./myread
- intsize="$ans"
- dflt=$intsize
- rp="What is the size of a long integer (in bytes)?"
- . ./myread
- longsize="$ans"
- dflt=2
- rp="What is the size of a short integer (in bytes)?"
- . ./myread
- shortsize="$ans"
- fi
- ;;
-esac
-$rm -f intsize intsize.*
-
-: check for long long
-echo " "
-$echo $n "Checking to see if your system supports long long..." $c >&4
-echo 'int main() { long long x = 7; }' > try.c
-set try
-if eval $compile; then
- val="$define"
- echo " Yes, it does." >&4
-else
- val="$undef"
- echo " No, it doesn't." >&4
-fi
-$rm try.*
-set d_longlong
-eval $setvar
-
-: check for length of long long
-case "${d_longlong}${longlongsize}" in
-$define)
- echo " "
- $echo $n "Checking to see how big your long longs are..." $c >&4
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", sizeof(long long));
-}
-EOCP
- set try
- if eval $compile_ok; then
- longlongsize=`./try$exe_ext`
- $echo " $longlongsize bytes." >&4
- else
- dflt='8'
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of a long long (in bytes)?"
- . ./myread
- longlongsize="$ans"
- fi
- if $test "X$longsize" = "X$longlongsize"; then
- echo "(That isn't any different from an ordinary long.)"
- fi
- ;;
-esac
-$rm -f try.* try
-
-: see if inttypes.h is available
-: we want a real compile instead of Inhdr because some systems
-: have an inttypes.h which includes non-existent headers
-echo " "
-$cat >try.c <<EOCP
-#include <inttypes.h>
-int main() {
- static int32_t foo32 = 0x12345678;
-}
-EOCP
-set try
-if eval $compile; then
- echo "<inttypes.h> found." >&4
- val="$define"
-else
- echo "<inttypes.h> NOT found." >&4
- val="$undef"
-fi
-$rm -f try.c try
-set i_inttypes
-eval $setvar
-
-: check for int64_t
-case "$use64bits" in
-"$define" )
- echo " "
- $echo $n "Checking to see if your system supports int64_t...$c" >&4
- $cat >try.c <<EOCP
-#include <sys/types.h>
-#$i_inttypes I_INTTYPES
-#ifdef I_INTTYPES
-#include <inttypes.h>
-#endif
-int main() { int64_t x = 7; }
-EOCP
- set try
- if eval $compile; then
- val="$define"
- echo " Yes, it does." >&4
- else
- val="$undef"
- echo " No, it doesn't." >&4
- fi
- $rm -f try try.*
- ;;
-*) val="$undef"
- ;;
-esac
-set d_int64t
-eval $setvar
-
-
-
-echo " "
-echo "Checking which 64-bit integer type to use..." >&4
-
-case "$intsize" in
-8) val=int
- set quadtype
- eval $setvar
- val='"unsigned int"'
- set uquadtype
- eval $setvar
- quadcase=1
- ;;
-*) case "$longsize" in
- 8) val=long
- set quadtype
- eval $setvar
- val='"unsigned long"'
- set uquadtype
- eval $setvar
- quadcase=2
- ;;
- *) case "$uselonglong:$d_longlong:$longlongsize" in
- define:define:8)
- val='"long long"'
- set quadtype
- eval $setvar
- val='"unsigned long long"'
- set uquadtype
- eval $setvar
- quadcase=3
- ;;
- *) case "$d_int64t" in
- define)
- val=int64_t
- set quadtype
- eval $setvar
- val=uint64_t
- set uquadtype
- eval $setvar
- quadcase=4
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
-esac
-
-case "$quadtype" in
-'') echo "Alas, no 64-bit integer types in sight." >&4 ;;
-*) echo "Using '$quadtype' for 64-bit integers." >&4 ;;
-esac
-
-echo " "
-
-if $test X"$quadtype" != X; then
-
-echo "Checking how to print 64-bit integers..." >&4
-
-if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- int q = 12345678901;
- printf("%ld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
- sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
- echo "We will use %d."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- long q = 12345678901;
- printf("%ld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
- sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
- echo "We will use %ld."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <inttypes.h>
-#include <stdio.h>
-int main() {
- int64_t q = 12345678901;
- printf("%" PRId64 "\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
- sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
- echo "We will use the C9X style."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
- $cat >try.c <<'EOCP'
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
- printf("%lld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
- sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
- echo "We will use the %lld style."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRId64" = X -a X"$quadtype" != X; then
- $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- $quadtype q = 12345678901;
- printf("%Ld\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
- sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
- echo "We will use %Ld."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRId64" = X -a X"$quadtype" != X; then
- $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- $quadtype q = 12345678901;
- printf("%qd\n", q);
-}
-EOCP
- set try
- if eval $compile; then
- yyy=`./try$exe_ext`
- case "$yyy" in
- 12345678901)
- sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
- sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
- echo "We will use %qd."
- ;;
- esac
- fi
-fi
-
-if $test X"$sPRId64" = X; then
- echo "Cannot figure out how to print 64-bit integers." >&4
-fi
-
-$rm -f try try.*
-
-fi
-
-case "$sPRId64" in
-'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
- d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
- ;;
-*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
- d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
- ;;
-esac
-
: check for length of double
echo " "
case "$doublesize" in
set bzero d_bzero
eval $inlibc
+: check for lengths of integral types
+echo " "
+case "$intsize" in
+'')
+ echo "Checking to see how big your integers are..." >&4
+ $cat >intsize.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("intsize=%d;\n", sizeof(int));
+ printf("longsize=%d;\n", sizeof(long));
+ printf("shortsize=%d;\n", sizeof(short));
+ exit(0);
+}
+EOCP
+ set intsize
+ if eval $compile_ok && ./intsize > /dev/null; then
+ eval `./intsize`
+ echo "Your integers are $intsize bytes long."
+ echo "Your long integers are $longsize bytes long."
+ echo "Your short integers are $shortsize bytes long."
+ else
+ $cat >&4 <<EOM
+!
+Help! I can't compile and run the intsize test program: please enlighten me!
+(This is probably a misconfiguration in your system or libraries, and
+you really ought to fix it. Still, I'll try anyway.)
+!
+EOM
+ dflt=4
+ rp="What is the size of an integer (in bytes)?"
+ . ./myread
+ intsize="$ans"
+ dflt=$intsize
+ rp="What is the size of a long integer (in bytes)?"
+ . ./myread
+ longsize="$ans"
+ dflt=2
+ rp="What is the size of a short integer (in bytes)?"
+ . ./myread
+ shortsize="$ans"
+ fi
+ ;;
+esac
+$rm -f intsize intsize.*
+
: see if signal is declared as pointer to function returning int or void
echo " "
xxx=`./findhdr signal.h`
set fgetpos d_fgetpos
eval $inlibc
-: see if flock exists
-set flock d_flock
-eval $inlibc
+: see if flock exists
+set flock d_flock
+eval $inlibc
+
+: see if fork exists
+set fork d_fork
+eval $inlibc
+
+: see if pathconf exists
+set pathconf d_pathconf
+eval $inlibc
+
+: see if fpathconf exists
+set fpathconf d_fpathconf
+eval $inlibc
+
+: define an is-a-typedef? function
+typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
+case "$inclist" in
+"") inclist="sys/types.h";;
+esac;
+eval "varval=\$$var";
+case "$varval" in
+"")
+ $rm -f temp.c;
+ for inc in $inclist; do
+ echo "#include <$inc>" >>temp.c;
+ done;
+ echo "#ifdef $type" >> temp.c;
+ echo "printf(\"We have $type\");" >> temp.c;
+ echo "#endif" >> temp.c;
+ $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
+ if $contains $type temp.E >/dev/null 2>&1; then
+ eval "$var=\$type";
+ else
+ eval "$var=\$def";
+ fi;
+ $rm -f temp.?;;
+*) eval "$var=\$varval";;
+esac'
+
+: define an is-a-typedef? function that prompts if the type is not available.
+typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
+case "$inclist" in
+"") inclist="sys/types.h";;
+esac;
+eval "varval=\$$var";
+case "$varval" in
+"")
+ $rm -f temp.c;
+ for inc in $inclist; do
+ echo "#include <$inc>" >>temp.c;
+ done;
+ echo "#ifdef $type" >> temp.c;
+ echo "printf(\"We have $type\");" >> temp.c;
+ echo "#endif" >> temp.c;
+ $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
+ echo " " ;
+ echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
+ if $contains $type temp.E >/dev/null 2>&1; then
+ echo "$type found." >&4;
+ eval "$var=\$type";
+ else
+ echo "$type NOT found." >&4;
+ dflt="$def";
+ . ./myread ;
+ eval "$var=\$ans";
+ fi;
+ $rm -f temp.?;;
+*) eval "$var=\$varval";;
+esac'
+
+: see what type lseek is declared as in the kernel
+rp="What is the type used for lseek's offset on this system?"
+set off_t lseektype long stdio.h sys/types.h
+eval $typedef_ask
-: see if fork exists
-set fork d_fork
-eval $inlibc
+echo " "
+$echo $n "Checking to see how big your file offsets are...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", sizeof($lseektype));
+}
+EOCP
+set try
+if eval $compile_ok; then
+ lseeksize=`./try`
+ $echo " $lseeksize bytes." >&4
+else
+ dflt='4'
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of your file offsets (in bytes)?"
+ . ./myread
+ lseeksize="$ans"
+fi
+$rm -f try.c try
-: see if pathconf exists
-set pathconf d_pathconf
-eval $inlibc
+: 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
+eval $typedef_ask
-: see if fpathconf exists
-set fpathconf d_fpathconf
-eval $inlibc
+echo " "
+case "$fpostype" in
+*_t) zzz="$fpostype" ;;
+*) zzz="fpos_t" ;;
+esac
+echo "Checking the size of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ printf("%d\n", sizeof($fpostype));
+}
+EOCP
+set try
+if eval $compile_ok; then
+ yyy=`./try`
+ case "$yyy" in
+ '') fpossize=4
+ echo "(I can't execute the test program--guessing $fpossize.)" >&4
+ ;;
+ *) fpossize=$yyy
+ echo "Your $zzz size is $fpossize bytes."
+ ;;
+ esac
+else
+ fpossize=4
+ echo "(I can't compile the test program--guessing $fpossize.)" >&4
+fi
-: see if llseek exists
-set llseek d_llseek
-eval $inlibc
: check for off64_t
echo " "
-$echo $n "Checking to see if your system supports off64_t...$c" >&4
+echo "Checking to see if your system supports off64_t..." >&4
$cat >try.c <<EOCP
#include <sys/types.h>
#include <unistd.h>
-off64_t foo() { off64_t x; x = 7; return x; }'
+int main() { off64_t x = 7; }'
EOCP
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+set try
+if eval $compile; then
val="$define"
- echo " Yup, it does." >&4
+ echo " Yup, it does."
else
val="$undef"
- echo " Nope, it doesn't." >&4
+ echo " Nope, it doesn't."
+ case "$lseeksize" in
+ 8) echo "(This is okay because your off_t is 64 bits wide.)" ;;
+ esac
fi
-$rm -f try.*
+$rm -f try.* try
set d_off64_t
eval $setvar
: check for fpos64_t
echo " "
-$echo $n "Checking to see if your system supports fpos64_t...$c" >&4
+echo "Checking to see if your system supports fpos64_t..." >&4
$cat >try.c <<EOCP
#include <sys/stdio.h>
-fpos64_t foo() { fpos64_t x; x = 7; return x; }'
+int main() { fpos64_t x x = 7; }'
EOCP
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+set try
+if eval $compile; then
val="$define"
- echo " Yup, it does." >&4
+ echo " Yup, it does."
else
val="$undef"
- echo " Nope, it doesn't." >&4
+ echo " Nope, it doesn't."
+ case "$fpossize" in
+ 8) echo "(This is okay because your fpos_t is 64 bits wide.)" ;;
+ esac
fi
-$rm -f try.*
+$rm -f try.* try
set d_fpos64_t
eval $setvar
echo " "
-$echo $n "Checking to see if your system supports struct fs_data..." $c >&4
+echo "Checking to see if your system supports struct fs_data..." >&4
set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
eval $hasstruct
case "$d_fs_data_s" in
-"$define") echo "Yup, it does." >&4 ;;
-*) echo "Nope, it doesn't." >&4 ;;
+"$define") echo "Yup, it does." ;;
+*) echo "Nope, it doesn't." ;;
esac
: see if fseeko exists
set inet_aton d_inetaton
eval $inlibc
+: see if inttypes.h is available
+: we want a real compile instead of Inhdr because some systems
+: have an inttypes.h which includes non-existent headers
+echo " "
+$cat >try.c <<EOCP
+#include <inttypes.h>
+int main() {
+ static int32_t foo32 = 0x12345678;
+}
+EOCP
+set try
+if eval $compile; then
+ echo "<inttypes.h> found." >&4
+ val="$define"
+else
+ echo "<inttypes.h> NOT found." >&4
+ val="$undef"
+fi
+$rm -f try.c try
+set i_inttypes
+eval $setvar
+
+: check for int64_t
+case "$use64bits" in
+"$define" )
+ echo " "
+ $echo $n "Checking to see if your system supports int64_t...$c" >&4
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+int main() { int64_t x = 7; }
+EOCP
+ set try
+ if eval $compile; then
+ val="$define"
+ echo " Yes, it does." >&4
+ else
+ val="$undef"
+ echo " No, it doesn't." >&4
+ fi
+ $rm -f try try.*
+ ;;
+*) val="$undef"
+ ;;
+esac
+set d_int64t
+eval $setvar
+
+
: Look for isascii
echo " "
$cat >isascii.c <<'EOCP'
set lockf d_lockf
eval $inlibc
+: check for long long
+echo " "
+$echo $n "Checking to see if your system supports long long..." $c >&4
+echo 'int main() { long long x = 7; }' > try.c
+set try
+if eval $compile; then
+ val="$define"
+ echo " Yes, it does." >&4
+else
+ val="$undef"
+ echo " No, it doesn't." >&4
+fi
+$rm try.*
+set d_longlong
+eval $setvar
+
+: check for length of long long
+case "${d_longlong}${longlongsize}" in
+$define)
+ echo " "
+ $echo $n "Checking to see how big your long longs are..." $c >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", sizeof(long long));
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ longlongsize=`./try$exe_ext`
+ $echo " $longlongsize bytes." >&4
+ else
+ dflt='8'
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of a long long (in bytes)?"
+ . ./myread
+ longlongsize="$ans"
+ fi
+ if $test "X$longsize" = "X$longlongsize"; then
+ echo "(That isn't any different from an ordinary long.)"
+ fi
+ ;;
+esac
+$rm -f try.* try
+
: see if lstat exists
set lstat d_lstat
eval $inlibc
echo " "
-$echo $n "Checking to see if your system supports struct statfs..." $c >&4
+echo "Checking to see if your system supports struct statfs..." >&4
set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
eval $hasstruct
case "$d_statfs_s" in
-"$define") echo "Yup, it does." >&4 ;;
-*) echo "Nope, it doesn't." >&4 ;;
+"$define") echo "Yup, it does." ;;
+*) echo "Nope, it doesn't." ;;
esac
case "$d_statfs_s" in
define)
echo " "
- $echo $n "Checking to see if your struct statfs has f_flags field..." $c >&4
+ echo "Checking to see if your struct statfs has f_flags field..." >&4
set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
eval $hasfield
;;
;;
esac
case "$d_statfs_f_flags" in
-"$define") echo "Yup, it does." >&4 ;;
-*) echo "Nope, it doesn't." >&4 ;;
+"$define") echo "Yup, it does." ;;
+*) echo "Nope, it doesn't." ;;
esac
: see if _ptr and _cnt from stdio act std
set strxfrm d_strxfrm
eval $inlibc
-: see if symlink exists
-set symlink d_symlink
-eval $inlibc
-
-: see if syscall exists
-set syscall d_syscall
-eval $inlibc
-
-: see if sysconf exists
-set sysconf d_sysconf
-eval $inlibc
-
-: see if system exists
-set system d_system
-eval $inlibc
-
-: see if tcgetpgrp exists
-set tcgetpgrp d_tcgetpgrp
-eval $inlibc
-
-: see if tcsetpgrp exists
-set tcsetpgrp d_tcsetpgrp
-eval $inlibc
-
-: see if prototype for telldir is available
-echo " "
-set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
-eval $hasproto
-
-: define an is-a-typedef? function
-typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
- $rm -f temp.c;
- for inc in $inclist; do
- echo "#include <$inc>" >>temp.c;
- done;
- echo "#ifdef $type" >> temp.c;
- echo "printf(\"We have $type\");" >> temp.c;
- echo "#endif" >> temp.c;
- $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
- if $contains $type temp.E >/dev/null 2>&1; then
- eval "$var=\$type";
- else
- eval "$var=\$def";
- fi;
- $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
-
-: define an is-a-typedef? function that prompts if the type is not available.
-typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
- $rm -f temp.c;
- for inc in $inclist; do
- echo "#include <$inc>" >>temp.c;
- done;
- echo "#ifdef $type" >> temp.c;
- echo "printf(\"We have $type\");" >> temp.c;
- echo "#endif" >> temp.c;
- $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
- echo " " ;
- echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
- if $contains $type temp.E >/dev/null 2>&1; then
- echo "$type found." >&4;
- eval "$var=\$type";
- else
- echo "$type NOT found." >&4;
- dflt="$def";
- . ./myread ;
- eval "$var=\$ans";
- fi;
- $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
+: see if symlink exists
+set symlink d_symlink
+eval $inlibc
+
+: see if syscall exists
+set syscall d_syscall
+eval $inlibc
+
+: see if sysconf exists
+set sysconf d_sysconf
+eval $inlibc
+
+: see if system exists
+set system d_system
+eval $inlibc
+
+: see if tcgetpgrp exists
+set tcgetpgrp d_tcgetpgrp
+eval $inlibc
+
+: see if tcsetpgrp exists
+set tcsetpgrp d_tcsetpgrp
+eval $inlibc
+
+: see if prototype for telldir is available
+echo " "
+set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
+eval $hasproto
: see if this is a sys/times.h system
set sys/times.h i_systimes
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
-eval $typedef_ask
-
: Store the full pathname to the ar program for use in the C program
: Respect a hint or command line value for full_ar.
case "$full_ar" in
*) dflt="$1" ;;
esac
;;
-*) dflt="$gidtype";;
+*) dflt="$gidtype";;
+esac
+case "$gidtype" in
+gid_t) echo "gid_t found." ;;
+*) rp="What is the type for group ids returned by getgid()?"
+ . ./myread
+ gidtype="$ans"
+ ;;
+esac
+
+echo " "
+case "$gidtype" in
+*_t) zzz="$gidtype" ;;
+*) zzz="gid" ;;
+esac
+echo "Checking the sign of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $gidtype foo = -1;
+ if (foo < 0)
+ printf("-1\n");
+ else
+ printf("1\n");
+}
+EOCP
+set try
+if eval $compile; then
+ yyy=`./try`
+ case "$yyy" in
+ '') gidsign=1
+ echo "(I can't execute the test program--guessing unsigned.)" >&4
+ ;;
+ *) gidsign=$yyy
+ case "$gidsign" in
+ 1) echo "Your $zzz is unsigned." ;;
+ -1) echo "Your $zzz is signed." ;;
+ esac
+ ;;
+ esac
+else
+ gidsign=1
+ echo "(I can't compile the test program--guessing unsigned.)" >&4
+fi
+
+
+echo " "
+case "$gidtype" in
+*_t) zzz="$gidtype" ;;
+*) zzz="gid" ;;
+esac
+echo "Checking the size of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ printf("%d\n", sizeof($gidtype));
+}
+EOCP
+set try
+if eval $compile_ok; then
+ yyy=`./try`
+ case "$yyy" in
+ '') gidsize=4
+ echo "(I can't execute the test program--guessing $gidsize.)" >&4
+ ;;
+ *) gidsize=$yyy
+ echo "Your $zzz size is $gidsize bytes."
+ ;;
+ esac
+else
+ gidsize=4
+ echo "(I can't compile the test program--guessing $gidsize.)" >&4
+fi
+
+
+: see if getgroups exists
+set getgroups d_getgrps
+eval $inlibc
+
+: see if setgroups exists
+set setgroups d_setgrps
+eval $inlibc
+
+
+: Find type of 2nd arg to 'getgroups()' and 'setgroups()'
+echo " "
+case "$d_getgrps$d_setgrps" in
+*define*)
+ case "$groupstype" in
+ '') dflt="$gidtype" ;;
+ *) dflt="$groupstype" ;;
+ esac
+ $cat <<EOM
+What type of pointer is the second argument to getgroups() and setgroups()?
+Usually this is the same as group ids, $gidtype, but not always.
+
+EOM
+ rp='What type pointer is the second argument to getgroups() and setgroups()?'
+ . ./myread
+ groupstype="$ans"
+ ;;
+*) groupstype="$gidtype";;
+esac
+
+
+echo " "
+echo "Checking which 64-bit integer type to use..." >&4
+
+case "$intsize" in
+8) val=int
+ set quadtype
+ eval $setvar
+ val='"unsigned int"'
+ set uquadtype
+ eval $setvar
+ quadcase=1
+ ;;
+*) case "$longsize" in
+ 8) val=long
+ set quadtype
+ eval $setvar
+ val='"unsigned long"'
+ set uquadtype
+ eval $setvar
+ quadcase=2
+ ;;
+ *) case "$uselonglong:$d_longlong:$longlongsize" in
+ define:define:8)
+ val='"long long"'
+ set quadtype
+ eval $setvar
+ val='"unsigned long long"'
+ set uquadtype
+ eval $setvar
+ quadcase=3
+ ;;
+ *) case "$d_int64t" in
+ define)
+ val=int64_t
+ set quadtype
+ eval $setvar
+ val=uint64_t
+ set uquadtype
+ eval $setvar
+ quadcase=4
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
+case "$quadtype" in
+'') echo "Alas, no 64-bit integer types in sight." >&4 ;;
+*) echo "Using '$quadtype' for 64-bit integers." >&4 ;;
+esac
+
+: check for length of character
+echo " "
+case "$charsize" in
+'')
+ echo "Checking to see how big your characters are..." >&4
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", sizeof(char));
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ dflt=`./try`
+ else
+ dflt='1'
+ echo "(I can't seem to compile the test program. Guessing...)"
+ fi
+ ;;
+*)
+ dflt="$charsize"
+ ;;
+esac
+rp="What is the size of a character (in bytes)?"
+. ./myread
+charsize="$ans"
+$rm -f try.c try
+
+
+echo " "
+$echo "Choosing the C types to be used for Perl's internal types..." >&4
+
+case "$use64bits:$quadtype" in
+define:?*)
+ ivtype="$quadtype"
+ uvtype="$uquadtype"
+ ivsize=8
+ uvsize=8
+ ;;
+*) ivtype="long"
+ uvtype="unsigned long"
+ ivsize=$longsize
+ uvsize=$longsize
+ ;;
+esac
+
+case "$uselongdouble:$d_longdbl" in
+define:define)
+ nvtype="long double"
+ nvsize=$longdblsize
+ ;;
+*) nvtype=double
+ nvsize=$doublesize
+ ;;
+esac
+
+echo "(IV will be "$ivtype", $ivsize bytes)"
+echo "(UV will be "$uvtype", $uvsize bytes)"
+echo "(NV will be "$nvtype", $nvsize bytes)"
+
+$cat >try.c <<EOCP
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+#include <stdio.h>
+int main() {
+#ifdef INT8
+ int8_t i = INT8_MAX;
+ uint8_t u = UINT8_MAX;
+ printf("int8_t\n");
+#endif
+#ifdef INT16
+ int16_t i = INT16_MAX;
+ uint16_t i = UINT16_MAX;
+ printf("int16_t\n");
+#endif
+#ifdef INT32
+ int32_t i = INT32_MAX;
+ uint32_t u = UINT32_MAX;
+ printf("int32_t\n");
+#endif
+#ifdef INT64
+ int64_t i = INT64_MAX;
+ uint64_t u = UINT64_MAX;
+ printf("int64_t\n");
+#endif
+}
+EOCP
+set try -DINT8
+if eval $compile; then
+ case "`./try$exe_ext`" in
+ int8_t) i8type=int8_t
+ u8type=uint8_t
+ i8size=1
+ u8size=1
+ ;;
+ esac
+fi
+case "$i8type" in
+'') i8type=char
+ u8type="unsigned char"
+ i8size=$charsize
+ u8size=$charsize
+ ;;
+esac
+set try -DINT16
+if eval $compile; then
+ case "`./try$exe_ext`" in
+ int16_t)
+ i16type=int16_t
+ u16type=uint16_t
+ i16size=2
+ u16size=2
+ ;;
+ esac
+fi
+case "$i16type" in
+'') i16type=short
+ u16type="unsigned short"
+ i16size=$shortsize
+ u16size=$shortsize
+ ;;
+esac
+set try -DINT32
+if eval $compile; then
+ case "`./try$exe_ext`" in
+ int32_t)
+ i32type=int32_t
+ u32type=uint32_t
+ i32size=4
+ u32size=4
+ ;;
+ esac
+fi
+case "$i32type" in
+'') case "$longsize" in
+ 4) i32type=long
+ u32type="unsigned long"
+ i32size=longsize
+ u32size=$longsize
+ ;;
+ *) case "$intsize" in
+ 4) i32type=int
+ u32type="unsigned int"
+ i32size=$intsize
+ u32size=$intsize
+ ;;
+ esac
+ ;;
+ esac
+ ;;
esac
-case "$gidtype" in
-gid_t) echo "gid_t found." ;;
-*) rp="What is the type for group ids returned by getgid()?"
- . ./myread
- gidtype="$ans"
+set try -DINT64
+if eval $compile; then
+ case "`./try$exe_ext`" in
+ int64_t)
+ i64type=int64_t
+ u64type=uint64_t
+ i64size=8
+ u64size=8
+ ;;
+ esac
+fi
+case "$i64type" in
+'') case "$quadtype" in
+ '') ;;
+ *) i64type="$quadtype"
+ u64type="$uquadtype"
+ i64size=8
+ u64size=8
+ ;;
+ esac
;;
esac
+$rm -f try.* try
+
echo " "
-case "$gidtype" in
-*_t) zzz="$gidtype" ;;
-*) zzz="gid" ;;
-esac
-echo "Checking the sign of $zzz..." >&4
-cat > try.c <<EOCP
+
+if $test X"$quadtype" != X; then
+
+echo "Checking how to print 64-bit integers..." >&4
+
+if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
+ $cat >try.c <<'EOCP'
#include <sys/types.h>
#include <stdio.h>
int main() {
- $gidtype foo = -1;
- if (foo < 0)
- printf("-1\n");
- else
- printf("1\n");
+ int q = 12345678901;
+ printf("%ld\n", q);
}
EOCP
-set try
-if eval $compile; then
- yyy=`./try`
- case "$yyy" in
- '') gidsign=1
- echo "(I can't execute the test program--guessing unsigned.)" >&4
- ;;
- *) gidsign=$yyy
- case "$gidsign" in
- 1) echo "Your $zzz is unsigned." ;;
- -1) echo "Your $zzz is signed." ;;
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
+ sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
+ echo "We will use %d."
+ ;;
esac
- ;;
- esac
-else
- gidsign=1
- echo "(I can't compile the test program--guessing unsigned.)" >&4
+ fi
fi
+if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ long q = 12345678901;
+ printf("%ld\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
+ sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
+ echo "We will use %ld."
+ ;;
+ esac
+ fi
+fi
-echo " "
-case "$gidtype" in
-*_t) zzz="$gidtype" ;;
-*) zzz="gid" ;;
-esac
-echo "Checking the size of $zzz..." >&4
-cat > try.c <<EOCP
+if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$quadtype" = Xint64_t; then
+ $cat >try.c <<'EOCP'
#include <sys/types.h>
+#include <inttypes.h>
#include <stdio.h>
int main() {
- printf("%d\n", sizeof($gidtype));
+ int64_t q = 12345678901;
+ printf("%" PRId64 "\n", q);
}
EOCP
-set try
-if eval $compile_ok; then
- yyy=`./try`
- case "$yyy" in
- '') gidsize=4
- echo "(I can't execute the test program--guessing $gidsize.)" >&4
- ;;
- *) gidsize=$yyy
- echo "Your $zzz size is $gidsize bytes."
- ;;
- esac
-else
- gidsize=4
- echo "(I can't compile the test program--guessing $gidsize.)" >&4
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
+ sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
+ echo "We will use the C9X style."
+ ;;
+ esac
+ fi
+fi
+
+if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
+ $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
+ printf("%lld\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
+ sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
+ echo "We will use the %lld style."
+ ;;
+ esac
+ fi
fi
+if $test X"$sPRId64" = X -a X"$quadtype" != X; then
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $quadtype q = 12345678901;
+ printf("%Ld\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
+ sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
+ echo "We will use %Ld."
+ ;;
+ esac
+ fi
+fi
-: see if getgroups exists
-set getgroups d_getgrps
-eval $inlibc
+if $test X"$sPRId64" = X -a X"$quadtype" != X; then
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ $quadtype q = 12345678901;
+ printf("%qd\n", q);
+}
+EOCP
+ set try
+ if eval $compile; then
+ yyy=`./try$exe_ext`
+ case "$yyy" in
+ 12345678901)
+ sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
+ sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
+ echo "We will use %qd."
+ ;;
+ esac
+ fi
+fi
-: see if setgroups exists
-set setgroups d_setgrps
-eval $inlibc
+if $test X"$sPRId64" = X; then
+ echo "Cannot figure out how to print 64-bit integers." >&4
+fi
+$rm -f try try.*
-: Find type of 2nd arg to 'getgroups()' and 'setgroups()'
-echo " "
-case "$d_getgrps$d_setgrps" in
-*define*)
- case "$groupstype" in
- '') dflt="$gidtype" ;;
- *) dflt="$groupstype" ;;
- esac
- $cat <<EOM
-What type of pointer is the second argument to getgroups() and setgroups()?
-Usually this is the same as group ids, $gidtype, but not always.
+fi
-EOM
- rp='What type pointer is the second argument to getgroups() and setgroups()?'
- . ./myread
- groupstype="$ans"
+case "$sPRId64" in
+'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
+ d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef";
+ ;;
+*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
+ d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define";
;;
-*) groupstype="$gidtype";;
esac
-: see what type lseek is declared as in the kernel
-rp="What is the type used for lseek's offset on this system?"
-set off_t lseektype long stdio.h sys/types.h
-eval $typedef_ask
echo " "
-$echo $n "Checking to see how big your file offsets are...$c" >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main()
-{
- printf("%d\n", sizeof($lseektype));
-}
-EOCP
-set try
-if eval $compile_ok; then
- lseeksize=`./try`
- $echo " $lseeksize bytes." >&4
+$echo "Checking the format strings to be used for Perl's internal types..." >&4
+
+if $test X"$ivsize" = X8; then
+ ivdformat="$sPRId64"
+ uvuformat="$sPRIu64"
+ uvoformat="$sPRIo64"
+ uvxformat="$sPRIx64"
else
- dflt='4'
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of your file offsets (in bytes)?"
- . ./myread
- lseeksize="$ans"
+ if $test X"$ivsize" = X"$longsize"; then
+ ivdformat='"ld"'
+ uvuformat='"lu"'
+ uvoformat='"lo"'
+ uvxformat='"lx"'
+ else
+ if $test X"$ivsize" = X"$intsize"; then
+ ivdformat='"d"'
+ uvuformat='"u"'
+ uvoformat='"o"'
+ uvxformat='"x"'
+ else
+ : far out
+ if $test X"$ivsize" = X"$shortsize"; then
+ ivdformat='"hd"'
+ uvuformat='"hu"'
+ uvoformat='"ho"'
+ uvxformat='"hx"'
+ fi
+ fi
+ fi
fi
-$rm -f try.c try
+
+case "$ivdformat" in
+'') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
+ exit 1
+ ;;
+esac
echo " "
echo "Checking if your $make program sets \$(MAKE)..." >&4
set sys/uio.h i_sysuio
eval $inhdr
-echo "Checking to see if your system supports struct iovec..." >&4
-set d_iovec_s iovec iov_base $i_sysuio sys/uio.h
-eval $hasfield
-case "$d_iovec_s" in
-"$define") echo "Yup, it does." >&4
- ;;
-*) echo "Nope, it doesn't." >&4
- ;;
-esac
-
: see if this is a sys/un.h system
set sys/un.h i_sysun
eval $inhdr
cf_by='$cf_by'
cf_email='$cf_email'
cf_time='$cf_time'
+charsize='$charsize'
chgrp='$chgrp'
chmod='$chmod'
chown='$chown'
d_index='$d_index'
d_inetaton='$d_inetaton'
d_int64t='$d_int64t'
-d_iovec_s='$d_iovec_s'
d_isascii='$d_isascii'
d_killpg='$d_killpg'
d_lchown='$d_lchown'
d_ldbl_dig='$d_ldbl_dig'
d_link='$d_link'
-d_llseek='$d_llseek'
d_locconv='$d_locconv'
d_lockf='$d_lockf'
d_longdbl='$d_longdbl'
find='$find'
firstmakefile='$firstmakefile'
flex='$flex'
+fpossize='$fpossize'
fpostype='$fpostype'
freetype='$freetype'
full_ar='$full_ar'
hint='$hint'
hostcat='$hostcat'
huge='$huge'
+i16size='$i16size'
+i16type='$i16type'
+i32size='$i32size'
+i32type='$i32type'
+i64size='$i64size'
+i64type='$i64type'
+i8size='$i8size'
+i8type='$i8type'
i_arpainet='$i_arpainet'
i_bsdioctl='$i_bsdioctl'
i_db='$i_db'
installvendorbin='$installvendorbin'
installvendorlib='$installvendorlib'
intsize='$intsize'
+ivdformat='$ivdformat'
+ivsize='$ivsize'
+ivtype='$ivtype'
known_extensions='$known_extensions'
ksh='$ksh'
large='$large'
nm_so_opt='$nm_so_opt'
nonxs_ext='$nonxs_ext'
nroff='$nroff'
+nvsize='$nvsize'
+nvtype='$nvtype'
o_nonblock='$o_nonblock'
obj_ext='$obj_ext'
old_pthread_create_joinable='$old_pthread_create_joinable'
tr='$tr'
trnl='$trnl'
troff='$troff'
+u16size='$u16size'
+u16type='$u16type'
+u32size='$u32size'
+u32type='$u32type'
+u64size='$u64size'
+u64type='$u64type'
+u8size='$u8size'
+u8type='$u8type'
uidsign='$uidsign'
uidsize='$uidsize'
uidtype='$uidtype'
usevfork='$usevfork'
usrinc='$usrinc'
uuname='$uuname'
+uvoformat='$uvoformat'
+uvsize='$uvsize'
+uvtype='$uvtype'
+uvuformat='$uvuformat'
+uvxformat='$uvxformat'
vendorbin='$vendorbin'
vendorbinexp='$vendorbinexp'
vendorlib='$vendorlib'