# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Thu May 28 12:01:39 EDT 1998 [metaconfig 3.0 PL70]
+# Generated on Tue Jul 7 10:10:21 EDT 1998 [metaconfig 3.0 PL70]
+# (with additional metaconfig patches by doughera@lafayette.edu)
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
;;
esac
+: the newline for tr
+if test X"$trnl" = X; then
+ case "`echo foo|tr '\n' x 2>/dev/null`" in
+ foox)
+ trnl='\n'
+ ;;
+ esac
+fi
+if test X"$trnl" = X; then
+ case "`echo foo|tr '\012' x 2>/dev/null`" in
+ foox)
+ trnl='\012'
+ ;;
+ esac
+fi
+if test -n "$DJGPP"; then
+ trnl='\012'
+fi
+if test X"$trnl" = X; then
+ cat <<EOM >&2
+
+$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
+
+EOM
+ exit 1
+fi
+
: Proper separator for the PATH environment variable
p_=:
: On OS/2 this directory should exist if this is not floppy only system :-]
;;
esac
+: if needed set CDPATH to a harmless value that is not chatty
+: avoid bash 2.02 problems with empty CDPATH.
+case "$CDPATH" in
+'') ;;
+*) case "$SHELL" in
+ *bash*) CDPATH='.' ;;
+ *) CDPATH='' ;;
+ esac
+ ;;
+esac
: Configure runs within the UU subdirectory
test -d UU || mkdir UU
-CDPATH=''
cd UU && rm -f ./*
dynamic_ext=''
extensions=''
known_extensions=''
+nonxs_ext=''
static_ext=''
useopcode=''
useposix=''
d_getsbyname=''
d_getsbyport=''
d_gnulibc=''
+i_arpainet=''
d_htonl=''
d_inetaton=''
d_isascii=''
d_memset=''
d_mkdir=''
d_mkfifo=''
-d_mkstemp=''
d_mktime=''
d_msg=''
d_msgctl=''
i_fcntl=''
i_float=''
i_gdbm=''
+d_grpasswd=''
+d_setgrent=''
+d_getgrent=''
+d_endgrent=''
i_grp=''
i_limits=''
i_locale=''
d_pwcomment=''
d_pwexpire=''
d_pwgecos=''
+d_pwpasswd=''
d_pwquota=''
+d_setpwent=''
+d_getpwent=''
+d_endpwent=''
i_pwd=''
i_sfio=''
i_stddef=''
package=''
spackage=''
pager=''
+apiversion=''
patchlevel=''
subversion=''
+version=''
perladmin=''
perlpath=''
pidtype=''
usrinc=''
defvoidused=''
voidflags=''
+ebcdic=''
CONFIG=''
define='define'
al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
al="$al VMS Xenix286"
-al="$al _AIX _AIX32 _AIX370 _AM29000 _COFF _CRAY _CX_UX _EPI"
+al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI _POWER"
al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
: default library list
libswanted=''
-: full support for void wanted by default
-defvoidused=15
-
: Possible local include directories to search.
: Set locincpth to "" in a hint file to defeat local include searches.
locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
: Extra object files, if any, needed on this platform.
archobjs=''
groupstype=''
+: full support for void wanted by default
+defvoidused=15
+
: set useposix=false in your hint file to disable the POSIX extension.
useposix=true
: set useopcode=false in your hint file to disable the Opcode extension.
$me: Fatal Error: I can't find a Bourne Shell anywhere.
Usually it's in /bin/sh. How did you even get this far?
-Please contact me (Andy Dougherty) at doughera@lafcol.lafayette.edu and
+Please contact me (Andy Dougherty) at doughera@lafayette.edu and
we'll try to straighten this all out.
EOM
exit 1
fi
rm -f try
+
+: Save command line options in file UU/cmdline.opt for later use in
+: generating config.sh.
+cat > cmdline.opt <<EOSH
+# Configure command line arguments.
+config_arg0='$0'
+config_args='$*'
+config_argc=$#
+EOSH
+argn=1
+for arg in "$@"; do
+ cat >>cmdline.opt <<EOSH
+config_arg$argn='$arg'
+EOSH
+ argn=`expr $argn + 1`
+done
+
: produce awk script to parse command line options
cat >options.awk <<'EOF'
BEGIN {
You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es. If you
do, don't blame me if something goes wrong. I advise you to type 'n'o
-and contact the author (doughera@lafcol.lafayette.edu).
+and contact the author (doughera@lafayette.edu).
EOM
echo $n "Continue? [n] $c" >&4
y)
echo "*** Substitution done -- please confirm."
xxxm="\$ans"
- ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
+ ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
xxxm="\$ans"
ans=!
;;
Unix system. If despite that it blows up on yours, your best bet is to edit
Configure and run it again. If you can't run Configure for some reason,
you'll have to generate a config.sh file by hand. Whatever problems you
-have, let me (doughera@lafcol.lafayette.edu) know how I blew it.
+have, let me (doughera@lafayette.edu) know how I blew it.
This installation script affects things in two ways:
: see whether [:lower:] and [:upper:] are supported character classes
echo " "
-up='[A-Z]'
-low='[a-z]'
case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
ABYZ)
echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
up='[:upper:]'
low='[:lower:]'
;;
+*) # There is a discontinuity in EBCDIC between 'I' and 'J'
+ # (0xc9 and 0xd1), therefore that is a nice testing point.
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr '[I-J]' '[i-j]' 2>/dev/null`" in
+ ij) up='[A-Z]'
+ low='[a-z]'
+ ;;
+ esac
+ fi
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr I-J i-j 2>/dev/null`" in
+ ij) up='A-Z'
+ low='a-z'
+ ;;
+ esac
+ fi
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | od -x 2>/dev/null`" in
+ *C9D1*|*c9d1*)
+ echo "Hey, this might be EBCDIC." >&4
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
+ ij) up='[A-IJ-RS-Z]'
+ low='[a-ij-rs-z]'
+ ;;
+ esac
+ fi
+ if test "X$up" = X -o "X$low" = X; then
+ case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
+ ij) up='A-IJ-RS-Z'
+ low='a-ij-rs-z'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ fi
+esac
+case "`echo IJ | tr \"$up\" \"$low\" 2>/dev/null`" in
+ij)
+ echo "Using $up and $low to convert case." >&4
+ ;;
*)
- echo "Your tr only supports [a-z] and [A-Z] to convert case." >&4
- ;;
+ echo "I don't know how to translate letters from upper to lower case." >&4
+ echo "Your tr is not acting any way I know of." >&4
+ exit 1
+ ;;
esac
: set up the translation script tr, must be called with ./tr of course
cat >tr <<EOSC
case "$config_sh" in
'')
myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
+# tr '[A-Z]' '[a-z]' would not work in EBCDIC
+# because the A-Z/a-z are not consecutive.
myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
- ./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
+ ./tr '[A-Z]' '[a-z]' | tr $trnl ' '`
newmyuname="$myuname"
dflt=n
case "$knowitall" in
(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
dflt=''
: Half the following guesses are probably wrong... If you have better
- : tests or hints, please send them to doughera@lafcol.lafayette.edu
+ : tests or hints, please send them to doughera@lafayette.edu
: The metaconfig authors would also appreciate a copy...
$test -f /irix && osname=irix
$test -f /xenix && osname=sco_xenix
osvers="$3" ;;
genix) osname=genix ;;
hp*) osname=hpux
- case "$3" in
- *.08.*) osvers=9 ;;
- *.09.*) osvers=9 ;;
- *.10.*) osvers=10 ;;
- *.11.*) osvers=11 ;;
- *.12.*) osvers=12 ;;
- *) osvers="$3" ;;
- esac
+ osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
;;
irix*) osname=irix
case "$3" in
*) osvers="$3" ;;
esac
;;
- netbsd*) osname=netbsd
+ MiNT) osname=mint
+ ;;
+ netbsd*) osname=netbsd
osvers="$3"
;;
news-os) osvers="$3"
case "$fn" in
*\(*)
- expr $fn : '.*(\(.*\)).*' | tr ',' '\012' >getfile.ok
+ expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
fn=`echo $fn | sed 's/(.*)//'`
;;
esac
esac;;
esac'
+: set the base revision
+baserev=5.0
+
+: get the patchlevel
+echo " "
+echo "Getting the current patchlevel..." >&4
+if $test -r $rsrc/patchlevel.h;then
+ patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
+ subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+else
+ patchlevel=0
+ subversion=0
+fi
+$echo $n "(You have $package" $c
+case "$package" in
+"*$baserev") ;;
+*) $echo $n " $baserev" $c ;;
+esac
+$echo $n " patchlevel $patchlevel" $c
+test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
+echo ".)"
+
+if test 0 -eq "$subversion"; then
+ version=`LC_ALL=C; export LC_ALL; \
+ echo $baserev $patchlevel | \
+ $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
+else
+ version=`LC_ALL=C; export LC_ALL; \
+ echo $baserev $patchlevel $subversion | \
+ $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
+fi
+: Figure out perl API version. Perhaps this should be in patchlevel.h
+if test "$subversion" -lt 50; then
+ apiversion=`LC_ALL=C; export LC_ALL; \
+ echo $baserev $patchlevel | \
+ $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
+else
+ apiversion="$version"
+fi
+
: determine where private library files go
-: Usual default is /usr/local/lib/perl5. Also allow things like
-: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
+: Usual default is /usr/local/lib/perl5/$version.
+: Also allow things like /opt/perl/lib/$version, since
+: /opt/perl/lib/perl5... would be redundant.
case "$prefix" in
-*perl*) set dflt privlib lib ;;
-*) set dflt privlib lib/$package ;;
+*perl*) set dflt privlib lib/$version ;;
+*) set dflt privlib lib/$package/$version ;;
esac
eval $prefixit
$cat <<EOM
installprivlib="$privlibexp"
fi
-: set the base revision
-baserev=5.0
-
-: get the patchlevel
-echo " "
-echo "Getting the current patchlevel..." >&4
-if $test -r $rsrc/patchlevel.h;then
- patchlevel=`awk '/define[ ]+PATCHLEVEL/ {print $3}' $rsrc/patchlevel.h`
- subversion=`awk '/define[ ]+SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
-else
- patchlevel=0
- subversion=0
-fi
-$echo $n "(You have $package" $c
-case "$package" in
-"*$baserev") ;;
-*) $echo $n " $baserev" $c ;;
-esac
-$echo $n " patchlevel $patchlevel" $c
-test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
-echo ".)"
-
: set the prefixup variable, to restore leading tilda escape
prefixup='case "$prefixexp" in
"$prefix") ;;
: determine where public architecture dependent libraries go
set archlib archlib
eval $prefixit
+: privlib default is /usr/local/lib/$package/$version
+: archlib default is /usr/local/lib/$package/$version/$archname
+: privlib may have an optional trailing /share.
+tdflt=`echo $privlib | $sed 's,/share$,,'`
+tdflt=$tdflt/$archname
case "$archlib" in
-'')
- case "$privlib" in
- '') dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
- set dflt
- eval $prefixup
+'') dflt=$tdflt
;;
- *) if test 0 -eq "$subversion"; then
- version=`LC_ALL=C; export LC_ALL; \
- echo $baserev $patchlevel | \
- $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
- else
- version=`LC_ALL=C; export LC_ALL; \
- echo $baserev $patchlevel $subversion | \
- $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
- fi
- dflt="$privlib/$archname/$version"
- ;;
- esac
- ;;
-*)
- dflt="$archlib"
+*) dflt="$archlib"
;;
esac
cat <<EOM
: coherency check
echo " "
echo "Checking your choice of C compiler and flags for coherency..." >&4
-set X $cc $optimize $ccflags $ldflags -o try try.c $libs
+set X $cc $optimize $ccflags -o try $ldflags try.c $libs
shift
$cat >try.msg <<EOM
I've tried to compile and run a simple program with:
main() { printf("Ok\n"); exit(0); }
EOF
dflt=y
-if sh -c "$cc $optimize $ccflags $ldflags -o try try.c $libs" >>try.msg 2>&1; then
+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`
case "$xxx" in
esac
$rm -f try try.* core
+: 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=''
+if test -f $usrinc/\$wanted; then
+ echo "$usrinc/\$wanted"
+ exit 0
+fi
+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 0;;
+ *) name='';;
+ esac;
+done;
+$rm -f foo\$\$.c;
+case "\$name" in
+'') exit 1;;
+esac
+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 this is a malloc.h system
+set malloc.h i_malloc
+eval $inhdr
+
+: see if stdlib is available
+set stdlib.h i_stdlib
+eval $inhdr
+
+: determine which malloc to compile in
+echo " "
+case "$usemymalloc" in
+''|y*|true) dflt='y' ;;
+n*|false) dflt='n' ;;
+*) dflt="$usemymalloc" ;;
+esac
+rp="Do you wish to attempt to use the malloc that comes with $package?"
+. ./myread
+usemymalloc="$ans"
+case "$ans" in
+y*|true)
+ usemymalloc='y'
+ mallocsrc='malloc.c'
+ mallocobj="malloc$_o"
+ d_mymalloc="$define"
+ case "$libs" in
+ *-lmalloc*)
+ : Remove malloc from list of libraries to use
+ echo "Removing unneeded -lmalloc from library list" >&4
+ set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
+ shift
+ libs="$*"
+ echo "libs = $libs" >&4
+ ;;
+ esac
+ ;;
+*)
+ usemymalloc='n'
+ mallocsrc=''
+ mallocobj=''
+ d_mymalloc="$undef"
+ ;;
+esac
+
+: compute the return types of malloc and free
+echo " "
+$cat >malloc.c <<END
+#$i_malloc I_MALLOC
+#$i_stdlib I_STDLIB
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef I_MALLOC
+#include <malloc.h>
+#endif
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#ifdef TRY_MALLOC
+void *malloc();
+#endif
+#ifdef TRY_FREE
+void free();
+#endif
+END
+case "$malloctype" in
+'')
+ if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
+ malloctype='void *'
+ else
+ malloctype='char *'
+ fi
+ ;;
+esac
+echo "Your system wants malloc to return '$malloctype', it would seem." >&4
+
+case "$freetype" in
+'')
+ if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
+ freetype='void'
+ else
+ freetype='int'
+ fi
+ ;;
+esac
+echo "Your system uses $freetype free(), it would seem." >&4
+$rm -f malloc.[co]
: Cruising for prototypes
echo " "
echo "Checking out function prototypes..." >&4
$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
echo " "
+echo "Determining whether or not we are on an EBCDIC system..." >&4
+cat >tebcdic.c <<EOM
+int main()
+{
+ if ('M'==0xd4) return 0;
+ return 1;
+}
+EOM
+val=$undef
+set tebcdic
+if eval $compile_ok; then
+ if ./tebcdic; then
+ echo "You have EBCDIC." >&4
+ val="$define"
+ else
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
+ fi
+else
+ echo "I'm unable to compile the test program." >&4
+ echo "I'll asuume ASCII or some ISO Latin." >&4
+fi
+$rm -f tebcdic.c tebcdic
+set ebcdic
+eval $setvar
+
+echo " "
echo "Checking for GNU C Library..." >&4
cat >gnulibc.c <<EOM
+#include <stdio.h>
int
main()
{
- return __libc_main();
+#ifdef __GLIBC__
+ exit(0);
+#else
+ exit(1);
+#endif
}
EOM
set gnulibc
-if eval $compile && \
- ./gnulibc | $contains '^GNU C Library'; then
+if eval $compile_ok && ./gnulibc; then
val="$define"
echo "You are using the GNU C Library"
else
: The messy sed command sorts on library version numbers.
$test -r $1 || \
set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
- tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
+ tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
h
s/[0-9][0-9]*/0000&/g
s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
EOM
else
dflt=''
- echo $libpth | tr ' ' '\012' | 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 ' ' '\012' | sort | uniq > libnames
+echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
set X `cat libnames`
shift
xxx=files
fi
;;
esac
-$rm -f libnames libpath
-
-: 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=''
-if test -f $usrinc/\$wanted; then
- echo "$usrinc/\$wanted"
- exit 0
-fi
-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 0;;
- *) name='';;
- esac;
-done;
-$rm -f foo\$\$.c;
-case "\$name" in
-'') exit 1;;
-esac
-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'
+$rm -f libnames libpath
: see if dld is available
set dld.h i_dld
hpux) dflt='+z' ;;
next) dflt='none' ;;
irix*) dflt='-KPIC' ;;
- svr4*|esix*|solaris)
- case "$ccflags" in
- *-DDEBUGGING*) dflt='-KPIC' ;;
- *) dflt='-Kpic' ;;
- esac
- ;;
+ svr4*|esix*|solaris) dflt='-KPIC' ;;
sunos) dflt='-pic' ;;
*) dflt='none' ;;
esac
;;
*) case "$osname" in
- svr4*|esix*|solaris)
- case "$ccflags" in
- *-DDEBUGGING*) dflt='-fPIC' ;;
- *) dflt='-fpic' ;;
- esac
- ;;
+ svr4*|esix*|solaris) dflt='-fPIC' ;;
*) dflt='-fpic' ;;
esac ;;
esac ;;
+ ' ') dflt='none' ;;
*) dflt="$cccdlflags" ;;
esac
rp="Any special flags to pass to $cc -c to compile shared library modules?"
*) dflt="$lddlflags" ;;
esac
-: Try to guess additional flags to pick up local libraries.
-for thisflag in $ldflags; do
- case "$thisflag" in
- -L*)
- case " $dflt " in
- *" $thisflag "*) ;;
- *) dflt="$dflt $thisflag" ;;
+ : Try to guess additional flags to pick up local libraries.
+ for thisflag in $ldflags; do
+ case "$thisflag" in
+ -L*)
+ case " $dflt " in
+ *" $thisflag "*) ;;
+ *) dflt="$dflt $thisflag" ;;
+ esac
+ ;;
esac
- ;;
- esac
-done
+ done
-case "$dflt" in
-'') dflt='none' ;;
-esac
+ case "$dflt" in
+ ''|' ') dflt='none' ;;
+ esac
rp="Any special flags to pass to $ld to create a dynamically loaded library?"
. ./myread
sunos) dflt='none' ;;
*) dflt='none' ;;
esac ;;
+ ' ') dflt='none' ;;
*) dflt="$ccdlflags" ;;
esac
rp="Any special flags to pass to $cc to use dynamic loading?"
*) $cat >&4 <<EOM
WARNING: Use of the shrpdir variable for the installation location of
the shared $libperl is not supported. It was never documented and
-will not work in this version. Let me (doughera@lafcol.lafayette.edu)
+will not work in this version. Let me (doughera@lafayette.edu)
know of any problems this may cause.
EOM
fi
: determine where site specific libraries go.
-set sitelib sitelib
-eval $prefixit
-case "$sitelib" in
-'')
- prog=`echo $package | $sed 's/-*[0-9.]*$//'`
- dflt="$privlib/site_$prog" ;;
-*) dflt="$sitelib" ;;
+: Usual default is /usr/local/lib/perl5/site_perl/$apiversion
+prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+case "$prefix" in
+*perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
+*) set dflt sitelib lib/$package/site_$prog/$apiversion ;;
esac
+eval $prefixit
$cat <<EOM
The installation process will also create a directory for
fi
: determine where site specific architecture-dependent libraries go.
-xxx=`echo $sitelib/$archname | sed 's!^$prefix!!'`
-: xxx is usuually lib/site_perl/archname.
+: sitelib default is /usr/local/lib/perl5/site_perl/$apiversion
+: sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
+: sitelib may have an optional trailing /share.
+tdflt=`echo $sitelib | $sed 's,/share$,,'`
+tdflt="$tdflt/$archname"
set sitearch sitearch none
eval $prefixit
case "$sitearch" in
-'') dflt="$sitelib/$archname" ;;
+'') dflt="$tdflt" ;;
*) dflt="$sitearch" ;;
esac
$cat <<EOM
eval $setvar
: Check how to convert floats to strings.
-echo " "
-echo "Checking for an efficient way to convert floats to strings."
-$cat >try.c <<'EOP'
+if test "X$d_Gconvert" = X; then
+ echo " "
+ echo "Checking for an efficient way to convert floats to strings."
+ $cat >try.c <<'EOP'
#ifdef TRY_gconvert
#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
char *myname = "gconvert";
exit(0);
}
EOP
-case "$d_Gconvert" in
-gconvert*) xxx_list='gconvert gcvt sprintf' ;;
-gcvt*) xxx_list='gcvt gconvert sprintf' ;;
-sprintf*) xxx_list='sprintf gconvert gcvt' ;;
-*) xxx_list='gconvert gcvt sprintf' ;;
-esac
+ case "$d_Gconvert" in
+ gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+ gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+ sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+ *) xxx_list='gconvert gcvt sprintf' ;;
+ esac
-for xxx_convert in $xxx_list; do
+ for xxx_convert in $xxx_list; do
echo "Trying $xxx_convert"
$rm -f try try$_o
set try -DTRY_$xxx_convert
else
echo "$xxx_convert NOT found." >&4
fi
-done
+ done
-case "$xxx_convert" in
-gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
-gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
-*) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
-esac
+ case "$xxx_convert" in
+ gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+ gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+ *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
+ esac
+fi
: Initialize h_fcntl
h_fcntl=false
$xxx i32;
double f, g;
int result = 0;
+ char str[16];
signal(SIGFPE, blech);
- /* Don't let compiler optimize the test away */
- sscanf("2147483647", "%lf", &f); /* f = (double) 0x7fffffff; */
+ /* Don't let compiler optimize the test away. Store the number
+ in a writable string for gcc to pass to sscanf under HP/UX.
+ */
+ sprintf(str, "2147483647");
+ sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
g = 10 * f;
i32 = ($xxx) g;
unsigned int aint;
unsigned short ashort;
int result = 0;
+ char str[16];
+
/* Frustrate gcc-2.7.2's optimizer which failed this test with
a direct f = -123. assignment. gcc-2.8.0 reportedly
optimized the whole file away
*/
- sscanf("-123.", "%lf", &f); /* f = -123.; */
+ /* Store the number in a writable string for gcc to pass to
+ sscanf under HP/UX.
+ */
+ sprintf(str, "-123");
+ sscanf(str, "%lf", &f); /* f = -123.; */
signal(SIGFPE, blech);
along = (unsigned long)f;
result |= 1;
if (ashort != (unsigned short)-123)
result |= 1;
- sscanf("1073741824.", "%lf", &f); /* f = (double)0x40000000; */
+ sprintf(str, "1073741824.");
+ sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
f = f + f;
along = 0;
along = (unsigned long)f;
if (result)
exit(result);
signal(SIGFPE, blech_in_list);
- sscanf("123.", "%lf", &f); /* f = 123.; */
+ sprintf(str, "123.");
+ sscanf(str, "%lf", &f); /* f = 123.; */
along = dummy_long((unsigned long)f);
aint = dummy_int((unsigned int)f);
ashort = dummy_short((unsigned short)f);
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 $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
+ $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
xxx=`./fred`
case $xxx in
1) echo "Test program failed using dlopen." >&4
set d_getprotoprotos getprotoent $i_netdb netdb.h
eval $hasproto
-
: see if getservbyname exists
set getservbyname d_getsbyname
eval $inlibc
set netinet/in.h i_niin sys/in.h i_sysin
eval $inhdr
+: see if this is an arpa/inet.h
+set arpa/inet.h i_arpainet
+eval $inhdr
+
: see if htonl --and friends-- exists
val=''
set htonl val
#include <sys/types.h>
#$i_niin I_NETINET_IN
#$i_sysin I_SYS_IN
+#$i_arpainet I_ARPA_INET
#ifdef I_NETINET_IN
#include <netinet/in.h>
#endif
#ifdef I_SYS_IN
#include <sys/in.h>
#endif
+#ifdef I_ARPA_INET
+#include <arpa/inet.h>
+#endif
#ifdef htonl
printf("Defined as a macro.");
#endif
set mkfifo d_mkfifo
eval $inlibc
-: see if mkstemp exists
-set mkstemp d_mkstemp
-eval $inlibc
-
: see if mktime exists
set mktime d_mktime
eval $inlibc
case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
*"$undef"*) h_msg=false;;
esac
+case "$osname" in
+freebsd)
+ case "`ipcs 2>&1`" in
+ "SVID messages"*"not configured"*)
+ echo "But your FreeBSD kernel does not have the msg*(2) configured." >&4
+ h_msg=false
+ val="$undef"
+ set msgctl d_msgctl
+ eval $setvar
+ set msgget d_msgget
+ eval $setvar
+ set msgsnd d_msgsnd
+ eval $setvar
+ set msgrcv d_msgrcv
+ eval $setvar
+ ;;
+ esac
+ ;;
+esac
: we could also check for sys/ipc.h ...
if $h_msg && $test `./findhdr sys/msg.h`; then
echo "You have the full msg*(2) library." >&4
set d_msg
eval $setvar
-: see if this is a malloc.h system
-set malloc.h i_malloc
-eval $inhdr
-
-: see if stdlib is available
-set stdlib.h i_stdlib
-eval $inhdr
-
-: determine which malloc to compile in
-echo " "
-case "$usemymalloc" in
-''|y*|true) dflt='y' ;;
-n*|false) dflt='n' ;;
-*) dflt="$usemymalloc" ;;
-esac
-rp="Do you wish to attempt to use the malloc that comes with $package?"
-. ./myread
-usemymalloc="$ans"
-case "$ans" in
-y*|true)
- usemymalloc='y'
- mallocsrc='malloc.c'
- mallocobj="malloc$_o"
- d_mymalloc="$define"
- case "$libs" in
- *-lmalloc*)
- : Remove malloc from list of libraries to use
- echo "Removing unneeded -lmalloc from library list" >&4
- set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
- shift
- libs="$*"
- echo "libs = $libs" >&4
- ;;
- esac
- ;;
-*)
- usemymalloc='n'
- mallocsrc=''
- mallocobj=''
- d_mymalloc="$undef"
- ;;
-esac
-
-: compute the return types of malloc and free
-echo " "
-$cat >malloc.c <<END
-#$i_malloc I_MALLOC
-#$i_stdlib I_STDLIB
-#include <stdio.h>
-#include <sys/types.h>
-#ifdef I_MALLOC
-#include <malloc.h>
-#endif
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#ifdef TRY_MALLOC
-void *malloc();
-#endif
-#ifdef TRY_FREE
-void free();
-#endif
-END
-case "$malloctype" in
-'')
- if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
- malloctype='void *'
- else
- malloctype='char *'
- fi
- ;;
-esac
-echo "Your system wants malloc to return '$malloctype', it would seem." >&4
-
-case "$freetype" in
-'')
- if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
- freetype='void'
- else
- freetype='int'
- fi
- ;;
-esac
-echo "Your system uses $freetype free(), it would seem." >&4
-$rm -f malloc.[co]
: see if nice exists
set nice d_nice
eval $inlibc
case "$i_pwd" in
$define)
+ : see if setpwent exists
+ set setpwent d_setpwent
+ eval $inlibc
+
+ : see if getpwent exists
+ set getpwent d_getpwent
+ eval $inlibc
+
+ : see if endpwent exists
+ set endpwent d_endpwent
+ eval $inlibc
+
xxx=`./findhdr pwd.h`
$cppstdin $cppflags $cppminus < $xxx >$$.h
set d_pwgecos
eval $setvar
+ if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
+ val="$define"
+ else
+ val="$undef"
+ fi
+ set d_pwpasswd
+ eval $setvar
+
$rm -f $$.h
;;
-*)
+*) # Assume all is lost as far as the d_*pw* go.
val="$undef";
+ set d_setpwent; eval $setvar
+ set d_getpwent; eval $setvar
+ set d_endpwent; eval $setvar
set d_pwquota; eval $setvar
set d_pwage; eval $setvar
set d_pwchange; eval $setvar
set d_pwexpire; eval $setvar
set d_pwcomment; eval $setvar
set d_pwgecos; eval $setvar
+ set d_pwpasswd; eval $setvar
;;
esac
case "$d_semctl$d_semget$d_semop" in
*"$undef"*) h_sem=false;;
esac
+case "$osname" in
+freebsd)
+ case "`ipcs 2>&1`" in
+ "SVID messages"*"not configured"*)
+ echo "But your FreeBSD kernel does not have the sem*(2) configured." >&4
+ h_sem=false
+ val="$undef"
+ set semctl d_semctl
+ eval $setvar
+ set semget d_semget
+ eval $setvar
+ set semop d_semop
+ eval $setvar
+ ;;
+ esac
+ ;;
+esac
: we could also check for sys/ipc.h ...
if $h_sem && $test `./findhdr sys/sem.h`; then
echo "You have the full sem*(2) library." >&4
case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
*"$undef"*) h_shm=false;;
esac
+case "$osname" in
+freebsd)
+ case "`ipcs 2>&1`" in
+ "SVID shared memory"*"not configured"*)
+ echo "But your FreeBSD kernel does not have the shm*(2) configured." >&4
+ h_shm=false
+ val="$undef"
+ set shmctl d_shmctl
+ evat $setvar
+ set shmget d_shmget
+ evat $setvar
+ set shmat d_shmat
+ evat $setvar
+ set shmdt d_shmdt
+ evat $setvar
+ ;;
+ esac
+ ;;
+esac
: we could also check for sys/ipc.h ...
if $h_shm && $test `./findhdr sys/shm.h`; then
echo "You have the full shm*(2) library." >&4
: see if strerror and/or sys_errlist[] exist
echo " "
-if set strerror val -f d_strerror; eval $csym; $val; then
+if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
+ if set strerror val -f d_strerror; eval $csym; $val; then
echo 'strerror() found.' >&4
d_strerror="$define"
d_strerrm='strerror(e)'
if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
- echo "(You also have sys_errlist[], so we could roll our own strerror.)"
- d_syserrlst="$define"
+ echo "(You also have sys_errlist[], so we could roll our own strerror.)"
+ d_syserrlst="$define"
else
- echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
- d_syserrlst="$undef"
+ echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
+ d_syserrlst="$undef"
fi
-elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
+ elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
$contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
echo 'strerror() found in string header.' >&4
d_strerror="$define"
d_strerrm='strerror(e)'
if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
- echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
- d_syserrlst="$define"
+ echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
+ d_syserrlst="$define"
else
- echo "(You don't appear to have any sys_errlist[], how can this be?)"
- d_syserrlst="$undef"
+ echo "(You don't appear to have any sys_errlist[], how can this be?)"
+ d_syserrlst="$undef"
fi
-elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
+ elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
d_strerror="$undef"
d_syserrlst="$define"
d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
-else
+ else
echo 'strerror() and sys_errlist[] NOT found.' >&4
d_strerror="$undef"
d_syserrlst="$undef"
d_strerrm='"unknown"'
+ fi
fi
: see if strtod exists
set sys/ndir.h i_sysndir
eval $inhdr
+: see if sys/types.h has to be included
+set sys/types.h i_systypes
+eval $inhdr
+
: see if closedir exists
set closedir d_closedir
eval $inlibc
#$i_dirent I_DIRENT /**/
#$i_sysdir I_SYS_DIR /**/
#$i_sysndir I_SYS_NDIR /**/
+#$i_systypes I_SYS_TYPES /**/
+#if defined(I_SYS_TYPES)
+#include <sys/types.h>
+#endif
#if defined(I_DIRENT)
#include <dirent.h>
#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
: check for void type
echo " "
echo "Checking to see how well your C compiler groks the void type..." >&4
-echo " "
-$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
-echo " "
case "$voidflags" in
'')
$cat >try.c <<'EOCP'
EOCP
if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
voidflags=$defvoidused
- echo "It appears to support void to the level $package wants ($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
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
: see if we should include time.h, sys/time.h, or both
echo " "
-echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
-$echo $n "I'm now running the test program...$c"
-$cat >try.c <<'EOCP'
+if test "X$timeincl" = X; then
+ echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
+ $echo $n "I'm now running the test program...$c"
+ $cat >try.c <<'EOCP'
#include <sys/types.h>
#ifdef I_TIME
#include <time.h>
exit(1);
}
EOCP
-flags=''
-for s_timezone in '-DS_TIMEZONE' ''; do
-sysselect=''
-for s_timeval in '-DS_TIMEVAL' ''; do
-for i_systimek in '' '-DSYSTIMEKERNEL'; do
-for i_time in '' '-DI_TIME'; do
-for i_systime in '-DI_SYSTIME' ''; do
+ flags=''
+ for s_timezone in '-DS_TIMEZONE' ''; do
+ sysselect=''
+ for s_timeval in '-DS_TIMEVAL' ''; do
+ for i_systimek in '' '-DSYSTIMEKERNEL'; do
+ for i_time in '' '-DI_TIME'; do
+ for i_systime in '-DI_SYSTIME' ''; do
case "$flags" in
'') $echo $n ".$c"
set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
fi
;;
esac
-done
-done
-done
-done
-done
-timeincl=''
-echo " "
-case "$flags" in
-*SYSTIMEKERNEL*) i_systimek="$define"
+ done
+ done
+ done
+ done
+ done
+ timeincl=''
+ echo " "
+ case "$flags" in
+ *SYSTIMEKERNEL*) i_systimek="$define"
timeincl=`./findhdr sys/time.h`
echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
-*) i_systimek="$undef";;
-esac
-case "$flags" in
-*I_TIME*) i_time="$define"
+ *) i_systimek="$undef";;
+ esac
+ case "$flags" in
+ *I_TIME*) i_time="$define"
timeincl=`./findhdr time.h`" $timeincl"
echo "We'll include <time.h>." >&4;;
-*) i_time="$undef";;
-esac
-case "$flags" in
-*I_SYSTIME*) i_systime="$define"
+ *) i_time="$undef";;
+ esac
+ case "$flags" in
+ *I_SYSTIME*) i_systime="$define"
timeincl=`./findhdr sys/time.h`" $timeincl"
echo "We'll include <sys/time.h>." >&4;;
-*) i_systime="$undef";;
-esac
-$rm -f try.c try
+ *) i_systime="$undef";;
+ esac
+ $rm -f try.c try
+fi
: check for fd_set items
$cat <<EOM
EOCP
-echo $xxx | $tr ' ' '\012' | $sort | $uniq | $awk '
+echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
{
printf "#ifdef SIG"; printf $1; printf "\n"
printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
echo 'NSIG 50' > signal.nsg
fi
: Now look at all the signal names, one at a time.
- for xx in `echo $xxx | $tr ' ' '\012' | $sort | $uniq`; do
+ for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
$cat > signal.c <<EOCP
#include <sys/types.h>
#include <signal.h>
case $# in
0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
esac
- echo $@ | $tr ' ' '\012' | \
+ echo $@ | $tr ' ' $trnl | \
$awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
fi
$rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
: see if time exists
echo " "
-if set time val -f d_time; eval $csym; $val; then
+if test "X$d_time" = X -o X"$timetype" = X; then
+ if set time val -f d_time; eval $csym; $val; then
echo 'time() found.' >&4
val="$define"
rp="What is the type returned by time() on this system?"
set time_t timetype long stdio.h sys/types.h
eval $typedef_ask
-else
+ else
echo 'time() not found, hope that will do.' >&4
val="$undef"
timetype='int';
+ fi
+ set d_time
+ eval $setvar
fi
-set d_time
-eval $setvar
: see what type uids are declared as in the kernel
echo " "
set grp.h i_grp
eval $inhdr
+case "$i_grp" in
+$define)
+ : see if setgrent exists
+ set setgrent d_setgrent
+ eval $inlibc
+
+ : see if getgrent exists
+ set getgrent d_getgrent
+ eval $inlibc
+
+ : see if endgrent exists
+ set endgrent d_endgrent
+ eval $inlibc
+
+ xxx=`./findhdr grp.h`
+ $cppstdin $cppflags $cppminus < $xxx >$$.h
+
+ if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
+ val="$define"
+ else
+ val="$undef"
+ fi
+ set d_grpasswd
+ eval $setvar
+
+ $rm -f $$.h
+ ;;
+*) # Assume all is lost as far as the d_*gr* go.
+ val="$undef";
+ set d_setgrent; eval $setvar
+ set d_getgrent; eval $setvar
+ set d_endgrent; eval $setvar
+ set d_grpasswd; eval $setvar
+ ;;
+esac
+
: see if locale.h is available
set locale.h i_locale
eval $inhdr
: get C preprocessor symbols handy
echo " "
$echo $n "Hmm... $c"
-echo $al | $tr ' ' '\012' >Cppsym.know
+echo $al | $tr ' ' $trnl >Cppsym.know
$cat <<EOSS >Cppsym
$startsh
case "\$1" in
case \$# in
0) exit 1;;
esac
-echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
+echo \$* | $tr ' ' '$trnl' | $sed -e 's/\(.*\)/\\
#ifdef \1\\
exit 0; _ _ _ _\1\\ \1\\
#endif\\
set sys/stat.h i_sysstat
eval $inhdr
-: see if sys/types.h has to be included
-set sys/types.h i_systypes
-eval $inhdr
-
: see if this is a sys/un.h system
set sys/un.h i_sysun
eval $inhdr
: If we are using the old config.sh, known_extensions may contain
: old or inaccurate or duplicate values.
known_extensions=''
+nonxs_extensions=''
: We do not use find because it might not be available.
: We do not just use MANIFEST because the user may have dropped
: some additional extensions into the source tree and expect them
: to be built.
for xxx in * ; do
case "$xxx" in
- DynaLoader) ;;
+ DynaLoader|dynaload) ;;
*) if $test -f $xxx/$xxx.xs; then
known_extensions="$known_extensions $xxx"
+ elif $test -f $xxx/Makefile.PL; then
+ nonxs_extensions="$nonxs_extensions $xxx"
else
if $test -d $xxx; then
+ # Look for nested extensions, eg. Devel/Dprof.
cd $xxx
for yyy in * ; do
if $test -f $yyy/$yyy.xs; then
known_extensions="$known_extensions $xxx/$yyy"
+ elif $test -f $yyy/Makefile.PL; then
+ nonxs_extensions="$nonxs_extensions $xxx/$yyy"
fi
done
cd ..
;;
esac
done
+set X $nonxs_extensions
+shift
+nonxs_extensions="$*"
set X $known_extensions
shift
known_extensions="$*"
true|$define|y) avail_ext="$avail_ext $xxx" ;;
esac
;;
+ IPC/SysV|ipc/sysv)
+ case "${d_msg}${d_sem}${d_shm}" in
+ *"${define}"*) avail_ext="$avail_ext $xxx" ;;
+ esac
+ ;;
*) avail_ext="$avail_ext $xxx"
;;
esac
shift
avail_ext="$*"
+: Now see which nonxs extensions are supported on this system.
+: For now assume all are.
+nonxs_ext=''
+for xxx in $nonxs_extensions ; do
+ case "$xxx" in
+ *) nonxs_ext="$nonxs_ext $xxx"
+ ;;
+ esac
+done
+
+set X $nonxs_ext
+shift
+nonxs_ext="$*"
+
case $usedl in
$define)
$cat <<EOM
esac
;;
esac
+ : Exclude those that are not xs extensions
case "$dflt" in
'') dflt=none;;
esac
;;
esac
-set X $dynamic_ext $static_ext
+set X $dynamic_ext $static_ext $nonxs_ext
shift
extensions="$*"
alignbytes='$alignbytes'
ansi2knr='$ansi2knr'
aphostname='$aphostname'
+apiversion='$apiversion'
ar='$ar'
archlib='$archlib'
archlibexp='$archlibexp'
d_dlsymun='$d_dlsymun'
d_dosuid='$d_dosuid'
d_dup2='$d_dup2'
+d_endgrent='$d_endgrent'
d_endhent='$d_endhent'
d_endnent='$d_endnent'
d_endpent='$d_endpent'
+d_endpwent='$d_endpwent'
d_endsent='$d_endsent'
d_eofnblk='$d_eofnblk'
d_eunice='$d_eunice'
d_fpathconf='$d_fpathconf'
d_fsetpos='$d_fsetpos'
d_ftime='$d_ftime'
+d_getgrent='$d_getgrent'
d_getgrps='$d_getgrps'
d_gethbyaddr='$d_gethbyaddr'
d_gethbyname='$d_gethbyname'
d_getppid='$d_getppid'
d_getprior='$d_getprior'
d_getprotoprotos='$d_getprotoprotos'
+d_getpwent='$d_getpwent'
d_getsbyname='$d_getsbyname'
d_getsbyport='$d_getsbyport'
d_getsent='$d_getsent'
d_getservprotos='$d_getservprotos'
d_gettimeod='$d_gettimeod'
d_gnulibc='$d_gnulibc'
+d_grpasswd='$d_grpasswd'
d_htonl='$d_htonl'
d_index='$d_index'
d_inetaton='$d_inetaton'
d_memset='$d_memset'
d_mkdir='$d_mkdir'
d_mkfifo='$d_mkfifo'
-d_mkstemp='$d_mkstemp'
d_mktime='$d_mktime'
d_msg='$d_msg'
d_msgctl='$d_msgctl'
d_pwexpire='$d_pwexpire'
d_pwgecos='$d_pwgecos'
d_pwquota='$d_pwquota'
+d_pwpasswd='$d_pwpasswd'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
d_rename='$d_rename'
d_semop='$d_semop'
d_setegid='$d_setegid'
d_seteuid='$d_seteuid'
+d_setgrent='$d_setgrent'
d_setgrps='$d_setgrps'
d_sethent='$d_sethent'
d_setlinebuf='$d_setlinebuf'
d_setpgrp2='$d_setpgrp2'
d_setpgrp='$d_setpgrp'
d_setprior='$d_setprior'
+d_setpwent='$d_setpwent'
d_setregid='$d_setregid'
d_setresgid='$d_setresgid'
d_setresuid='$d_setresuid'
doublesize='$doublesize'
dynamic_ext='$dynamic_ext'
eagain='$eagain'
+ebcdic='$ebcdic'
echo='$echo'
egrep='$egrep'
emacs='$emacs'
hint='$hint'
hostcat='$hostcat'
huge='$huge'
+i_arpainet='$i_arpainet'
i_bsdioctl='$i_bsdioctl'
i_db='$i_db'
i_dbm='$i_dbm'
nm='$nm'
nm_opt='$nm_opt'
nm_so_opt='$nm_so_opt'
+nonxs_ext='$nonxs_ext'
nroff='$nroff'
o_nonblock='$o_nonblock'
obj_ext='$obj_ext'
timetype='$timetype'
touch='$touch'
tr='$tr'
+trnl='$trnl'
troff='$troff'
uidtype='$uidtype'
uname='$uname'
usevfork='$usevfork'
usrinc='$usrinc'
uuname='$uuname'
+version='$version'
vi='$vi'
voidflags='$voidflags'
xlibpth='$xlibpth'
zip='$zip'
EOT
+: Add in command line options if available
+$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
+
: add special variables
$test -f $src/patchlevel.h && \
awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
: if this fails, just run all the .SH files by hand
. ./config.sh
+case "$ebcdic" in
+$define)
+ xxx=''
+ echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4
+ rm -f y.tab.c y.tab.h
+ yacc -d perly.y >/dev/null 2>&1
+ if cmp -s y.tab.c perly.c; then
+ rm -f y.tab.c
+ else
+ echo "perly.y -> perly.c" >&4
+ mv -f y.tab.c perly.c
+ chmod u+w perly.c
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+ -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
+ xxx="$xxx perly.c"
+ fi
+ if cmp -s y.tab.h perly.h; then
+ rm -f y.tab.h
+ else
+ echo "perly.y -> perly.h" >&4
+ mv -f y.tab.h perly.h
+ xxx="$xxx perly.h"
+ fi
+ echo "x2p/a2p.y" >&4
+ cd x2p
+ rm -f y.tab.c
+ yacc a2p.y >/dev/null 2>&1
+ if cmp -s y.tab.c a2p.c
+ then
+ rm -f y.tab.c
+ else
+ echo "a2p.y -> a2p.c" >&4
+ mv -f y.tab.c a2p.c
+ chmod u+w a2p.c
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+ -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
+ xxx="$xxx a2p.c"
+ fi
+ cd ..
+ case "$xxx" in
+ '') echo "No parser files were regenerated. That's okay." >&4 ;;
+ esac
+ ;;
+esac
+
echo " "
exec 1>&4
. ./UU/extract