# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Oct 6 15:40:31 EET DST 2000 [metaconfig 3.0 PL70]
+# Generated on Wed Oct 3 16:47:48 EET DST 2001 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
-cat >/tmp/c1$$ <<EOF
+cat >c1$$ <<EOF
ARGGGHHHH!!!!!
SCO csh still thinks true is false. Write to SCO today and tell them that next
[End of diatribe. We now return you to your regularly scheduled programming...]
EOF
-cat >/tmp/c2$$ <<EOF
+cat >c2$$ <<EOF
OOPS! You naughty creature! You didn't run Configure with sh!
I will attempt to remedy the situation by running sh for you...
EOF
-true || cat /tmp/c1$$ /tmp/c2$$
+true || cat c1$$ c2$$
true || exec sh $0 $argv:q
-(exit $?0) || cat /tmp/c2$$
+(exit $?0) || cat c2$$
(exit $?0) || exec sh $0 $argv:q
-rm -f /tmp/c1$$ /tmp/c2$$
+rm -f c1$$ c2$$
: compute my invocation name
me=$0
PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
elif test -n "$DJGPP"; then
- p_=\;
+ case "X${MACHTYPE:-nonesuchmach}" in
+ *cygwin) ;;
+ *) p_=\; ;;
+ esac
fi
fi
ccsymbols=''
cppccsymbols=''
cppsymbols=''
+from=''
+run=''
+targetarch=''
+to=''
+usecrosscompile=''
perllibs=''
dynamic_ext=''
extensions=''
static_ext=''
useopcode=''
useposix=''
+extras=''
d_bsd=''
d_eunice=''
d_xenix=''
obj_ext=''
path_sep=''
afs=''
+afsroot=''
alignbytes=''
ansi2knr=''
archlib=''
cppminus=''
cpprun=''
cppstdin=''
-crosscompile=''
+d__fwalk=''
d_access=''
d_accessx=''
d_alarm=''
d_chown=''
d_chroot=''
d_chsize=''
+d_class=''
d_closedir=''
d_void_closedir=''
+d_cmsghdr_s=''
d_const=''
cryptlib=''
d_crypt=''
full_csh=''
d_cuserid=''
d_dbl_dig=''
+d_dbminitproto=''
d_difftime=''
d_dlerror=''
d_dlopen=''
d_endpent=''
d_endpwent=''
d_endsent=''
+d_fchdir=''
d_fchmod=''
d_fchown=''
d_fcntl=''
+d_fcntl_can_lock=''
d_fd_macros=''
d_fd_set=''
d_fds_bits=''
d_fgetpos=''
+d_finite=''
+d_finitel=''
d_flexfnam=''
d_flock=''
+d_flockproto=''
d_fork=''
+d_fp_class=''
+d_fpclass=''
+d_fpclassify=''
+d_fpclassl=''
d_fpos64_t=''
d_frexpl=''
d_fs_data_s=''
d_fseeko=''
d_fsetpos=''
d_fstatfs=''
+d_fsync=''
d_ftello=''
d_ftime=''
d_gettimeod=''
d_phostname=''
d_uname=''
d_gethostprotos=''
+d_getitimer=''
d_getlogin=''
d_getmnt=''
d_getmntent=''
d_getnbyname=''
d_getnent=''
d_getnetprotos=''
+d_getpagsz=''
d_getpent=''
d_getpgid=''
d_getpgrp2=''
d_gnulibc=''
d_hasmntopt=''
d_htonl=''
-d_iconv=''
d_inetaton=''
d_int64_t=''
d_isascii=''
+d_isfinite=''
+d_isinf=''
d_isnan=''
d_isnanl=''
d_killpg=''
d_mmap=''
mmaptype=''
d_modfl=''
+d_modfl_pow32_bug=''
d_mprotect=''
d_msg=''
d_msgctl=''
d_msgget=''
+d_msghdr_s=''
d_msgrcv=''
d_msgsnd=''
d_msync=''
d_munmap=''
d_nice=''
+d_nl_langinfo=''
d_off64_t=''
d_open3=''
d_fpathconf=''
d_portable=''
d_old_pthread_create_joinable=''
old_pthread_create_joinable=''
+d_pthread_atfork=''
d_pthread_yield=''
d_sched_yield=''
sched_yield=''
d_seekdir=''
d_telldir=''
d_readlink=''
+d_readv=''
+d_recvmsg=''
d_rename=''
d_rmdir=''
d_safebcpy=''
d_safemcpy=''
d_sanemcmp=''
+d_sbrkproto=''
d_select=''
d_sem=''
d_semctl=''
d_semget=''
d_semop=''
+d_sendmsg=''
d_setegid=''
d_seteuid=''
d_setgrent=''
d_setgrps=''
d_sethent=''
+d_setitimer=''
d_setlinebuf=''
d_setlocale=''
d_setnent=''
d_shmdt=''
d_shmget=''
d_sigaction=''
+d_sigprocmask=''
d_sigsetjmp=''
+d_sockatmark=''
+d_sockatmarkproto=''
d_msg_ctrunc=''
d_msg_dontroute=''
d_msg_oob=''
d_socklen_t=''
d_socks5_init=''
d_sqrtl=''
+d_sresgproto=''
+d_sresuproto=''
d_statblks=''
d_statfs_f_flags=''
d_statfs_s=''
d_statvfs=''
d_stdio_cnt_lval=''
d_stdio_ptr_lval=''
+d_stdio_ptr_lval_nochange_cnt=''
+d_stdio_ptr_lval_sets_cnt=''
d_stdiobase=''
d_stdstdio=''
stdio_base=''
d_strerror=''
d_sysernlst=''
d_syserrlst=''
+d_strftime=''
d_strtod=''
d_strtol=''
d_strtold=''
d_strtoll=''
+d_strtoq=''
d_strtoul=''
d_strtoull=''
d_strtouq=''
d_strxfrm=''
d_symlink=''
d_syscall=''
+d_syscallproto=''
d_sysconf=''
d_system=''
d_tcgetpgrp=''
d_times=''
d_truncate=''
d_tzname=''
+d_u32align=''
+d_ualarm=''
d_umask=''
d_semctl_semid_ds=''
d_semctl_semun=''
d_union_semun=''
+d_unordered=''
+d_usleep=''
+d_usleepproto=''
d_ustat=''
d_vfork=''
usevfork=''
d_waitpid=''
d_wcstombs=''
d_wctomb=''
+d_writev=''
dlext=''
cccdlflags=''
ccdlflags=''
i_arpainet=''
db_hashtype=''
db_prefixtype=''
+db_version_major=''
+db_version_minor=''
+db_version_patch=''
i_db=''
i_dbm=''
i_rpcsvcdbm=''
i_dlfcn=''
i_fcntl=''
i_float=''
+i_fp=''
+i_fp_class=''
i_gdbm=''
d_grpasswd=''
i_grp=''
-i_iconv=''
i_ieeefp=''
i_inttypes=''
+i_langinfo=''
i_libutil=''
i_limits=''
i_locale=''
inc_version_list_init=''
installprefix=''
installprefixexp=''
-installscripts=''
installstyle=''
installusrbinperl=''
intsize=''
longsize=''
shortsize=''
+issymlink=''
libc=''
ldlibpthname=''
libperl=''
eagain=''
o_nonblock=''
rd_nodata=''
+need_va_copy=''
netdb_hlen_type=''
netdb_host_type=''
netdb_name_type=''
api_version=''
api_versionstring=''
patchlevel=''
+perl_patchlevel=''
revision=''
subversion=''
version=''
+version_patchlevel_string=''
perl5=''
perladmin=''
perlpath=''
sig_name_init=''
sig_num=''
sig_num_init=''
+sig_size=''
installsitearch=''
sitearch=''
sitearchexp=''
d_oldpthreads=''
use5005threads=''
useithreads=''
+usereentrant=''
usethreads=''
incpath=''
mips_type=''
usevendorprefix=''
vendorprefix=''
vendorprefixexp=''
+versiononly=''
defvoidused=''
voidflags=''
pm_apiversion=''
xs_apiversion=''
+yacc=''
+yaccflags=''
CONFIG=''
define='define'
inclwanted=''
groupstype=''
+libnames=''
: change the next line if compiling for Xenix/286 on Xenix/386
xlibpth='/usr/lib/386 /lib/386'
: Possible local library directories to search.
: set usemultiplicity on the Configure command line to enable multiplicity.
: set usesocks on the Configure command line to enable socks.
: set usethreads on the Configure command line to enable threads.
+usereentrant='undef'
: full support for void wanted by default
defvoidused=15
libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
libswanted="$libswanted dld ld sun m c cposix posix"
libswanted="$libswanted ndir dir crypt sec"
-libswanted="$libswanted ucb bsd BSD PW x iconv util"
+libswanted="$libswanted ucb bsd BSD PW x util"
: We probably want to search /usr/shlib before most other libraries.
: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
esac
case "$sh" in
-'') cat <<EOM >&2
+'') cat >&2 <<EOM
$me: Fatal Error: I can't find a Bourne Shell anywhere.
Usually it's in /bin/sh. How did you even get this far?
spitshell=cat
xcat=/bin/cat
test -f $xcat || xcat=/usr/bin/cat
- echo "#!$xcat" >try
- $eunicefix try
- chmod +x try
- ./try > today
+ echo "#!$xcat" >sharp
+ $eunicefix sharp
+ chmod +x sharp
+ ./sharp > today
if test -s today; then
sharpbang='#!'
else
- echo "#! $xcat" > try
- $eunicefix try
- chmod +x try
- ./try > today
+ echo "#! $xcat" > sharp
+ $eunicefix sharp
+ chmod +x sharp
+ ./sharp > today
if test -s today; then
sharpbang='#! '
else
echo "I presume that if # doesn't work, #! won't work either!"
sharpbang=': use '
fi
-rm -f try today
+rm -f sharp today
: figure out how to guarantee sh startup
case "$startsh" in
'') startsh=${sharpbang}${sh} ;;
*)
esac
-cat >try <<EOSS
+cat >sharp <<EOSS
$startsh
set abc
test "$?abc" != 1
EOSS
-chmod +x try
-$eunicefix try
-if ./try; then
+chmod +x sharp
+$eunicefix sharp
+if ./sharp; then
: echo "Yup, it does."
else
echo "Hmm... '$startsh' does not guarantee sh startup..."
echo "You may have to fix up the shell scripts to make sure $sh runs them."
fi
-rm -f try
+rm -f sharp
: Save command line options in file UU/cmdline.opt for later use in
config_argc=$#
EOSH
argn=1
+args_exp=''
+args_sep=''
for arg in "$@"; do
cat >>cmdline.opt <<EOSH
config_arg$argn='$arg'
EOSH
+ # Extreme backslashitis: replace each ' by '"'"'
+ cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
+$arg
+EOC
+ arg_exp=`cat cmdl.opt`
+ args_exp="$args_exp$args_sep'$arg_exp'"
argn=`expr $argn + 1`
+ args_sep=' '
done
+# args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
+# used by ./hints/os2.sh
+rm -f cmdl.opt
: produce awk script to parse command line options
cat >options.awk <<'EOF'
*/*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
case "$src" in
/*) ;;
+ .) ;;
*) src=`cd ../$src && pwd` ;;
esac
;;
: script used to extract .SH files with variable substitutions
cat >extract <<'EOS'
-CONFIGDOTSH=true
+PERL_CONFIG_SH=true
echo "Doing variable substitutions on .SH files..."
-if test -f $src/MANIFEST; then
- set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
+if test -f MANIFEST; then
+ set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
else
echo "(Looking for .SH files under the source directory.)"
set x `(cd $src; find . -name "*.SH" -print)`
echo " "
. UU/extract
rm -rf UU
- echo "Done."
+ echo "Extraction done."
exit 0
;;
esac
It is most seriously suggested that you do not continue any further
unless you want to help in developing and debugging Perl.
+ If you *still* want to build perl, you can answer 'y' now,
+ or pass -Dusedevel to Configure.
+
EOH
rp='Do you really want to continue?'
dflt='n'
. ./myread
case "$ans" in
- [yY]) echo >&4 "Okay, continuing." ;;
+ [yY]) echo >&4 "Okay, continuing."
+ usedevel="$define" ;;
*) echo >&4 "Okay, bye."
exit 1
;;
esac
;;
esac
+case "$usedevel" in
+$define|true|[yY]*)
+ case "$versiononly" in
+ '') versiononly="$define" ;;
+ esac
+ case "$installusrbinperl" in
+ '') installusrbinperl="$undef" ;;
+ esac
+ ;;
+esac
: general instructions
needman=true
loclist="
awk
cat
+chmod
comm
cp
echo
trylist="
Mcc
ar
+bison
byacc
cpp
csh
return 0;
}
EOM
- if $cc $cflags -o try try.c; then
+ if $cc -o try $ccflags $ldflags try.c; then
:
else
echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
fi
$rm -f blurfl sym
+: determine whether symbolic links are supported
+echo " "
+case "$lns" in
+*"ln -s")
+ echo "Checking how to test for symbolic links..." >&4
+ $lns blurfl sym
+ if $test "X$issymlink" = X; then
+ sh -c "PATH= test -h sym" >/dev/null 2>&1
+ if test $? = 0; then
+ issymlink="test -h"
+ fi
+ fi
+ if $test "X$issymlink" = X; then
+ if $test -h >/dev/null 2>&1; then
+ issymlink="$test -h"
+ echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
+ fi
+ fi
+ if $test "X$issymlink" = X; then
+ if $test -L sym 2>/dev/null; then
+ issymlink="$test -L"
+ fi
+ fi
+ if $test "X$issymlink" != X; then
+ echo "You can test for symbolic links with '$issymlink'." >&4
+ else
+ echo "I do not know how you can test for symbolic links." >&4
+ fi
+ $rm -f blurfl sym
+ ;;
+*) echo "No symbolic links, so not testing for their testing..." >&4
+ ;;
+esac
+echo " "
+
+
+case "$mksymlinks" in
+$define|true|[yY]*)
+ case "$src" in
+ ''|'.') echo "Cannot create symlinks in the original directory." >&4
+ exit 1
+ ;;
+ *) case "$lns:$issymlink" in
+ *"ln -s:"*"test -"?)
+ echo "Creating the symbolic links..." >&4
+ echo "(First creating the subdirectories...)" >&4
+ cd ..
+ awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
+ read directory
+ test -z "$directory" && break
+ mkdir -p $directory
+ done
+ # Sanity check 1.
+ if test ! -d t/base; then
+ echo "Failed to create the subdirectories. Aborting." >&4
+ exit 1
+ fi
+ echo "(Then creating the symlinks...)" >&4
+ awk '{print $1}' $src/MANIFEST | while true; do
+ read filename
+ test -z "$filename" && break
+ if test -f $filename; then
+ if $issymlink $filename; then
+ rm -f $filename
+ fi
+ fi
+ if test -f $filename; then
+ echo "$filename already exists, not symlinking."
+ else
+ ln -s $src/$filename $filename
+ fi
+ done
+ # Sanity check 2.
+ if test ! -f t/base/lex.t; then
+ echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
+ exit 1
+ fi
+ cd UU
+ ;;
+ *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
+
+case "$usecrosscompile" in
+$define|true|[yY]*)
+ $echo "Cross-compiling..."
+ croak=''
+ case "$cc" in
+ *-*-gcc) # A cross-compiling gcc, probably.
+ targetarch=`$echo $cc|$sed 's/-gcc$//'`
+ ar=$targetarch-ar
+ # leave out ld, choosing it is more complex
+ nm=$targetarch-nm
+ ranlib=$targetarch-ranlib
+ $echo 'extern int foo;' > try.c
+ set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
+ shift
+ if $test $# -gt 0; then
+ incpth="$incpth $*"
+ incpth="`$echo $incpth|$sed 's/^ //'`"
+ echo "Guessing incpth '$incpth'." >&4
+ for i in $*; do
+ j="`$echo $i|$sed 's,/include$,/lib,'`"
+ if $test -d $j; then
+ libpth="$libpth $j"
+ fi
+ done
+ libpth="`$echo $libpth|$sed 's/^ //'`"
+ echo "Guessing libpth '$libpth'." >&4
+ fi
+ $rm -f try.c
+ ;;
+ esac
+ case "$targetarch" in
+ '') echo "Targetarch not defined." >&4; croak=y ;;
+ *) echo "Using targetarch $targetarch." >&4 ;;
+ esac
+ case "$incpth" in
+ '') echo "Incpth not defined." >&4; croak=y ;;
+ *) echo "Using incpth '$incpth'." >&4 ;;
+ esac
+ case "$libpth" in
+ '') echo "Libpth not defined." >&4; croak=y ;;
+ *) echo "Using libpth '$libpth'." >&4 ;;
+ esac
+ case "$usrinc" in
+ '') for i in $incpth; do
+ if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
+ usrinc=$i
+ echo "Guessing usrinc $usrinc." >&4
+ break
+ fi
+ done
+ case "$usrinc" in
+ '') echo "Usrinc not defined." >&4; croak=y ;;
+ esac
+ ;;
+ *) echo "Using usrinc $usrinc." >&4 ;;
+ esac
+ case "$targethost" in
+ '') echo "Targethost not defined." >&4; croak=y ;;
+ *) echo "Using targethost $targethost." >&4
+ esac
+ locincpth=' '
+ loclibpth=' '
+ case "$croak" in
+ y) echo "Cannot continue, aborting." >&4; exit 1 ;;
+ esac
+ case "$src" in
+ /*) run=$src/Cross/run
+ targetmkdir=$src/Cross/mkdir
+ to=$src/Cross/to
+ from=$src/Cross/from
+ ;;
+ *) pwd=`$test -f ../Configure & cd ..; pwd`
+ run=$pwd/Cross/run
+ targetmkdir=$pwd/Cross/mkdir
+ to=$pwd/Cross/to
+ from=$pwd/Cross/from
+ ;;
+ esac
+ case "$targetrun" in
+ '') targetrun=ssh ;;
+ esac
+ case "$targetto" in
+ '') targetto=scp ;;
+ esac
+ case "$targetfrom" in
+ '') targetfrom=scp ;;
+ esac
+ run=$run-$targetrun
+ to=$to-$targetto
+ from=$from-$targetfrom
+ case "$targetdir" in
+ '') targetdir=/tmp
+ echo "Guessing targetdir $targetdir." >&4
+ ;;
+ esac
+ case "$targetuser" in
+ '') targetuser=root
+ echo "Guessing targetuser $targetuser." >&4
+ ;;
+ esac
+ case "$targetfrom" in
+ scp) q=-q ;;
+ *) q='' ;;
+ esac
+ case "$targetrun" in
+ ssh|rsh)
+ cat >$run <<EOF
+#!/bin/sh
+case "\$1" in
+-cwd)
+ shift
+ cwd=\$1
+ shift
+ ;;
+esac
+case "\$cwd" in
+'') cwd=$targetdir ;;
+esac
+exe=\$1
+shift
+if $test ! -f \$exe.xok; then
+ $to \$exe
+ $touch \$exe.xok
+fi
+$targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+EOF
+ ;;
+ *) echo "Unknown targetrun '$targetrun'" >&4
+ exit 1
+ ;;
+ esac
+ case "$targetmkdir" in
+ */Cross/mkdir)
+ cat >$targetmkdir <<EOF
+#!/bin/sh
+$targetrun -l $targetuser $targethost "mkdir -p \$@"
+EOF
+ $chmod a+rx $targetmkdir
+ ;;
+ *) echo "Unknown targetmkdir '$targetmkdir'" >&4
+ exit 1
+ ;;
+ esac
+ case "$targetto" in
+ scp|rcp)
+ cat >$to <<EOF
+#!/bin/sh
+for f in \$@
+do
+ case "\$f" in
+ /*)
+ $targetmkdir \`dirname \$f\`
+ $targetto $q \$f $targetuser@$targethost:\$f || exit 1
+ ;;
+ *)
+ $targetmkdir $targetdir/\`dirname \$f\`
+ $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
+ ;;
+ esac
+done
+exit 0
+EOF
+ ;;
+ cp) cat >$to <<EOF
+#!/bin/sh
+for f in \$@
+do
+ case "\$f" in
+ /*)
+ $mkdir -p $targetdir/\`dirname \$f\`
+ $cp \$f $targetdir/\$f || exit 1
+ ;;
+ *)
+ $targetmkdir $targetdir/\`dirname \$f\`
+ $cp \$f $targetdir/\$f || exit 1
+ ;;
+ esac
+done
+exit 0
+EOF
+ ;;
+ *) echo "Unknown targetto '$targetto'" >&4
+ exit 1
+ ;;
+ esac
+ case "$targetfrom" in
+ scp|rcp)
+ cat >$from <<EOF
+#!/bin/sh
+for f in \$@
+do
+ $rm -f \$f
+ $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
+done
+exit 0
+EOF
+ ;;
+ cp) cat >$from <<EOF
+#!/bin/sh
+for f in \$@
+do
+ $rm -f \$f
+ cp $targetdir/\$f . || exit 1
+done
+exit 0
+EOF
+ ;;
+ *) echo "Unknown targetfrom '$targetfrom'" >&4
+ exit 1
+ ;;
+ esac
+ if $test ! -f $run; then
+ echo "Target 'run' script '$run' not found." >&4
+ else
+ $chmod a+rx $run
+ fi
+ if $test ! -f $to; then
+ echo "Target 'to' script '$to' not found." >&4
+ else
+ $chmod a+rx $to
+ fi
+ if $test ! -f $from; then
+ echo "Target 'from' script '$from' not found." >&4
+ else
+ $chmod a+rx $from
+ fi
+ if $test ! -f $run -o ! -f $to -o ! -f $from; then
+ exit 1
+ fi
+ cat >&4 <<EOF
+Using '$run' for remote execution,
+and '$from' and '$to'
+for remote file transfer.
+EOF
+ ;;
+*) run=''
+ to=:
+ from=:
+ usecrosscompile='undef'
+ targetarch=''
+ ;;
+esac
+
: see whether [:lower:] and [:upper:] are supported character classes
echo " "
case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
rp="I see a config.sh file. Shall I use it to set the defaults?"
. UU/myread
case "$ans" in
- n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
+ n*|N*) echo "OK, I'll ignore it."
+ mv config.sh config.sh.old
+ myuname="$newmyuname"
+ ;;
*) echo "Fetching default answers from your old config.sh file..." >&4
tmp_n="$n"
tmp_c="$c"
esac
;;
next*) osname=next ;;
+ nonstop-ux) osname=nonstopux ;;
POSIX-BC | posix-bc ) osname=posix-bc
osvers="$3"
;;
fi
fi
+ case "$targetarch" in
+ '') ;;
+ *) hostarch=$osname
+ osname=`echo $targetarch|sed 's,^[^-]*-,,'`
+ osvers=''
+ ;;
+ esac
+
: Now look for a hint file osname_osvers, unless one has been
: specified already.
case "$hintfile" in
elif $test -f $src/hints/$file.sh; then
. $src/hints/$file.sh
$cat $src/hints/$file.sh >> UU/config.sh
- elif $test X$tans = X -o X$tans = Xnone ; then
+ elif $test X"$tans" = X -o X"$tans" = Xnone ; then
: nothing
else
: Give one chance to correct a possible typo.
;;
esac
test "$override" && . ./optdef.sh
-myuname="$newmyuname"
: Restore computed paths
for file in $loclist $trylist; do
;;
esac
+case "$useithreads$use5005threads" in
+"$define$define")
+ $cat >&4 <<EOM
+
+You cannot have both the ithreads and the 5.005 threads enabled
+at the same time. Disabling the 5.005 threads since they are
+much less stable than the ithreads.
+
+EOM
+ use5005threads="$undef"
+ ;;
+esac
+
case "$d_oldpthreads" in
'') : Configure tests would be welcome here. For now, assume undef.
val="$undef" ;;
set usemultiplicity
eval $setvar
+
+case "$usemorebits" in
+"$define"|true|[yY]*)
+ use64bitint="$define"
+ uselongdouble="$define"
+ usemorebits="$define"
+ ;;
+*) usemorebits="$undef"
+ ;;
+esac
+
: make some quick guesses about what we are up against
echo " "
$echo $n "Hmm... $c"
then
echo "Looks kind of like an OSF/1 system, but we'll see..."
echo exit 0 >osf1
-elif test `echo abc | tr a-z A-Z` = Abc ; then
+elif test `echo abc | $tr a-z A-Z` = Abc ; then
xxx=`./loc addbib blurfl $pth`
if $test -f $xxx; then
echo "Looks kind of like a USG system with BSD features, but we'll see..."
echo " "
echo "Checking for GNU cc in disguise and/or its version number..." >&4
-$cat >gccvers.c <<EOM
+$cat >try.c <<EOM
#include <stdio.h>
int main() {
#ifdef __GNUC__
exit(0);
}
EOM
-if $cc $ldflags -o gccvers gccvers.c; then
- gccversion=`./gccvers`
+if $cc -o try $ccflags $ldflags try.c; then
+ gccversion=`$run ./try`
case "$gccversion" in
'') echo "You are not using GNU cc." ;;
*) echo "You are using GNU cc $gccversion."
;;
esac
fi
-$rm -f gccvers*
+$rm -f try try.*
case "$gccversion" in
1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
esac
'') ccname="$cc" ;;
esac
-: see how we invoke the C preprocessor
-echo " "
-echo "Now, how can we feed standard input to your C preprocessor..." >&4
-cat <<'EOT' >testcpp.c
-#define ABC abc
-#define XYZ xyz
-ABC.XYZ
-EOT
-cd ..
-if test ! -f cppstdin; then
- if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
- # AIX cc -E doesn't show the absolute headerfile
- # locations but we'll cheat by using the -M flag.
- echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
+
+: decide how portable to be. Allow command line overrides.
+case "$d_portable" in
+"$undef") ;;
+*) d_portable="$define" ;;
+esac
+
+: set up shell script to do ~ expansion
+cat >filexp <<EOSS
+$startsh
+: expand filename
+case "\$1" in
+ ~/*|~)
+ echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
+ ;;
+ ~*)
+ if $test -f /bin/csh; then
+ /bin/csh -f -c "glob \$1"
+ failed=\$?
+ echo ""
+ exit \$failed
else
- echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+ name=\`$expr x\$1 : '..\([^/]*\)'\`
+ dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
+ if $test ! -d "\$dir"; then
+ me=\`basename \$0\`
+ echo "\$me: can't locate home directory for: \$name" >&2
+ exit 1
+ fi
+ case "\$1" in
+ */*)
+ echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
+ ;;
+ *)
+ echo \$dir
+ ;;
+ esac
fi
-else
- echo "Keeping your $hint cppstdin wrapper."
-fi
-chmod 755 cppstdin
-wrapper=`pwd`/cppstdin
-ok='false'
-cd UU
+ ;;
+*)
+ echo \$1
+ ;;
+esac
+EOSS
+chmod +x filexp
+$eunicefix filexp
-if $test "X$cppstdin" != "X" && \
- $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
-then
- echo "You used to use $cppstdin $cppminus so we'll use that again."
- case "$cpprun" in
- '') echo "But let's see if we can live without a wrapper..." ;;
- *)
- if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
- then
- echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
- ok='true'
- else
- echo "(However, $cpprun $cpplast does not work, let's see...)"
- fi
- ;;
- esac
-else
- case "$cppstdin" in
- '') ;;
- *)
- echo "Good old $cppstdin $cppminus does not seem to be of any help..."
- ;;
- esac
-fi
-
-if $ok; then
- : nothing
-elif echo 'Maybe "'"$cc"' -E" will work...'; \
- $cc -E <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yup, it does."
- x_cpp="$cc -E"
- x_minus='';
-elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
- $cc -E - <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yup, it does."
- x_cpp="$cc -E"
- x_minus='-';
-elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
- $cc -P <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Yipee, that works!"
- x_cpp="$cc -P"
- x_minus='';
-elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
- $cc -P - <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "At long last!"
- x_cpp="$cc -P"
- x_minus='-';
-elif echo 'No such luck, maybe "'$cpp'" will work...'; \
- $cpp <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "It works!"
- x_cpp="$cpp"
- x_minus='';
-elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
- $cpp - <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "Hooray, it works! I was beginning to wonder."
- x_cpp="$cpp"
- x_minus='-';
-elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
- $wrapper <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- x_cpp="$wrapper"
- x_minus=''
- echo "Eureka!"
-else
- dflt=''
- rp="No dice. I can't find a C preprocessor. Name one:"
- . ./myread
- x_cpp="$ans"
- x_minus=''
- $x_cpp <testcpp.c >testcpp.out 2>&1
- if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- echo "OK, that will do." >&4
- else
-echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
- exit 1
- fi
-fi
-
-case "$ok" in
-false)
- cppstdin="$x_cpp"
- cppminus="$x_minus"
- cpprun="$x_cpp"
- cpplast="$x_minus"
- set X $x_cpp
- shift
- case "$1" in
- "$cpp")
- echo "Perhaps can we force $cc -E using a wrapper..."
- if $wrapper <testcpp.c >testcpp.out 2>&1; \
- $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
- then
- echo "Yup, we can."
- cppstdin="$wrapper"
- cppminus='';
- else
- echo "Nope, we'll have to live without it..."
- fi
- ;;
- esac
- case "$cpprun" in
- "$wrapper")
- cpprun=''
- cpplast=''
- ;;
- esac
- ;;
-esac
-
-case "$cppstdin" in
-"$wrapper"|'cppstdin') ;;
-*) $rm -f $wrapper;;
-esac
-$rm -f testcpp.c testcpp.out
-
-: decide how portable to be. Allow command line overrides.
-case "$d_portable" in
-"$undef") ;;
-*) d_portable="$define" ;;
-esac
-
-: set up shell script to do ~ expansion
-cat >filexp <<EOSS
-$startsh
-: expand filename
-case "\$1" in
- ~/*|~)
- echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
- ;;
- ~*)
- if $test -f /bin/csh; then
- /bin/csh -f -c "glob \$1"
- failed=\$?
- echo ""
- exit \$failed
- else
- name=\`$expr x\$1 : '..\([^/]*\)'\`
- dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
- if $test ! -d "\$dir"; then
- me=\`basename \$0\`
- echo "\$me: can't locate home directory for: \$name" >&2
- exit 1
- fi
- case "\$1" in
- */*)
- echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
- ;;
- *)
- echo \$dir
- ;;
- esac
- fi
- ;;
-*)
- echo \$1
- ;;
-esac
-EOSS
-chmod +x filexp
-$eunicefix filexp
-
-: now set up to get a file name
-cat <<EOS >getfile
-$startsh
-EOS
-cat <<'EOSC' >>getfile
-tilde=''
-fullpath=''
-already=''
-skip=''
-none_ok=''
-exp_file=''
-nopath_ok=''
-orig_rp="$rp"
-orig_dflt="$dflt"
-case "$gfpth" in
-'') gfpth='.' ;;
-esac
+: now set up to get a file name
+cat <<EOS >getfile
+$startsh
+EOS
+cat <<'EOSC' >>getfile
+tilde=''
+fullpath=''
+already=''
+skip=''
+none_ok=''
+exp_file=''
+nopath_ok=''
+orig_rp="$rp"
+orig_dflt="$dflt"
+case "$gfpth" in
+'') gfpth='.' ;;
+esac
case "$fn" in
*\(*)
- expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
+ expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
fn=`echo $fn | sed 's/(.*)//'`
;;
esac
;;
esac
-: Set private lib path
-case "$plibpth" in
-'') if ./mips; then
- plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
- fi;;
-esac
-case "$libpth" in
-' ') dlist='';;
-'') dlist="$loclibpth $plibpth $glibpth";;
-*) dlist="$libpth";;
-esac
-
-: Now check and see which directories actually exist, avoiding duplicates
-libpth=''
-for xxx in $dlist
-do
- if $test -d $xxx; then
- case " $libpth " in
- *" $xxx "*) ;;
- *) libpth="$libpth $xxx";;
- esac
- fi
-done
-$cat <<'EOM'
-
-Some systems have incompatible or broken versions of libraries. Among
-the directories listed in the question below, please remove any you
-know not to be holding relevant libraries, and add any that are needed.
-Say "none" for none.
-
-EOM
-case "$libpth" in
-'') dflt='none';;
-*)
- set X $libpth
- shift
- dflt=${1+"$@"}
- ;;
-esac
-rp="Directories to use for library searches?"
-. ./myread
-case "$ans" in
-none) libpth=' ';;
-*) libpth="$ans";;
-esac
-
-: compute shared library extension
-case "$so" in
-'')
- if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
- dflt='sl'
+: see how we invoke the C preprocessor
+echo " "
+echo "Now, how can we feed standard input to your C preprocessor..." >&4
+cat <<'EOT' >testcpp.c
+#define ABC abc
+#define XYZ xyz
+ABC.XYZ
+EOT
+cd ..
+if test ! -f cppstdin; then
+ if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
+ # AIX cc -E doesn't show the absolute headerfile
+ # locations but we'll cheat by using the -M flag.
+ echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
else
- dflt='so'
+ echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
fi
- ;;
-*) dflt="$so";;
-esac
-$cat <<EOM
-
-On some systems, shared libraries may be available. Answer 'none' if
-you want to suppress searching of shared libraries for the remainder
-of this configuration.
-
-EOM
-rp='What is the file extension used for shared libraries?'
-. ./myread
-so="$ans"
+else
+ echo "Keeping your $hint cppstdin wrapper."
+fi
+chmod 755 cppstdin
+wrapper=`pwd`/cppstdin
+ok='false'
+cd UU
-: Define several unixisms.
-: Hints files or command line option can be used to override them.
-: The convoluted testing is in case hints files set either the old
-: or the new name.
-case "$_exe" in
-'') case "$exe_ext" in
- '') ;;
- *) _exe="$exe_ext" ;;
- esac
- ;;
-esac
-case "$_a" in
+if $test "X$cppstdin" != "X" && \
+ $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+then
+ echo "You used to use $cppstdin $cppminus so we'll use that again."
+ case "$cpprun" in
+ '') echo "But let's see if we can live without a wrapper..." ;;
+ *)
+ if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+ then
+ echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
+ ok='true'
+ else
+ echo "(However, $cpprun $cpplast does not work, let's see...)"
+ fi
+ ;;
+ esac
+else
+ case "$cppstdin" in
+ '') ;;
+ *)
+ echo "Good old $cppstdin $cppminus does not seem to be of any help..."
+ ;;
+ esac
+fi
+
+if $ok; then
+ : nothing
+elif echo 'Maybe "'"$cc"' -E" will work...'; \
+ $cc -E <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Yup, it does."
+ x_cpp="$cc -E"
+ x_minus='';
+elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
+ $cc -E - <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Yup, it does."
+ x_cpp="$cc -E"
+ x_minus='-';
+elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
+ $cc -P <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Yipee, that works!"
+ x_cpp="$cc -P"
+ x_minus='';
+elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
+ $cc -P - <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "At long last!"
+ x_cpp="$cc -P"
+ x_minus='-';
+elif echo 'No such luck, maybe "'$cpp'" will work...'; \
+ $cpp <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "It works!"
+ x_cpp="$cpp"
+ x_minus='';
+elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
+ $cpp - <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "Hooray, it works! I was beginning to wonder."
+ x_cpp="$cpp"
+ x_minus='-';
+elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
+ $wrapper <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ x_cpp="$wrapper"
+ x_minus=''
+ echo "Eureka!"
+else
+ dflt=''
+ rp="No dice. I can't find a C preprocessor. Name one:"
+ . ./myread
+ x_cpp="$ans"
+ x_minus=''
+ $x_cpp <testcpp.c >testcpp.out 2>&1
+ if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+ echo "OK, that will do." >&4
+ else
+echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
+ exit 1
+ fi
+fi
+
+case "$ok" in
+false)
+ cppstdin="$x_cpp"
+ cppminus="$x_minus"
+ cpprun="$x_cpp"
+ cpplast="$x_minus"
+ set X $x_cpp
+ shift
+ case "$1" in
+ "$cpp")
+ echo "Perhaps can we force $cc -E using a wrapper..."
+ if $wrapper <testcpp.c >testcpp.out 2>&1; \
+ $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+ then
+ echo "Yup, we can."
+ cppstdin="$wrapper"
+ cppminus='';
+ else
+ echo "Nope, we'll have to live without it..."
+ fi
+ ;;
+ esac
+ case "$cpprun" in
+ "$wrapper")
+ cpprun=''
+ cpplast=''
+ ;;
+ esac
+ ;;
+esac
+
+case "$cppstdin" in
+"$wrapper"|'cppstdin') ;;
+*) $rm -f $wrapper;;
+esac
+$rm -f testcpp.c testcpp.out
+
+: Set private lib path
+case "$plibpth" in
+'') if ./mips; then
+ plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
+ fi;;
+esac
+case "$libpth" in
+' ') dlist='';;
+'') dlist="$loclibpth $plibpth $glibpth";;
+*) dlist="$libpth";;
+esac
+
+: Now check and see which directories actually exist, avoiding duplicates
+libpth=''
+for xxx in $dlist
+do
+ if $test -d $xxx; then
+ case " $libpth " in
+ *" $xxx "*) ;;
+ *) libpth="$libpth $xxx";;
+ esac
+ fi
+done
+$cat <<'EOM'
+
+Some systems have incompatible or broken versions of libraries. Among
+the directories listed in the question below, please remove any you
+know not to be holding relevant libraries, and add any that are needed.
+Say "none" for none.
+
+EOM
+case "$libpth" in
+'') dflt='none';;
+*)
+ set X $libpth
+ shift
+ dflt=${1+"$@"}
+ ;;
+esac
+rp="Directories to use for library searches?"
+. ./myread
+case "$ans" in
+none) libpth=' ';;
+*) libpth="$ans";;
+esac
+
+: compute shared library extension
+case "$so" in
+'')
+ if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
+ dflt='sl'
+ else
+ dflt='so'
+ fi
+ ;;
+*) dflt="$so";;
+esac
+$cat <<EOM
+
+On some systems, shared libraries may be available. Answer 'none' if
+you want to suppress searching of shared libraries for the remainder
+of this configuration.
+
+EOM
+rp='What is the file extension used for shared libraries?'
+. ./myread
+so="$ans"
+
+: Define several unixisms.
+: Hints files or command line option can be used to override them.
+: The convoluted testing is in case hints files set either the old
+: or the new name.
+case "$_exe" in
+'') case "$exe_ext" in
+ '') ;;
+ *) _exe="$exe_ext" ;;
+ esac
+ ;;
+esac
+case "$_a" in
'') case "$lib_ext" in
'') _a='.a';;
*) _a="$lib_ext" ;;
cat <<EOM
Perl can be built to use the SOCKS proxy protocol library. To do so,
-Configure must be run with -Dusesocks.
+Configure must be run with -Dusesocks. If you use SOCKS you also need
+to use the PerlIO abstraction layer, this will be implicitly selected.
If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
set usesocks
eval $setvar
+case "$usesocks" in
+$define|true|[yY]*) useperlio="$define";;
+esac
+
: Looking for optional libraries
echo " "
echo "Checking for optional libraries..." >&4
esac
: the following weeds options from ccflags that are of no interest to cpp
-cppflags="$ccflags"
+case "$cppflags" in
+'') cppflags="$ccflags" ;;
+*) cppflags="$cppflags $ccflags" ;;
+esac
case "$gccversion" in
1*) cppflags="$cppflags -D__GNUC__"
esac
#include <stdio.h>
int main() { printf("Ok\n"); exit(0); }
EOF
-set X $cc $optimize $ccflags -o try $ldflags try.c $libs
+set X $cc -o try $optimize $ccflags $ldflags try.c $libs
shift
$cat >try.msg <<'EOM'
I've tried to compile and run the following simple program:
I used the command:
$*
- ./try
+ $run ./try
and I got the following output:
EOM
dflt=y
-if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
- if sh -c './try' >>try.msg 2>&1; then
- xxx=`./try`
+if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
+ if $sh -c "$run ./try" >>try.msg 2>&1; then
+ xxx=`$run ./try`
case "$xxx" in
"Ok") dflt=n ;;
*) echo 'The program compiled OK, but produced no output.' >> try.msg
esac
$rm -f try try.* core
-: 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'
-
-: define a shorthand compile call
-compile='
-mc_file=$1;
-shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
-: define a shorthand compile call for compilations that should be ok.
-compile_ok='
-mc_file=$1;
-shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
+: define a shorthand compile call
+compile='
+mc_file=$1;
+shift;
+$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
+: define a shorthand compile call for compilations that should be ok.
+compile_ok='
+mc_file=$1;
+shift;
+$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
: check for lengths of integral types
echo " "
case "$intsize" in
'')
echo "Checking to see how big your integers are..." >&4
- $cat >intsize.c <<'EOCP'
+ $cat >try.c <<'EOCP'
#include <stdio.h>
int main()
{
exit(0);
}
EOCP
- set intsize
- if eval $compile_ok && ./intsize > /dev/null; then
- eval `./intsize`
+ set try
+ if eval $compile_ok && $run ./try > /dev/null; then
+ eval `$run ./try`
echo "Your integers are $intsize bytes long."
echo "Your long integers are $longsize bytes long."
echo "Your short integers are $shortsize bytes long."
fi
;;
esac
-$rm -f intsize intsize.*
-
-: 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
+$rm -f try try.*
+: check for void type
echo " "
-echo "Checking to see how big your file offsets are..." >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main()
-{
- printf("%d\n", (int)sizeof($lseektype));
- return(0);
+echo "Checking to see how well your C compiler groks the void type..." >&4
+case "$voidflags" in
+'')
+ $cat >try.c <<'EOCP'
+#if TRY & 1
+void sub() {
+#else
+sub() {
+#endif
+ extern void moo(); /* function returning void */
+ void (*goo)(); /* ptr to func returning void */
+#if TRY & 8
+ void *hue; /* generic ptr */
+#endif
+#if TRY & 2
+ void (*foo[10])();
+#endif
+
+#if TRY & 4
+ if(goo == moo) {
+ exit(0);
+ }
+#endif
+ exit(0);
}
+int main() { sub(); }
EOCP
-set try
-if eval $compile_ok; then
- lseeksize=`./try`
- echo "Your file offsets are $lseeksize bytes long."
-else
- dflt=$longsize
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of your file offsets (in bytes)?"
+ if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
+ voidflags=$defvoidused
+ echo "Good. It appears to support void to the level $package wants.">&4
+ if $contains warning .out >/dev/null 2>&1; then
+ echo "However, you might get some warnings that look like this:"
+ $cat .out
+ fi
+ else
+echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
+ if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
+ echo "It supports 1..."
+ if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
+ echo "It also supports 2..."
+ if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
+ voidflags=7
+ echo "And it supports 4 but not 8 definitely."
+ else
+ echo "It doesn't support 4..."
+ if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
+ voidflags=11
+ echo "But it supports 8."
+ else
+ voidflags=3
+ echo "Neither does it support 8."
+ fi
+ fi
+ else
+ echo "It does not support 2..."
+ if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
+ voidflags=13
+ echo "But it supports 4 and 8."
+ else
+ if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
+ voidflags=5
+ echo "And it supports 4 but has not heard about 8."
+ else
+ echo "However it supports 8 but not 4."
+ fi
+ fi
+ fi
+ else
+ echo "There is no support at all for void."
+ voidflags=0
+ fi
+ fi
+esac
+case "$voidflags" in
+"$defvoidused") ;;
+*) $cat >&4 <<'EOM'
+ Support flag bits are:
+ 1: basic void declarations.
+ 2: arrays of pointers to functions returning void.
+ 4: operations between pointers to and addresses of void functions.
+ 8: generic void pointers.
+EOM
+ dflt="$voidflags";
+ rp="Your void support flags add up to what?"
. ./myread
- lseeksize="$ans"
-fi
-$rm -f try.c try
-
-: 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
+ voidflags="$ans"
+ ;;
+esac
+$rm -f try.* .out
+: check for length of pointer
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>
+case "$ptrsize" in
+'')
+ echo "Checking to see how big your pointers are..." >&4
+ if test "$voidflags" -gt 7; then
+ echo '#define VOID_PTR char *' > try.c
+ else
+ echo '#define VOID_PTR void *' > try.c
+ fi
+ $cat >>try.c <<'EOCP'
#include <stdio.h>
-int main() {
- printf("%d\n", (int)sizeof($fpostype));
+int main()
+{
+ printf("%d\n", (int)sizeof(VOID_PTR));
exit(0);
}
EOCP
+ set try
+ if eval $compile_ok; then
+ ptrsize=`$run ./try`
+ echo "Your pointers are $ptrsize bytes long."
+ else
+ dflt='4'
+ echo "(I can't seem to compile the test program. Guessing...)" >&4
+ rp="What is the size of a pointer (in bytes)?"
+ . ./myread
+ ptrsize="$ans"
+ fi
+ ;;
+esac
+$rm -f try.c try
+
+: check for long long
+echo " "
+echo "Checking to see if you have long long..." >&4
+echo 'int main() { long long x = 7; return 0; }' > try.c
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 is $fpossize bytes long."
- ;;
- esac
+if eval $compile; then
+ val="$define"
+ echo "You have long long."
else
- dflt="$longsize"
- echo " " >&4
- echo "(I can't compile the test program. Guessing...)" >&4
- rp="What is the size of your file positions (in bytes)?"
- . ./myread
- fpossize="$ans"
+ val="$undef"
+ echo "You do not have long long."
fi
-
-
-
-# Backward compatibility (uselfs is deprecated).
-case "$uselfs" in
-"$define"|true|[yY]*)
- cat <<EOM >&4
-
-*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
-EOM
- uselargefiles="$define"
- ;;
-esac
-
-case "$lseeksize:$fpossize" in
-8:8) cat <<EOM
-
-You can have files larger than 2 gigabytes.
-EOM
- val="$define" ;;
-*) case "$uselargefiles" in
- "$undef"|false|[nN]*) dflt='n' ;;
- *) dflt='y' ;;
- esac
- cat <<EOM
-
-Perl can be built to understand large files (files larger than 2 gigabytes)
-on some systems. To do so, Configure can be run with -Duselargefiles.
-
-If this doesn't make any sense to you, just accept the default '$dflt'.
-EOM
- rp='Try to understand large files, if available?'
- . ./myread
- case "$ans" in
- y|Y) val="$define" ;;
- *) val="$undef" ;;
- esac
- ;;
-esac
-set uselargefiles
+$rm try.*
+set d_longlong
eval $setvar
-case "$uselargefiles" in
-"$define")
-: Look for a hint-file generated 'call-back-unit'. If the
-: user has specified that a large files perl is to be built,
-: we may need to set or change some other defaults.
- if $test -f uselargefiles.cbu; then
- echo "Your platform has some specific hints for large file builds, using them..."
- . ./uselargefiles.cbu
- echo " "
- echo "Rechecking to see how big your file offsets are..." >&4
- $cat >try.c <<EOCP
-#include <sys/types.h>
+
+: check for length of long long
+case "${d_longlong}${longlongsize}" in
+$define)
+ echo " "
+ echo "Checking to see how big your long longs are..." >&4
+ $cat >try.c <<'EOCP'
#include <stdio.h>
int main()
{
- printf("%d\n", (int)sizeof($lseektype));
- return(0);
+ printf("%d\n", (int)sizeof(long long));
+ return(0);
}
EOCP
- set try
- if eval $compile_ok; then
- lseeksize=`./try`
- $echo "Your file offsets are now $lseeksize bytes long."
- else
- dflt="$lseeksize"
- 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"
+ set try
+ if eval $compile_ok; then
+ longlongsize=`$run ./try`
+ echo "Your long longs are $longlongsize bytes long."
+ 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
+
+: determine filename position in cpp output
+echo " "
+echo "Computing filename position in cpp output for #include directives..." >&4
+echo '#include <stdio.h>' > foo.c
+$cat >fieldn <<EOF
+$startsh
+$cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
+$grep '^[ ]*#.*stdio\.h' | \
+while read cline; do
+ pos=1
+ set \$cline
+ while $test \$# -gt 0; do
+ if $test -r \`echo \$1 | $tr -d '"'\`; then
+ echo "\$pos"
+ exit 0
fi
- case "$fpostype" in
- *_t) zzz="$fpostype" ;;
- *) zzz="fpos_t" ;;
- esac
- $echo $n "Rechecking the size of $zzz...$c" >&4
- $cat > try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
+ shift
+ pos=\`expr \$pos + 1\`
+ done
+done
+EOF
+chmod +x fieldn
+fieldn=`./fieldn`
+$rm -f foo.c fieldn
+case $fieldn in
+'') pos='???';;
+1) pos=first;;
+2) pos=second;;
+3) pos=third;;
+*) pos="${fieldn}th";;
+esac
+echo "Your cpp writes the filename in the $pos field of the line."
+
+: locate header file
+$cat >findhdr <<EOF
+$startsh
+wanted=\$1
+name=''
+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 | \
+$grep "^[ ]*#.*\$wanted" | \
+while read cline; do
+ name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
+ case "\$name" in
+ *[/\\\\]\$wanted) echo "\$name"; exit 1;;
+ *[\\\\/]\$wanted) echo "\$name"; exit 1;;
+ *) exit 2;;
+ esac;
+done;
+#
+# status = 0: grep returned 0 lines, case statement not executed
+# status = 1: headerfile found
+# status = 2: while loop executed, no headerfile found
+#
+status=\$?
+$rm -f foo\$\$.c;
+if test \$status -eq 1; then
+ exit 0;
+fi
+exit 1
+EOF
+chmod +x findhdr
+
+: define an alternate in-header-list? function
+inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
+cont=true; xxf="echo \"<\$1> found.\" >&4";
+case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
+*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
+esac;
+case $# in 4) instead=instead;; *) instead="at last";; esac;
+while $test "$cont"; do
+ xxx=`./findhdr $1`
+ var=$2; eval "was=\$$2";
+ if $test "$xxx" && $test -r "$xxx";
+ then eval $xxf;
+ eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
+ cont="";
+ else eval $xxnf;
+ eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
+ set $yyy; shift; shift; yyy=$@;
+ case $# in 0) cont="";;
+ 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
+ xxnf="echo \"and I did not find <\$1> either.\" >&4";;
+ *) xxf="echo \"but I found <\$1\> instead.\" >&4";
+ xxnf="echo \"there is no <\$1>, ...\" >&4";;
+ esac;
+done;
+while $test "$yyy";
+do set $yyy; var=$2; eval "was=\$$2";
+ eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
+ set $yyy; shift; shift; yyy=$@;
+done'
+
+: 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() {
- printf("%d\n", (int)sizeof($fpostype));
- exit(0);
+ static int32_t foo32 = 0x12345678;
}
EOCP
- set try
- if eval $compile_ok; then
- yyy=`./try`
- dflt="$lseeksize"
- case "$yyy" in
- '') echo " "
- echo "(I can't execute the test program--guessing $fpossize.)" >&4
- ;;
- *) fpossize=$yyy
- echo " $fpossize bytes." >&4
- ;;
- esac
- else
- dflt="$fpossize"
- echo " "
- echo "(I can't compile the test program. Guessing...)" >&4
- rp="What is the size of your file positions (in bytes)?"
- . ./myread
- fpossize="$ans"
- fi
- $rm -f try.c try
- fi
- ;;
-esac
+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
+echo " "
+echo "Checking to see if you have int64_t..." >&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 "You have int64_t."
+else
+ val="$undef"
+ echo "You do not have int64_t."
+fi
+$rm -f try try.*
+set d_int64_t
+eval $setvar
-case "$usemorebits" in
-"$define"|true|[yY]*)
- use64bitint="$define"
- uselongdouble="$define"
- usemorebits="$define"
+echo " "
+echo "Checking which 64-bit integer type we could use..." >&4
+
+case "$intsize" in
+8) val=int
+ set quadtype
+ eval $setvar
+ val='"unsigned int"'
+ set uquadtype
+ eval $setvar
+ quadkind=1
+ ;;
+*) case "$longsize" in
+ 8) val=long
+ set quadtype
+ eval $setvar
+ val='"unsigned long"'
+ set uquadtype
+ eval $setvar
+ quadkind=2
+ ;;
+ *) case "$d_longlong:$longlongsize" in
+ define:8)
+ val='"long long"'
+ set quadtype
+ eval $setvar
+ val='"unsigned long long"'
+ set uquadtype
+ eval $setvar
+ quadkind=3
+ ;;
+ *) case "$d_int64_t" in
+ define)
+ val=int64_t
+ set quadtype
+ eval $setvar
+ val=uint64_t
+ set uquadtype
+ eval $setvar
+ quadkind=4
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
+case "$quadtype" in
+'') echo "Alas, no 64-bit integer types in sight." >&4
+ d_quad="$undef"
;;
-*) usemorebits="$undef"
+*) echo "We could use '$quadtype' for 64-bit integers." >&4
+ d_quad="$define"
;;
esac
"$define"|true|[yY]*) dflt='y';;
*) dflt='n';;
esac
+ case "$d_quad" in
+ "$define") ;;
+ *) dflt='n' ;;
+ esac
cat <<EOM
Perl can be built to take advantage of 64-bit integer types
Choosing this option will most probably introduce binary incompatibilities.
If this doesn't make any sense to you, just accept the default '$dflt'.
+(The default has been chosen based on your configuration.)
EOM
rp='Try to use 64-bit integers, if available?'
. ./myread
have any more 64-bitness available than what you already have chosen.
If this doesn't make any sense to you, just accept the default '$dflt'.
+(The default has been chosen based on your configuration.)
EOM
rp='Try to use maximal 64-bit support, if available?'
. ./myread
;;
esac
+case "$use64bitall" in
+"$define"|true|[yY]*)
+ case "$ptrsize" in
+ 4) cat <<EOM >&4
+
+*** You have chosen a maximally 64-bit build, but your pointers
+*** are only 4 bytes wide, disabling maximal 64-bitness.
+
+EOM
+ use64bitall="$undef"
+ case "$use64bitint" in
+ "$define"|true|[yY]*) ;;
+ *) cat <<EOM >&4
+
+*** Downgrading from maximal 64-bitness to using 64-bit integers.
+
+EOM
+ use64bitint="$define"
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+esac
+
case "$use64bitint" in
"$define"|true|[yY]*)
: Look for a hint-file generated 'call-back-unit'. If the
echo " "
echo "Checking for GNU C Library..." >&4
-cat >gnulibc.c <<EOM
+cat >try.c <<EOM
#include <stdio.h>
int main()
{
#endif
}
EOM
-set gnulibc
-if eval $compile_ok && ./gnulibc; then
+set try
+if eval $compile_ok && $run ./try; then
val="$define"
echo "You are using the GNU C Library"
else
val="$undef"
echo "You are not using the GNU C Library"
fi
-$rm -f gnulibc*
+$rm -f try try.*
set d_gnulibc
eval $setvar
esac
;;
esac
-libnames='';
case "$libs" in
'') ;;
*) for thislib in $libs; do
s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
G
s/\n/ /' | \
- sort | $sed -e 's/^.* //'`
+ $sort | $sed -e 's/^.* //'`
eval set \$$#
done
$test -r $1 || set /usr/ccs/lib/libc.$so
EOM
else
dflt=''
- echo $libpth | tr ' ' $trnl | sort | uniq > libpath
+ echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
cat >&4 <<EOM
I can't seem to find your C library. I've looked in the following places:
libc="$ans"
echo " "
-echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
+echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
set X `cat libnames`
shift
xxx=files
if $test -f /lib/syscalls.exp; then
echo " "
echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
- $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
+ $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
fi
;;
esac
fi;;
*)
echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
- if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
+ if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
then tval=true;
else tval=false;
fi;
EOCP
set try
if eval $compile_ok; then
- doublesize=`./try`
+ doublesize=`$run ./try`
echo "Your double is $doublesize bytes long."
else
dflt='8'
set try
set try
if eval $compile; then
- longdblsize=`./try$exe_ext`
+ longdblsize=`$run ./try`
echo "Your long doubles are $longdblsize bytes long."
else
dflt='8'
esac
$rm -f try.* try
+case "$useperlio" in
+$define|true|[yY]*|'') dflt='y';;
+*) dflt='n';;
+esac
+cat <<EOM
+
+Previous version of $package used the standard IO mechanisms as
+defined in <stdio.h>. Versions 5.003_02 and later of $package allow
+alternate IO mechanisms via the PerlIO abstraction layer, but the
+stdio mechanism is still available if needed. The abstraction layer
+can use AT&T's sfio (if you already have sfio installed) or regular stdio.
+Using PerlIO with sfio may cause problems with some extension modules.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Use the PerlIO abstraction layer?'
+. ./myread
+case "$ans" in
+y|Y)
+ val="$define"
+ ;;
+*)
+ echo "Ok, doing things the stdio way."
+ val="$undef"
+ ;;
+esac
+set useperlio
+eval $setvar
+
+case "$usesocks" in
+$define|true|[yY]*)
+ case "$useperlio" in
+ $define|true|[yY]*) ;;
+ *) cat >&4 <<EOM
+
+You are using the SOCKS proxy protocol library which means that you
+should also use the PerlIO layer. You may be headed for trouble.
+
+EOM
+ ;;
+ esac
+ ;;
+esac
+
+
: determine the architecture name
echo " "
if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
archname=''
;;
esac
+case "$targetarch" in
+'') ;;
+*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
+esac
myarchname="$tarch"
case "$archname" in
'') dflt="$tarch";;
echo "Long doubles selected." >&4
case "$longdblsize" in
$doublesize)
- "...but long doubles are equal to doubles, not changing architecture name." >&4
+ echo "...but long doubles are equal to doubles, not changing architecture name." >&4
;;
*)
case "$archname" in
esac
;;
esac
+case "$useperlio" in
+$define)
+ echo "Perlio selected." >&4
+ ;;
+*)
+ echo "Perlio not selected, using stdio." >&4
+ case "$archname" in
+ *-stdio*) echo "...and architecture name already has -stdio." >&4
+ ;;
+ *) archname="$archname-stdio"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+esac
: determine root of directory hierarchy where package will be installed.
case "$prefix" in
prefix="$ans"
prefixexp="$ansexp"
+case "$afsroot" in
+'') afsroot=/afs ;;
+*) afsroot=$afsroot ;;
+esac
+
: is AFS running?
echo " "
case "$afs" in
$define|true) afs=true ;;
$undef|false) afs=false ;;
-*) if test -d /afs; then
+*) if test -d $afsroot; then
afs=true
else
afs=false
esac;;
esac'
-
: get the patchlevel
echo " "
echo "Getting the current patchlevel..." >&4
api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+ perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
else
revision=0
patchlevel=0
api_revision=0
api_version=0
api_subversion=0
+ perl_patchlevel=0
+ $echo "(You do not have patchlevel.h. Eek.)"
fi
-$echo "(You have $package version $patchlevel subversion $subversion.)"
+if $test -r $rsrc/.patch ; then
+ if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
+ perl_patchlevel=`cat $rsrc/.patch`
+ fi
+fi
+: Define a handy string here to avoid duplication in myconfig.SH and configpm.
+version_patchlevel_string="version $patchlevel subversion $subversion"
+case "$perl_patchlevel" in
+0|'') ;;
+*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
+esac
+
+$echo "(You have $package $version_patchlevel_string.)"
+
case "$osname" in
dos|vms)
: XXX Should be a Configure test for double-dots in filenames.
val="$undef"
fi
set d_suidsafe
-eval $setvar
-
-$rm -f reflect flect
-
-: now see if they want to do setuid emulation
-echo " "
-val="$undef"
-case "$d_suidsafe" in
-"$define")
- val="$undef"
- echo "No need to emulate SUID scripts since they are secure here." >& 4
- ;;
-*)
- $cat <<EOM
-Some systems have disabled setuid scripts, especially systems where
-setuid scripts cannot be secure. On systems where setuid scripts have
-been disabled, the setuid/setgid bits on scripts are currently
-useless. It is possible for $package to detect those bits and emulate
-setuid/setgid in a secure fashion. This emulation will only work if
-setuid scripts have been disabled in your kernel.
-
-EOM
- case "$d_dosuid" in
- "$define") dflt=y ;;
- *) dflt=n ;;
- esac
- rp="Do you want to do setuid/setgid emulation?"
- . ./myread
- case "$ans" in
- [yY]*) val="$define";;
- *) val="$undef";;
- esac
- ;;
-esac
-set d_dosuid
-eval $setvar
-
-: determine filename position in cpp output
-echo " "
-echo "Computing filename position in cpp output for #include directives..." >&4
-echo '#include <stdio.h>' > foo.c
-$cat >fieldn <<EOF
-$startsh
-$cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
-$grep '^[ ]*#.*stdio\.h' | \
-while read cline; do
- pos=1
- set \$cline
- while $test \$# -gt 0; do
- if $test -r \`echo \$1 | $tr -d '"'\`; then
- echo "\$pos"
- exit 0
- fi
- shift
- pos=\`expr \$pos + 1\`
- done
-done
-EOF
-chmod +x fieldn
-fieldn=`./fieldn`
-$rm -f foo.c fieldn
-case $fieldn in
-'') pos='???';;
-1) pos=first;;
-2) pos=second;;
-3) pos=third;;
-*) pos="${fieldn}th";;
-esac
-echo "Your cpp writes the filename in the $pos field of the line."
-
-: locate header file
-$cat >findhdr <<EOF
-$startsh
-wanted=\$1
-name=''
-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 | \
-$grep "^[ ]*#.*\$wanted" | \
-while read cline; do
- name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
- case "\$name" in
- *[/\\\\]\$wanted) echo "\$name"; exit 1;;
- *[\\\\/]\$wanted) echo "\$name"; exit 1;;
- *) exit 2;;
- esac;
-done;
-#
-# status = 0: grep returned 0 lines, case statement not executed
-# status = 1: headerfile found
-# status = 2: while loop executed, no headerfile found
-#
-status=\$?
-$rm -f foo\$\$.c;
-if test \$status -eq 1; then
- exit 0;
-fi
-exit 1
-EOF
-chmod +x findhdr
+eval $setvar
-: define an alternate in-header-list? function
-inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
-cont=true; xxf="echo \"<\$1> found.\" >&4";
-case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
-*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
-esac;
-case $# in 4) instead=instead;; *) instead="at last";; esac;
-while $test "$cont"; do
- xxx=`./findhdr $1`
- var=$2; eval "was=\$$2";
- if $test "$xxx" && $test -r "$xxx";
- then eval $xxf;
- eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
- cont="";
- else eval $xxnf;
- eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
- set $yyy; shift; shift; yyy=$@;
- case $# in 0) cont="";;
- 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
- xxnf="echo \"and I did not find <\$1> either.\" >&4";;
- *) xxf="echo \"but I found <\$1\> instead.\" >&4";
- xxnf="echo \"there is no <\$1>, ...\" >&4";;
- esac;
-done;
-while $test "$yyy";
-do set $yyy; var=$2; eval "was=\$$2";
- eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
- set $yyy; shift; shift; yyy=$@;
-done'
+$rm -f reflect flect
+
+: now see if they want to do setuid emulation
+echo " "
+val="$undef"
+case "$d_suidsafe" in
+"$define")
+ val="$undef"
+ echo "No need to emulate SUID scripts since they are secure here." >& 4
+ ;;
+*)
+ $cat <<EOM
+Some systems have disabled setuid scripts, especially systems where
+setuid scripts cannot be secure. On systems where setuid scripts have
+been disabled, the setuid/setgid bits on scripts are currently
+useless. It is possible for $package to detect those bits and emulate
+setuid/setgid in a secure fashion. This emulation will only work if
+setuid scripts have been disabled in your kernel.
+
+EOM
+ case "$d_dosuid" in
+ "$define") dflt=y ;;
+ *) dflt=n ;;
+ esac
+ rp="Do you want to do setuid/setgid emulation?"
+ . ./myread
+ case "$ans" in
+ [yY]*) val="$define";;
+ *) val="$undef";;
+ esac
+ ;;
+esac
+set d_dosuid
+eval $setvar
: see if this is a malloc.h system
set malloc.h i_malloc
: determine which malloc to compile in
echo " "
case "$usemymalloc" in
-''|[yY]*|true|$define) dflt='y' ;;
-*) dflt='n' ;;
+[yY]*|true|$define) dflt='y' ;;
+[nN]*|false|$undef) dflt='n' ;;
+*) case "$ptrsize" in
+ 4) dflt='y' ;;
+ *) dflt='n' ;;
+ esac
+ ;;
esac
rp="Do you wish to attempt to use the malloc that comes with $package?"
. ./myread
installbin="$binexp"
fi
+echo " "
+case "$extras" in
+'') dflt='n';;
+*) dflt='y';;
+esac
+cat <<EOM
+Perl can be built with extra modules or bundles of modules which
+will be fetched from the CPAN and installed alongside Perl.
+
+Notice that you will need access to the CPAN; either via the Internet,
+or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
+be asked later to configure the CPAN.pm module which will in turn do
+the installation of the rest of the extra modules or bundles.)
+
+Notice also that if the modules require any external software such as
+libraries and headers (the libz library and the zlib.h header for the
+Compress::Zlib module, for example) you MUST have any such software
+already installed, this configuration process will NOT install such
+things for you.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Install any extra modules (y or n)?'
+. ./myread
+case "$ans" in
+y|Y)
+ cat <<EOM
+
+Please list any extra modules or bundles to be installed from CPAN,
+with spaces between the names. The names can be in any format the
+'install' command of CPAN.pm will understand. (Answer 'none',
+without the quotes, to install no extra modules or bundles.)
+EOM
+ rp='Extras?'
+ dflt="$extras"
+ . ./myread
+ extras="$ans"
+esac
+case "$extras" in
+''|'none')
+ val=''
+ $rm -f ../extras.lst
+ ;;
+*) echo "(Saving the list of extras for later...)"
+ echo "$extras" > ../extras.lst
+ val="'$extras'"
+ ;;
+esac
+set extras
+eval $setvar
+echo " "
+
: Find perl5.005 or later.
echo "Looking for a previously installed perl5.005 or later... "
case "$perl5" in
-'') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
+'') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
: Check if this perl is recent and can load a simple module
- if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+ if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
perl5=$tdir/perl
break;
- elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
- perl5=$tdir/perl
+ elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+ perl5=$tdir/perl5
break;
fi
done
EOPL
chmod +x getverlist
case "$inc_version_list" in
-'') if test -x "$perl5"; then
+'') if test -x "$perl5$exe_ext"; then
dflt=`$perl5 getverlist`
else
dflt='none'
fi
;;
$undef) dflt='none' ;;
-*) dflt="$inc_version_list" ;;
+*) eval dflt=\"$inc_version_list\" ;;
esac
case "$dflt" in
''|' ') dflt=none ;;
esac
$rm -f getverlist
-: determine whether to install the scripts
-
-echo " "
-$cat <<EOM
-Do you want to install the various scripts accompanying Perl?
-Usually you do want this.
-EOM
-case "$installscripts" in
-"$undef"|[nN]*) dflt='n';;
-*) dflt='y';;
-esac
-rp="Do you want to install the scripts?"
-. ./myread
-case "$ans" in
-[yY]*) val="$define";;
-*) val="$undef" ;;
-esac
-set installscripts
-eval $setvar
-
: determine whether to install perl also as /usr/bin/perl
echo " "
hpux) dflt='+z' ;;
next) dflt='none' ;;
irix*) dflt='-KPIC' ;;
- svr4*|esix*|solaris) dflt='-KPIC' ;;
+ svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
sunos) dflt='-pic' ;;
*) dflt='none' ;;
esac
;;
*) case "$osname" in
- svr4*|esix*|solaris) dflt='-fPIC' ;;
+ darwin) dflt='none' ;;
+ svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
*) dflt='-fpic' ;;
esac ;;
esac ;;
exit(1); /* fail */
}
EOM
- if $cc $ccflags try.c >/dev/null 2>&1 && ./a.out; then
+ if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
cat <<EOM
You appear to have ELF support. I'll use $cc to build dynamic libraries.
EOM
next) dflt='none' ;;
solaris) dflt='-G' ;;
sunos) dflt='-assert nodefinitions' ;;
- svr4*|esix*) dflt="-G $ldflags" ;;
+ svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
*) dflt='none' ;;
esac
;;
;;
*) case "$useshrplib" in
'') case "$osname" in
- svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
+ svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
dflt=y
also='Building a shared libperl is required for dynamic loading to work on your system.'
;;
echo " "
case "$sysman" in
'')
- syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
- syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
+ syspath='/usr/share/man/man1 /usr/man/man1'
+ syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
+ syspath="$syspath /usr/man/u_man/man1"
syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
' ') dflt=none
;;
'')
- lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
+ lookpath="$prefixexp/share/man/man1"
+ lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
lookpath="$lookpath $prefixexp/man/p_man/man1"
lookpath="$lookpath $prefixexp/man/u_man/man1"
lookpath="$lookpath $prefixexp/man/man.1"
esac
;;
esac
+ case "$dflt$osname" in
+ .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
+ dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
+ ;;
+ esac
case "$dflt" in
.) echo "(Lost all hope -- silly guess then)"
dflt='.uucp'
. ./myread
perladmin="$ans"
+: determine whether to only install version-specific parts.
+echo " "
+$cat <<EOM
+Do you want to install only the version-specific parts of the perl
+distribution? Usually you do *not* want to do this.
+EOM
+case "$versiononly" in
+"$define"|[Yy]*|true) dflt='y' ;;
+*) dflt='n';
+esac
+rp="Do you want to install only the version-specific parts of perl?"
+. ./myread
+case "$ans" in
+[yY]*) val="$define";;
+*) val="$undef" ;;
+esac
+set versiononly
+eval $setvar
+
: figure out how to guarantee perl startup
case "$startperl" in
'')
a shell by starting the script with a single ':' character.
EOH
- dflt="$binexp/perl"
+ case "$versiononly" in
+ "$define") dflt="$binexp/perl$version";;
+ *) dflt="$binexp/perl";;
+ esac
rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
. ./myread
case "$ans" in
installsitebin="$sitebinexp"
fi
-case "$useperlio" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
+: 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
+
+echo " "
+echo "Checking to see how big your file offsets are..." >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof($lseektype));
+ return(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+ lseeksize=`$run ./try`
+ echo "Your file offsets are $lseeksize bytes long."
+else
+ dflt=$longsize
+ 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 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
+
+echo " "
+case "$fpostype" in
+*_t) zzz="$fpostype" ;;
+*) zzz="fpos_t" ;;
esac
-cat <<EOM
+echo "Checking the size of $zzz..." >&4
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ printf("%d\n", (int)sizeof($fpostype));
+ exit(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+ yyy=`$run ./try`
+ case "$yyy" in
+ '') fpossize=4
+ echo "(I can't execute the test program--guessing $fpossize.)" >&4
+ ;;
+ *) fpossize=$yyy
+ echo "Your $zzz is $fpossize bytes long."
+ ;;
+ esac
+else
+ dflt="$longsize"
+ echo " " >&4
+ echo "(I can't compile the test program. Guessing...)" >&4
+ rp="What is the size of your file positions (in bytes)?"
+ . ./myread
+ fpossize="$ans"
+fi
+
+
+
+# Backward compatibility (uselfs is deprecated).
+case "$uselfs" in
+"$define"|true|[yY]*)
+ cat <<EOM >&4
+
+*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
+EOM
+ uselargefiles="$define"
+ ;;
+esac
+
+case "$lseeksize:$fpossize" in
+8:8) cat <<EOM
+
+You can have files larger than 2 gigabytes.
+EOM
+ val="$define" ;;
+*) case "$uselargefiles" in
+ "$undef"|false|[nN]*) dflt='n' ;;
+ *) dflt='y' ;;
+ esac
+ cat <<EOM
-Previous version of $package used the standard IO mechanisms as defined
-in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
-mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
-the default. This abstraction layer can use AT&T's sfio (if you already
-have sfio installed) or regular stdio. Using PerlIO with sfio may cause
-problems with some extension modules. Using PerlIO with stdio is safe,
-but it is slower than plain stdio and therefore is not the default.
+Perl can be built to understand large files (files larger than 2 gigabytes)
+on some systems. To do so, Configure can be run with -Duselargefiles.
If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
-rp='Use the experimental PerlIO abstraction layer?'
-. ./myread
-case "$ans" in
-y|Y)
- val="$define"
- ;;
-*)
- echo "Ok, doing things the stdio way"
- val="$undef"
+ rp='Try to understand large files, if available?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ ;;
+esac
+set uselargefiles
+eval $setvar
+case "$uselargefiles" in
+"$define")
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that a large files perl is to be built,
+: we may need to set or change some other defaults.
+ if $test -f uselargefiles.cbu; then
+ echo "Your platform has some specific hints for large file builds, using them..."
+ . ./uselargefiles.cbu
+ echo " "
+ echo "Rechecking to see how big your file offsets are..." >&4
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof($lseektype));
+ return(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ lseeksize=`$run ./try`
+ $echo "Your file offsets are now $lseeksize bytes long."
+ else
+ dflt="$lseeksize"
+ 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
+ case "$fpostype" in
+ *_t) zzz="$fpostype" ;;
+ *) zzz="fpos_t" ;;
+ esac
+ $echo $n "Rechecking the size of $zzz...$c" >&4
+ $cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+ printf("%d\n", (int)sizeof($fpostype));
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ yyy=`$run ./try`
+ dflt="$lseeksize"
+ case "$yyy" in
+ '') echo " "
+ echo "(I can't execute the test program--guessing $fpossize.)" >&4
+ ;;
+ *) fpossize=$yyy
+ echo " $fpossize bytes." >&4
+ ;;
+ esac
+ else
+ dflt="$fpossize"
+ echo " "
+ echo "(I can't compile the test program. Guessing...)" >&4
+ rp="What is the size of your file positions (in bytes)?"
+ . ./myread
+ fpossize="$ans"
+ fi
+ $rm -f try.c try
+ fi
;;
esac
-set useperlio
-eval $setvar
case "$vendorprefix" in
'') d_vendorbin="$undef"
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
123.456)
sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
#include <stdio.h>
int main() {
long double d = 123.456;
- printf("%.3llf\n", d);
+ printf("%.3Lf\n", d);
}
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
123.456)
- sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
- sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
- echo "We will use %llf."
+ sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
+ sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
+ echo "We will use %Lf."
;;
esac
fi
#include <stdio.h>
int main() {
long double d = 123.456;
- printf("%.3Lf\n", d);
+ printf("%.3llf\n", d);
}
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
123.456)
- sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
- sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
- echo "We will use %Lf."
+ sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
+ sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
+ echo "We will use %llf."
;;
esac
fi
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
123.456)
sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
checkit("123.456", buf);
+ /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
+ Gconvert((DOUBLETYPE)1e30, 8, 0, buf);
+ if (strlen(buf) > 5)
+ checkit("1e+030", buf); /* for Microsoft */
+ else
+ checkit("1e+30", buf);
+
exit(0);
}
EOP
set try -DTRY_$xxx_convert
if eval $compile; then
echo "$xxx_convert() found." >&4
- if ./try; then
+ if $run ./try; then
echo "I'll use $xxx_convert to convert floats into a string." >&4
break;
else
;;
esac
+: see if _fwalk exists
+set fwalk d__fwalk
+eval $inlibc
+
: Initialize h_fcntl
h_fcntl=false
EOCP
: check sys/file.h first, no particular reason here
if $test `./findhdr sys/file.h` && \
- $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
+ $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
h_sysfile=true;
echo "<sys/file.h> defines the *_OK access constants." >&4
elif $test `./findhdr fcntl.h` && \
- $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
+ $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
h_fcntl=true;
echo "<fcntl.h> defines the *_OK access constants." >&4
elif $test `./findhdr unistd.h` && \
- $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
+ $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
echo "<unistd.h> defines the *_OK access constants." >&4
else
echo "I can't find the four *_OK access constants--I'll use mine." >&4
"$define")
echo " "
echo "Checking to see which flavor of getpgrp is in use..."
- $cat >set.c <<EOP
+ $cat >try.c <<EOP
#$i_unistd I_UNISTD
#include <sys/types.h>
#ifdef I_UNISTD
exit(1);
}
EOP
- if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+ if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
val="$define"
- elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+ elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
val="$undef"
else
esac
set d_bsdgetpgrp
eval $setvar
-$rm -f set set.c
+$rm -f try try.*
: see if setpgrp exists
set setpgrp d_setpgrp
"$define")
echo " "
echo "Checking to see which flavor of setpgrp is in use..."
- $cat >set.c <<EOP
+ $cat >try.c <<EOP
#$i_unistd I_UNISTD
#include <sys/types.h>
#ifdef I_UNISTD
exit(1);
}
EOP
- if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+ if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
val="$define"
- elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+ elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
val="$undef"
else
esac
set d_bsdsetpgrp
eval $setvar
-$rm -f set set.c
+$rm -f try try.*
: see if bzero exists
set bzero d_bzero
eval $inlibc
EOCP
set try
if eval $compile_ok; then
- ./try
+ $run ./try
yyy=$?
else
echo "(I can't seem to compile the test program--assuming it can't)"
EOCP
set try
if eval $compile_ok; then
- ./try
+ $run ./try
castflags=$?
else
echo "(I can't seem to compile the test program--assuming it can't)"
if set vprintf val -f d_vprintf; eval $csym; $val; then
echo 'vprintf() found.' >&4
val="$define"
- $cat >vprintf.c <<'EOF'
+ $cat >try.c <<'EOF'
#include <varargs.h>
-int main() { xxx("foo"); }
+int main() { xxx("foo"); }
+
+xxx(va_alist)
+va_dcl
+{
+ va_list args;
+ char buf[10];
+
+ va_start(args);
+ exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
+}
+EOF
+ set try
+ if eval $compile && $run ./try; then
+ echo "Your vsprintf() returns (int)." >&4
+ val2="$undef"
+ else
+ echo "Your vsprintf() returns (char*)." >&4
+ val2="$define"
+ fi
+else
+ echo 'vprintf() NOT found.' >&4
+ val="$undef"
+ val2="$undef"
+fi
+$rm -f try try.*
+set d_vprintf
+eval $setvar
+val=$val2
+set d_charvspr
+eval $setvar
+
+: see if chown exists
+set chown d_chown
+eval $inlibc
+
+: see if chroot exists
+set chroot d_chroot
+eval $inlibc
+
+: see if chsize exists
+set chsize d_chsize
+eval $inlibc
+
+: see if class exists
+set class d_class
+eval $inlibc
+
+hasstruct='varname=$1; struct=$2; shift; shift;
+while $test $# -ge 2; do
+ case "$1" in
+ $define) echo "#include <$2>";;
+ esac ;
+ shift 2;
+done > try.c;
+echo "int main () { struct $struct foo; }" >> try.c;
+set try;
+if eval $compile; then
+ val="$define";
+else
+ val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm -f try.c try.o'
+
+: see if sys/types.h has to be included
+set sys/types.h i_systypes
+eval $inhdr
+
+hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
+while $test $# -ge 2; do
+ case "$1" in
+ $define) echo "#include <$2>";;
+ esac ;
+ shift 2;
+done > try.c;
+echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
+set try;
+if eval $compile; then
+ val="$define";
+else
+ val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm -f try.c try.o'
+
+socketlib=''
+sockethdr=''
+: see whether socket exists
+echo " "
+$echo $n "Hmm... $c" >&4
+if set socket val -f d_socket; eval $csym; $val; then
+ echo "Looks like you have Berkeley networking support." >&4
+ d_socket="$define"
+ if set setsockopt val -f; eval $csym; $val; then
+ d_oldsock="$undef"
+ else
+ echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
+ d_oldsock="$define"
+ fi
+else
+ if $contains socklib libc.list >/dev/null 2>&1; then
+ echo "Looks like you have Berkeley networking support." >&4
+ d_socket="$define"
+ : we will have to assume that it supports the 4.2 BSD interface
+ d_oldsock="$undef"
+ else
+ echo "You don't have Berkeley networking in libc$_a..." >&4
+ if test "X$d_socket" = "X$define"; then
+ echo "...but you seem to believe that you have sockets." >&4
+ else
+ for net in net socket
+ do
+ if test -f /usr/lib/lib$net$_a; then
+ ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
+ $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
+ if $contains socket libc.list >/dev/null 2>&1; then
+ d_socket="$define"
+ socketlib="-l$net"
+ case "$net" in
+ net)
+ echo "...but the Wollongong group seems to have hacked it in." >&4
+ sockethdr="-I/usr/netinclude"
+ ;;
+ esac
+ echo "Found Berkeley sockets interface in lib$net." >& 4
+ if $contains setsockopt libc.list >/dev/null 2>&1; then
+ d_oldsock="$undef"
+ else
+ echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
+ d_oldsock="$define"
+ fi
+ break
+ fi
+ fi
+ done
+ if test "X$d_socket" != "X$define"; then
+ echo "or anywhere else I see." >&4
+ d_socket="$undef"
+ d_oldsock="$undef"
+ fi
+ fi
+ fi
+fi
+
+: see if socketpair exists
+set socketpair d_sockpair
+eval $inlibc
-xxx(va_alist)
-va_dcl
-{
- va_list args;
- char buf[10];
- va_start(args);
- exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
+echo " "
+echo "Checking the availability of certain socket constants..." >& 4
+for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
+ enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
+ $cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+int main() {
+ int i = $ENUM;
}
EOF
- set vprintf
- if eval $compile && ./vprintf; then
- echo "Your vsprintf() returns (int)." >&4
- val2="$undef"
- else
- echo "Your vsprintf() returns (char*)." >&4
- val2="$define"
+ val="$undef"
+ set try; if eval $compile; then
+ val="$define"
fi
-else
- echo 'vprintf() NOT found.' >&4
- val="$undef"
- val2="$undef"
-fi
-set d_vprintf
-eval $setvar
-val=$val2
-set d_charvspr
-eval $setvar
+ set d_${enum}; eval $setvar
+ $rm -f try.c try
+done
-: see if chown exists
-set chown d_chown
-eval $inlibc
+: see if this is a sys/uio.h system
+set sys/uio.h i_sysuio
+eval $inhdr
-: see if chroot exists
-set chroot d_chroot
-eval $inlibc
-: see if chsize exists
-set chsize d_chsize
-eval $inlibc
+echo " "
+echo "Checking to see if your system supports struct cmsghdr..." >&4
+set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
+eval $hasstruct
+case "$d_cmsghdr_s" in
+"$define") echo "Yes, it does." ;;
+*) echo "No, it doesn't." ;;
+esac
+
: check for const keyword
echo " "
set d_dbl_dig
eval $setvar
+hasproto='varname=$1; func=$2; shift; shift;
+while $test $# -ge 2; do
+ case "$1" in
+ $define) echo "#include <$2>";;
+ esac ;
+ shift 2;
+done > try.c;
+$cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
+if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
+ echo "$func() prototype found.";
+ val="$define";
+else
+ echo "$func() prototype NOT found.";
+ val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm -f try.c tryout.c'
+
+: see if dbm.h is available
+: see if dbmclose exists
+set dbmclose d_dbmclose
+eval $inlibc
+
+case "$d_dbmclose" in
+$define)
+ set dbm.h i_dbm
+ eval $inhdr
+ case "$i_dbm" in
+ $define)
+ val="$undef"
+ set i_rpcsvcdbm
+ eval $setvar
+ ;;
+ *) set rpcsvc/dbm.h i_rpcsvcdbm
+ eval $inhdr
+ ;;
+ esac
+ ;;
+*) echo "We won't be including <dbm.h>"
+ val="$undef"
+ set i_dbm
+ eval $setvar
+ val="$undef"
+ set i_rpcsvcdbm
+ eval $setvar
+ ;;
+esac
+
+: see if prototype for dbminit is available
+echo " "
+set d_dbminitproto dbminit $i_dbm dbm.h
+eval $hasproto
+
: see if difftime exists
set difftime d_difftime
eval $inlibc
#include <stdio.h>
#$i_dlfcn I_DLFCN
#ifdef I_DLFCN
-#include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
+#include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
#else
#include <sys/types.h>
#include <nlist.h>
: Call the object file tmp-dyna.o in case dlext=o.
if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
- $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 &&
- $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
- xxx=`./fred`
+ $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
+ $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
+ xxx=`$run ./fred`
case $xxx in
1) echo "Test program failed using dlopen." >&4
echo "Perhaps you should not use dynamic loading." >&4;;
set d_dlsymun
eval $setvar
-hasproto='varname=$1; func=$2; shift; shift;
-while $test $# -ge 2; do
- case "$1" in
- $define) echo "#include <$2>";;
- esac ;
- shift 2;
-done > try.c;
-$cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
-if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
- echo "$func() prototype found.";
- val="$define";
-else
- echo "$func() prototype NOT found.";
- val="$undef";
-fi;
-set $varname;
-eval $setvar;
-$rm -f try.c tryout.c'
-
: see if prototype for drand48 is available
echo " "
set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
: Locate the flags for 'open()'
echo " "
-$cat >open3.c <<'EOCP'
+$cat >try.c <<'EOCP'
#include <sys/types.h>
#ifdef I_FCNTL
#include <fcntl.h>
EOCP
: check sys/file.h first to get FREAD on Sun
if $test `./findhdr sys/file.h` && \
- set open3 -DI_SYS_FILE && eval $compile; then
+ set try -DI_SYS_FILE && eval $compile; then
h_sysfile=true;
echo "<sys/file.h> defines the O_* constants..." >&4
- if ./open3; then
+ if $run ./try; then
echo "and you have the 3 argument form of open()." >&4
val="$define"
else
val="$undef"
fi
elif $test `./findhdr fcntl.h` && \
- set open3 -DI_FCNTL && eval $compile; then
+ set try -DI_FCNTL && eval $compile; then
h_fcntl=true;
echo "<fcntl.h> defines the O_* constants..." >&4
- if ./open3; then
+ if $run ./try; then
echo "and you have the 3 argument form of open()." >&4
val="$define"
else
fi
set d_open3
eval $setvar
-$rm -f open3*
+$rm -f try try.*
: see which of string.h or strings.h is needed
echo " "
case "$h_sysfile" in
true) echo "#include <sys/file.h>" > head.c;;
*)
- case "$h_fcntl" in
- true) echo "#include <fcntl.h>" > head.c;;
- *) echo "#include <sys/fcntl.h>" > head.c;;
- esac
- ;;
+ case "$h_fcntl" in
+ true) echo "#include <fcntl.h>" > head.c;;
+ *) echo "#include <sys/fcntl.h>" > head.c;;
+ esac
+ ;;
esac
echo " "
echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
$cat head.c > try.c
$cat >>try.c <<'EOCP'
#include <stdio.h>
+#include <stdlib.h>
int main() {
#ifdef O_NONBLOCK
printf("O_NONBLOCK\n");
EOCP
set try
if eval $compile_ok; then
- o_nonblock=`./try`
+ o_nonblock=`$run ./try`
case "$o_nonblock" in
'') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
*) echo "Seems like we can use $o_nonblock.";;
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
+#include <stdlib.h>
#define MY_O_NONBLOCK $o_nonblock
#ifndef errno /* XXX need better Configure test */
extern int errno;
int ret;
close(pd[1]); /* Parent reads from pd[0] */
close(pu[0]); /* Parent writes (blocking) to pu[1] */
+#ifdef F_SETFL
if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
exit(1);
+#else
+ exit(4);
+#endif
signal(SIGALRM, blech);
alarm(5);
if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
set try
if eval $compile_ok; then
echo "$startsh" >mtry
- echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
+ echo "$run ./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
chmod +x mtry
./mtry >/dev/null 2>&1
case $? in
1) echo "Could not perform non-blocking setting!";;
2) echo "I did a successful read() for something that was not there!";;
3) echo "Hmm... non-blocking I/O does not seem to be working!";;
+ 4) echo "Could not find F_SETFL!";;
*) echo "Something terribly wrong happened during testing.";;
esac
rd_nodata=`$cat try.ret`
-1) echo "But it also returns -1 to signal EOF, so be careful!";;
*) echo "However, your read() returns '$status' on EOF??";;
esac
- val="$define"
- if test "$status" = "$rd_nodata"; then
- echo "WARNING: you can't distinguish between EOF and no data!"
- val="$undef"
- fi
- else
- echo "I can't compile the test program--assuming errno EAGAIN will do."
- eagain=EAGAIN
- fi
- set d_eofnblk
- eval $setvar
- ;;
-*)
- echo "Using $hint value $eagain."
- echo "Your read() returns $rd_nodata when no data is present."
- case "$d_eofnblk" in
- "$define") echo "And you can see EOF because read() returns 0.";;
- "$undef") echo "But you can't see EOF status from read() returned value.";;
- *)
- echo "(Assuming you can't see EOF status from read anyway.)"
- d_eofnblk=$undef
- ;;
- esac
- ;;
-esac
-$rm -f try try.* .out core head.c mtry
-
-: see if fchmod exists
-set fchmod d_fchmod
-eval $inlibc
-
-: see if fchown exists
-set fchown d_fchown
-eval $inlibc
-
-: see if this is an fcntl system
-set fcntl d_fcntl
-eval $inlibc
-
-hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
-while $test $# -ge 2; do
- case "$1" in
- $define) echo "#include <$2>";;
- esac ;
- shift 2;
-done > try.c;
-echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
-set try;
-if eval $compile; then
- val="$define";
-else
- val="$undef";
-fi;
-set $varname;
-eval $setvar;
-$rm -f try.c try.o'
-
-socketlib=''
-sockethdr=''
-: see whether socket exists
-echo " "
-$echo $n "Hmm... $c" >&4
-if set socket val -f d_socket; eval $csym; $val; then
- echo "Looks like you have Berkeley networking support." >&4
- d_socket="$define"
- if set setsockopt val -f; eval $csym; $val; then
- d_oldsock="$undef"
- else
- echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
- d_oldsock="$define"
- fi
-else
- if $contains socklib libc.list >/dev/null 2>&1; then
- echo "Looks like you have Berkeley networking support." >&4
- d_socket="$define"
- : we will have to assume that it supports the 4.2 BSD interface
- d_oldsock="$undef"
- else
- echo "You don't have Berkeley networking in libc$_a..." >&4
- if test "X$d_socket" = "X$define"; then
- echo "...but you seem to believe that you have sockets." >&4
- else
- for net in net socket
- do
- if test -f /usr/lib/lib$net$_a; then
- ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
- $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
- if $contains socket libc.list >/dev/null 2>&1; then
- d_socket="$define"
- socketlib="-l$net"
- case "$net" in
- net)
- echo "...but the Wollongong group seems to have hacked it in." >&4
- sockethdr="-I/usr/netinclude"
- ;;
- esac
- echo "Found Berkeley sockets interface in lib$net." >& 4
- if $contains setsockopt libc.list >/dev/null 2>&1; then
- d_oldsock="$undef"
- else
- echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
- d_oldsock="$define"
- fi
- break
- fi
- fi
- done
- if test "X$d_socket" != "X$define"; then
- echo "or anywhere else I see." >&4
- d_socket="$undef"
- d_oldsock="$undef"
- fi
+ val="$define"
+ if test "$status" = "$rd_nodata"; then
+ echo "WARNING: you can't distinguish between EOF and no data!"
+ val="$undef"
fi
+ else
+ echo "I can't compile the test program--assuming errno EAGAIN will do."
+ eagain=EAGAIN
fi
-fi
+ set d_eofnblk
+ eval $setvar
+ ;;
+*)
+ echo "Using $hint value $eagain."
+ echo "Your read() returns $rd_nodata when no data is present."
+ case "$d_eofnblk" in
+ "$define") echo "And you can see EOF because read() returns 0.";;
+ "$undef") echo "But you can't see EOF status from read() returned value.";;
+ *)
+ echo "(Assuming you can't see EOF status from read anyway.)"
+ d_eofnblk=$undef
+ ;;
+ esac
+ ;;
+esac
+$rm -f try try.* .out core head.c mtry
-: see if socketpair exists
-set socketpair d_sockpair
+: see if fchdir exists
+set fchdir d_fchdir
+eval $inlibc
+
+: see if fchmod exists
+set fchmod d_fchmod
+eval $inlibc
+
+: see if fchown exists
+set fchown d_fchown
eval $inlibc
+: see if this is an fcntl system
+set fcntl d_fcntl
+eval $inlibc
echo " "
-echo "Checking the availability of certain socket constants..." >& 4
-for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
- enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
- $cat >try.c <<EOF
-#include <sys/types.h>
-#include <sys/socket.h>
+: See if fcntl-based locking works.
+$cat >try.c <<EOCP
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <signal.h>
+$signal_t blech(x) int x; { exit(3); }
int main() {
- int i = $ENUM;
+#if defined(F_SETLK) && defined(F_SETLKW)
+ struct flock flock;
+ int retval, fd;
+ fd = open("try.c", O_RDONLY);
+ flock.l_type = F_RDLCK;
+ flock.l_whence = SEEK_SET;
+ flock.l_start = flock.l_len = 0;
+ signal(SIGALRM, blech);
+ alarm(10);
+ retval = fcntl(fd, F_SETLK, &flock);
+ close(fd);
+ (retval < 0 ? exit(2) : exit(0));
+#else
+ exit(2);
+#endif
}
-EOF
- val="$undef"
- set try; if eval $compile; then
- val="$define"
+EOCP
+echo "Checking if fcntl-based file locking works... "
+case "$d_fcntl" in
+"$define")
+ set try
+ if eval $compile_ok; then
+ if $run ./try; then
+ echo "Yes, it seems to work."
+ val="$define"
+ else
+ echo "Nope, it didn't work."
+ val="$undef"
+ case "$?" in
+ 3) $cat >&4 <<EOM
+***
+*** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
+*** This is (almost) impossible.
+*** If your NFS lock daemons are not feeling well, something like
+*** this may happen, please investigate. Cannot continue, aborting.
+***
+EOM
+ exit 1
+ ;;
+ esac
+ fi
+ else
+ echo "I'm unable to compile the test program, so I'll assume not."
+ val="$undef"
fi
- set d_${enum}; eval $setvar
- $rm -f try.c try
-done
+ ;;
+*) val="$undef";
+ echo "Nope, since you don't even have fcntl()."
+ ;;
+esac
+set d_fcntl_can_lock
+eval $setvar
+$rm -f try*
+
: see if sys/select.h has to be included
set sys/select.h i_sysselct
Checking to see how well your C compiler handles fd_set and friends ...
EOM
-$cat >fd_set.c <<EOCP
+$cat >try.c <<EOCP
#$i_systime I_SYS_TIME
#$i_sysselct I_SYS_SELECT
#$d_socket HAS_SOCKET
#endif
}
EOCP
-set fd_set -DTRYBITS
+set try -DTRYBITS
if eval $compile; then
d_fds_bits="$define"
d_fd_set="$define"
echo "Well, your system knows about the normal fd_set typedef..." >&4
- if ./fd_set; then
+ if $run ./try; then
echo "and you have the normal fd_set macros (just as I'd expect)." >&4
d_fd_macros="$define"
else
$cat <<'EOM'
Hmm, your compiler has some difficulty with fd_set. Checking further...
EOM
- set fd_set
+ set try
if eval $compile; then
d_fds_bits="$undef"
d_fd_set="$define"
echo "Well, your system has some sort of fd_set available..." >&4
- if ./fd_set; then
+ if $run ./try; then
echo "and you have the normal fd_set macros." >&4
d_fd_macros="$define"
else
d_fd_macros="$undef"
fi
fi
-$rm -f fd_set*
+$rm -f try try.*
: see if fgetpos exists
set fgetpos d_fgetpos
eval $inlibc
+: see if finite exists
+set finite d_finite
+eval $inlibc
+
+: see if finitel exists
+set finitel d_finitel
+eval $inlibc
+
: see if flock exists
set flock d_flock
eval $inlibc
+: see if this is a sys/file.h system
+val=''
+set sys/file.h val
+eval $inhdr
+
+: do we need to include sys/file.h ?
+case "$val" in
+"$define")
+ echo " "
+ if $h_sysfile; then
+ val="$define"
+ echo "We'll be including <sys/file.h>." >&4
+ else
+ val="$undef"
+ echo "We won't be including <sys/file.h>." >&4
+ fi
+ ;;
+*)
+ h_sysfile=false
+ ;;
+esac
+set i_sysfile
+eval $setvar
+
+: see if prototype for flock is available
+echo " "
+set d_flockproto flock $i_sysfile sys/file.h
+eval $hasproto
+
: see if fork exists
set fork d_fork
eval $inlibc
+: see if fp_class exists
+set fp_class d_fp_class
+eval $inlibc
+
: see if pathconf exists
set pathconf d_pathconf
eval $inlibc
set fpathconf d_fpathconf
eval $inlibc
+: see if fpclass exists
+set fpclass d_fpclass
+eval $inlibc
+
+: see if fpclassify exists
+set fpclassify d_fpclassify
+eval $inlibc
+
+: see if fpclassl exists
+set fpclassl d_fpclassl
+eval $inlibc
+
: check for fpos64_t
echo " "
set frexpl d_frexpl
eval $inlibc
-hasstruct='varname=$1; struct=$2; shift; shift;
-while $test $# -ge 2; do
- case "$1" in
- $define) echo "#include <$2>";;
- esac ;
- shift 2;
-done > try.c;
-echo "int main () { struct $struct foo; }" >> try.c;
-set try;
-if eval $compile; then
- val="$define";
-else
- val="$undef";
-fi;
-set $varname;
-eval $setvar;
-$rm -f try.c try.o'
-
: see if this is a sys/param system
set sys/param.h i_sysparam
eval $inhdr
set sys/mount.h i_sysmount
eval $inhdr
-: see if sys/types.h has to be included
-set sys/types.h i_systypes
-eval $inhdr
-
echo " "
echo "Checking to see if your system supports struct fs_data..." >&4
eval $inlibc
+: see if fsync exists
+set fsync d_fsync
+eval $inlibc
+
: see if ftello exists
set ftello d_ftello
eval $inlibc
set d_gethostprotos gethostent $i_netdb netdb.h
eval $hasproto
+: see if getitimer exists
+set getitimer d_getitimer
+eval $inlibc
+
: see if getlogin exists
set getlogin d_getlogin
eval $inlibc
set d_getnetprotos getnetent $i_netdb netdb.h
eval $hasproto
+: see if getpagesize exists
+set getpagesize d_getpagsz
+eval $inlibc
+
: see if getprotobyname exists
set getprotobyname d_getpbyname
set d_htonl
eval $setvar
-: see if iconv exists
-set iconv d_iconv
-eval $inlibc
-
: index or strchr
echo " "
if set index val -f; eval $csym; $val; then
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
-echo " "
-echo "Checking to see if you have int64_t..." >&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 "You have int64_t."
-else
- val="$undef"
- echo "You do not have int64_t."
-fi
-$rm -f try try.*
-set d_int64_t
-eval $setvar
-
: Look for isascii
echo " "
$cat >isascii.c <<'EOCP'
eval $setvar
$rm -f isascii*
+: see if isfinite exists
+set isfinite d_isfinite
+eval $inlibc
+
+: see if isinf exists
+set isinf d_isinf
+eval $inlibc
+
: see if isnan exists
set isnan d_isnan
eval $inlibc
: see if link exists
set link d_link
-eval $inlibc
-
-: see if localeconv exists
-set localeconv d_locconv
-eval $inlibc
-
-: see if lockf exists
-set lockf d_lockf
-eval $inlibc
-
-: check for long long
-echo " "
-echo "Checking to see if you have long long..." >&4
-echo 'int main() { long long x = 7; return 0; }' > try.c
-set try
-if eval $compile; then
- val="$define"
- echo "You have long long."
-else
- val="$undef"
- echo "You do not have long long."
-fi
-$rm try.*
-set d_longlong
-eval $setvar
-
-: check for length of long long
-case "${d_longlong}${longlongsize}" in
-$define)
- echo " "
- echo "Checking to see how big your long longs are..." >&4
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", (int)sizeof(long long));
- return(0);
-}
-EOCP
- set try
- if eval $compile_ok; then
- longlongsize=`./try$exe_ext`
- echo "Your long longs are $longlongsize bytes long."
- 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
+eval $inlibc
+
+: see if localeconv exists
+set localeconv d_locconv
+eval $inlibc
+
+: see if lockf exists
+set lockf d_lockf
+eval $inlibc
: see if prototype for lseek is available
echo " "
set modfl d_modfl
eval $inlibc
+d_modfl_pow32_bug="$undef"
+
+case "$d_longdbl$d_modfl" in
+$define$define)
+ $cat <<EOM
+Checking to see whether your modfl() is okay for large values...
+EOM
+$cat >try.c <<EOCP
+#include <math.h>
+#include <stdio.h>
+int main() {
+ long double nv = 4294967303.15;
+ long double v, w;
+ v = modfl(nv, &w);
+#ifdef __GLIBC__
+ printf("glibc");
+#endif
+ printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
+ return 0;
+}
+EOCP
+ case "$osname:$gccversion" in
+ aix:) saveccflags="$ccflags"
+ ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
+ esac
+ set try
+ if eval $compile; then
+ foo=`$run ./try`
+ case "$foo" in
+ *" 4294967303.150000 1.150000 4294967302.000000")
+ echo >&4 "Your modfl() is broken for large values."
+ d_modfl_pow32_bug="$define"
+ case "$foo" in
+ glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
+ ;;
+ esac
+ ;;
+ *" 4294967303.150000 0.150000 4294967303.000000")
+ echo >&4 "Your modfl() seems okay for large values."
+ ;;
+ *) echo >&4 "I don't understand your modfl() at all."
+ d_modfl="$undef"
+ ;;
+ esac
+ $rm -f try.* try core core.try.*
+ else
+ echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
+ d_modfl="$undef"
+ fi
+ case "$osname:$gccversion" in
+ aix:) ccflags="$saveccflags" ;; # restore
+ esac
+ ;;
+esac
+
: see if mprotect exists
set mprotect d_mprotect
eval $inlibc
set d_msg
eval $setvar
+
+echo " "
+echo "Checking to see if your system supports struct msghdr..." >&4
+set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
+eval $hasstruct
+case "$d_msghdr_s" in
+"$define") echo "Yes, it does." ;;
+*) echo "No, it doesn't." ;;
+esac
+
+
: see if msync exists
set msync d_msync
eval $inlibc
set nice d_nice
eval $inlibc
+: see if this is a langinfo.h system
+set langinfo.h i_langinfo
+eval $inhdr
-echo " "
-echo "Checking which 64-bit integer type we could use..." >&4
-
-case "$intsize" in
-8) val=int
- set quadtype
- eval $setvar
- val='"unsigned int"'
- set uquadtype
- eval $setvar
- quadkind=1
- ;;
-*) case "$longsize" in
- 8) val=long
- set quadtype
- eval $setvar
- val='"unsigned long"'
- set uquadtype
- eval $setvar
- quadkind=2
- ;;
- *) case "$d_longlong:$longlongsize" in
- define:8)
- val='"long long"'
- set quadtype
- eval $setvar
- val='"unsigned long long"'
- set uquadtype
- eval $setvar
- quadkind=3
- ;;
- *) case "$d_int64_t" in
- define)
- val=int64_t
- set quadtype
- eval $setvar
- val=uint64_t
- set uquadtype
- eval $setvar
- quadkind=4
- ;;
- esac
- ;;
- esac
- ;;
- esac
- ;;
-esac
-
-case "$quadtype" in
-'') echo "Alas, no 64-bit integer types in sight." >&4
- d_quad="$undef"
- ;;
-*) if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
- verb="will"
- else
- verb="could"
- fi
- echo "We $verb use '$quadtype' for 64-bit integers." >&4
- d_quad="$define"
- ;;
-esac
+: see if nl_langinfo exists
+set nl_langinfo d_nl_langinfo
+eval $inlibc
: check for length of character
echo " "
EOCP
set try
if eval $compile_ok; then
- dflt=`./try`
+ dflt=`$run ./try`
else
dflt='1'
echo "(I can't seem to compile the test program. Guessing...)"
charsize="$ans"
$rm -f try.c try
+: check for volatile keyword
+echo " "
+echo 'Checking to see if your C compiler knows about "volatile"...' >&4
+$cat >try.c <<'EOCP'
+int main()
+{
+ typedef struct _goo_struct goo_struct;
+ goo_struct * volatile goo = ((goo_struct *)0);
+ struct _goo_struct {
+ long long_int;
+ int reg_int;
+ char char_var;
+ };
+ typedef unsigned short foo_t;
+ char *volatile foo;
+ volatile int bar;
+ volatile foo_t blech;
+ foo = foo;
+}
+EOCP
+if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
+ val="$define"
+ echo "Yup, it does."
+else
+ val="$undef"
+ echo "Nope, it doesn't."
+fi
+set d_volatile
+eval $setvar
+$rm -f try.*
+
echo " "
$echo "Choosing the C types to be used for Perl's internal types..." >&4
case "$i8type" in
'') set try -DINT8
if eval $compile; then
- case "`./try$exe_ext`" in
+ case "`$run ./try`" in
int8_t) i8type=int8_t
u8type=uint8_t
i8size=1
case "$i16type" in
'') set try -DINT16
if eval $compile; then
- case "`./try$exe_ext`" in
+ case "`$run ./try`" in
int16_t)
i16type=int16_t
u16type=uint16_t
case "$i32type" in
'') set try -DINT32
if eval $compile; then
- case "`./try$exe_ext`" in
+ case "`$run ./try`" in
int32_t)
i32type=int32_t
u32type=uint32_t
;;
esac
-$echo "Checking whether your NVs can preserve your UVs..." >&4
+$echo "Checking how many bits of your UVs your NVs can preserve..." >&4
+: volatile so that the compiler has to store it out to memory.
+if test X"$d_volatile" = X"$define"; then
+ volatile=volatile
+fi
$cat <<EOP >try.c
#include <stdio.h>
-int main() {
- $uvtype k = ($uvtype)~0, l;
- $nvtype d;
- l = k;
- d = ($nvtype)l;
- l = ($uvtype)d;
- if (l == k)
- printf("preserve\n");
- exit(0);
-}
-EOP
-set try
-if eval $compile; then
- case "`./try$exe_ext`" in
- preserve) d_nv_preserves_uv="$define" ;;
- esac
-fi
-case "$d_nv_preserves_uv" in
-$define) $echo "Yes, they can." 2>&1 ;;
-*) $echo "No, they can't." 2>&1
- d_nv_preserves_uv="$undef"
- ;;
-esac
-
-$rm -f try.* try
-
-case "$d_nv_preserves_uv" in
-"$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;;
-*) $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
- $cat <<EOP >try.c
-#include <stdio.h>
+#include <sys/types.h>
+#include <signal.h>
+#ifdef SIGFPE
+$volatile int bletched = 0;
+$signal_t blech(s) int s; { bletched = 1; }
+#endif
int main() {
$uvtype u = 0;
+ $nvtype d;
int n = 8 * $uvsize;
int i;
+#ifdef SIGFPE
+ signal(SIGFPE, blech);
+#endif
+
for (i = 0; i < n; i++) {
u = u << 1 | ($uvtype)1;
- if (($uvtype)($nvtype)u != u)
+ d = ($nvtype)u;
+ if (($uvtype)d != u)
break;
+ if (d <= 0)
+ break;
+ d = ($nvtype)(u - 1);
+ if (($uvtype)d != (u - 1))
+ break;
+#ifdef SIGFPE
+ if (bletched) {
+ break;
+#endif
+ }
}
- printf("%d\n", i);
+ printf("%d\n", ((i == n) ? -n : i));
exit(0);
}
EOP
- set try
- if eval $compile; then
- d_nv_preserves_uv_bits="`./try$exe_ext`"
- fi
- case "$d_nv_preserves_uv_bits" in
- [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs." 2>&1 ;;
- *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
- d_nv_preserves_uv_bits="$undef"
- ;;
- esac
- $rm -f try.* try
+set try
+
+d_nv_preserves_uv="$undef"
+if eval $compile; then
+ d_nv_preserves_uv_bits="`$run ./try`"
+fi
+case "$d_nv_preserves_uv_bits" in
+\-[1-9]*)
+ d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
+ $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
+ d_nv_preserves_uv="$define"
;;
+[1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
+ d_nv_preserves_uv="$undef" ;;
+*) $echo "Can't figure out how many bits your NVs preserve." 2>&1
+ d_nv_preserves_uv_bits="$undef" ;;
esac
+$rm -f try.* try
+
: check for off64_t
echo " "
set poll d_poll
eval $inlibc
+: see if pthread_atfork exists
+set pthread_atfork d_pthread_atfork
+eval $inlibc
+
: see whether the various POSIXish _yields exist
$cat >try.c <<EOP
set readlink d_readlink
eval $inlibc
+: see if readv exists
+set readv d_readv
+eval $inlibc
+
+: see if recvmsg exists
+set recvmsg d_recvmsg
+eval $inlibc
+
: see if rename exists
set rename d_rename
eval $inlibc
eval $setvar
: can bcopy handle overlapping blocks?
+echo " "
val="$undef"
-case "$d_bcopy" in
-"$define")
- echo " "
- echo "Checking to see if your bcopy() can do overlapping copies..." >&4
- $cat >try.c <<EOCP
+case "$d_memmove" in
+"$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
+*) case "$d_bcopy" in
+ "$define")
+ echo "Checking to see if bcopy() can do overlapping copies..." >&4
+ $cat >try.c <<EOCP
#$i_memory I_MEMORY
#$i_stdlib I_STDLIB
#$i_string I_STRING
int off;
int align;
+/* Copy "abcde..." string to char abc[] so that gcc doesn't
+ try to store the string in read-only memory. */
bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
for (align = 7; align >= 0; align--) {
exit(0);
}
EOCP
- set try
- if eval $compile_ok; then
- if ./try 2>/dev/null; then
- echo "Yes, it can."
- val="$define"
+ set try
+ if eval $compile_ok; then
+ if ./try 2>/dev/null; then
+ echo "Yes, it can."
+ val="$define"
+ else
+ echo "It can't, sorry."
+ fi
else
- echo "It can't, sorry."
- case "$d_memmove" in
- "$define") echo "But that's Ok since you have memmove()." ;;
- esac
+ echo "(I can't compile the test program, so we'll assume not...)"
fi
- else
- echo "(I can't compile the test program, so we'll assume not...)"
- case "$d_memmove" in
- "$define") echo "But that's Ok since you have memmove()." ;;
- esac
- fi
+ ;;
+ esac
+ $rm -f try.* try core
;;
esac
-$rm -f try.* try core
set d_safebcpy
eval $setvar
: can memcpy handle overlapping blocks?
+echo " "
val="$undef"
-case "$d_memcpy" in
-"$define")
- echo " "
- echo "Checking to see if your memcpy() can do overlapping copies..." >&4
- $cat >try.c <<EOCP
+case "$d_memmove" in
+"$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
+*) case "$d_memcpy" in
+ "$define")
+ echo "Checking to see if memcpy() can do overlapping copies..." >&4
+ $cat >try.c <<EOCP
#$i_memory I_MEMORY
#$i_stdlib I_STDLIB
#$i_string I_STRING
exit(0);
}
EOCP
- set try
- if eval $compile_ok; then
- if ./try 2>/dev/null; then
- echo "Yes, it can."
- val="$define"
+ set try
+ if eval $compile_ok; then
+ if ./try 2>/dev/null; then
+ echo "Yes, it can."
+ val="$define"
+ else
+ echo "It can't, sorry."
+ fi
else
- echo "It can't, sorry."
- case "$d_memmove" in
- "$define") echo "But that's Ok since you have memmove()." ;;
- esac
+ echo "(I can't compile the test program, so we'll assume not...)"
fi
- else
- echo "(I can't compile the test program, so we'll assume not...)"
- case "$d_memmove" in
- "$define") echo "But that's Ok since you have memmove()." ;;
- esac
- fi
+ ;;
+ esac
+ $rm -f try.* try core
;;
esac
-$rm -f try.* try core
set d_safemcpy
eval $setvar
EOCP
set try
if eval $compile_ok; then
- if ./try 2>/dev/null; then
+ if $run ./try 2>/dev/null; then
echo "Yes, it can."
val="$define"
else
set d_sanemcmp
eval $setvar
+: see if prototype for sbrk is available
+echo " "
+set d_sbrkproto sbrk $i_unistd unistd.h
+eval $hasproto
+
: see if select exists
set select d_select
eval $inlibc
val="$undef"
set try
if eval $compile; then
- xxx=`./try`
+ xxx=`$run ./try`
case "$xxx" in
semun) val="$define" ;;
esac
val="$undef"
set try
if eval $compile; then
- xxx=`./try`
+ xxx=`$run ./try`
case "$xxx" in
semid_ds) val="$define" ;;
esac
;;
esac
+: see if sendmsg exists
+set sendmsg d_sendmsg
+eval $inlibc
+
: see if setegid exists
set setegid d_setegid
eval $inlibc
set sethostent d_sethent
eval $inlibc
+: see if setitimer exists
+set setitimer d_setitimer
+eval $inlibc
+
: see if setlinebuf exists
set setlinebuf d_setlinebuf
eval $inlibc
;;
*) echo "Ok, avoiding sfio this time. I'll use stdio instead."
val="$undef"
- : Remove sfio from list of libraries to use
- set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
- shift
- libs="$*"
- echo "libs = $libs" >&4
;;
esac
;;
$define) usesfio='true';;
*) usesfio='false';;
esac
+case "$d_sfio" in
+$define) ;;
+*) : Remove sfio from list of libraries to use
+ case "$libs" in
+ *-lsfio*)
+ echo "Removing unneeded -lsfio from library list" >&4
+ set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
+ shift
+ libs="$*"
+ echo "libs = $libs" >&4
+ ;;
+ esac
+;;
+esac
+
: see if shmctl exists
set shmctl d_shmctl
set d_sigaction; eval $setvar
$rm -f try try$_o try.c
+: see if sigprocmask exists
+set sigprocmask d_sigprocmask
+eval $inlibc
+
: see if sigsetjmp exists
echo " "
case "$d_sigsetjmp" in
EOP
set try
if eval $compile; then
- if ./try >/dev/null 2>&1; then
+ if $run ./try >/dev/null 2>&1; then
echo "POSIX sigsetjmp found." >&4
val="$define"
else
eval $setvar
$rm -f try.c try
+: see if sockatmark exists
+set sockatmark d_sockatmark
+eval $inlibc
+
+: see if prototype for sockatmark is available
+echo " "
+set d_sockatmarkproto sockatmark $d_socket sys/socket.h
+eval $hasproto
+
: see if socks5_init exists
set socks5_init d_socks5_init
eval $inlibc
+: see if prototype for setresgid is available
+echo " "
+set d_sresgproto setresgid $i_unistd unistd.h
+eval $hasproto
+
+: see if prototype for setresuid is available
+echo " "
+set d_sresuproto setresuid $i_unistd unistd.h
+eval $hasproto
+
: see if sys/stat.h is available
set sys/stat.h i_sysstat
eval $inhdr
: see if _ptr and _cnt from stdio act std
echo " "
-if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
+
+if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+ echo "(Looks like you have stdio.h from BSD.)"
+ case "$stdio_ptr" in
+ '') stdio_ptr='((fp)->_p)'
+ ptr_lval=$define
+ ;;
+ *) ptr_lval=$d_stdio_ptr_lval;;
+ esac
+ case "$stdio_cnt" in
+ '') stdio_cnt='((fp)->_r)'
+ cnt_lval=$define
+ ;;
+ *) cnt_lval=$d_stdio_cnt_lval;;
+ esac
+ case "$stdio_base" in
+ '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
+ esac
+ case "$stdio_bufsiz" in
+ '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
+ esac
+elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
echo "(Looks like you have stdio.h from Linux.)"
case "$stdio_ptr" in
'') stdio_ptr='((fp)->_IO_read_ptr)'
'') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
esac
fi
+
: test whether _ptr and _cnt really work
echo "Checking how std your stdio is..." >&4
$cat >try.c <<EOP
EOP
val="$undef"
set try
-if eval $compile; then
- if ./try; then
+if eval $compile && $to try.c; then
+ if $run ./try; then
echo "Your stdio acts pretty std."
val="$define"
else
set d_stdio_cnt_lval
eval $setvar
+
+: test whether setting _ptr sets _cnt as a side effect
+d_stdio_ptr_lval_sets_cnt="$undef"
+d_stdio_ptr_lval_nochange_cnt="$undef"
+case "$d_stdio_ptr_lval$d_stdstdio" in
+$define$define)
+ echo "Checking to see what happens if we set the stdio ptr..." >&4
+$cat >try.c <<EOP
+#include <stdio.h>
+/* Can we scream? */
+/* Eat dust sed :-) */
+/* In the buffer space, no one can hear you scream. */
+#define FILE_ptr(fp) $stdio_ptr
+#define FILE_cnt(fp) $stdio_cnt
+#include <sys/types.h>
+int main() {
+ FILE *fp = fopen("try.c", "r");
+ int c;
+ char *ptr;
+ size_t cnt;
+ if (!fp) {
+ puts("Fail even to read");
+ exit(1);
+ }
+ c = getc(fp); /* Read away the first # */
+ if (c == EOF) {
+ puts("Fail even to read");
+ exit(1);
+ }
+ if (!(
+ 18 <= FILE_cnt(fp) &&
+ strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
+ )) {
+ puts("Fail even to read");
+ exit (1);
+ }
+ ptr = (char*) FILE_ptr(fp);
+ cnt = (size_t)FILE_cnt(fp);
+
+ FILE_ptr(fp) += 42;
+
+ if ((char*)FILE_ptr(fp) != (ptr + 42)) {
+ printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
+ exit (1);
+ }
+ if (FILE_cnt(fp) <= 20) {
+ printf ("Fail (<20 chars to test)");
+ exit (1);
+ }
+ if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
+ puts("Fail compare");
+ exit (1);
+ }
+ if (cnt == FILE_cnt(fp)) {
+ puts("Pass_unchanged");
+ exit (0);
+ }
+ if (FILE_cnt(fp) == (cnt - 42)) {
+ puts("Pass_changed");
+ exit (0);
+ }
+ printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
+ return 1;
+
+}
+EOP
+ set try
+ if eval $compile && $to try.c; then
+ case `$run ./try` in
+ Pass_changed)
+ echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
+ d_stdio_ptr_lval_sets_cnt="$define" ;;
+ Pass_unchanged)
+ echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
+ d_stdio_ptr_lval_nochange_cnt="$define" ;;
+ Fail*)
+ echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
+ *)
+ echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
+ esac
+ else
+ echo "It seems we can't set ptr in your stdio. Nevermind." >&4
+ fi
+ $rm -f try.c try
+ ;;
+esac
+
: see if _base is also standard
val="$undef"
case "$d_stdstdio" in
}
EOP
set try
- if eval $compile; then
- if ./try; then
+ if eval $compile && $to try.c; then
+ if $run ./try; then
echo "And its _base field acts std."
val="$define"
else
do
set try -DSTDIO_STREAM_ARRAY=$s
if eval $compile; then
- case "`./try$exe_ext`" in
+ case "`$run ./try`" in
yes) stdio_stream_array=$s; break ;;
esac
fi
fi
fi
+: see if strftime exists
+set strftime d_strftime
+eval $inlibc
+
: see if strtod exists
set strtod d_strtod
eval $inlibc
EOCP
set try
if eval $compile; then
- yyy=`./try`
+ yyy=`$run ./try`
case "$yyy" in
ok) echo "Your strtoll() seems to be working okay." ;;
*) cat <<EOM >&4
;;
esac
+: see if strtoq exists
+set strtoq d_strtoq
+eval $inlibc
+
: see if strtoul exists
set strtoul d_strtoul
eval $inlibc
+case "$d_strtoul" in
+"$define")
+ $cat <<EOM
+Checking whether your strtoul() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#include <stdio.h>
+extern unsigned long int strtoul(char *s, char **, int);
+static int bad = 0;
+void check(char *s, unsigned long eul, int een) {
+ unsigned long gul;
+ errno = 0;
+ gul = strtoul(s, 0, 10);
+ if (!((gul == eul) && (errno == een)))
+ bad++;
+}
+int main() {
+ check(" 1", 1L, 0);
+ check(" 0", 0L, 0);
+EOCP
+ case "$longsize" in
+ 8)
+ $cat >>try.c <<'EOCP'
+ check("18446744073709551615", 18446744073709551615UL, 0);
+ check("18446744073709551616", 18446744073709551615UL, ERANGE);
+#if 0 /* strtoul() for /^-/ strings is undefined. */
+ check("-1", 18446744073709551615UL, 0);
+ check("-18446744073709551614", 2, 0);
+ check("-18446744073709551615", 1, 0);
+ check("-18446744073709551616", 18446744073709551615UL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615UL, ERANGE);
+#endif
+EOCP
+ ;;
+ 4)
+ $cat >>try.c <<'EOCP'
+ check("4294967295", 4294967295UL, 0);
+ check("4294967296", 4294967295UL, ERANGE);
+#if 0 /* strtoul() for /^-/ strings is undefined. */
+ check("-1", 4294967295UL, 0);
+ check("-4294967294", 2, 0);
+ check("-4294967295", 1, 0);
+ check("-4294967296", 4294967295UL, ERANGE);
+ check("-4294967297", 4294967295UL, ERANGE);
+#endif
+EOCP
+ ;;
+ *)
+: Should we write these tests to be more portable by sprintf-ing
+: ~0 and then manipulating that char string as input for strtol?
+ ;;
+ esac
+ $cat >>try.c <<'EOCP'
+ if (!bad)
+ printf("ok\n");
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`$run ./try`" in
+ ok) echo "Your strtoul() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtoul() doesn't seem to be working okay.
+EOM
+ d_strtoul="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strtoull exists
set strtoull d_strtoull
eval $inlibc
bad++;
}
int main() {
- check(" 1", 1LL, 0);
- check(" 0", 0LL, 0);
- check("18446744073709551615", 18446744073709551615ULL, 0);
- check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check(" 1", 1LL, 0);
+ check(" 0", 0LL, 0);
+ check("18446744073709551615", 18446744073709551615ULL, 0);
+ check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+#if 0 /* strtoull() for /^-/ strings is undefined. */
+ check("-1", 18446744073709551615ULL, 0);
+ check("-18446744073709551614", 2LL, 0);
+ check("-18446744073709551615", 1LL, 0);
+ check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
+#endif
if (!bad)
printf("ok\n");
}
EOCP
set try
if eval $compile; then
- case "`./try`" in
+ case "`$run ./try`" in
ok) echo "Your strtoull() seems to be working okay." ;;
*) cat <<EOM >&4
Your strtoull() doesn't seem to be working okay.
set strtouq d_strtouq
eval $inlibc
+case "$d_strtouq" in
+"$define")
+ $cat <<EOM
+Checking whether your strtouq() works okay...
+EOM
+ $cat >try.c <<'EOCP'
+#include <errno.h>
+#include <stdio.h>
+extern unsigned long long int strtouq(char *s, char **, int);
+static int bad = 0;
+void check(char *s, unsigned long long eull, int een) {
+ unsigned long long gull;
+ errno = 0;
+ gull = strtouq(s, 0, 10);
+ if (!((gull == eull) && (errno == een)))
+ bad++;
+}
+int main() {
+ check(" 1", 1LL, 0);
+ check(" 0", 0LL, 0);
+ check("18446744073709551615", 18446744073709551615ULL, 0);
+ check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+#if 0 /* strtouq() for /^-/ strings is undefined. */
+ check("-1", 18446744073709551615ULL, 0);
+ check("-18446744073709551614", 2LL, 0);
+ check("-18446744073709551615", 1LL, 0);
+ check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
+ check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
+#endif
+ if (!bad)
+ printf("ok\n");
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile; then
+ case "`$run ./try`" in
+ ok) echo "Your strtouq() seems to be working okay." ;;
+ *) cat <<EOM >&4
+Your strtouq() doesn't seem to be working okay.
+EOM
+ d_strtouq="$undef"
+ ;;
+ esac
+ fi
+ ;;
+esac
+
: see if strxfrm exists
set strxfrm d_strxfrm
eval $inlibc
set syscall d_syscall
eval $inlibc
+: see if prototype for syscall is available
+echo " "
+set d_syscallproto syscall $i_unistd unistd.h
+eval $hasproto
+
: see if sysconf exists
set sysconf d_sysconf
eval $inlibc
set tcgetpgrp d_tcgetpgrp
eval $inlibc
-: see if tcsetpgrp exists
-set tcsetpgrp d_tcsetpgrp
-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
+eval $inhdr
+
+: see if times exists
+echo " "
+if set times val -f d_times; eval $csym; $val; then
+ echo 'times() found.' >&4
+ d_times="$define"
+ inc=''
+ case "$i_systimes" in
+ "$define") inc='sys/times.h';;
+ esac
+ rp="What is the type returned by times() on this system?"
+ set clock_t clocktype long stdio.h sys/types.h $inc
+ eval $typedef_ask
+else
+ echo 'times() NOT found, hope that will do.' >&4
+ d_times="$undef"
+ clocktype='int'
+fi
+
+: see if truncate exists
+set truncate d_truncate
+eval $inlibc
+
+: see if tzname[] exists
+echo " "
+if set tzname val -a d_tzname; eval $csym; $val; then
+ val="$define"
+ echo 'tzname[] found.' >&4
+else
+ val="$undef"
+ echo 'tzname[] NOT found.' >&4
+fi
+set d_tzname
+eval $setvar
+
+case "$osname" in
+next|rhapsody|darwin) multiarch="$define" ;;
+esac
+case "$multiarch" in
+''|[nN]*) multiarch="$undef" ;;
+esac
+
+: check for ordering of bytes in a long
+echo " "
+case "$usecrosscompile$multiarch" in
+*$define*)
+ $cat <<EOM
+You seem to be either cross-compiling or doing a multiarchitecture build,
+skipping the byteorder check.
+
+EOM
+ byteorder='ffff'
+ ;;
+*)
+ case "$byteorder" in
+ '')
+ $cat <<'EOM'
+In the following, larger digits indicate more significance. A big-endian
+machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
+little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
+machines may have weird orders like 3412. A Cray will report 87654321,
+an Alpha will report 12345678. If the test program works the default is
+probably right.
+I'm now running the test program...
+EOM
+ $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ int i;
+ union {
+ unsigned long l;
+ char c[sizeof(long)];
+ } u;
+
+ if (sizeof(long) > 4)
+ u.l = (0x08070605L << 32) | 0x04030201L;
+ else
+ u.l = 0x04030201L;
+ for (i = 0; i < sizeof(long); i++)
+ printf("%c", u.c[i]+'0');
+ printf("\n");
+ exit(0);
+}
+EOCP
+ xxx_prompt=y
+ set try
+ if eval $compile && ./try > /dev/null; then
+ dflt=`$run ./try`
+ case "$dflt" in
+ [1-4][1-4][1-4][1-4]|12345678|87654321)
+ echo "(The test program ran ok.)"
+ echo "byteorder=$dflt"
+ xxx_prompt=n
+ ;;
+ ????|????????) echo "(The test program ran ok.)" ;;
+ *) echo "(The test program didn't run right for some reason.)" ;;
+ esac
+ else
+ dflt='4321'
+ cat <<'EOM'
+(I can't seem to compile the test program. Guessing big-endian...)
+EOM
+ fi
+ case "$xxx_prompt" in
+ y)
+ rp="What is the order of bytes in a long?"
+ . ./myread
+ byteorder="$ans"
+ ;;
+ *) byteorder=$dflt
+ ;;
+ esac
+ ;;
+ esac
+ $rm -f try.c try
+ ;;
+esac
+
+
+$cat <<EOM
+
+Checking to see whether you can access character data unalignedly...
+EOM
+$cat >try.c <<EOCP
+#include <stdio.h>
+#define U32 $u32type
+#define BYTEORDER $byteorder
+int main() {
+#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
+ U8 buf[] = "\0\0\0\1\0\0\0\0";
+ U32 *up;
+ int i;
+
+ if (sizeof(U32) != 4) {
+ printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
+ exit(1);
+ }
-: see if prototype for telldir is available
-echo " "
-set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
-eval $hasproto
+ fflush(stdout);
+
+ for (i = 0; i < 4; i++) {
+ up = (U32*)(buf + i);
+ if (! ((*up == 1 << (8*i)) || /* big-endian */
+ (*up == 1 << (8*(3-i))) /* little-endian */
+ )
+ )
+ {
+ printf("read failed (%x)\n", *up);
+ exit(2);
+ }
+ }
-: see if this is a sys/times.h system
-set sys/times.h i_systimes
-eval $inhdr
+ /* write test */
+ for (i = 0; i < 4; i++) {
+ up = (U32*)(buf + i);
+ *up = 0xBeef;
+ if (*up != 0xBeef) {
+ printf("write failed (%x)\n", *up);
+ exit(3);
+ }
+ }
-: see if times exists
-echo " "
-if set times val -f d_times; eval $csym; $val; then
- echo 'times() found.' >&4
- d_times="$define"
- inc=''
- case "$i_systimes" in
- "$define") inc='sys/times.h';;
+ exit(0);
+#else
+ printf("1\n");
+ exit(1);
+#endif
+ return 0;
+}
+EOCP
+set try
+if eval $compile_ok; then
+ echo "(Testing for character data alignment may dump core.)" >&4
+ $run ./try 2>&1 >/dev/null
+ case "$?" in
+ 0) cat >&4 <<EOM
+You can access character data pretty unalignedly.
+EOM
+ d_u32align="$undef"
+ ;;
+ *) cat >&4 <<EOM
+It seems that you must access character data in an aligned manner.
+EOM
+ d_u32align="$define"
+ ;;
esac
- rp="What is the type returned by times() on this system?"
- set clock_t clocktype long stdio.h sys/types.h $inc
- eval $typedef_ask
+ $rm -f core core.try.* try.core
else
- echo 'times() NOT found, hope that will do.' >&4
- d_times="$undef"
- clocktype='int'
+ rp='Can you access character data at unaligned addresses?'
+ dflt='n'
+ . ./myread
+ case "$ans" in
+ [yY]*) d_u32align="$undef" ;;
+ *) d_u32align="$define" ;;
+ esac
fi
-: see if truncate exists
-set truncate d_truncate
+: see if ualarm exists
+set ualarm d_ualarm
eval $inlibc
-: see if tzname[] exists
-echo " "
-if set tzname val -a d_tzname; eval $csym; $val; then
- val="$define"
- echo 'tzname[] found.' >&4
-else
- val="$undef"
- echo 'tzname[] NOT found.' >&4
-fi
-set d_tzname
-eval $setvar
-
: see if umask exists
set umask d_umask
eval $inlibc
+: see if unordered exists
+set unordered d_unordered
+eval $inlibc
+
+: see if usleep exists
+set usleep d_usleep
+eval $inlibc
+
+: see if prototype for usleep is available
+echo " "
+set d_usleepproto usleep $i_unistd unistd.h
+eval $hasproto
+
: see if ustat exists
set ustat d_ustat
eval $inlibc
"$define")
echo " "
echo "Checking whether closedir() returns a status..." >&4
- cat > closedir.c <<EOM
+ cat > try.c <<EOM
#$i_dirent I_DIRENT /**/
#$i_sysdir I_SYS_DIR /**/
#$i_sysndir I_SYS_NDIR /**/
#endif
int main() { return closedir(opendir(".")); }
EOM
- set closedir
+ set try
if eval $compile_ok; then
- if ./closedir > /dev/null 2>&1 ; then
+ if $run ./try > /dev/null 2>&1 ; then
echo "Yes, it does."
val="$undef"
else
esac
set d_void_closedir
eval $setvar
-$rm -f closedir*
-: check for volatile keyword
-echo " "
-echo 'Checking to see if your C compiler knows about "volatile"...' >&4
-$cat >try.c <<'EOCP'
-int main()
-{
- typedef struct _goo_struct goo_struct;
- goo_struct * volatile goo = ((goo_struct *)0);
- struct _goo_struct {
- long long_int;
- int reg_int;
- char char_var;
- };
- typedef unsigned short foo_t;
- char *volatile foo;
- volatile int bar;
- volatile foo_t blech;
- foo = foo;
-}
-EOCP
-if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
- val="$define"
- echo "Yup, it does."
-else
- val="$undef"
- echo "Nope, it doesn't."
-fi
-set d_volatile
-eval $setvar
-$rm -f try.*
-
+$rm -f try try.*
: see if there is a wait4
set wait4 d_wait4
eval $inlibc
set wctomb d_wctomb
eval $inlibc
+: see if writev exists
+set writev d_writev
+eval $inlibc
+
: preserve RCS keywords in files with variable substitution, grrr
Date='$Date'
Id='$Id'
RCSfile='$RCSfile'
Revision='$Revision'
-case "$crosscompile" in
-''|[nN]*) crosscompile="$undef" ;;
-esac
-
-case "$osname" in
-next|rhapsody|darwin) multiarch="$define" ;;
-esac
-case "$multiarch" in
-''|[nN]*) multiarch="$undef" ;;
-esac
-
: check for alignment requirements
echo " "
-case "$crosscompile$multiarch" in
+case "$usecrosscompile$multiarch" in
*$define*)
$cat <<EOM
You seem to be either cross-compiling or doing a multiarchitecture build,
EOCP
set try
if eval $compile_ok; then
- dflt=`./try`
+ dflt=`$run ./try`
else
dflt='8'
echo "(I can't seem to compile the test program...)"
: set the base revision
baserev=5.0
-: check for ordering of bytes in a long
-echo " "
-case "$crosscompile$multiarch" in
-*$define*)
- $cat <<EOM
-You seem to be either cross-compiling or doing a multiarchitecture build,
-skipping the byteorder check.
-
-EOM
- byteorder='0xffff'
- ;;
-*)
- case "$byteorder" in
- '')
- $cat <<'EOM'
-In the following, larger digits indicate more significance. A big-endian
-machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
-little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
-machines may have weird orders like 3412. A Cray will report 87654321,
-an Alpha will report 12345678. If the test program works the default is
-probably right.
-I'm now running the test program...
-EOM
- $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- int i;
- union {
- unsigned long l;
- char c[sizeof(long)];
- } u;
-
- if (sizeof(long) > 4)
- u.l = (0x08070605L << 32) | 0x04030201L;
- else
- u.l = 0x04030201L;
- for (i = 0; i < sizeof(long); i++)
- printf("%c", u.c[i]+'0');
- printf("\n");
- exit(0);
-}
-EOCP
- xxx_prompt=y
- set try
- if eval $compile && ./try > /dev/null; then
- dflt=`./try`
- case "$dflt" in
- [1-4][1-4][1-4][1-4]|12345678|87654321)
- echo "(The test program ran ok.)"
- echo "byteorder=$dflt"
- xxx_prompt=n
- ;;
- ????|????????) echo "(The test program ran ok.)" ;;
- *) echo "(The test program didn't run right for some reason.)" ;;
- esac
- else
- dflt='4321'
- cat <<'EOM'
-(I can't seem to compile the test program. Guessing big-endian...)
-EOM
- fi
- case "$xxx_prompt" in
- y)
- rp="What is the order of bytes in a long?"
- . ./myread
- byteorder="$ans"
- ;;
- *) byteorder=$dflt
- ;;
- esac
- ;;
- esac
- $rm -f try.c try
- ;;
-esac
-
-
: how do we catenate cpp tokens here?
echo " "
echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
#include <sys/types.h>
#include <stdio.h>
#include <db.h>
-int main()
+int main(int argc, char *argv[])
{
#ifdef DB_VERSION_MAJOR /* DB version >= 2 */
int Major, Minor, Patch ;
unsigned long Version ;
(void)db_version(&Major, &Minor, &Patch) ;
- printf("You have Berkeley DB Version 2 or greater\n");
+ if (argc == 2) {
+ printf("%d %d %d %d %d %d\n",
+ DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+ Major, Minor, Patch);
+ exit(0);
+ }
+ printf("You have Berkeley DB Version 2 or greater.\n");
printf("db.h is from Berkeley DB Version %d.%d.%d\n",
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
/* check that db.h & libdb are compatible */
if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
- printf("db.h and libdb are incompatible\n") ;
+ printf("db.h and libdb are incompatible.\n") ;
exit(3);
}
- printf("db.h and libdb are compatible\n") ;
+ printf("db.h and libdb are compatible.\n") ;
Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
+ DB_VERSION_PATCH ;
/* needs to be >= 2.3.4 */
if (Version < 2003004) {
/* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
- printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
+ printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
exit(2);
}
exit(0);
#else
#if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
- printf("You have Berkeley DB Version 1\n");
+ if (argc == 2) {
+ printf("1 0 0\n");
+ exit(0);
+ }
+ printf("You have Berkeley DB Version 1.\n");
exit(0); /* DB version < 2: the coast is clear. */
#else
exit(1); /* <db.h> not Berkeley DB? */
}
EOCP
set try
- if eval $compile_ok && ./try; then
+ if eval $compile_ok && $run ./try; then
echo 'Looks OK.' >&4
+ set `$run ./try 1`
+ db_version_major=$1
+ db_version_minor=$2
+ db_version_patch=$3
else
echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
i_db=$undef
echo "Checking return type needed for prefix for Berkeley DB ..." >&4
cat >try.c <<EOCP
#$d_const HASCONST
-#ifndef HASCONST
-#define const
-#endif
-#include <sys/types.h>
-#include <db.h>
-
-#ifndef DB_VERSION_MAJOR
-size_t prefix_cb (key1, key2)
-const DBT *key1;
-const DBT *key2;
-{
-}
-BTREEINFO info;
-int main()
-{
- info.prefix = prefix_cb;
-}
-#endif
-EOCP
- if $cc $ccflags -c try.c >try.out 2>&1 ; then
- if $contains warning try.out >>/dev/null 2>&1 ; then
- db_prefixtype='int'
- else
- db_prefixtype='size_t'
- fi
- else
- db_prefixtype='size_t'
- : XXX Maybe we should just give up here.
- $cat try.out >&4
- echo "Help: I can't seem to compile the db test program." >&4
- echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
- fi
- $rm -f try.*
- echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
- ;;
-*) db_prefixtype='size_t'
- ;;
-esac
-
-: check for void type
-echo " "
-echo "Checking to see how well your C compiler groks the void type..." >&4
-case "$voidflags" in
-'')
- $cat >try.c <<'EOCP'
-#if TRY & 1
-void sub() {
-#else
-sub() {
-#endif
- extern void moo(); /* function returning void */
- void (*goo)(); /* ptr to func returning void */
-#if TRY & 8
- void *hue; /* generic ptr */
-#endif
-#if TRY & 2
- void (*foo[10])();
-#endif
-
-#if TRY & 4
- if(goo == moo) {
- exit(0);
- }
+#ifndef HASCONST
+#define const
#endif
- exit(0);
+#include <sys/types.h>
+#include <db.h>
+
+#ifndef DB_VERSION_MAJOR
+size_t prefix_cb (key1, key2)
+const DBT *key1;
+const DBT *key2;
+{
}
-int main() { sub(); }
+BTREEINFO info;
+int main()
+{
+ info.prefix = prefix_cb;
+}
+#endif
EOCP
- if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
- voidflags=$defvoidused
- echo "Good. It appears to support void to the level $package wants.">&4
- if $contains warning .out >/dev/null 2>&1; then
- echo "However, you might get some warnings that look like this:"
- $cat .out
- fi
- else
-echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
- if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
- echo "It supports 1..."
- if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
- echo "It also supports 2..."
- if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
- voidflags=7
- echo "And it supports 4 but not 8 definitely."
- else
- echo "It doesn't support 4..."
- if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
- voidflags=11
- echo "But it supports 8."
- else
- voidflags=3
- echo "Neither does it support 8."
- fi
- fi
- else
- echo "It does not support 2..."
- if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
- voidflags=13
- echo "But it supports 4 and 8."
- else
- if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
- voidflags=5
- echo "And it supports 4 but has not heard about 8."
- else
- echo "However it supports 8 but not 4."
- fi
- fi
- fi
+ if $cc $ccflags -c try.c >try.out 2>&1 ; then
+ if $contains warning try.out >>/dev/null 2>&1 ; then
+ db_prefixtype='int'
else
- echo "There is no support at all for void."
- voidflags=0
+ db_prefixtype='size_t'
fi
+ else
+ db_prefixtype='size_t'
+ : XXX Maybe we should just give up here.
+ $cat try.out >&4
+ echo "Help: I can't seem to compile the db test program." >&4
+ echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
fi
-esac
-case "$voidflags" in
-"$defvoidused") ;;
-*) $cat >&4 <<'EOM'
- Support flag bits are:
- 1: basic void declarations.
- 2: arrays of pointers to functions returning void.
- 4: operations between pointers to and addresses of void functions.
- 8: generic void pointers.
-EOM
- dflt="$voidflags";
- rp="Your void support flags add up to what?"
- . ./myread
- voidflags="$ans"
+ $rm -f try.*
+ echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
+ ;;
+*) db_prefixtype='size_t'
;;
esac
-$rm -f try.* .out
: How can we generate normalized random numbers ?
echo " "
echo "Determining whether or not we are on an EBCDIC system..." >&4
-$cat >tebcdic.c <<'EOM'
+$cat >try.c <<'EOM'
int main()
{
if ('M'==0xd4) return 0;
EOM
val=$undef
-set tebcdic
+set try
if eval $compile_ok; then
- if ./tebcdic; then
+ if $run ./try; then
echo "You seem to speak EBCDIC." >&4
val="$define"
else
- echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
+ echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
fi
else
echo "I'm unable to compile the test program." >&4
echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
fi
-$rm -f tebcdic.c tebcdic
+$rm -f try try.*
set ebcdic
eval $setvar
# define STDIO_STREAM_ARRAY $stdio_stream_array
#endif
int main() {
- FILE* p = fopen("try.out", "w");
+ FILE* p;
+ unlink("try.out");
+ p = fopen("try.out", "w");
#ifdef TRY_FPUTC
fputc('x', p);
#else
}
EOCP
: first we have to find out how _not_ to flush
+$to try.c
if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
output=''
set try -DTRY_FPUTC
if eval $compile; then
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- if $test ! -s try.out -a "X$?" = X42; then
+ $run ./try 2>/dev/null
+ code="$?"
+ $from try.out
+ if $test ! -s try.out -a "X$code" = X42; then
output=-DTRY_FPUTC
fi
fi
case "$output" in
'')
set try -DTRY_FPRINTF
- $rm -f try.out
if eval $compile; then
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- if $test ! -s try.out -a "X$?" = X42; then
+ $run ./try 2>/dev/null
+ code="$?"
+ $from try.out
+ if $test ! -s try.out -a "X$code" = X42; then
output=-DTRY_FPRINTF
fi
fi
case "$fflushNULL" in
'') set try -DTRY_FFLUSH_NULL $output
if eval $compile; then
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
+ $run ./try 2>/dev/null
code="$?"
+ $from try.out
if $test -s try.out -a "X$code" = X42; then
fflushNULL="`$cat try.out`"
else
set tryp
if eval $compile; then
$rm -f tryp.out
- $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+ $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
if cmp tryp.c tryp.out >/dev/null 2>&1; then
$cat >&4 <<EOM
fflush(NULL) seems to behave okay with input streams.
set tryp
if eval $compile; then
$rm -f tryp.out
- $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+ $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
if cmp tryp.c tryp.out >/dev/null 2>&1; then
$cat >&4 <<EOM
Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
$cat >&4 <<EOM
(Now testing the other method--but note that this also may fail.)
EOM
- $rm -f try.out
- ./try$exe_ext 2>/dev/null
- if $test -s try.out -a "X$?" = X42; then
+ $run ./try 2>/dev/null
+ code=$?
+ $from try.out
+ if $test -s try.out -a "X$code" = X42; then
fflushall="`$cat try.out`"
fi
fi
EOCP
set try
if eval $compile_ok; then
- yyy=`./try`
+ yyy=`$run ./try`
case "$yyy" in
'') gidsize=4
echo "(I can't execute the test program--guessing $gidsize.)" >&4
EOCP
set try
if eval $compile; then
- yyy=`./try`
+ yyy=`$run ./try`
case "$yyy" in
'') gidsign=1
echo "(I can't execute the test program--guessing unsigned.)" >&4
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
12345678901)
sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
12345678901)
sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
12345678901)
sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
fi
fi
-if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
- $cat >try.c <<'EOCP'
+if $test X"$sPRId64" = X -a X"$quadtype" != X; then
+ $cat >try.c <<EOCP
#include <sys/types.h>
#include <stdio.h>
int main() {
- long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
- printf("%lld\n", q);
+ $quadtype q = 12345678901;
+ printf("%Ld\n", q);
}
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
12345678901)
- sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
- sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
- echo "We will use the %lld style."
+ sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
+ sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
+ echo "We will use %Ld."
;;
esac
fi
fi
-if $test X"$sPRId64" = X -a X"$quadtype" != X; then
- $cat >try.c <<EOCP
+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() {
- $quadtype q = 12345678901;
- printf("%Ld\n", q);
+ long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
+ printf("%lld\n", q);
}
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
12345678901)
- sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
- sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
- echo "We will use %Ld."
+ sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
+ sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
+ echo "We will use the %lld style."
;;
esac
fi
EOCP
set try
if eval $compile; then
- yyy=`./try$exe_ext`
+ yyy=`$run ./try`
case "$yyy" in
12345678901)
sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
*maketemp=*) make_set_make='#' ;;
*) make_set_make="MAKE=$make" ;;
esac
- $rm -f testmake.mak
+ $rm -f testmake.mak
+ ;;
+esac
+case "$make_set_make" in
+'#') echo "Yup, it does.";;
+*) echo "Nope, it doesn't.";;
+esac
+
+: see what type is used for mode_t
+rp="What is the type used for file modes for system calls (e.g. fchmod())?"
+set mode_t modetype int stdio.h sys/types.h
+eval $typedef_ask
+
+: see if stdarg is available
+echo " "
+if $test `./findhdr stdarg.h`; then
+ echo "<stdarg.h> found." >&4
+ valstd="$define"
+else
+ echo "<stdarg.h> NOT found." >&4
+ valstd="$undef"
+fi
+
+: see if varags is available
+echo " "
+if $test `./findhdr varargs.h`; then
+ echo "<varargs.h> found." >&4
+else
+ echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
+fi
+
+: set up the varargs testing programs
+$cat > varargs.c <<EOP
+#ifdef I_STDARG
+#include <stdarg.h>
+#endif
+#ifdef I_VARARGS
+#include <varargs.h>
+#endif
+
+#ifdef I_STDARG
+int f(char *p, ...)
+#else
+int f(va_alist)
+va_dcl
+#endif
+{
+ va_list ap;
+#ifndef I_STDARG
+ char *p;
+#endif
+#ifdef I_STDARG
+ va_start(ap,p);
+#else
+ va_start(ap);
+ p = va_arg(ap, char *);
+#endif
+ va_end(ap);
+}
+EOP
+$cat > varargs <<EOP
+$startsh
+if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
+ echo "true"
+else
+ echo "false"
+fi
+$rm -f varargs$_o
+EOP
+chmod +x varargs
+
+: now check which varargs header should be included
+echo " "
+i_varhdr=''
+case "$valstd" in
+"$define")
+ if `./varargs I_STDARG`; then
+ val='stdarg.h'
+ elif `./varargs I_VARARGS`; then
+ val='varargs.h'
+ fi
+ ;;
+*)
+ if `./varargs I_VARARGS`; then
+ val='varargs.h'
+ fi
+ ;;
+esac
+case "$val" in
+'')
+echo "I could not find the definition for va_dcl... You have problems..." >&4
+ val="$undef"; set i_stdarg; eval $setvar
+ val="$undef"; set i_varargs; eval $setvar
+ ;;
+*)
+ set i_varhdr
+ eval $setvar
+ case "$i_varhdr" in
+ stdarg.h)
+ val="$define"; set i_stdarg; eval $setvar
+ val="$undef"; set i_varargs; eval $setvar
+ ;;
+ varargs.h)
+ val="$undef"; set i_stdarg; eval $setvar
+ val="$define"; set i_varargs; eval $setvar
+ ;;
+ esac
+ echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
+esac
+$rm -f varargs*
+
+: see if we need va_copy
+echo " "
+case "$i_stdarg" in
+"$define")
+ $cat >try.c <<EOCP
+#include <stdarg.h>
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#include <signal.h>
+
+int
+ivfprintf(FILE *f, const char *fmt, va_list *valp)
+{
+ return vfprintf(f, fmt, *valp);
+}
+
+int
+myvfprintf(FILE *f, const char *fmt, va_list val)
+{
+ return ivfprintf(f, fmt, &val);
+}
+
+int
+myprintf(char *fmt, ...)
+{
+ va_list val;
+ va_start(val, fmt);
+ return myvfprintf(stdout, fmt, val);
+}
+
+int
+main(int ac, char **av)
+{
+ signal(SIGSEGV, exit);
+
+ myprintf("%s%cs all right, then\n", "that", '\'');
+ exit(0);
+}
+EOCP
+ set try
+ if eval $compile && $run ./try 2>&1 >/dev/null; then
+ case "`$run ./try`" in
+ "that's all right, then")
+ okay=yes
+ ;;
+ esac
+ fi
+ case "$okay" in
+ yes) echo "It seems that you don't need va_copy()." >&4
+ need_va_copy="$undef"
+ ;;
+ *) echo "It seems that va_copy() or similar will be needed." >&4
+ need_va_copy="$define"
+ ;;
+ esac
+ $rm -f try.* core core.* *.core *.core.*
+ ;;
+*) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
;;
esac
-case "$make_set_make" in
-'#') echo "Yup, it does.";;
-*) echo "Nope, it doesn't.";;
-esac
-
-: see what type is used for mode_t
-rp="What is the type used for file modes for system calls (e.g. fchmod())?"
-set mode_t modetype int stdio.h sys/types.h
-eval $typedef_ask
: define a fucntion to check prototypes
$cat > protochk <<EOSH
: The versioned directories started at 5.005.
pm_apiversion='5.005'
-: check for length of pointer
-echo " "
-case "$ptrsize" in
-'')
- echo "Checking to see how big your pointers are..." >&4
- if test "$voidflags" -gt 7; then
- echo '#define VOID_PTR char *' > try.c
- else
- echo '#define VOID_PTR void *' > try.c
- fi
- $cat >>try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("%d\n", (int)sizeof(VOID_PTR));
- exit(0);
-}
-EOCP
- set try
- if eval $compile_ok; then
- ptrsize=`./try`
- echo "Your pointers are $ptrsize bytes long."
- else
- dflt='4'
- echo "(I can't seem to compile the test program. Guessing...)" >&4
- rp="What is the size of a pointer (in bytes)?"
- . ./myread
- ptrsize="$ans"
- fi
- ;;
-esac
-$rm -f try.c try
-
: see if ar generates random libraries by itself
echo " "
echo "Checking how to generate random libraries on your machine..." >&4
$cc $ccflags -c bar2.c >/dev/null 2>&1
$cc $ccflags -c foo.c >/dev/null 2>&1
$ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
-if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
- ./foobar >/dev/null 2>&1; then
+if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
+ $run ./foobar >/dev/null 2>&1; then
echo "$ar appears to generate random libraries itself."
orderlib=false
ranlib=":"
elif $ar ts bar$_a >/dev/null 2>&1 &&
- $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
- ./foobar >/dev/null 2>&1; then
+ $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
+ $run ./foobar >/dev/null 2>&1; then
echo "a table of contents needs to be added with '$ar ts'."
orderlib=false
ranlib="$ar ts"
EOCP
set try
if eval $compile_ok; then
- selectminbits=`./try`
+ selectminbits=`$run ./try`
case "$selectminbits" in
'') cat >&4 <<EOM
Cannot figure out on how many bits at a time your select() operates.
xxx=`echo '#include <signal.h>' |
$cppstdin $cppminus $cppflags 2>/dev/null |
$grep '^[ ]*#.*include' |
- $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
+ $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
fi
: Check this list of files to be sure we have parsed the cpp output ok.
: This will also avoid potentially non-existent files, such
set signal
if eval $compile_ok; then
- ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
+ $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
else
echo "(I can't seem be able to compile the whole test program)" >&4
echo "(I'll try it in little pieces.)" >&4
set signal -DJUST_NSIG
if eval $compile_ok; then
- ./signal$_exe > signal.nsg
+ $run ./signal$_exe > signal.nsg
$cat signal.nsg
else
echo "I can't seem to figure out how many signals you have." >&4
set signal
if eval $compile; then
echo "SIG${xx} found."
- ./signal$_exe >> signal.ls1
+ $run ./signal$_exe >> signal.ls1
else
echo "SIG${xx} NOT found."
fi
}
printf "\n"
}'
+sig_size=`echo $sig_name | awk '{print NF}'`
$rm -f signal signal.c signal.awk signal.lst signal_cmd
echo " "
EOCP
set try
if eval $compile_ok; then
- yyy=`./try`
+ yyy=`$run ./try`
case "$yyy" in
'') sizesize=4
echo "(I can't execute the test program--guessing $sizesize.)" >&4
set d_socklen_t
eval $setvar
+: see if this is a socks.h system
+set socks.h i_socks
+eval $inhdr
+
: check for type of the size argument to socket calls
case "$d_socket" in
"$define")
Checking to see what type is the last argument of accept().
EOM
- hdrs="$define sys/types.h $d_socket sys/socket.h"
yyy=''
case "$d_socklen_t" in
"$define") yyy="$yyy socklen_t"
for xxx in $yyy; do
case "$socksizetype" in
'') try="extern int accept(int, struct sockaddr *, $xxx *);"
- if ./protochk "$try" $hdrs; then
- echo "Your system accepts '$xxx *' for the last argument of accept()."
- socksizetype="$xxx"
- fi
+ case "$usesocks" in
+ "$define")
+ if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
+ echo "Your system accepts '$xxx *' for the last argument of accept()."
+ socksizetype="$xxx"
+ fi
+ ;;
+ *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
+ echo "Your system accepts '$xxx *' for the last argument of accept()."
+ socksizetype="$xxx"
+ fi
+ ;;
+ esac
;;
esac
done
set ssize_t ssizetype int stdio.h sys/types.h
eval $typedef
dflt="$ssizetype"
-$cat > ssize.c <<EOM
+$cat > try.c <<EOM
#include <stdio.h>
#include <sys/types.h>
#define Size_t $sizetype
}
EOM
echo " "
-set ssize
-if eval $compile_ok && ./ssize > /dev/null; then
- ssizetype=`./ssize`
+set try
+if eval $compile_ok && $run ./try > /dev/null; then
+ ssizetype=`$run ./try`
echo "I'll be using $ssizetype for functions returning a byte count." >&4
else
$cat >&4 <<EOM
. ./myread
ssizetype="$ans"
fi
-$rm -f ssize ssize.*
+$rm -f try try.*
: see what type of char stdio uses.
echo " "
-if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
+if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
echo "Your stdio uses unsigned chars." >&4
stdchar="unsigned char"
else
echo "Your stdio uses signed chars." >&4
stdchar="char"
fi
+$rm -f stdioh
+
+
: see if time exists
echo " "
EOCP
set try
if eval $compile_ok; then
- yyy=`./try`
+ yyy=`$run ./try`
case "$yyy" in
'') uidsize=4
echo "(I can't execute the test program--guessing $uidsize.)" >&4
EOCP
set try
if eval $compile; then
- yyy=`./try`
+ yyy=`$run ./try`
case "$yyy" in
'') uidsign=1
echo "(I can't execute the test program--guessing unsigned.)" >&4
;;
esac
-: see if dbm.h is available
-: see if dbmclose exists
-set dbmclose d_dbmclose
-eval $inlibc
-
-case "$d_dbmclose" in
-$define)
- set dbm.h i_dbm
- eval $inhdr
- case "$i_dbm" in
- $define)
- val="$undef"
- set i_rpcsvcdbm
- eval $setvar
- ;;
- *) set rpcsvc/dbm.h i_rpcsvcdbm
- eval $inhdr
+: determine compiler compiler
+case "$yacc" in
+'')
+ dflt=yacc;;
+*)
+ dflt="$yacc";;
+esac
+echo " "
+comp='yacc'
+if $test -f "$byacc"; then
+ dflt="$byacc"
+ comp="byacc or $comp"
+fi
+if $test -f "$bison"; then
+ comp="$comp or bison -y"
+fi
+rp="Which compiler compiler ($comp) shall I use?"
+. ./myread
+yacc="$ans"
+case "$yacc" in
+*bis*)
+ case "$yacc" in
+ *-y*) ;;
+ *)
+ yacc="$yacc -y"
+ echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
;;
esac
;;
-*) echo "We won't be including <dbm.h>"
- val="$undef"
- set i_dbm
- eval $setvar
- val="$undef"
- set i_rpcsvcdbm
- eval $setvar
- ;;
esac
-: see if this is a sys/file.h system
-val=''
-set sys/file.h val
-eval $inhdr
-
-: do we need to include sys/file.h ?
-case "$val" in
-"$define")
- echo " "
- if $h_sysfile; then
- val="$define"
- echo "We'll be including <sys/file.h>." >&4
- else
- val="$undef"
- echo "We won't be including <sys/file.h>." >&4
- fi
- ;;
-*)
- h_sysfile=false
- ;;
-esac
-set i_sysfile
-eval $setvar
-
: see if fcntl.h is there
val=''
set fcntl.h val
set i_fcntl
eval $setvar
-: see if this is a iconv.h system
-set iconv.h i_iconv
+: see if this is a fp.h system
+set fp.h i_fp
+eval $inhdr
+
+: see if this is a fp_class.h system
+set fp_class.h i_fp_class
eval $inhdr
: see if this is a ieeefp.h system
$cat <<'EOSH' > Cppsym.know
a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
-alliant alpha am29000 AM29000 amiga AMIGAOS AMIX
-ansi ANSI_C_SOURCE apollo ardent atarist att386 att3b BeOS
-BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
+alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
+ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
+BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
bull c cadmus clipper CMU COFF COMPILER_VERSION
concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
-Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
-FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
-GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
+Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
+FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
+GLIBC GLIBC_MINOR
+GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
H3050R H3050RX hbullx20 hcx host_mips
hp200 hp300 hp700 HP700 hp800 hp9000
hp9000s200 hp9000s300 hp9000s400 hp9000s500
hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
-iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
+IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
NetBSD news1500 news1700 news1800 news1900 news3700
-news700 news800 news900 NeXT NLS ns16000 ns32000
+news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
ns32016 ns32332 ns32k nsc32000
OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
POSIX_C_SOURCE POSIX_SOURCE POWER
PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
-riscix riscos RT scs SCO sequent sgi SGI_SOURCE sinix
+riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
sony sony_news sonyrisc sparc sparclite spectrum
stardent stdc STDC_EXT stratos sun sun3 sun386
SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
sysV68 sysV88 Tek4132 Tek4300 titan
+TM3200 TM5400 TM5600
tower tower32 tower32_200 tower32_600 tower32_700
tower32_800 tower32_850 tss
u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
-unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
+unix UNIX95 UNIX99 unixpc unos
+USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
+USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
+USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
+USGr4 USGr4_2
Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
$cat Cppsym.know > Cppsym.c
-$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know
+$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
$rm -f Cppsym.a Cppsym.b Cppsym.c
cat <<EOSH > Cppsym
$startsh
EOSH
cat <<'EOSH' >> Cppsym.try
'length($1) > 0 {
- printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
- printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
- printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
- printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
+ printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
+ printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
+ printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
+ printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
}' >> try.c
-echo '}' >> try.c
+echo 'return 0;}' >> try.c
EOSH
cat <<EOSH >> Cppsym.try
ccflags="$ccflags"
irix-) ccflags="\$ccflags -woff 1178" ;;
os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
esac
-$cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
+$cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
EOSH
chmod +x Cppsym.try
$eunicefix Cppsym.try
$test "$silent" || sleep 1
fi
fi
-$rm -f ccsym* Cppsym.*
: see if this is a termio system
val="$undef"
set shadow.h i_shadow
eval $inhdr
-: see if this is a socks.h system
-set socks.h i_socks
-eval $inhdr
-
-: see if stdarg is available
-echo " "
-if $test `./findhdr stdarg.h`; then
- echo "<stdarg.h> found." >&4
- valstd="$define"
-else
- echo "<stdarg.h> NOT found." >&4
- valstd="$undef"
-fi
-
-: see if varags is available
-echo " "
-if $test `./findhdr varargs.h`; then
- echo "<varargs.h> found." >&4
-else
- echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
-fi
-
-: set up the varargs testing programs
-$cat > varargs.c <<EOP
-#ifdef I_STDARG
-#include <stdarg.h>
-#endif
-#ifdef I_VARARGS
-#include <varargs.h>
-#endif
-
-#ifdef I_STDARG
-int f(char *p, ...)
-#else
-int f(va_alist)
-va_dcl
-#endif
-{
- va_list ap;
-#ifndef I_STDARG
- char *p;
-#endif
-#ifdef I_STDARG
- va_start(ap,p);
-#else
- va_start(ap);
- p = va_arg(ap, char *);
-#endif
- va_end(ap);
-}
-EOP
-$cat > varargs <<EOP
-$startsh
-if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
- echo "true"
-else
- echo "false"
-fi
-$rm -f varargs$_o
-EOP
-chmod +x varargs
-
-: now check which varargs header should be included
-echo " "
-i_varhdr=''
-case "$valstd" in
-"$define")
- if `./varargs I_STDARG`; then
- val='stdarg.h'
- elif `./varargs I_VARARGS`; then
- val='varargs.h'
- fi
- ;;
-*)
- if `./varargs I_VARARGS`; then
- val='varargs.h'
- fi
- ;;
-esac
-case "$val" in
-'')
-echo "I could not find the definition for va_dcl... You have problems..." >&4
- val="$undef"; set i_stdarg; eval $setvar
- val="$undef"; set i_varargs; eval $setvar
- ;;
-*)
- set i_varhdr
- eval $setvar
- case "$i_varhdr" in
- stdarg.h)
- val="$define"; set i_stdarg; eval $setvar
- val="$undef"; set i_varargs; eval $setvar
- ;;
- varargs.h)
- val="$undef"; set i_stdarg; eval $setvar
- val="$define"; set i_varargs; eval $setvar
- ;;
- esac
- echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
-esac
-$rm -f varargs*
-
: see if stddef is available
set stddef.h i_stddef
eval $inhdr
set i_sysioctl
eval $setvar
+: see if socket ioctl defs are in sys/sockio.h
+echo " "
+xxx=`./findhdr sys/sockio.h`
+if $test "$xxx"; then
+ if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
+ val="$define"
+ echo "You have socket ioctls defined in <sys/sockio.h>." >&4
+ else
+ val="$undef"
+ echo "No socket ioctls found in <sys/sockio.h>." >&4
+ fi
+else
+ val="$undef"
+ $cat <<EOM
+<sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
+EOM
+fi
+set i_syssockio
+eval $setvar
+
: see if this is a syslog.h system
set syslog.h i_syslog
set sys/statvfs.h i_sysstatvfs
eval $inhdr
-: see if this is a sys/uio.h system
-set sys/uio.h i_sysuio
-eval $inhdr
-
: see if this is a sys/un.h system
set sys/un.h i_sysun
eval $inhdr
$define) avail_ext="$avail_ext $xxx" ;;
esac
;;
+ I18N/Langinfo|i18n_lan)
+ case "$i_langinfo$d_nl_langinfo" in
+ $define$define) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
NDBM_File|ndbm_fil)
case "$i_ndbm" in
$define)
case "$osname-$use64bitint" in
- hpux-define)
+ cygwin-*|hpux-define)
case "$libs" in
*-lndbm*) avail_ext="$avail_ext $xxx" ;;
esac
case "${i_dbm}${i_rpcsvcdbm}" in
*"${define}"*)
case "$osname-$use64bitint" in
- hpux-define)
+ cygwin-*|hpux-define)
case "$libs" in
*-ldbm*) avail_ext="$avail_ext $xxx" ;;
esac
esac
;;
Thread|thread)
- case "$usethreads" in
- true|$define|y) avail_ext="$avail_ext $xxx" ;;
+ case "$usethreads" in
+ true|$define|y)
+ case "$useithreads" in
+ $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
+ esac
+ esac
+ ;;
+ threads)
+ case "$usethreads" in
+ true|$define|y)
+ case "$useithreads" in
+ $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
+ esac
esac
;;
IPC/SysV|ipc/sysv)
: Remove libraries needed only for extensions
: The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
-case "$usedl" in
-$define|true|[yY]*)
- set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
- shift
- perllibs="$*"
- ;;
-*) perllibs="$libs"
- ;;
+: The exception is SunOS 4.x, which needs them.
+case "${osname}X${osvers}" in
+sunos*X4*)
+ perllibs="$libs"
+ ;;
+*) case "$usedl" in
+ $define|true|[yY]*)
+ set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
+ shift
+ perllibs="$*"
+ ;;
+ *) perllibs="$libs"
+ ;;
+ esac
+ ;;
esac
: Remove build directory name from cppstdin so it can be used from
_exe='$_exe'
_o='$_o'
afs='$afs'
+afsroot='$afsroot'
alignbytes='$alignbytes'
ansi2knr='$ansi2knr'
aphostname='$aphostname'
cpprun='$cpprun'
cppstdin='$cppstdin'
cppsymbols='$cppsymbols'
-crosscompile='$crosscompile'
cryptlib='$cryptlib'
csh='$csh'
d_Gconvert='$d_Gconvert'
d_PRIu64='$d_PRIu64'
d_PRIx64='$d_PRIx64'
d_SCNfldbl='$d_SCNfldbl'
+d__fwalk='$d__fwalk'
d_access='$d_access'
d_accessx='$d_accessx'
d_alarm='$d_alarm'
d_chown='$d_chown'
d_chroot='$d_chroot'
d_chsize='$d_chsize'
+d_class='$d_class'
d_closedir='$d_closedir'
+d_cmsghdr_s='$d_cmsghdr_s'
d_const='$d_const'
d_crypt='$d_crypt'
d_csh='$d_csh'
d_cuserid='$d_cuserid'
d_dbl_dig='$d_dbl_dig'
+d_dbminitproto='$d_dbminitproto'
d_difftime='$d_difftime'
d_dirnamlen='$d_dirnamlen'
d_dlerror='$d_dlerror'
d_endsent='$d_endsent'
d_eofnblk='$d_eofnblk'
d_eunice='$d_eunice'
+d_fchdir='$d_fchdir'
d_fchmod='$d_fchmod'
d_fchown='$d_fchown'
d_fcntl='$d_fcntl'
+d_fcntl_can_lock='$d_fcntl_can_lock'
d_fd_macros='$d_fd_macros'
d_fd_set='$d_fd_set'
d_fds_bits='$d_fds_bits'
d_fgetpos='$d_fgetpos'
+d_finite='$d_finite'
+d_finitel='$d_finitel'
d_flexfnam='$d_flexfnam'
d_flock='$d_flock'
+d_flockproto='$d_flockproto'
d_fork='$d_fork'
+d_fp_class='$d_fp_class'
d_fpathconf='$d_fpathconf'
+d_fpclass='$d_fpclass'
+d_fpclassify='$d_fpclassify'
+d_fpclassl='$d_fpclassl'
d_fpos64_t='$d_fpos64_t'
d_frexpl='$d_frexpl'
d_fs_data_s='$d_fs_data_s'
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_getcwd='$d_getcwd'
d_gethent='$d_gethent'
d_gethname='$d_gethname'
d_gethostprotos='$d_gethostprotos'
+d_getitimer='$d_getitimer'
d_getlogin='$d_getlogin'
d_getmnt='$d_getmnt'
d_getmntent='$d_getmntent'
d_getnbyname='$d_getnbyname'
d_getnent='$d_getnent'
d_getnetprotos='$d_getnetprotos'
+d_getpagsz='$d_getpagsz'
d_getpbyname='$d_getpbyname'
d_getpbynumber='$d_getpbynumber'
d_getpent='$d_getpent'
d_grpasswd='$d_grpasswd'
d_hasmntopt='$d_hasmntopt'
d_htonl='$d_htonl'
-d_iconv='$d_iconv'
d_index='$d_index'
d_inetaton='$d_inetaton'
d_int64_t='$d_int64_t'
d_isascii='$d_isascii'
+d_isfinite='$d_isfinite'
+d_isinf='$d_isinf'
d_isnan='$d_isnan'
d_isnanl='$d_isnanl'
d_killpg='$d_killpg'
d_mktime='$d_mktime'
d_mmap='$d_mmap'
d_modfl='$d_modfl'
+d_modfl_pow32_bug='$d_modfl_pow32_bug'
d_mprotect='$d_mprotect'
d_msg='$d_msg'
d_msg_ctrunc='$d_msg_ctrunc'
d_msg_proxy='$d_msg_proxy'
d_msgctl='$d_msgctl'
d_msgget='$d_msgget'
+d_msghdr_s='$d_msghdr_s'
d_msgrcv='$d_msgrcv'
d_msgsnd='$d_msgsnd'
d_msync='$d_msync'
d_munmap='$d_munmap'
d_mymalloc='$d_mymalloc'
d_nice='$d_nice'
+d_nl_langinfo='$d_nl_langinfo'
d_nv_preserves_uv='$d_nv_preserves_uv'
d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
d_off64_t='$d_off64_t'
d_pipe='$d_pipe'
d_poll='$d_poll'
d_portable='$d_portable'
+d_pthread_atfork='$d_pthread_atfork'
d_pthread_yield='$d_pthread_yield'
d_pwage='$d_pwage'
d_pwchange='$d_pwchange'
d_quad='$d_quad'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
+d_readv='$d_readv'
+d_recvmsg='$d_recvmsg'
d_rename='$d_rename'
d_rewinddir='$d_rewinddir'
d_rmdir='$d_rmdir'
d_safebcpy='$d_safebcpy'
d_safemcpy='$d_safemcpy'
d_sanemcmp='$d_sanemcmp'
+d_sbrkproto='$d_sbrkproto'
d_sched_yield='$d_sched_yield'
d_scm_rights='$d_scm_rights'
d_seekdir='$d_seekdir'
d_semctl_semun='$d_semctl_semun'
d_semget='$d_semget'
d_semop='$d_semop'
+d_sendmsg='$d_sendmsg'
d_setegid='$d_setegid'
d_seteuid='$d_seteuid'
d_setgrent='$d_setgrent'
d_setgrps='$d_setgrps'
d_sethent='$d_sethent'
+d_setitimer='$d_setitimer'
d_setlinebuf='$d_setlinebuf'
d_setlocale='$d_setlocale'
d_setnent='$d_setnent'
d_shmdt='$d_shmdt'
d_shmget='$d_shmget'
d_sigaction='$d_sigaction'
+d_sigprocmask='$d_sigprocmask'
d_sigsetjmp='$d_sigsetjmp'
+d_sockatmark='$d_sockatmark'
+d_sockatmarkproto='$d_sockatmarkproto'
d_socket='$d_socket'
d_socklen_t='$d_socklen_t'
d_sockpair='$d_sockpair'
d_socks5_init='$d_socks5_init'
d_sqrtl='$d_sqrtl'
+d_sresgproto='$d_sresgproto'
+d_sresuproto='$d_sresuproto'
d_statblks='$d_statblks'
d_statfs_f_flags='$d_statfs_f_flags'
d_statfs_s='$d_statfs_s'
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_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
d_stdio_stream_array='$d_stdio_stream_array'
d_stdiobase='$d_stdiobase'
d_stdstdio='$d_stdstdio'
d_strctcpy='$d_strctcpy'
d_strerrm='$d_strerrm'
d_strerror='$d_strerror'
+d_strftime='$d_strftime'
d_strtod='$d_strtod'
d_strtol='$d_strtol'
d_strtold='$d_strtold'
d_strtoll='$d_strtoll'
+d_strtoq='$d_strtoq'
d_strtoul='$d_strtoul'
d_strtoull='$d_strtoull'
d_strtouq='$d_strtouq'
d_suidsafe='$d_suidsafe'
d_symlink='$d_symlink'
d_syscall='$d_syscall'
+d_syscallproto='$d_syscallproto'
d_sysconf='$d_sysconf'
d_sysernlst='$d_sysernlst'
d_syserrlst='$d_syserrlst'
d_times='$d_times'
d_truncate='$d_truncate'
d_tzname='$d_tzname'
+d_u32align='$d_u32align'
+d_ualarm='$d_ualarm'
d_umask='$d_umask'
d_uname='$d_uname'
d_union_semun='$d_union_semun'
+d_unordered='$d_unordered'
+d_usleep='$d_usleep'
+d_usleepproto='$d_usleepproto'
d_ustat='$d_ustat'
d_vendorarch='$d_vendorarch'
d_vendorbin='$d_vendorbin'
d_waitpid='$d_waitpid'
d_wcstombs='$d_wcstombs'
d_wctomb='$d_wctomb'
+d_writev='$d_writev'
d_xenix='$d_xenix'
date='$date'
db_hashtype='$db_hashtype'
db_prefixtype='$db_prefixtype'
+db_version_major='$db_version_major'
+db_version_minor='$db_version_minor'
+db_version_patch='$db_version_patch'
defvoidused='$defvoidused'
direntrytype='$direntrytype'
dlext='$dlext'
exe_ext='$exe_ext'
expr='$expr'
extensions='$extensions'
+extras='$extras'
fflushNULL='$fflushNULL'
fflushall='$fflushall'
find='$find'
fpossize='$fpossize'
fpostype='$fpostype'
freetype='$freetype'
+from='$from'
full_ar='$full_ar'
full_csh='$full_csh'
full_sed='$full_sed'
i_dlfcn='$i_dlfcn'
i_fcntl='$i_fcntl'
i_float='$i_float'
+i_fp='$i_fp'
+i_fp_class='$i_fp_class'
i_gdbm='$i_gdbm'
i_grp='$i_grp'
-i_iconv='$i_iconv'
i_ieeefp='$i_ieeefp'
i_inttypes='$i_inttypes'
+i_langinfo='$i_langinfo'
i_libutil='$i_libutil'
i_limits='$i_limits'
i_locale='$i_locale'
installprefixexp='$installprefixexp'
installprivlib='$installprivlib'
installscript='$installscript'
-installscripts='$installscripts'
installsitearch='$installsitearch'
installsitebin='$installsitebin'
installsitelib='$installsitelib'
installvendorbin='$installvendorbin'
installvendorlib='$installvendorlib'
intsize='$intsize'
+issymlink='$issymlink'
ivdformat='$ivdformat'
ivsize='$ivsize'
ivtype='$ivtype'
myhostname='$myhostname'
myuname='$myuname'
n='$n'
+need_va_copy='$need_va_copy'
netdb_hlen_type='$netdb_hlen_type'
netdb_host_type='$netdb_host_type'
netdb_name_type='$netdb_name_type'
path_sep='$path_sep'
perl5='$perl5'
perl='$perl'
+perl_patchlevel='$perl_patchlevel'
perladmin='$perladmin'
perllibs='$perllibs'
perlpath='$perlpath'
revision='$revision'
rm='$rm'
rmail='$rmail'
+run='$run'
runnm='$runnm'
sPRIEUldbl='$sPRIEUldbl'
sPRIFUldbl='$sPRIFUldbl'
sig_name_init='$sig_name_init'
sig_num='$sig_num'
sig_num_init='$sig_num_init'
+sig_size='$sig_size'
signal_t='$signal_t'
sitearch='$sitearch'
sitearchexp='$sitearchexp'
sysman='$sysman'
tail='$tail'
tar='$tar'
+targetarch='$targetarch'
tbl='$tbl'
tee='$tee'
test='$test'
timeincl='$timeincl'
timetype='$timetype'
+to='$to'
touch='$touch'
tr='$tr'
trnl='$trnl'
use5005threads='$use5005threads'
use64bitall='$use64bitall'
use64bitint='$use64bitint'
+usecrosscompile='$usecrosscompile'
usedl='$usedl'
useithreads='$useithreads'
uselargefiles='$uselargefiles'
useopcode='$useopcode'
useperlio='$useperlio'
useposix='$useposix'
+usereentrant='$usereentrant'
usesfio='$usesfio'
useshrplib='$useshrplib'
usesocks='$usesocks'
vendorprefix='$vendorprefix'
vendorprefixexp='$vendorprefixexp'
version='$version'
+version_patchlevel_string='$version_patchlevel_string'
+versiononly='$versiononly'
vi='$vi'
voidflags='$voidflags'
xlibpth='$xlibpth'
xs_apiversion='$xs_apiversion'
+yacc='$yacc'
+yaccflags='$yaccflags'
zcat='$zcat'
zip='$zip'
EOT
: add special variables
$test -f $src/patchlevel.h && \
awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
-echo "CONFIGDOTSH=true" >>config.sh
+echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
+echo "PERL_CONFIG_SH=true" >>config.sh
: propagate old symbols
if $test -f UU/config.sh; then
- <UU/config.sh sort | uniq >UU/oldconfig.sh
+ <UU/config.sh $sort | $uniq >UU/oldconfig.sh
sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
- sort | uniq -u >UU/oldsyms
+ $sort | $uniq -u >UU/oldsyms
set X `cat UU/oldsyms`
shift
case $# in
case "$alldone" in
exit)
$rm -rf UU
- echo "Done."
+ echo "Extraction done."
exit 0
;;
cont)
echo " "
exec 1>&4
+pwd=`pwd`
. ./UU/extract
+cd $pwd
if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
dflt=y
echo " "
echo "Now you must run a $make."
else
- echo "Done."
+ echo "Configure done."
fi
if $test -f Policy.sh; then