# $Id: Head.U,v 3.0.1.6 1994/10/29 15:54:19 ram Exp $
#
-# Generated on Wed Jan 18 13:55:15 EST 1995 [metaconfig 3.0 PL48]
+# Generated on Tue Feb 28 10:00:27 EST 1995 [metaconfig 3.0 PL51]
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
uuname=''
vi=''
zcat=''
+full_sed=''
libswanted=''
hint=''
myuname=''
alignbytes=''
archlib=''
archlibexp=''
-archname=''
d_archlib=''
installarchlib=''
+archname=''
+myarchname=''
baserev=''
bin=''
binexp=''
d_attribut=''
d_bcmp=''
d_bcopy=''
+d_byacc=''
d_bzero=''
d_casti32=''
castflags=''
cryptlib=''
d_crypt=''
d_csh=''
+full_csh=''
d_cuserid=''
d_dbl_dig=''
d_difftime=''
d_getpgrp=''
d_getppid=''
d_getprior=''
-d_group=''
d_htonl=''
d_isascii=''
d_killpg=''
d_msgsnd=''
d_nice=''
d_open3=''
-d_passwd=''
d_fpathconf=''
d_pathconf=''
d_pause=''
i_sysndir=''
i_sysparam=''
i_sysselct=''
+i_sysstat=''
i_systimes=''
+i_systypes=''
i_sgtty=''
i_termio=''
i_termios=''
lns=''
lseektype=''
d_mymalloc=''
+freetype=''
mallocobj=''
mallocsrc=''
malloctype=''
spackage=''
patchlevel=''
prefix=''
+prefixexp=''
installprivlib=''
privlib=''
privlibexp=''
libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
libswanted="$libswanted ucb bsd BSD PW x"
-: We want to search /usr/shlib before most other libraries.
-: This is only used by ext/util/extliblist
+: 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 ! !'`
glibpth="/usr/shlib $glibpth"
: Do not use vfork unless overridden by a hint file.
usevfork=false
+: We might as well always be portable. It makes no difference for
+: perl5, and makes people happy.
+d_portable=define
: script used to extract .SH files with variable substitutions
cat >extract <<'EOS'
silent=''
extractsh=''
override=''
-optdef='optdef.sh'
-rm -f $optdef
+rm -f optdef.sh
: option parsing
while test $# -gt 0; do
echo "$me: ignoring -D $1" >&2
;;
*=*) echo "$1" | \
- sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> $optdef;;
- *) echo "$1='define'" >> $optdef;;
+ sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
+ *) echo "$1='define'" >> optdef.sh;;
esac
shift
;;
-U)
shift
case "$1" in
- *=) echo "$1" >> $optdef;;
+ *=) echo "$1" >> optdef.sh;;
*=*)
echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
echo "$me: ignoring -U $1" >&2
;;
- *) echo "$1='undef'" >> $optdef;;
+ *) echo "$1='undef'" >> optdef.sh;;
esac
shift
;;
- -V) echo "$me generated by metaconfig 3.0 PL48." >&2
+ -V) echo "$me generated by metaconfig 3.0 PL51." >&2
exit 0;;
--) break;;
-*) echo "$me: unknown option $1" >&2; shift; error=true;;
esac
: run the defines and the undefines, if any, but leave the file out there...
-touch $optdef
-. ./$optdef
+touch optdef.sh
+. ./optdef.sh
case "$extractsh" in
true)
echo "Fetching answers from $config_sh..."
cd ..
. $config
- test "$override" && . ./$optdef
+ test "$override" && . ./optdef.sh
echo " "
. ./UU/extract
rm -rf UU
: set package name
package=perl5
+first=`echo $package | sed -e 's/^\(.\).*/\1/'`
+last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
+case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
+ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
+*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
+esac
: Eunice requires " " instead of "", can you believe it
echo " "
: Here we go...
echo "Beginning of configuration questions for $package."
-trap 'echo " "; rm -rf $rmlist; exit 1' 1 2 3 15
+trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
: Some greps do not return status, grrr.
echo "grimblepritz" >grimble
Much effort has been expended to ensure that this shell script will run on any
Unix system. If despite that it blows up on yours, your best bet is to edit
-Configure and run it again. Also, let me (lwall@netlabs.com)
-know how I blew it. If you can't run Configure for some reason, you'll have to
-generate a config.sh file by hand.
+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 (lwall@netlabs.com) know how I blew it.
This installation script affects things in two ways:
myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
./tr '[A-Z]' '[a-z]' | tr '\012' ' '`
+newmyuname="$myuname"
dflt=n
if test "$fastread" = yes; then
dflt=y
elif test -f ../config.sh; then
- oldmyuname=''
if $contains myuname= ../config.sh >/dev/null 2>&1; then
- eval "old`grep myuname= ../config.sh`"
+ eval "`grep myuname= ../config.sh`"
fi
- if test "X$myuname" = "X$oldmyuname"; then
+ if test "X$myuname" = "X$newmyuname"; then
dflt=y
fi
fi
tmp_n="$n"
tmp_c="$c"
. ./config.sh
- test "$override" && . UU/$optdef
cp config.sh UU
n="$tmp_n"
c="$tmp_c"
aix) osname=aix
tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
case "$tmp" in
- 'not found') osvers=3.2.0 ;;
+ 'not found') osvers="$4"."$3" ;;
'<3240'|'<>3240') osvers=3.2.0 ;;
'=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
'=3250'|'>3250') osvers=3.2.5 ;;
- *) osvers='' ;;
+ *) osvers=$tmp;;
esac
;;
dnix) osname=dnix
osvers="$3"
;;
osf1) case "$5" in
- alpha) osname=dec_osf
- case "$3" in
- [vt]1\.*) osvers=1 ;;
- [vt]2\.*) osvers=2 ;;
- [vt]3\.*) osvers=3 ;;
- esac
+ alpha)
+ osname=dec_osf
+ osvers=`echo "$3" | sed 's/^[vt]//'`
;;
hp*) osname=hp_osf1 ;;
mips) osname=mips_osf1 ;;
dflt=`echo $hintfile | $sed 's/\.sh$//'`
;;
esac
-
+
$cat <<EOM
You may give one or more space-separated answers, or "none" if appropriate.
cp $config_sh config.sh 2>/dev/null
. ./config.sh
cd UU
- test "$override" && . ./$optdef
cp ../config.sh .
n="$tmp_n"
c="$tmp_c"
hint=previous
;;
esac
+test "$override" && . ./optdef.sh
+myuname="$newmyuname"
: Restore computed paths
for file in $loclist $trylist; do
fi
;;
Locate)
- if test -d "$value"; then
+ if test -d "$ansexp"; then
echo "(Looking for $loc_file in directory $value.)"
value="$value/$loc_file"
+ ansexp="$ansexp/$loc_file"
fi
- if test -f "$value"; then
+ if test -f "$ansexp"; then
type=''
fi
case "$nopath_ok" in
fi
$rm -f usr.c usr.out
echo "and you're compiling with the $mips_type compiler and libraries."
+ echo "exit 0" >mips
else
echo "Doesn't look like a MIPS system."
echo "exit 1" >mips
- chmod +x mips
- $eunicefix mips
fi
+chmod +x mips
+$eunicefix mips
echo " "
case "$usrinc" in
'') ;;
set alarm d_alarm
eval $inlibc
+: determine the architecture name
+echo " "
+if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
+ tarch=`arch`"-$osname"
+elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
+ if uname -m > tmparch 2>&1 ; then
+ tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
+ else
+ tarch="$osname"
+ fi
+ $rm -f tmparch
+else
+ tarch="$osname"
+fi
+case "$myarchname" in
+''|"$tarch") ;;
+*)
+ echo "(Your architecture name used to be $myarchname.)"
+ archname=''
+ ;;
+esac
+case "$archname" in
+'') dflt="$tarch";;
+*) dflt="$archname";;
+esac
+rp='What is your architecture name'
+. ./myread
+archname="$ans"
+myarchname="$tarch"
+
: is AFS running?
echo " "
if test -d /afs; then
binaries. If you wish to have binaries under /bin but manual pages
under /usr/local/man, that's ok: you will be prompted separately
for each of the installation directories, the prefix being only used
-to set defaults.
+to set the defaults.
EOM
fn=d~
rp='Installation prefix to use?'
. ./getfile
+oldprefix=''
+case "$prefix" in
+'') ;;
+*)
+ case "$ans" in
+ "$prefix") ;;
+ *) oldprefix="$prefix";;
+ esac
+ ;;
+esac
prefix="$ans"
+prefixexp="$ansexp"
+
+: set the prefixit variable, to compute a suitable default value
+prefixit='case "$3" in
+""|none)
+ case "$oldprefix" in
+ "") eval "$1=\"\$$2\"";;
+ *)
+ case "$3" in
+ "") eval "$1=";;
+ none)
+ eval "tp=\"\$$2\"";
+ case "$tp" in
+ ""|" ") eval "$1=\"\$$2\"";;
+ *) eval "$1=";;
+ esac;;
+ esac;;
+ esac;;
+*)
+ eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
+ case "$tp" in
+ --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
+ /*-$oldprefix/*|\~*-$oldprefix/*)
+ eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
+ *) eval "$1=\"\$$2\"";;
+ esac;;
+esac'
: determine where private executables go
-case "$privlib" in
-'')
- dflt=$prefix/lib/$package
- ;;
-*) dflt="$privlib"
- ;;
-esac
+set dflt privlib lib/$package
+eval $prefixit
$cat <<EOM
There are some auxiliary files for $package that need to be put into a
EOM
fn=d~+
-rp='Pathname where private library files will reside?'
+rp='Pathname where the private library files will reside?'
. ./getfile
+if $test "X$privlibexp" != "X$ansexp"; then
+ installprivlib=''
+fi
privlib="$ans"
privlibexp="$ansexp"
if $afs; then
installprivlib="$privlibexp"
fi
+: set the prefixup variable, to restore leading tilda escape
+prefixup='case "$prefixexp" in
+"$prefix") ;;
+*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
+esac'
+
: determine where public architecture dependent libraries go
-case "$archname" in
-'') tpath=`echo $PATH | sed -e 's/:/ /g'`
- if xxx=`./loc arch blurfl $tpath`; test -f "$xxx"; then
- tarchname=`arch`
- archname="${tarchname}-$osname"
- elif xxx=`./loc uname blurfl $tpath`; test -f "$xxx" ; then
- if uname -m > tmparch 2>&1 ; then
- tarchname=`cat tmparch`
- archname="${tarchname}-$osname"
- fi
- rm -f tmparch
- else
- archname="$osname"
- fi
- ;;
-esac
+set archlib archlib
+eval $prefixit
case "$archlib" in
'')
case "$privlib" in
- '') dflt=`./loc . "." $prefix/lib /usr/local/lib /usr/lib /lib`;;
+ '')
+ dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
+ set dflt
+ eval $prefixup
+ ;;
*) dflt="$privlib/$archname";;
esac
;;
esac
cat <<EOM
-$package contains architecture-dependent library files. If you are
+$spackage contains architecture-dependent library files. If you are
sharing libraries in a heterogeneous environment, you might store
these files in a separate location. Otherwise, you can just include
them with the rest of the public library files.
echo " "
echo "Checking whether your compiler can handle __attribute__ ..." >&4
$cat >attrib.c <<'EOCP'
+#include <stdio.h>
void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
eval $setvar
$rm -f set set.c
+: Check if we really have byacc
+case "$byacc" in
+''|'byacc') val="$undef" ;;
+*) val="$define" ;;
+esac
+set d_byacc
+eval $setvar
+
: see if bzero exists
set bzero d_bzero
eval $inlibc
esac
set d_csh
eval $setvar
+full_csh=$csh
: see if cuserid exists
set cuserid d_cuserid
: Can not go over to $dldir because getfile has path hard-coded in.
cd ..; ls -C $dldir/dl*.xs; cd UU
rp="Source file to use for dynamic loading"
- fn="fne~"
+ fn="fne"
. ./getfile
usedl="$define"
: emulate basename
set getpriority d_getprior
eval $inlibc
-: see if group exists
-set group d_group
-eval $inlibc
-
: see if this is a netinet/in.h or sys/in.h system
set netinet/in.h i_niin sys/in.h i_sysin
eval $inhdr
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
;;
esac
-: compute the type returned by malloc
+: compute the return types of malloc and free
echo " "
-case "$malloctype" in
-'')
- $cat >malloc.c <<END
+$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
- if $cc $ccflags -c malloc.c >/dev/null 2>&1; then
+case "$malloctype" in
+'')
+ if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
malloctype='void *'
else
malloctype='char *'
fi
- $rm -f malloc.[co]
;;
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
eval $setvar
$rm -f open3*
-: see if passwd exists
-set passwd d_passwd
-eval $inlibc
-
: see if pause exists
set pause d_pause
eval $inlibc
. ./myread
case "$ans" in
y*) hostcat='nidump hosts .';;
- *) hostcat='cat /etc/hosts';;
+ *) ;;
esac
fi
case "$hostcat" in
: determine where public executables go
echo " "
-case "$bin" in
-'')
- dflt="$prefix/bin"
- ;;
-*)
- dflt="$bin"
- ;;
-esac
+set dflt bin bin
+eval $prefixit
fn=d~
rp='Pathname where the public executables will reside?'
. ./getfile
+if $test "X$ansexp" != "X$binexp"; then
+ installbin=''
+fi
bin="$ans"
binexp="$ansexp"
if $afs; then
. ./myread
fpostype="$ans"
+: Store the full pathname to the sed program for use in the C program
+full_sed=$sed
+
: see what type gids are declared as in the kernel
set gid_t gidtype xxx stdio.h sys/types.h
eval $typedef
lseektype="$ans"
: determine where manual pages go
+set mansrc mansrc none
+eval $prefixit
$cat <<EOM
-$package has manual pages available in source form.
+$spackage has manual pages available in source form.
EOM
case "$nroff" in
nroff)
echo "If you don't want the manual sources installed, answer 'none'."
case "$mansrc" in
'')
- lookpath="$prefix/man/man1 $prefix/man/u_man/man1 $prefix/man/l_man/man1"
- lookpath="$lookpath /usr/local/man/man1 /usr/local/man/man1 /usr/man/manl"
+ lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
+ lookpath="$lookpath $prefixexp/man/l_man/man1"
+ lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
lookpath="$lookpath /usr/man/man.L"
- mansrc=`./loc . $prefix/man/man1 $lookpath`
+ mansrc=`./loc . $prefixexp/man/man1 $lookpath`
if $test -d "$mansrc"; then
dflt="$mansrc"
else
dflt="$sysman"
fi
+ set dflt
+ eval $prefixup
;;
+' ') dflt=none;;
*) dflt="$mansrc"
;;
esac
fn=dn~
rp='Where do the manual pages (source) go?'
. ./getfile
+if test "X$mansrcexp" != "X$ansexp"; then
+ installmansrc=''
+fi
mansrc="$ans"
mansrcexp="$ansexp"
+case "$mansrc" in
+'') mansrc=' '
+ installmansrc='';;
+esac
if $afs; then
$cat <<EOM
installmansrc="$mansrcexp"
fi
-
case "$mansrc" in
-'') manext='0';;
+' ') manext='0';;
*l) manext=l;;
*n) manext=n;;
*o) manext=l;;
$rm -f foo* bar*
: determine where public executable scripts go
+set scriptdir scriptdir
+eval $prefixit
case "$scriptdir" in
'')
dflt="$bin"
$test -d /usr/share/scripts && dflt=/usr/share/scripts
$test -d /usr/share/bin && dflt=/usr/share/bin
$test -d /usr/local/script && dflt=/usr/local/script
- $test -d $prefix/script && dflt=$prefix/script
+ $test -d $prefixexp/script && dflt=$prefixexp/script
+ set dflt
+ eval $prefixup
;;
*) dflt="$scriptdir"
;;
fn=d~
rp='Where do you keep publicly executable scripts?'
. ./getfile
+if $test "X$ansexp" != "X$scriptdirexp"; then
+ installscript=''
+fi
scriptdir="$ans"
scriptdirexp="$ansexp"
if $afs; then
case "$sig_name" in
'')
echo "Generating a list of signal names..." >&4
- xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
+ xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`" "`./findhdr linux/signal.h`
set X `cat $xxx 2>&1 | $awk '
$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
sig[$3] = substr($2,4,20)
set stddef.h i_stddef
eval $inhdr
-: see if stdlib is available
-set stdlib.h i_stdlib
-eval $inhdr
-
: see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
set sys/filio.h i_sysfilio
eval $inhdr
set sys/param.h i_sysparam
eval $inhdr
+: see if sys/stat.h is available
+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 unistd.h system
set unistd.h i_unistd
eval $inhdr
d_bcopy='$d_bcopy'
d_bsd='$d_bsd'
d_bsdpgrp='$d_bsdpgrp'
+d_byacc='$d_byacc'
d_bzero='$d_bzero'
d_casti32='$d_casti32'
d_castneg='$d_castneg'
d_getpgrp='$d_getpgrp'
d_getppid='$d_getppid'
d_getprior='$d_getprior'
-d_group='$d_group'
d_htonl='$d_htonl'
d_index='$d_index'
d_isascii='$d_isascii'
d_nice='$d_nice'
d_oldsock='$d_oldsock'
d_open3='$d_open3'
-d_passwd='$d_passwd'
d_pathconf='$d_pathconf'
d_pause='$d_pause'
d_phostname='$d_phostname'
find='$find'
flex='$flex'
fpostype='$fpostype'
+freetype='$freetype'
+full_csh='$full_csh'
+full_sed='$full_sed'
gcc='$gcc'
gccversion='$gccversion'
gidtype='$gidtype'
i_sysparam='$i_sysparam'
i_sysselct='$i_sysselct'
i_syssockio='$i_syssockio'
+i_sysstat='$i_sysstat'
i_systime='$i_systime'
i_systimek='$i_systimek'
i_systimes='$i_systimes'
+i_systypes='$i_systypes'
i_termio='$i_termio'
i_termios='$i_termios'
i_time='$i_time'
modetype='$modetype'
more='$more'
mv='$mv'
+myarchname='$myarchname'
mydomain='$mydomain'
myhostname='$myhostname'
myuname='$myuname'
pmake='$pmake'
pr='$pr'
prefix='$prefix'
+prefixexp='$prefixexp'
privlib='$privlib'
privlibexp='$privlibexp'
prototype='$prototype'
cont)
;;
'')
- echo " "
dflt=''
nostick=true
-echo "If you didn't make any mistakes, then just type a carriage return here."
- rp="If you need to edit config.sh, do it as a shell escape here:"
+ $cat <<EOM
+
+If you'd like to make any changes to the config.sh file before I begin
+to configure things, do it as a shell escape now (e.g. !vi config.sh).
+
+EOM
+ rp="Press return or use a shell escape to edit config.sh:"
. UU/myread
nostick=''
case "$ans" in