summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-11-14 17:08:23 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-11-14 17:08:23 +0000
commitbd9b35c97ad661cc06e68f6193733424fc65c9c0 (patch)
tree6b7a1e2bce6634bd3dbdf64d38ee84adbcb624f8 /Configure
parent505afebfe64a1941e58b72354808b12b77d682bb (diff)
downloadperl-bd9b35c97ad661cc06e68f6193733424fc65c9c0.tar.gz
The separation of 64-bitness and largefileness continues
(with a setback, see hpux.sh). p4raw-id: //depot/cfgperl@4581
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure1817
1 files changed, 954 insertions, 863 deletions
diff --git a/Configure b/Configure
index 26bc1f2a60..b634e2d261 100755
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Sat Nov 13 17:55:50 EET 1999 [metaconfig 3.0 PL70]
+# Generated on Sun Nov 14 17:26:56 EET 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
@@ -3055,167 +3055,154 @@ case "$gccversion" in
1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
esac
-
-case "$usemorebits" in
-"$define"|true|[yY]*)
- use64bits="$define"
- uselongdouble="$define"
- usemorebits="$define"
- ;;
-*) usemorebits="$undef"
- ;;
-esac
-
-
-cat <<EOM
-
-Perl can be built to understand large files (files larger than 2 gigabytes)
-on some systems. To do so, Configure must be run with -Duselargefiles.
-
-If this doesn't make any sense to you, just accept the default.
-EOM
-case "$uselargefiles" in
-"$define"|true|[yY]*) dflt='y' ;;
-*) dflt='n' ;;
-esac
-rp='Try to understand large files?'
-. ./myread
-case "$ans" in
-y|Y) val="$define" ;;
-*) val="$undef" ;;
-esac
-set uselargefiles
-eval $setvar
-case "$uselargefiles" in
-"$define") use64bits="$define" ;;
-esac
-
-cat <<EOM
-
-Perl can be built to take advantage of explicit 64-bit interfaces,
-on some systems. To do so, Configure must be run with -Duse64bits.
-
-If this doesn't make any sense to you, just accept the default.
-EOM
-case "$use64bits" in
-$define|true|[yY]*) dflt='y';;
-*) dflt='n';;
-esac
-rp='Try to use explicit 64-bit interfaces, if available?'
-. ./myread
-case "$ans" in
-y|Y)
- val="$define"
- ;;
-*)
- val="$undef"
- ;;
-esac
-set use64bits
-eval $setvar
-
-case "$archname64" in
-'') archname64='' ;; # not a typo
-esac
-
-case "$use64bits" in
-"$define"|true|[yY]*)
-: Look for a hint-file generated 'call-back-unit'. If the
-: user has specified that a 64 bit perl is to be built,
-: we may need to set or change some other defaults.
- if $test -f use64bits.cbu; then
- echo "Your platform has some specific hints for 64-bit builds, using them..."
- . ./use64bits.cbu
- else
- $cat <<EOM
-(Your platform doesn't have any specific hints for 64-bit builds.
- This is probably okay, especially if your system is a true 64-bit system.)
-EOM
- case "$gccversion" in
- '') ;;
- *) $cat <<EOM
-But since you seem to be using gcc,
-I will now add -DUSE_LONG_LONG to the compilation flags.
-EOM
- ccflags="$ccflags -DUSE_LONG_LONG"
- ;;
- esac
- fi
- ;;
-esac
-
-: determine the architecture name
+: see how we invoke the C preprocessor
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/ *$//' -e 's/ /_/g' \
- -e 's/$/'"-$osname/" tmparch`
+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
- tarch="$osname"
+ echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
fi
- $rm -f tmparch
else
- tarch="$osname"
+ echo "Keeping your $hint cppstdin wrapper."
fi
-case "$myarchname" in
-''|"$tarch") ;;
-*)
- echo "(Your architecture name used to be $myarchname.)"
- archname=''
- ;;
-esac
-myarchname="$tarch"
-case "$archname" in
-'') dflt="$tarch";;
-*) dflt="$archname";;
-esac
-rp='What is your architecture name'
-. ./myread
-archname="$ans"
-case "$usethreads" in
-$define)
- echo "Threads selected." >&4
- case "$archname" in
- *-thread*) echo "...and architecture name already has -thread." >&4
- ;;
- *) archname="$archname-thread"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
-esac
-case "$usemultiplicity" in
-$define)
- echo "Multiplicity selected." >&4
- case "$archname" in
- *-multi*) echo "...and architecture name already has -multi." >&4
- ;;
- *) archname="$archname-multi"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
- ;;
-esac
-case "$use64bits" in
-$define)
- echo "Explicit 64-bitness selected." >&4
- case "$archname64" in
- '')
+chmod 755 cppstdin
+wrapper=`pwd`/cppstdin
+ok='false'
+cd UU
+
+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
+ '') ;;
*)
- case "$archname" in
- *-$archname64*) echo "...and architecture name already has $archname64." >&4
- ;;
- *) archname="$archname-$archname64"
- echo "...setting architecture name to $archname." >&4
- ;;
- esac
+ 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") ;;
@@ -3493,391 +3480,6 @@ rm -f getfile.ok
test "X$gfpthkeep" != Xy && gfpth=""
EOSC
-: determine root of directory hierarchy where package will be installed.
-case "$prefix" in
-'')
- dflt=`./loc . /usr/local /usr/local /local /opt /usr`
- ;;
-*)
- dflt="$prefix"
- ;;
-esac
-$cat <<EOM
-
-By default, $package will be installed in $dflt/bin, manual pages
-under $dflt/man, etc..., i.e. with $dflt as prefix for all
-installation directories. Typically this is something like /usr/local.
-If you wish to have binaries under /usr/bin but other parts of the
-installation under /usr/local, that's ok: you will be prompted
-separately for each of the installation directories, the prefix being
-only used 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"
-
-: is AFS running?
-echo " "
-case "$afs" in
-$define|true) afs=true ;;
-$undef|false) afs=false ;;
-*) if test -d /afs; then
- afs=true
- else
- afs=false
- fi
- ;;
-esac
-if $afs; then
- echo "AFS may be running... I'll be extra cautious then..." >&4
-else
- echo "AFS does not seem to be running..." >&4
-fi
-
-: determine installation prefix for where package is to be installed.
-if $afs; then
-$cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-files will reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
-
-EOM
- case "$installprefix" in
- '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installprefix";;
- esac
-else
-$cat <<EOM
-
-In some special cases, particularly when building $package for distribution,
-it is convenient to distinguish between the directory in which files should
-be installed from the directory ($prefix) in which they
-will eventually reside. For most users, these two directories are the same.
-
-EOM
- case "$installprefix" in
- '') dflt=$prefix ;;
- *) dflt=$installprefix;;
- esac
-fi
-fn=d~
-rp='What installation prefix should I use for installing files?'
-. ./getfile
-installprefix="$ans"
-installprefixexp="$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'
-
-: 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[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
- subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
- apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
-else
- patchlevel=0
- subversion=0
- apiversion=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
-
-: determine installation style
-: For now, try to deduce it from prefix unless it is already set.
-: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
-case "$installstyle" in
-'') case "$prefix" in
- *perl*) dflt='lib';;
- *) dflt='lib/perl5' ;;
- esac
- ;;
-*) dflt='lib/perl5' ;;
-esac
-: Probably not worth prompting for this since we prompt for all
-: the directories individually, and the prompt would be too long and
-: confusing anyway.
-installstyle=$dflt
-
-: determine where private library files go
-: Usual default is /usr/local/lib/perl5/$version.
-: Also allow things like /opt/perl/lib/$version, since
-: /opt/perl/lib/perl5... would be redundant.
-: The default "style" setting is made in installstyle.U
-case "$installstyle" in
-*lib/perl5*) set dflt privlib lib/$package/$version ;;
-*) set dflt privlib lib/$version ;;
-esac
-eval $prefixit
-$cat <<EOM
-
-There are some auxiliary files for $package that need to be put into a
-private library directory that is accessible by everyone.
-
-EOM
-fn=d~+
-rp='Pathname where the private library files will reside?'
-. ./getfile
-privlib="$ans"
-privlibexp="$ansexp"
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
- installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
-else
- 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
-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
-'') dflt=$tdflt
- ;;
-*) dflt="$archlib"
- ;;
-esac
-$cat <<EOM
-
-$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.
-
-EOM
-fn=d+~
-rp='Where do you want to put the public architecture-dependent libraries?'
-. ./getfile
-archlib="$ans"
-archlibexp="$ansexp"
-if $test X"$archlib" = X"$privlib"; then
- d_archlib="$undef"
-else
- d_archlib="$define"
-fi
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
- installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
-else
- installarchlib="$archlibexp"
-fi
-
-
-: Binary compatibility with 5.005 is not possible for builds
-: with advanced features
-case "$usethreads$usemultiplicity" in
-*define*)
- bincompat5005="$undef"
- d_bincompat5005="$undef"
- ;;
-*) $cat <<EOM
-
-Perl 5.006 can be compiled for binary compatibility with 5.005.
-If you decide to do so, you will be able to continue using most
-of the extensions that were compiled for Perl 5.005.
-
-EOM
- case "$bincompat5005$d_bincompat5005" in
- *"$undef"*) dflt=n ;;
- *) dflt=y ;;
- esac
- rp='Binary compatibility with Perl 5.005?'
- . ./myread
- case "$ans" in
- y*) val="$define" ;;
- *) val="$undef" ;;
- esac
- set d_bincompat5005
- eval $setvar
- case "$d_bincompat5005" in
- "$define")
- bincompat5005="$define"
- ;;
- *) bincompat5005="$undef"
- d_bincompat5005="$undef"
- ;;
- esac
- ;;
-esac
-
-
-: see if setuid scripts can be secure
-$cat <<EOM
-
-Some kernels have a bug that prevents setuid #! scripts from being
-secure. Some sites have disabled setuid #! scripts because of this.
-
-First let's decide if your kernel supports secure setuid #! scripts.
-(If setuid #! scripts would be secure but have been disabled anyway,
-don't say that they are secure if asked.)
-
-EOM
-
-val="$undef"
-if $test -d /dev/fd; then
- echo "#!$ls" >reflect
- chmod +x,u+s reflect
- ./reflect >flect 2>&1
- if $contains "/dev/fd" flect >/dev/null; then
- echo "Congratulations, your kernel has secure setuid scripts!" >&4
- val="$define"
- else
- $cat <<EOM
-If you are not sure if they are secure, I can check but I'll need a
-username and password different from the one you are using right now.
-If you don't have such a username or don't want me to test, simply
-enter 'none'.
-
-EOM
- rp='Other username to test security of setuid scripts with?'
- dflt='none'
- . ./myread
- case "$ans" in
- n|none)
- case "$d_suidsafe" in
- '') echo "I'll assume setuid scripts are *not* secure." >&4
- dflt=n;;
- "$undef")
- echo "Well, the $hint value is *not* secure." >&4
- dflt=n;;
- *) echo "Well, the $hint value *is* secure." >&4
- dflt=y;;
- esac
- ;;
- *)
- $rm -f reflect flect
- echo "#!$ls" >reflect
- chmod +x,u+s reflect
- echo >flect
- chmod a+w flect
- echo '"su" will (probably) prompt you for '"$ans's password."
- su $ans -c './reflect >flect'
- if $contains "/dev/fd" flect >/dev/null; then
- echo "Okay, it looks like setuid scripts are secure." >&4
- dflt=y
- else
- echo "I don't think setuid scripts are secure." >&4
- dflt=n
- fi
- ;;
- esac
- rp='Does your kernel have *secure* setuid scripts?'
- . ./myread
- case "$ans" in
- [yY]*) val="$define";;
- *) val="$undef";;
- esac
- fi
-else
- echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
- echo "(That's for file descriptors, not floppy disks.)"
- 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
-
: What should the include directory be ?
echo " "
$echo $n "Hmm... $c"
@@ -3924,154 +3526,6 @@ y) fn=d/
;;
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
- else
- echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
- fi
-else
- echo "Keeping your $hint cppstdin wrapper."
-fi
-chmod 755 cppstdin
-wrapper=`pwd`/cppstdin
-ok='false'
-cd UU
-
-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
@@ -4597,6 +4051,822 @@ n) echo "OK, that should do.";;
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;'
+
+: check for lengths of integral types
+echo " "
+case "$intsize" in
+'')
+ echo "Checking to see how big your integers are..." >&4
+ $cat >intsize.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+ printf("intsize=%d;\n", (int)sizeof(int));
+ printf("longsize=%d;\n", (int)sizeof(long));
+ printf("shortsize=%d;\n", (int)sizeof(short));
+ exit(0);
+}
+EOCP
+ set intsize
+ if eval $compile_ok && ./intsize > /dev/null; then
+ eval `./intsize`
+ echo "Your integers are $intsize bytes long."
+ echo "Your long integers are $longsize bytes long."
+ echo "Your short integers are $shortsize bytes long."
+ else
+ $cat >&4 <<EOM
+!
+Help! I can't compile and run the intsize test program: please enlighten me!
+(This is probably a misconfiguration in your system or libraries, and
+you really ought to fix it. Still, I'll try anyway.)
+!
+EOM
+ dflt=4
+ rp="What is the size of an integer (in bytes)?"
+ . ./myread
+ intsize="$ans"
+ dflt=$intsize
+ rp="What is the size of a long integer (in bytes)?"
+ . ./myread
+ longsize="$ans"
+ dflt=2
+ rp="What is the size of a short integer (in bytes)?"
+ . ./myread
+ shortsize="$ans"
+ fi
+ ;;
+esac
+$rm -f intsize intsize.*
+
+: see what type lseek is declared as in the kernel
+rp="What is the type used for lseek's offset on this system?"
+set off_t lseektype long stdio.h sys/types.h
+eval $typedef_ask
+
+echo " "
+$echo $n "Checking to see how big your file offsets are...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof($lseektype));
+ return(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+ lseeksize=`./try`
+ $echo " $lseeksize bytes." >&4
+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
+$echo $n "Checking 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=`./try`
+ case "$yyy" in
+ '') fpossize=4
+ echo " "
+ echo "(I can't execute the test program--guessing $fpossize.)" >&4
+ ;;
+ *) fpossize=$yyy
+ echo " $fpossize bytes."
+ ;;
+ esac
+else
+ dflt="$longsize"
+ 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
+
+
+
+case "$lseeksize:$fpossize" in
+8:8) cat <<EOM
+
+You can have files larger than 2 gigabytes.
+EOM
+ val="$define" ;;
+*) cat <<EOM
+
+Perl can be built to understand large files (files larger than 2 gigabytes)
+on some systems. To do so, Configure must be run with -Duselargefiles.
+
+If this doesn't make any sense to you, just accept the default 'y'.
+EOM
+ case "$uselargefiles" in
+ "$undef"|false|[nN]*) dflt='n' ;;
+ *) dflt='y' ;;
+ esac
+ 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 uselfs.cbu; then
+ echo "Your platform has some specific hints for large file builds, using them..."
+ . ./uselfs.cbu
+ echo " "
+ $echo $n "Rechecking to see how big your file offsets are...$c" >&4
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+ printf("%d\n", (int)sizeof($lseektype));
+ return(0);
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ lseeksize=`./try`
+ $echo " $lseeksize bytes." >&4
+ 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=`./try`
+ dflt="$lseeksize"
+ case "$yyy" in
+ '') echo " "
+ echo "(I can't execute the test program--guessing $fpossize.)" >&4
+ ;;
+ *) fpossize=$yyy
+ echo " $fpossize bytes."
+ ;;
+ 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
+
+
+case "$usemorebits" in
+"$define"|true|[yY]*)
+ use64bits="$define"
+ uselongdouble="$define"
+ usemorebits="$define"
+ ;;
+*) usemorebits="$undef"
+ ;;
+esac
+
+
+case "$intsize:$longsize" in
+8:*|*:8) cat <<EOM
+
+You have natively 64-bit integers.
+EOM
+ val="$define" ;;
+*) cat <<EOM
+
+Perl can be built to take advantage of 64-bit integer types
+on some systems. To do so, Configure must be run with -Duse64bits.
+
+If this doesn't make any sense to you, just accept the default.
+EOM
+ case "$use64bits" in
+ $define|true|[yY]*) dflt='y';;
+ *) dflt='n';;
+ esac
+ rp='Try to use 64-bit integers, if available?'
+ . ./myread
+ case "$ans" in
+ y|Y) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ ;;
+esac
+set use64bits
+eval $setvar
+
+case "$archname64" in
+'') archname64='' ;; # not a typo
+esac
+
+case "$use64bits" in
+"$define"|true|[yY]*)
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that a 64-bit perl is to be built,
+: we may need to set or change some other defaults.
+ if $test -f use64bits.cbu; then
+ echo "Your platform has some specific hints for 64-bit builds, using them..."
+ . ./use64bits.cbu
+ else
+ $cat <<EOM
+(Your platform doesn't have any specific hints for 64-bit builds.)
+EOM
+ case "$intsize:$longsize" in
+8:*|*:8) cat <<EOM
+(This is probably okay, as your system is a natively 64-bit system.)
+EOM
+ ;;
+ esac
+ case "$gccversion" in
+ '') ;;
+ *) case "$ccflags" in
+ *-DUSE_LONG_LONG*) ;;
+ *) $cat <<EOM
+But since you seem to be using gcc, I will now add -DUSE_LONG_LONG
+to the compilation flags.
+EOM
+ ccflags="$ccflags -DUSE_LONG_LONG"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+: 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/ *$//' -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
+myarchname="$tarch"
+case "$archname" in
+'') dflt="$tarch";;
+*) dflt="$archname";;
+esac
+rp='What is your architecture name'
+. ./myread
+archname="$ans"
+case "$usethreads" in
+$define)
+ echo "Threads selected." >&4
+ case "$archname" in
+ *-thread*) echo "...and architecture name already has -thread." >&4
+ ;;
+ *) archname="$archname-thread"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+esac
+case "$usemultiplicity" in
+$define)
+ echo "Multiplicity selected." >&4
+ case "$archname" in
+ *-multi*) echo "...and architecture name already has -multi." >&4
+ ;;
+ *) archname="$archname-multi"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+esac
+case "$use64bits" in
+$define)
+ case "$archname64" in
+ '')
+ ;;
+ *)
+ case "$archname" in
+ *-$archname64*) echo "...and architecture name already has $archname64." >&4
+ ;;
+ *) archname="$archname-$archname64"
+ echo "...setting architecture name to $archname." >&4
+ ;;
+ esac
+ ;;
+ esac
+esac
+
+: determine root of directory hierarchy where package will be installed.
+case "$prefix" in
+'')
+ dflt=`./loc . /usr/local /usr/local /local /opt /usr`
+ ;;
+*)
+ dflt="$prefix"
+ ;;
+esac
+$cat <<EOM
+
+By default, $package will be installed in $dflt/bin, manual pages
+under $dflt/man, etc..., i.e. with $dflt as prefix for all
+installation directories. Typically this is something like /usr/local.
+If you wish to have binaries under /usr/bin but other parts of the
+installation under /usr/local, that's ok: you will be prompted
+separately for each of the installation directories, the prefix being
+only used 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"
+
+: is AFS running?
+echo " "
+case "$afs" in
+$define|true) afs=true ;;
+$undef|false) afs=false ;;
+*) if test -d /afs; then
+ afs=true
+ else
+ afs=false
+ fi
+ ;;
+esac
+if $afs; then
+ echo "AFS may be running... I'll be extra cautious then..." >&4
+else
+ echo "AFS does not seem to be running..." >&4
+fi
+
+: determine installation prefix for where package is to be installed.
+if $afs; then
+$cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+files will reside from the directory in which they are installed (and from
+which they are presumably copied to the former directory by occult means).
+
+EOM
+ case "$installprefix" in
+ '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installprefix";;
+ esac
+else
+$cat <<EOM
+
+In some special cases, particularly when building $package for distribution,
+it is convenient to distinguish between the directory in which files should
+be installed from the directory ($prefix) in which they
+will eventually reside. For most users, these two directories are the same.
+
+EOM
+ case "$installprefix" in
+ '') dflt=$prefix ;;
+ *) dflt=$installprefix;;
+ esac
+fi
+fn=d~
+rp='What installation prefix should I use for installing files?'
+. ./getfile
+installprefix="$ans"
+installprefixexp="$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'
+
+: 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[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
+ subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+ apiversion=`awk '/define[ ]+PERL_APIVERSION/ {print $3}' $rsrc/patchlevel.h`
+else
+ patchlevel=0
+ subversion=0
+ apiversion=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
+
+: determine installation style
+: For now, try to deduce it from prefix unless it is already set.
+: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
+case "$installstyle" in
+'') case "$prefix" in
+ *perl*) dflt='lib';;
+ *) dflt='lib/perl5' ;;
+ esac
+ ;;
+*) dflt='lib/perl5' ;;
+esac
+: Probably not worth prompting for this since we prompt for all
+: the directories individually, and the prompt would be too long and
+: confusing anyway.
+installstyle=$dflt
+
+: determine where private library files go
+: Usual default is /usr/local/lib/perl5/$version.
+: Also allow things like /opt/perl/lib/$version, since
+: /opt/perl/lib/perl5... would be redundant.
+: The default "style" setting is made in installstyle.U
+case "$installstyle" in
+*lib/perl5*) set dflt privlib lib/$package/$version ;;
+*) set dflt privlib lib/$version ;;
+esac
+eval $prefixit
+$cat <<EOM
+
+There are some auxiliary files for $package that need to be put into a
+private library directory that is accessible by everyone.
+
+EOM
+fn=d~+
+rp='Pathname where the private library files will reside?'
+. ./getfile
+privlib="$ans"
+privlibexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+ installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
+else
+ 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
+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
+'') dflt=$tdflt
+ ;;
+*) dflt="$archlib"
+ ;;
+esac
+$cat <<EOM
+
+$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.
+
+EOM
+fn=d+~
+rp='Where do you want to put the public architecture-dependent libraries?'
+. ./getfile
+archlib="$ans"
+archlibexp="$ansexp"
+if $test X"$archlib" = X"$privlib"; then
+ d_archlib="$undef"
+else
+ d_archlib="$define"
+fi
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+ installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
+else
+ installarchlib="$archlibexp"
+fi
+
+
+: Binary compatibility with 5.005 is not possible for builds
+: with advanced features
+case "$usethreads$usemultiplicity" in
+*define*)
+ bincompat5005="$undef"
+ d_bincompat5005="$undef"
+ ;;
+*) $cat <<EOM
+
+Perl 5.006 can be compiled for binary compatibility with 5.005.
+If you decide to do so, you will be able to continue using most
+of the extensions that were compiled for Perl 5.005.
+
+EOM
+ case "$bincompat5005$d_bincompat5005" in
+ *"$undef"*) dflt=n ;;
+ *) dflt=y ;;
+ esac
+ rp='Binary compatibility with Perl 5.005?'
+ . ./myread
+ case "$ans" in
+ y*) val="$define" ;;
+ *) val="$undef" ;;
+ esac
+ set d_bincompat5005
+ eval $setvar
+ case "$d_bincompat5005" in
+ "$define")
+ bincompat5005="$define"
+ ;;
+ *) bincompat5005="$undef"
+ d_bincompat5005="$undef"
+ ;;
+ esac
+ ;;
+esac
+
+
+: see if setuid scripts can be secure
+$cat <<EOM
+
+Some kernels have a bug that prevents setuid #! scripts from being
+secure. Some sites have disabled setuid #! scripts because of this.
+
+First let's decide if your kernel supports secure setuid #! scripts.
+(If setuid #! scripts would be secure but have been disabled anyway,
+don't say that they are secure if asked.)
+
+EOM
+
+val="$undef"
+if $test -d /dev/fd; then
+ echo "#!$ls" >reflect
+ chmod +x,u+s reflect
+ ./reflect >flect 2>&1
+ if $contains "/dev/fd" flect >/dev/null; then
+ echo "Congratulations, your kernel has secure setuid scripts!" >&4
+ val="$define"
+ else
+ $cat <<EOM
+If you are not sure if they are secure, I can check but I'll need a
+username and password different from the one you are using right now.
+If you don't have such a username or don't want me to test, simply
+enter 'none'.
+
+EOM
+ rp='Other username to test security of setuid scripts with?'
+ dflt='none'
+ . ./myread
+ case "$ans" in
+ n|none)
+ case "$d_suidsafe" in
+ '') echo "I'll assume setuid scripts are *not* secure." >&4
+ dflt=n;;
+ "$undef")
+ echo "Well, the $hint value is *not* secure." >&4
+ dflt=n;;
+ *) echo "Well, the $hint value *is* secure." >&4
+ dflt=y;;
+ esac
+ ;;
+ *)
+ $rm -f reflect flect
+ echo "#!$ls" >reflect
+ chmod +x,u+s reflect
+ echo >flect
+ chmod a+w flect
+ echo '"su" will (probably) prompt you for '"$ans's password."
+ su $ans -c './reflect >flect'
+ if $contains "/dev/fd" flect >/dev/null; then
+ echo "Okay, it looks like setuid scripts are secure." >&4
+ dflt=y
+ else
+ echo "I don't think setuid scripts are secure." >&4
+ dflt=n
+ fi
+ ;;
+ esac
+ rp='Does your kernel have *secure* setuid scripts?'
+ . ./myread
+ case "$ans" in
+ [yY]*) val="$define";;
+ *) val="$undef";;
+ esac
+ fi
+else
+ echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
+ echo "(That's for file descriptors, not floppy disks.)"
+ 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
@@ -4945,17 +5215,6 @@ fi
set installusrbinperl
eval $setvar
-: 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;'
-
echo " "
echo "Checking for GNU C Library..." >&4
cat >gnulibc.c <<EOM
@@ -7237,52 +7496,6 @@ $rm -f set set.c
set bzero d_bzero
eval $inlibc
-: check for lengths of integral types
-echo " "
-case "$intsize" in
-'')
- echo "Checking to see how big your integers are..." >&4
- $cat >intsize.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
- printf("intsize=%d;\n", (int)sizeof(int));
- printf("longsize=%d;\n", (int)sizeof(long));
- printf("shortsize=%d;\n", (int)sizeof(short));
- exit(0);
-}
-EOCP
- set intsize
- if eval $compile_ok && ./intsize > /dev/null; then
- eval `./intsize`
- echo "Your integers are $intsize bytes long."
- echo "Your long integers are $longsize bytes long."
- echo "Your short integers are $shortsize bytes long."
- else
- $cat >&4 <<EOM
-!
-Help! I can't compile and run the intsize test program: please enlighten me!
-(This is probably a misconfiguration in your system or libraries, and
-you really ought to fix it. Still, I'll try anyway.)
-!
-EOM
- dflt=4
- rp="What is the size of an integer (in bytes)?"
- . ./myread
- intsize="$ans"
- dflt=$intsize
- rp="What is the size of a long integer (in bytes)?"
- . ./myread
- longsize="$ans"
- dflt=2
- rp="What is the size of a short integer (in bytes)?"
- . ./myread
- shortsize="$ans"
- fi
- ;;
-esac
-$rm -f intsize intsize.*
-
: see if signal is declared as pointer to function returning int or void
echo " "
xxx=`./findhdr signal.h`
@@ -8442,128 +8655,6 @@ eval $inlibc
set fpathconf d_fpathconf
eval $inlibc
-: define an is-a-typedef? function
-typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
- $rm -f temp.c;
- for inc in $inclist; do
- echo "#include <$inc>" >>temp.c;
- done;
- echo "#ifdef $type" >> temp.c;
- echo "printf(\"We have $type\");" >> temp.c;
- echo "#endif" >> temp.c;
- $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
- if $contains $type temp.E >/dev/null 2>&1; then
- eval "$var=\$type";
- else
- eval "$var=\$def";
- fi;
- $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
-
-: define an is-a-typedef? function that prompts if the type is not available.
-typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
- $rm -f temp.c;
- for inc in $inclist; do
- echo "#include <$inc>" >>temp.c;
- done;
- echo "#ifdef $type" >> temp.c;
- echo "printf(\"We have $type\");" >> temp.c;
- echo "#endif" >> temp.c;
- $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
- echo " " ;
- echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
- if $contains $type temp.E >/dev/null 2>&1; then
- echo "$type found." >&4;
- eval "$var=\$type";
- else
- echo "$type NOT found." >&4;
- dflt="$def";
- . ./myread ;
- eval "$var=\$ans";
- fi;
- $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
-
-: see what type lseek is declared as in the kernel
-rp="What is the type used for lseek's offset on this system?"
-set off_t lseektype long stdio.h sys/types.h
-eval $typedef_ask
-
-echo " "
-$echo $n "Checking to see how big your file offsets are...$c" >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main()
-{
- printf("%d\n", (int)sizeof($lseektype));
- return(0);
-}
-EOCP
-set try
-if eval $compile_ok; then
- lseeksize=`./try`
- $echo " $lseeksize bytes." >&4
-else
- dflt='4'
- echo " "
- echo "(I can't seem to compile the test program. Guessing...)"
- rp="What is the size of your file offsets (in bytes)?"
- . ./myread
- lseeksize="$ans"
-fi
-$rm -f try.c try
-
-: see 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
-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=`./try`
- case "$yyy" in
- '') fpossize=4
- echo "(I can't execute the test program--guessing $fpossize.)" >&4
- ;;
- *) fpossize=$yyy
- echo "Your $zzz size is $fpossize bytes."
- ;;
- esac
-else
- fpossize=4
- echo "(I can't compile the test program--guessing $fpossize.)" >&4
-fi
-
-
: check for off64_t
echo " "