exit 1
fi
-if test ! -c /dev/null ; then
+if test -f /sys/utilities/MultiView ; then
+ # AmigaOS, test -c for /dev/null is not useful
+ :
+elif test ! -c /dev/null ; then
cat <<EOF
***
*** I'm sorry, but /dev/null appears to be a file rather than a device.
d_fpgetround=''
d_fpos64_t=''
d_frexpl=''
-d_fs_data_s=''
d_fseeko=''
d_fsetpos=''
-d_fstatfs=''
d_fsync=''
d_ftello=''
d_ftime=''
d_getaddrinfo=''
d_getcwd=''
d_getespwnam=''
-d_getfsstat=''
d_getgrent=''
d_getgrent_r=''
getgrent_r_proto=''
d_getlogin=''
d_getlogin_r=''
getlogin_r_proto=''
-d_getmnt=''
-d_getmntent=''
d_getnameinfo=''
d_getnbyaddr=''
d_getnbyname=''
gmtime_r_proto=''
d_gnulibc=''
gnulibc_version=''
-d_hasmntopt=''
d_htonl=''
d_hypot=''
d_ilogb=''
d_logb=''
d_ldexpl=''
d_longdbl=''
-longdblinfbytes=''
longdblkind=''
-longdblmantbits=''
-longdblnanbytes=''
longdblsize=''
d_longlong=''
longlongsize=''
d_sresuproto=''
d_stat=''
d_statblks=''
-d_statfs_f_flags=''
-d_statfs_s=''
d_static_inline=''
perl_static_inline=''
-d_fstatvfs=''
-d_statvfs=''
d_stdio_cnt_lval=''
d_stdio_ptr_lval=''
d_stdio_ptr_lval_nochange_cnt=''
d_unsetenv=''
d_usleep=''
d_usleepproto=''
-d_ustat=''
d_pseudofork=''
d_vfork=''
usevfork=''
i_mallocmalloc=''
i_math=''
i_memory=''
-i_mntent=''
d_gdbm_ndbm_h_uses_prototypes=''
d_gdbmndbm_h_uses_prototypes=''
d_ndbm=''
i_syslog=''
i_sysmman=''
i_sysmode=''
-i_sysmount=''
i_sysndir=''
i_sysparam=''
i_syspoll=''
i_syssecrt=''
i_sysselct=''
i_sysstat=''
-i_sysstatfs=''
-i_sysstatvfs=''
i_systimes=''
i_systypes=''
i_sysuio=''
i_sysun=''
i_sysutsname=''
-i_sysvfs=''
i_syswait=''
i_sgtty=''
i_termio=''
i_time=''
timeincl=''
i_unistd=''
-i_ustat=''
i_utime=''
i_values=''
i_stdarg=''
d_inc_version_list=''
inc_version_list=''
inc_version_list_init=''
+doubleinfbytes=''
+doublenanbytes=''
+longdblinfbytes=''
+longdblnanbytes=''
installprefix=''
installprefixexp=''
installstyle=''
d_PRIgldbl=''
d_SCNfldbl=''
doublekind=''
-doubleinfbytes=''
-doublemantbits=''
-doublenanbytes=''
sPRIEUldbl=''
sPRIFUldbl=''
sPRIGUldbl=''
man3dir=''
man3direxp=''
man3ext=''
+doublemantbits=''
+longdblmantbits=''
+nvmantbits=''
modetype=''
multiarch=''
mydomain=''
ivtype=''
nv_overflows_integers_at=''
nv_preserves_uv_bits=''
-nvmantbits=''
nvsize=''
nvtype=''
u16size=''
: run the defines and the undefines, if any, but leave the file out there...
touch optdef.sh
+grep -q '\\' optdef.sh
+if test $? = 0; then
+ echo "Configure does not support \\ in -D arguments"
+ exit 1
+fi
. ./optdef.sh
: create the posthint manipulation script and leave the file out there...
touch posthint.sh
package='perl5'
first=`echo $package | sed -e 's/^\(.\).*/\1/'`
last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
-case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
-ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
+case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
+ABYZ-abyz) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
esac
: see whether [:lower:] and [:upper:] are supported character classes
echo " "
-case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
-ABYZ)
+case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`"-"`echo AbyZ | $tr '[:upper:]' '[:lower:]' 2>/dev/null`" in
+ABYZ-abyz)
echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
up='[:upper:]'
low='[:lower:]'
$test -f /etc/saf/_sactab && osname=svr4
$test -d /usr/include/minix && osname=minix && osvers=`$uname -r`
$test -f /system/gnu_library/bin/ar.pm && osname=vos
+ $test -f /sys/utilities/MultiView && osname=amigaos
if $test -d /MachTen -o -d /MachTen_Folder; then
osname=machten
if $test -x /sbin/version; then
dos|vms)
: XXX Should be a Configure test for double-dots in filenames.
version=`echo $revision $patchlevel $subversion | \
- $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
+ $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
api_versionstring=`echo $api_revision $api_version $api_subversion | \
- $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
+ $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
;;
*)
version=`echo $revision $patchlevel $subversion | \
- $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
+ $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
api_versionstring=`echo $api_revision $api_version $api_subversion | \
- $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
+ $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
;;
esac
: Special case the 5.005_xx maintenance series, which used 5.005
# is to add the flag to the flags passed to the compiler at link time,
# as that way the compiler can do the right implementation dependant
# thing. (NWC)
- case "$gccversion" in
- ?*) set stack-protector-strong -fstack-protector-strong
- eval $checkccflag
- case "$dflt" in
- *-fstack-protector-strong*) ;; # It got added.
- *) # Try the plain/older -fstack-protector.
- set stack-protector -fstack-protector
- eval $checkccflag
- ;;
+ case "$osname" in
+ amigaos) ;; # -fstack-protector builds but doesn't work
+ *) case "$gccversion" in
+ ?*) set stack-protector-strong -fstack-protector-strong
+ eval $checkccflag
+ case "$dflt" in
+ *-fstack-protector-strong*) ;; # It got added.
+ *) # Try the plain/older -fstack-protector.
+ set stack-protector -fstack-protector
+ eval $checkccflag
+ ;;
+ esac
+ ;;
esac
;;
esac
echo " "
echo "Computing filename position in cpp output for #include directives..." >&4
case "$osname" in
+amigaos) fieldn=3 ;; # Workaround for a bug in abc (pdksh).
+esac
+case "$fieldn" in
+'')
+case "$osname" in
vos) testaccess=-e ;;
*) testaccess=-r ;;
esac
chmod +x fieldn
fieldn=`./fieldn`
$rm -f foo.c fieldn
+;;
+esac
case $fieldn in
'') pos='???';;
1) pos=first;;
Perl can be built to support DTrace on platforms that support it.
DTrace is a diagnosis and performance analysis tool from Sun.
-If this doesn't make any sense to you, just accept the default '$dflt'.
+If this doesn't make any sense to you, just accept the default.
EOM
while $test 1 ; do
: with g++ one needs -shared to get is-in-libc to work for dlopen
case "$gccversion" in
'') ;;
+*Clang*) ;;
*) case "$d_cplusplus" in
"$define") ccflags="$ccflags -shared" ;;
esac
exit(1); /* fail */
}
EOM
- if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
+ if $cc $ccflags $ldflags -o a.out try.c >/dev/null 2>&1 && $run ./a.out; then
bin_ELF="$define"
fi
$rm_try
esac
$rm_try
-: see if this is a math.h system
-set math.h i_math
-eval $inhdr
-
-: Check what kind of inf/nan your system has
-$echo "Checking the kind of infinities and nans you have..." >&4
-$cat >try.c <<EOP
-#define DOUBLESIZE $doublesize
-#$d_longdbl HAS_LONG_DOUBLE
-#ifdef HAS_LONG_DOUBLE
-#define LONGDBLSIZE $longdblsize
-#define LONGDBLKIND $longdblkind
-#endif
-#$i_math I_MATH
-#ifdef I_MATH
-#include <math.h>
-#endif
-#include <stdio.h>
-/* Note that whether the sign bit is on or off
- * for NaN depends on the CPU/FPU, and possibly
- * can be affected by the build toolchain.
- *
- * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
- * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
- * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- * (respectively) as opposed to the more usual
- * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- */
-static void bytes(unsigned char *p, unsigned int n) {
- int i;
- for (i = 0; i < n; i++) {
- printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
- }
-}
-int main(int argc, char *argv[]) {
- /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
- * because some compilers are 'smart' and not only warn but refuse to
- * compile such 'illegal' values. */
- double dinf = exp(1e9);
- double dnan = sqrt(-1.0);
-#ifdef HAS_LONG_DOUBLE
- long double ldinf = (long double)exp(1e9);
- long double ldnan = (long double)sqrt(-1.0);
-#endif
- if (argc == 2) {
- switch (argv[1][0]) {
- case '1': bytes(&dinf, sizeof(dinf)); break;
- case '2': bytes(&dnan, sizeof(dnan)); break;
-#ifdef HAS_LONG_DOUBLE
-# if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
-/* the 80-bit long doubles might have garbage in their excess bytes */
- memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
-# endif
- case '3': bytes(&ldinf, sizeof(ldinf)); break;
- case '4': bytes(&ldnan, sizeof(ldnan)); break;
-#endif
- }
- }
- return 0;
-}
-EOP
-set try
-if eval $compile; then
- doubleinfbytes=`$run ./try 1`
- doublenanbytes=`$run ./try 2`
- case "$d_longdbl" in
- $define)
- longdblinfbytes=`$run ./try 3`
- longdblnanbytes=`$run ./try 4`
- ;;
- esac
-else
- # Defaults in case the above test program failed.
- case "$doublekind" in
- 1) # IEEE 754 32-bit LE
- doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
- doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
- ;;
- 2) # IEEE 754 32-bit BE
- doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
- doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
- ;;
- 3) # IEEE 754 64-bit LE
- doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
- doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
- ;;
- 4) # IEEE 754 64-bit BE
- doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- ;;
- 5) # IEEE 754 128-bit LE
- doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
- doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
- ;;
- 6) # IEEE 754 128-bit BE
- doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- ;;
- 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
- doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
- doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
- ;;
- 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
- doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
- doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
- ;;
- *) # No idea.
- doubleinfbytes=$undef
- doublenanbytes=$undef
- ;;
- esac
- case "$longdblkind" in
- 1) # IEEE 754 128-bit LE
- longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
- longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
- ;;
- 2) # IEEE 754 128-bit BE
- longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- ;;
- 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
- case "$longdblsize" in
- 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
- longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
- longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
- ;;
- 16) # x86_64
- longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- ;;
- *) # No idea.
- longdblinfbytes=$undef
- longdblnanbytes=$undef
- ;;
- esac
- ;;
- 4) # IEEE 754 80-bit BE, 12 or 16 bytes
- case "$longdblsize" in
- 12) # 32-bit system
- longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- ;;
- 16) # 64-bit system
- longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- ;;
- *) # No idea.
- longdblinfbytes=$undef
- longdblnanbytes=$undef
- ;;
- esac
- ;;
- 5) # 128-bit LE "double double"
- longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
- longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
- ;;
- 6) # 128-bit BE "double double"
- longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
- ;;
- *) # No idea.
- longdblinfbytes=$undef
- longdblnanbytes=$undef
- ;;
- esac
-fi
-$rm_try
-
: Check print/scan long double stuff
echo " "
echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
case "$eagain" in
'')
- case "$d_fork:$d_pipe" in
+ case "$d_fork:$d_pipe:$d_alarm" in
define:define)
$cat head.c > try.c
$cat >>try.c <<EOCP
set sys/param.h i_sysparam
eval $inhdr
-: see if this is a sys/mount.h system
-set sys/mount.h i_sysmount
-eval $inhdr
-
-: Check for fs_data_s
-echo " "
-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 "Yes, it does." ;;
-*) echo "No, it doesn't." ;;
-esac
-
: see if fseeko exists
set fseeko d_fseeko
eval $inlibc
set fsetpos d_fsetpos
eval $inlibc
-: see if fstatfs exists
-set fstatfs d_fstatfs
-eval $inlibc
-
-: see if statvfs exists
-set statvfs d_statvfs
-eval $inlibc
-
-: see if fstatvfs exists
-set fstatvfs d_fstatvfs
-eval $inlibc
-
-
: see if fsync exists
set fsync d_fsync
eval $inlibc
set getespwnam d_getespwnam
eval $inlibc
-: see if getfsstat exists
-set getfsstat d_getfsstat
-eval $inlibc
-
: see if getgrent exists
set getgrent d_getgrent
eval $inlibc
;;
esac
-: see if getmnt exists
-set getmnt d_getmnt
-eval $inlibc
-
-: see if getmntent exists
-set getmntent d_getmntent
-eval $inlibc
-
: see if getnameinfo exists
set getnameinfo d_getnameinfo
eval $inlibc
;;
esac
-: see if hasmntopt exists
-set hasmntopt d_hasmntopt
-eval $inlibc
-
: see if this is a netinet/in.h or sys/in.h system
set netinet/in.h i_niin sys/in.h i_sysin
eval $inhdr
echo " "
procselfexe=''
val="$undef"
+case "$d_procselfexe" in
+'')
case "$d_readlink" in
"$define")
: NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
$rm -f reflect
set d_procselfexe
eval $setvar
+;;
+esac
: backward compatibility for d_hvfork
if test X$d_hvfork != X; then
eval $setvar
$rm_try
-$echo "Checking how many mantissa bits your doubles have..." >&4
-$cat >try.c <<EOP
-#$i_float I_FLOAT
-#$i_sunmath I_SUNMATH
-#ifdef I_FLOAT
-# include <float.h>
-#endif
-#ifdef I_SUNMATH
-# include <sunmath.h>
-#endif
-#ifdef DBL_MANT_DIG
-# define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
-#endif
-#include <stdio.h>
-int main(int argc, char *argv[]) {
-#ifdef BITS
- printf("%d\n", BITS);
-#endif
- return 0;
-}
-EOP
-set try
-if eval $compile; then
- doublemantbits=`$run ./try`
-else
- doublemantbits="$undef"
-fi
-$rm_try
-
-$echo "Checking how many mantissa bits your long doubles have..." >&4
-$cat >try.c <<EOP
-#$i_float I_FLOAT
-#$i_sunmath I_SUNMATH
-#ifdef I_FLOAT
-# include <float.h>
-#endif
-#ifdef I_SUNMATH
-# include <sunmath.h>
-#endif
-#$d_longdbl HAS_LONG_DOUBLE
-#if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
-# if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
-/* This format has no implicit bit. Beware, however, that for
- * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
- * the top three bits are used for inf (100) / qnan (11x) / snan (101),
- * and the top bit must have been one since 387, zero is plain invalid.
- * For normal fp values, the LDBL_MANT_DIG is fine, though. */
-# define BITS LDBL_MANT_DIG
-# elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
-/* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
- * reason e.g. Irix thinks 107. But in any case, we want only
- * the number of real bits, the implicit bits are of no interest. */
-# define BITS 2 * (DBL_MANT_DIG - 1)
-# else
-# define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
-# endif
-#endif
-#include <stdio.h>
-int main(int argc, char *argv[]) {
-#ifdef BITS
- printf("%d\n", BITS);
-#endif
- return 0;
-}
-EOP
-set try
-if eval $compile; then
- longdblmantbits=`$run ./try`
-else
- longdblmantbits="$undef"
-fi
-$rm_try
-
-$echo "Checking how many mantissa bits your NVs have..." >&4
-if test "X$usequadmath" = "X$define"; then
- nvmantbits=112 # 128-1-15
-else
- if test "X$nvsize" = "X$doublesize"; then
- nvmantbits="$doublemantbits"
- else
- if test "X$nvsize" = "X$longdblsize"; then
- nvmantbits="$longdblmantbits"
- else
- nvmantbits="$undef"
- fi
- fi
-fi
-
-: see if sigprocmask exists
-set sigprocmask d_sigprocmask
-eval $inlibc
+: see if sigprocmask exists
+set sigprocmask d_sigprocmask
+eval $inlibc
: see if sigsetjmp exists
echo " "
set d_statblks stat st_blocks $i_sysstat sys/stat.h
eval $hasfield
-: see if this is a sys/vfs.h system
-set sys/vfs.h i_sysvfs
-eval $inhdr
-
-: see if this is a sys/statfs.h system
-set sys/statfs.h i_sysstatfs
-eval $inhdr
-
-: Check for statfs_s
-echo " "
-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 "Yes, it does." ;;
-*) echo "No, it doesn't." ;;
-esac
-
-
-: see if struct statfs knows about f_flags
-case "$d_statfs_s" in
-define)
- echo " "
- 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
- ;;
-*) val="$undef"
- set d_statfs_f_flags
- eval $setvar
- ;;
-esac
-case "$d_statfs_f_flags" in
-"$define") echo "Yes, it does." ;;
-*) echo "No, it doesn't." ;;
-esac
-
: see what flavor, if any, of static inline is supported
echo " "
echo "Checking to see if your system supports static inline..."
set d_usleepproto usleep $i_unistd unistd.h
eval $hasproto
-: see if ustat exists
-set ustat d_ustat
-eval $inlibc
-
: see if closedir exists
set closedir d_closedir
eval $inlibc
;;
esac
+: Check what kind of inf/nan your system has
+$echo "Checking the kind of infinities and nans you have..." >&4
+$cat >try.c <<EOP
+#define DOUBLESIZE $doublesize
+#$d_longdbl HAS_LONG_DOUBLE
+#ifdef HAS_LONG_DOUBLE
+#define LONGDBLSIZE $longdblsize
+#define LONGDBLKIND $longdblkind
+#endif
+#$i_math I_MATH
+#ifdef I_MATH
+#include <math.h>
+#endif
+#include <stdio.h>
+/* Note that whether the sign bit is on or off
+ * for NaN depends on the CPU/FPU, and possibly
+ * can be affected by the build toolchain.
+ *
+ * For example for older MIPS and HP-PA 2.0 the quiet NaN is:
+ * 0x7f, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+ * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ * (respectively) as opposed to the more usual
+ * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ */
+static void bytes(unsigned char *p, unsigned int n) {
+ int i;
+ for (i = 0; i < n; i++) {
+ printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
+ }
+}
+int main(int argc, char *argv[]) {
+ /* We cannot use 1.0/0.0 and 0.0/0.0 (with L suffixes for long double)
+ * because some compilers are 'smart' and not only warn but refuse to
+ * compile such 'illegal' values. */
+ double dinf = exp(1e9);
+ double dnan = sqrt(-1.0);
+#ifdef HAS_LONG_DOUBLE
+ long double ldinf = (long double)exp(1e9);
+ long double ldnan = (long double)sqrt(-1.0);
+#endif
+ if (argc == 2) {
+ switch (argv[1][0]) {
+ case '1': bytes(&dinf, sizeof(dinf)); break;
+ case '2': bytes(&dnan, sizeof(dnan)); break;
+#ifdef HAS_LONG_DOUBLE
+# if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
+/* the 80-bit long doubles might have garbage in their excess bytes */
+ memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
+# endif
+ case '3': bytes(&ldinf, sizeof(ldinf)); break;
+ case '4': bytes(&ldnan, sizeof(ldnan)); break;
+#endif
+ }
+ }
+ return 0;
+}
+EOP
+set try
+if eval $compile; then
+ doubleinfbytes=`$run ./try 1`
+ doublenanbytes=`$run ./try 2`
+ case "$d_longdbl" in
+ $define)
+ longdblinfbytes=`$run ./try 3`
+ longdblnanbytes=`$run ./try 4`
+ ;;
+ esac
+else
+ # Defaults in case the above test program failed.
+ case "$doublekind" in
+ 1) # IEEE 754 32-bit LE
+ doubleinfbytes='0x00, 0x00, 0xf0, 0x7f'
+ doublenanbytes='0x00, 0x00, 0xf8, 0x7f'
+ ;;
+ 2) # IEEE 754 32-bit BE
+ doubleinfbytes='0x7f, 0xf0, 0x00, 0x00'
+ doublenanbytes='0x7f, 0xf8, 0x00, 0x00'
+ ;;
+ 3) # IEEE 754 64-bit LE
+ doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
+ doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
+ ;;
+ 4) # IEEE 754 64-bit BE
+ doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ 5) # IEEE 754 128-bit LE
+ doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
+ doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
+ ;;
+ 6) # IEEE 754 128-bit BE
+ doubleinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ doublenanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ 7) # IEEE 754 64-bit mixed: 32-bit LEs in BE
+ doubleinfbytes='0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00'
+ doublenanbytes='0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ 8) # IEEE 754 64-bit mixed: 32-bit BEs in LE
+ doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
+ doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
+ ;;
+ *) # No idea.
+ doubleinfbytes=$undef
+ doublenanbytes=$undef
+ ;;
+ esac
+ case "$longdblkind" in
+ 1) # IEEE 754 128-bit LE
+ longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f'
+ longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f'
+ ;;
+ 2) # IEEE 754 128-bit BE
+ longdblinfbytes='0x7f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ longdblnanbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ 3) # IEEE 754 80-bit LE, 12 or 16 bytes (x86)
+ case "$longdblsize" in
+ 12) # x86 32-bit (96 bits, or 4 x 32, or 12 x 8)
+ longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00'
+ longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00'
+ ;;
+ 16) # x86_64
+ longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ *) # No idea.
+ longdblinfbytes=$undef
+ longdblnanbytes=$undef
+ ;;
+ esac
+ ;;
+ 4) # IEEE 754 80-bit BE, 12 or 16 bytes
+ case "$longdblsize" in
+ 12) # 32-bit system
+ longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ 16) # 64-bit system
+ longdblinfbytes='0x7f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ longdblnanbytes='0x7f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ *) # No idea.
+ longdblinfbytes=$undef
+ longdblnanbytes=$undef
+ ;;
+ esac
+ ;;
+ 5) # 128-bit LE "double double"
+ longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
+ longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
+ ;;
+ 6) # 128-bit BE "double double"
+ longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+ ;;
+ *) # No idea.
+ longdblinfbytes=$undef
+ longdblnanbytes=$undef
+ ;;
+ esac
+fi
+$rm_try
+
+: Check the length of the double mantissa
+$echo "Checking how many mantissa bits your doubles have..." >&4
+$cat >try.c <<EOP
+#$i_float I_FLOAT
+#$i_sunmath I_SUNMATH
+#ifdef I_FLOAT
+# include <float.h>
+#endif
+#ifdef I_SUNMATH
+# include <sunmath.h>
+#endif
+#ifdef DBL_MANT_DIG
+# define BITS (DBL_MANT_DIG - 1) /* the implicit bit does not count */
+#endif
+#include <stdio.h>
+int main(int argc, char *argv[]) {
+#ifdef BITS
+ printf("%d\n", BITS);
+#endif
+ return 0;
+}
+EOP
+set try
+if eval $compile; then
+ doublemantbits=`$run ./try`
+else
+ doublemantbits="$undef"
+fi
+$rm_try
+
+: Check the length of the longdouble mantissa
+$echo "Checking how many mantissa bits your long doubles have..." >&4
+$cat >try.c <<EOP
+#$i_float I_FLOAT
+#$i_sunmath I_SUNMATH
+#ifdef I_FLOAT
+# include <float.h>
+#endif
+#ifdef I_SUNMATH
+# include <sunmath.h>
+#endif
+#$d_longdbl HAS_LONG_DOUBLE
+#if defined(HAS_LONG_DOUBLE) && defined(LDBL_MANT_DIG)
+# if ($longdblkind == 3) || ($longdblkind == 4) /* 80-bit extended precision */
+/* This format has no implicit bit. Beware, however, that for
+ * this format the bare LDBL_MANT_DIG is misleading for inf/nan:
+ * the top three bits are used for inf (100) / qnan (11x) / snan (101),
+ * and the top bit must have been one since 387, zero is plain invalid.
+ * For normal fp values, the LDBL_MANT_DIG is fine, though. */
+# define BITS LDBL_MANT_DIG
+# elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
+/* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
+ * reason e.g. Irix thinks 107. But in any case, we want only
+ * the number of real bits, the implicit bits are of no interest. */
+# define BITS 2 * (DBL_MANT_DIG - 1)
+# else
+# define BITS (LDBL_MANT_DIG - 1) /* the implicit bit does not count */
+# endif
+#endif
+#include <stdio.h>
+int main(int argc, char *argv[]) {
+#ifdef BITS
+ printf("%d\n", BITS);
+#endif
+ return 0;
+}
+EOP
+set try
+if eval $compile; then
+ longdblmantbits=`$run ./try`
+else
+ longdblmantbits="$undef"
+fi
+$rm_try
+
+: Check the length of the NV mantissa
+$echo "Checking how many mantissa bits your NVs have..." >&4
+if test "X$usequadmath" = "X$define"; then
+ nvmantbits=112 # 128-1-15
+else
+ if test "X$nvsize" = "X$doublesize"; then
+ nvmantbits="$doublemantbits"
+ else
+ if test "X$nvsize" = "X$longdblsize"; then
+ nvmantbits="$longdblmantbits"
+ else
+ nvmantbits="$undef"
+ fi
+ fi
+fi
+
: How can we generate normalized random numbers ?
echo " "
echo "Using our internal random number implementation..." >&4
esac
: Trace out the files included by signal.h, then look for SIGxxx names.
+case "$sig_num_init" in
+'')
if [ "X$fieldn" = X ]; then
: Just make some guesses. We check them later.
xxx="$sysroot/usr/include/signal.h $sysroot/usr/include/sys/signal.h"
}'
sig_size=`echo $sig_name | awk '{print NF}'`
$rm -f signal signal.c signal.awk signal.lst signal_cmd
+;;
+esac
: Check size of size
echo " "
i_machcthr="$undef"
fi
-: see if this is a mntent.h system
-set mntent.h i_mntent
-eval $inhdr
-
: see if net/errno.h is available
val=''
set net/errno.h val
set sys/security.h i_syssecrt
eval $inhdr
-: see if this is a sys/statvfs.h system
-set sys/statvfs.h i_sysstatvfs
-eval $inhdr
-
: see if this is a sys/un.h system
set sys/un.h i_sysun
eval $inhdr
set sys/wait.h i_syswait
eval $inhdr
-: see if this is a ustat.h system
-set ustat.h i_ustat
-eval $inhdr
-
: see if this is an utime system
set utime.h i_utime
eval $inhdr
case "$xxx" in
DynaLoader|dynaload) ;;
*)
- this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
+ this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
case "$this_ext" in
Scalar/List/Utils) this_ext="List/Util" ;;
PathTools) this_ext="Cwd" ;;
esac;
- echo " $xs_extensions $nonxs_extensions" > $tdir/$$.tmp;
- if $contains " $this_ext " $tdir/$$.tmp; then
+ echo " $xs_extensions $nonxs_extensions" > "$tdir/$$.tmp";
+ if $contains " $this_ext " "$tdir/$$.tmp"; then
echo >&4;
echo "Duplicate directories detected for extension $xxx" >&4;
echo "Configure cannot correctly recover from this - shall I abort?" >&4;
esac;
echo "Ok. You will need to correct config.sh before running make." >&4;
fi;
- $ls -1 $xxx > $tdir/$$.tmp;
- if $contains "\.xs$" $tdir/$$.tmp > /dev/null 2>&1; then
+ $ls -1 "$xxx" > "$tdir/$$.tmp";
+ if $contains "\.xs$" "$tdir/$$.tmp" > /dev/null 2>&1; then
xs_extensions="$xs_extensions $this_ext";
- elif $contains "\.c$" $tdir/$$.tmp > /dev/null 2>&1; then
+ elif $contains "\.c$" "$tdir/$$.tmp" > /dev/null 2>&1; then
xs_extensions="$xs_extensions $this_ext";
- elif $test -d $xxx; then
+ elif $test -d "$xxx"; then
nonxs_extensions="$nonxs_extensions $this_ext";
fi;
- $rm -f $tdir/$$.tmp;
+ $rm -f "$tdir/$$.tmp";
;;
esac;
done'
avail_ext=''
for xxx in $xs_extensions ; do
case "$xxx" in
+ Amiga*)
+ case "$osname" in
+ amigaos) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
DB_File|db_file)
case "$i_db" in
$define) avail_ext="$avail_ext $xxx" ;;
esac
;;
Sys/Syslog|sys/syslog)
- : XXX syslog requires socket
- case "$d_socket" in
- true|$define|y) avail_ext="$avail_ext $xxx" ;;
+ case $osname in
+ amigaos) ;; # not really very useful on AmigaOS
+ *)
+ : XXX syslog requires socket
+ case "$d_socket" in
+ true|$define|y) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
esac
;;
Thread|thread)
d_fs_data_s='$d_fs_data_s'
d_fseeko='$d_fseeko'
d_fsetpos='$d_fsetpos'
-d_fstatfs='$d_fstatfs'
-d_fstatvfs='$d_fstatvfs'
d_fsync='$d_fsync'
d_ftello='$d_ftello'
d_ftime='$d_ftime'
d_getaddrinfo='$d_getaddrinfo'
d_getcwd='$d_getcwd'
d_getespwnam='$d_getespwnam'
-d_getfsstat='$d_getfsstat'
d_getgrent='$d_getgrent'
d_getgrent_r='$d_getgrent_r'
d_getgrgid_r='$d_getgrgid_r'
d_getitimer='$d_getitimer'
d_getlogin='$d_getlogin'
d_getlogin_r='$d_getlogin_r'
-d_getmnt='$d_getmnt'
-d_getmntent='$d_getmntent'
d_getnameinfo='$d_getnameinfo'
d_getnbyaddr='$d_getnbyaddr'
d_getnbyname='$d_getnbyname'
d_gmtime_r='$d_gmtime_r'
d_gnulibc='$d_gnulibc'
d_grpasswd='$d_grpasswd'
-d_hasmntopt='$d_hasmntopt'
d_htonl='$d_htonl'
d_hypot='$d_hypot'
d_ilogb='$d_ilogb'
d_sresuproto='$d_sresuproto'
d_stat='$d_stat'
d_statblks='$d_statblks'
-d_statfs_f_flags='$d_statfs_f_flags'
-d_statfs_s='$d_statfs_s'
d_static_inline='$d_static_inline'
-d_statvfs='$d_statvfs'
d_stdio_cnt_lval='$d_stdio_cnt_lval'
d_stdio_ptr_lval='$d_stdio_ptr_lval'
d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
d_unsetenv='$d_unsetenv'
d_usleep='$d_usleep'
d_usleepproto='$d_usleepproto'
-d_ustat='$d_ustat'
d_vendorarch='$d_vendorarch'
d_vendorbin='$d_vendorbin'
d_vendorlib='$d_vendorlib'
i_mallocmalloc='$i_mallocmalloc'
i_math='$i_math'
i_memory='$i_memory'
-i_mntent='$i_mntent'
i_ndbm='$i_ndbm'
i_netdb='$i_netdb'
i_neterrno='$i_neterrno'
i_syslog='$i_syslog'
i_sysmman='$i_sysmman'
i_sysmode='$i_sysmode'
-i_sysmount='$i_sysmount'
i_sysndir='$i_sysndir'
i_sysparam='$i_sysparam'
i_syspoll='$i_syspoll'
i_sysselct='$i_sysselct'
i_syssockio='$i_syssockio'
i_sysstat='$i_sysstat'
-i_sysstatfs='$i_sysstatfs'
-i_sysstatvfs='$i_sysstatvfs'
i_systime='$i_systime'
i_systimek='$i_systimek'
i_systimes='$i_systimes'
i_sysuio='$i_sysuio'
i_sysun='$i_sysun'
i_sysutsname='$i_sysutsname'
-i_sysvfs='$i_sysvfs'
i_syswait='$i_syswait'
i_termio='$i_termio'
i_termios='$i_termios'
i_time='$i_time'
i_unistd='$i_unistd'
-i_ustat='$i_ustat'
i_utime='$i_utime'
i_values='$i_values'
i_varargs='$i_varargs'