| | 5485 | |
| | 5486 | case "$d_quad:$use64bitint" in |
| | 5487 | $undef:$define) |
| | 5488 | cat >&4 <<EOF |
| | 5489 | |
| | 5490 | *** You have chosen to use 64-bit integers, |
| | 5491 | *** but none cannot be found. |
| | 5492 | *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits. |
| | 5493 | *** Cannot continue, aborting. |
| | 5494 | |
| | 5495 | EOF |
| | 5496 | exit 1 |
| | 5497 | ;; |
| | 5498 | esac |
| | 5499 | |
| | 5500 | : check for length of double |
| | 5501 | echo " " |
| | 5502 | case "$doublesize" in |
| | 5503 | '') |
| | 5504 | echo "Checking to see how big your double precision numbers are..." >&4 |
| | 5505 | $cat >try.c <<EOCP |
| | 5506 | #include <stdio.h> |
| | 5507 | #$i_stdlib I_STDLIB |
| | 5508 | #ifdef I_STDLIB |
| | 5509 | #include <stdlib.h> |
| | 5510 | #endif |
| | 5511 | int main() |
| | 5512 | { |
| | 5513 | printf("%d\n", (int)sizeof(double)); |
| | 5514 | exit(0); |
| | 5515 | } |
| | 5516 | EOCP |
| | 5517 | set try |
| | 5518 | if eval $compile_ok; then |
| | 5519 | doublesize=`$run ./try` |
| | 5520 | echo "Your double is $doublesize bytes long." |
| | 5521 | else |
| | 5522 | dflt='8' |
| | 5523 | echo "(I can't seem to compile the test program. Guessing...)" |
| | 5524 | rp="What is the size of a double precision number (in bytes)?" |
| | 5525 | . ./myread |
| | 5526 | doublesize="$ans" |
| | 5527 | fi |
| | 5528 | ;; |
| | 5529 | esac |
| | 5530 | $rm -f try.c try |
| | 5531 | |
| | 5532 | : check for long doubles |
| | 5533 | echo " " |
| | 5534 | echo "Checking to see if you have long double..." >&4 |
| | 5535 | echo 'int main() { long double x = 7.0; }' > try.c |
| | 5536 | set try |
| | 5537 | if eval $compile; then |
| | 5538 | val="$define" |
| | 5539 | echo "You have long double." |
| | 5540 | else |
| | 5541 | val="$undef" |
| | 5542 | echo "You do not have long double." |
| | 5543 | fi |
| | 5544 | $rm try.* |
| | 5545 | set d_longdbl |
| | 5546 | eval $setvar |
| | 5547 | |
| | 5548 | : check for length of long double |
| | 5549 | case "${d_longdbl}${longdblsize}" in |
| | 5550 | $define) |
| | 5551 | echo " " |
| | 5552 | echo "Checking to see how big your long doubles are..." >&4 |
| | 5553 | $cat >try.c <<'EOCP' |
| | 5554 | #include <stdio.h> |
| | 5555 | int main() |
| | 5556 | { |
| | 5557 | printf("%d\n", sizeof(long double)); |
| | 5558 | } |
| | 5559 | EOCP |
| | 5560 | set try |
| | 5561 | set try |
| | 5562 | if eval $compile; then |
| | 5563 | longdblsize=`$run ./try` |
| | 5564 | echo "Your long doubles are $longdblsize bytes long." |
| | 5565 | else |
| | 5566 | dflt='8' |
| | 5567 | echo " " |
| | 5568 | echo "(I can't seem to compile the test program. Guessing...)" >&4 |
| | 5569 | rp="What is the size of a long double (in bytes)?" |
| | 5570 | . ./myread |
| | 5571 | longdblsize="$ans" |
| | 5572 | fi |
| | 5573 | if $test "X$doublesize" = "X$longdblsize"; then |
| | 5574 | echo "That isn't any different from an ordinary double." |
| | 5575 | echo "I'll keep your setting anyway, but you may see some" |
| | 5576 | echo "harmless compilation warnings." |
| | 5577 | fi |
| | 5578 | ;; |
| | 5579 | esac |
| | 5580 | $rm -f try.* try |
| | 5581 | |
| | 5582 | : determine the architecture name |
| | 5583 | echo " " |
| | 5584 | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
| | 5585 | tarch=`arch`"-$osname" |
| | 5586 | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then |
| | 5587 | if uname -m > tmparch 2>&1 ; then |
| | 5588 | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ |
| | 5589 | -e 's/$/'"-$osname/" tmparch` |
| | 5590 | else |
| | 5591 | tarch="$osname" |
| | 5592 | fi |
| | 5593 | $rm -f tmparch |
| | 5594 | else |
| | 5595 | tarch="$osname" |
| | 5596 | fi |
| | 5597 | case "$myarchname" in |
| | 5598 | ''|"$tarch") ;; |
| | 5599 | *) |
| | 5600 | echo "(Your architecture name used to be $myarchname.)" |
| | 5601 | archname='' |
| | 5602 | ;; |
| | 5603 | esac |
| | 5604 | case "$targetarch" in |
| | 5605 | '') ;; |
| | 5606 | *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; |
| | 5607 | esac |
| | 5608 | myarchname="$tarch" |
| | 5609 | case "$archname" in |
| | 5610 | '') dflt="$tarch";; |
| | 5611 | *) dflt="$archname";; |
| | 5612 | esac |
| | 5613 | rp='What is your architecture name' |
| | 5614 | . ./myread |
| | 5615 | archname="$ans" |
| | 5616 | case "$usethreads" in |
| | 5617 | $define) |
| | 5618 | echo "Threads selected." >&4 |
| | 5619 | case "$archname" in |
| | 5620 | *-thread*) echo "...and architecture name already has -thread." >&4 |
| | 5621 | ;; |
| | 5622 | *) archname="$archname-thread" |
| | 5623 | echo "...setting architecture name to $archname." >&4 |
| | 5624 | ;; |
| | 5625 | esac |
| | 5626 | ;; |
| | 5627 | esac |
| | 5628 | case "$usemultiplicity" in |
| | 5629 | $define) |
| | 5630 | echo "Multiplicity selected." >&4 |
| | 5631 | case "$archname" in |
| | 5632 | *-multi*) echo "...and architecture name already has -multi." >&4 |
| | 5633 | ;; |
| | 5634 | *) archname="$archname-multi" |
| | 5635 | echo "...setting architecture name to $archname." >&4 |
| | 5636 | ;; |
| | 5637 | esac |
| | 5638 | ;; |
| | 5639 | esac |
| | 5640 | case "$use64bitint$use64bitall" in |
| | 5641 | *"$define"*) |
| | 5642 | case "$archname64" in |
| | 5643 | '') |
| | 5644 | echo "This architecture is naturally 64-bit, not changing architecture name." >&4 |
| | 5645 | ;; |
| | 5646 | *) |
| | 5647 | case "$use64bitint" in |
| | 5648 | "$define") echo "64 bit integers selected." >&4 ;; |
| | 5649 | esac |
| | 5650 | case "$use64bitall" in |
| | 5651 | "$define") echo "Maximal 64 bitness selected." >&4 ;; |
| | 5652 | esac |
| | 5653 | case "$archname" in |
| | 5654 | *-$archname64*) echo "...and architecture name already has $archname64." >&4 |
| | 5655 | ;; |
| | 5656 | *) archname="$archname-$archname64" |
| | 5657 | echo "...setting architecture name to $archname." >&4 |
| | 5658 | ;; |
| | 5659 | esac |
| | 5660 | ;; |
| | 5661 | esac |
| | 5662 | esac |
| | 5663 | case "$uselongdouble" in |
| | 5664 | $define) |
| | 5665 | echo "Long doubles selected." >&4 |
| | 5666 | case "$longdblsize" in |
| | 5667 | $doublesize) |
| | 5668 | echo "...but long doubles are equal to doubles, not changing architecture name." >&4 |
| | 5669 | ;; |
| | 5670 | *) |
| | 5671 | case "$archname" in |
| | 5672 | *-ld*) echo "...and architecture name already has -ld." >&4 |
| | 5673 | ;; |
| | 5674 | *) archname="$archname-ld" |
| | 5675 | echo "...setting architecture name to $archname." >&4 |
| | 5676 | ;; |
| | 5677 | esac |
| | 5678 | ;; |
| | 5679 | esac |
| | 5680 | ;; |
| | 5681 | esac |
| | 5682 | case "$useperlio" in |
| | 5683 | $define) |
| | 5684 | echo "Perlio selected." >&4 |
| | 5685 | ;; |
| | 5686 | *) |
| | 5687 | echo "Perlio not selected, using stdio." >&4 |
| | 5688 | case "$archname" in |
| | 5689 | *-stdio*) echo "...and architecture name already has -stdio." >&4 |
| | 5690 | ;; |
| | 5691 | *) archname="$archname-stdio" |
| | 5692 | echo "...setting architecture name to $archname." >&4 |
| | 5693 | ;; |
| | 5694 | esac |
| | 5695 | ;; |
| | 5696 | esac |
| | 5697 | if $test -f archname.cbu; then |
| | 5698 | echo "Your platform has some specific hints for architecture name, using them..." |
| | 5699 | . ./archname.cbu |
| | 5700 | fi |
| | 5701 | |
| | 5702 | : determine root of directory hierarchy where package will be installed. |
| | 5703 | case "$prefix" in |
| | 5704 | '') |
| | 5705 | dflt=`./loc . /usr/local /usr/local /local /opt /usr` |
| | 5706 | ;; |
| | 5707 | *?/) |
| | 5708 | dflt=`echo "$prefix" | sed 's/.$//'` |
| | 5709 | ;; |
| | 5710 | *) |
| | 5711 | dflt="$prefix" |
| | 5712 | ;; |
| | 5713 | esac |
| | 5714 | $cat <<EOM |
| | 5715 | |
| | 5716 | By default, $package will be installed in $dflt/bin, manual pages |
| | 5717 | under $dflt/man, etc..., i.e. with $dflt as prefix for all |
| | 5718 | installation directories. Typically this is something like /usr/local. |
| | 5719 | If you wish to have binaries under /usr/bin but other parts of the |
| | 5720 | installation under /usr/local, that's ok: you will be prompted |
| | 5721 | separately for each of the installation directories, the prefix being |
| | 5722 | only used to set the defaults. |
| | 5723 | |
| | 5724 | EOM |
| | 5725 | fn=d~ |
| | 5726 | rp='Installation prefix to use?' |
| | 5727 | . ./getfile |
| | 5728 | oldprefix='' |
| | 5729 | case "$prefix" in |
| | 5730 | '') ;; |
| | 5731 | *) |
| | 5732 | case "$ans" in |
| | 5733 | "$prefix") ;; |
| | 5734 | *) oldprefix="$prefix";; |
| | 5735 | esac |
| | 5736 | ;; |
| | 5737 | esac |
| | 5738 | prefix="$ans" |
| | 5739 | prefixexp="$ansexp" |
| | 5740 | |
| | 5741 | case "$afsroot" in |
| | 5742 | '') afsroot=/afs ;; |
| | 5743 | *) afsroot=$afsroot ;; |
| | 5744 | esac |
| | 5745 | |
| | 5746 | : is AFS running? |
| | 5747 | echo " " |
| | 5748 | case "$afs" in |
| | 5749 | $define|true) afs=true ;; |
| | 5750 | $undef|false) afs=false ;; |
| | 5751 | *) if test -d $afsroot; then |
| | 5752 | afs=true |
| | 5753 | else |
| | 5754 | afs=false |
| | 5755 | fi |
| | 5756 | ;; |
| | 5757 | esac |
| | 5758 | if $afs; then |
| | 5759 | echo "AFS may be running... I'll be extra cautious then..." >&4 |
| | 5760 | else |
| | 5761 | echo "AFS does not seem to be running..." >&4 |
| | 5762 | fi |
| | 5763 | |
| | 5764 | : determine installation prefix for where package is to be installed. |
| | 5765 | if $afs; then |
| | 5766 | $cat <<EOM |
| | 5767 | |
| | 5768 | Since you are running AFS, I need to distinguish the directory in which |
| | 5769 | files will reside from the directory in which they are installed (and from |
| | 5770 | which they are presumably copied to the former directory by occult means). |
| | 5771 | |
| | 5772 | EOM |
| | 5773 | case "$installprefix" in |
| | 5774 | '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;; |
| | 5775 | *) dflt="$installprefix";; |
| | 5776 | esac |
| | 5777 | else |
| | 5778 | $cat <<EOM |
| | 5779 | |
| | 5780 | In some special cases, particularly when building $package for distribution, |
| | 5781 | it is convenient to distinguish the directory in which files should be |
| | 5782 | installed from the directory ($prefix) in which they will |
| | 5783 | eventually reside. For most users, these two directories are the same. |
| | 5784 | |
| | 5785 | EOM |
| | 5786 | case "$installprefix" in |
| | 5787 | '') dflt=$prefix ;; |
| | 5788 | *) dflt=$installprefix;; |
| | 5789 | esac |
| | 5790 | fi |
| | 5791 | fn=d~ |
| | 5792 | rp='What installation prefix should I use for installing files?' |
| | 5793 | . ./getfile |
| | 5794 | installprefix="$ans" |
| | 5795 | installprefixexp="$ansexp" |
| | 5796 | |
| | 5797 | : set the prefixit variable, to compute a suitable default value |
| | 5798 | prefixit='case "$3" in |
| | 5799 | ""|none) |
| | 5800 | case "$oldprefix" in |
| | 5801 | "") eval "$1=\"\$$2\"";; |
| | 5802 | *) |
| | 5803 | case "$3" in |
| | 5804 | "") eval "$1=";; |
| | 5805 | none) |
| | 5806 | eval "tp=\"\$$2\""; |
| | 5807 | case "$tp" in |
| | 5808 | ""|" ") eval "$1=\"\$$2\"";; |
| | 5809 | *) eval "$1=";; |
| | 5810 | esac;; |
| | 5811 | esac;; |
| | 5812 | esac;; |
| | 5813 | *) |
| | 5814 | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; |
| | 5815 | case "$tp" in |
| | 5816 | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; |
| | 5817 | /*-$oldprefix/*|\~*-$oldprefix/*) |
| | 5818 | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; |
| | 5819 | *) eval "$1=\"\$$2\"";; |
| | 5820 | esac;; |
| | 5821 | esac' |
| | 5822 | |
| | 5823 | : get the patchlevel |
| | 5824 | echo " " |
| | 5825 | echo "Getting the current patchlevel..." >&4 |
| | 5826 | if $test -r $rsrc/patchlevel.h;then |
| | 5827 | revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` |
| | 5828 | patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| | 5829 | subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` |
| | 5830 | api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` |
| | 5831 | api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| | 5832 | api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` |
| | 5833 | perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'` |
| | 5834 | else |
| | 5835 | revision=0 |
| | 5836 | patchlevel=0 |
| | 5837 | subversion=0 |
| | 5838 | api_revision=0 |
| | 5839 | api_version=0 |
| | 5840 | api_subversion=0 |
| | 5841 | perl_patchlevel=0 |
| | 5842 | $echo "(You do not have patchlevel.h. Eek.)" |
| | 5843 | fi |
| | 5844 | if $test -r $rsrc/.patch ; then |
| | 5845 | if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then |
| | 5846 | perl_patchlevel=`cat $rsrc/.patch` |
| | 5847 | fi |
| | 5848 | fi |
| | 5849 | : Define a handy string here to avoid duplication in myconfig.SH and configpm. |
| | 5850 | version_patchlevel_string="version $patchlevel subversion $subversion" |
| | 5851 | case "$perl_patchlevel" in |
| | 5852 | 0|'') ;; |
| | 5853 | *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;; |
| | 5854 | esac |
| | 5855 | |
| | 5856 | $echo "(You have $package $version_patchlevel_string.)" |
| | 5857 | |
| | 5858 | case "$osname" in |
| | 5859 | dos|vms) |
| | 5860 | : XXX Should be a Configure test for double-dots in filenames. |
| | 5861 | version=`echo $revision $patchlevel $subversion | \ |
| | 5862 | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` |
| | 5863 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ |
| | 5864 | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` |
| | 5865 | ;; |
| | 5866 | *) |
| | 5867 | version=`echo $revision $patchlevel $subversion | \ |
| | 5868 | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` |
| | 5869 | api_versionstring=`echo $api_revision $api_version $api_subversion | \ |
| | 5870 | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` |
| | 5871 | ;; |
| | 5872 | esac |
| | 5873 | : Special case the 5.005_xx maintenance series, which used 5.005 |
| | 5874 | : without any subversion label as a subdirectory in $sitelib |
| | 5875 | if test "${api_revision}${api_version}${api_subversion}" = "550"; then |
| | 5876 | api_versionstring='5.005' |
| | 5877 | fi |
| | 5878 | |
| | 5879 | : determine installation style |
| | 5880 | : For now, try to deduce it from prefix unless it is already set. |
| | 5881 | : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. |
| | 5882 | case "$installstyle" in |
| | 5883 | '') case "$prefix" in |
| | 5884 | *perl*) dflt='lib';; |
| | 5885 | *) dflt='lib/perl5' ;; |
| | 5886 | esac |
| | 5887 | ;; |
| | 5888 | *) dflt="$installstyle" ;; |
| | 5889 | esac |
| | 5890 | : Probably not worth prompting for this since we prompt for all |
| | 5891 | : the directories individually, and the prompt would be too long and |
| | 5892 | : confusing anyway. |
| | 5893 | installstyle=$dflt |
| | 5894 | |
| | 5895 | : determine where private library files go |
| | 5896 | : Usual default is /usr/local/lib/perl5/$version. |
| | 5897 | : Also allow things like /opt/perl/lib/$version, since |
| | 5898 | : /opt/perl/lib/perl5... would be redundant. |
| | 5899 | : The default "style" setting is made in installstyle.U |
| | 5900 | case "$installstyle" in |
| | 5901 | *lib/perl5*) set dflt privlib lib/$package/$version ;; |
| | 5902 | *) set dflt privlib lib/$version ;; |
| | 5903 | esac |
| | 5904 | eval $prefixit |
| | 5905 | $cat <<EOM |
| | 5906 | |
| | 5907 | There are some auxiliary files for $package that need to be put into a |
| | 5908 | private library directory that is accessible by everyone. |
| | 5909 | |
| | 5910 | EOM |
| | 5911 | fn=d~+ |
| | 5912 | rp='Pathname where the private library files will reside?' |
| | 5913 | . ./getfile |
| | 5914 | privlib="$ans" |
| | 5915 | privlibexp="$ansexp" |
| | 5916 | : Change installation prefix, if necessary. |
| | 5917 | if $test X"$prefix" != X"$installprefix"; then |
| | 5918 | installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"` |
| | 5919 | else |
| | 5920 | installprivlib="$privlibexp" |
| | 5921 | fi |
| | 5922 | |
| | 5923 | : set the prefixup variable, to restore leading tilda escape |
| | 5924 | prefixup='case "$prefixexp" in |
| | 5925 | "$prefix") ;; |
| | 5926 | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; |
| | 5927 | esac' |
| | 5928 | |
| | 5929 | : determine where public architecture dependent libraries go |
| | 5930 | set archlib archlib |
| | 5931 | eval $prefixit |
| | 5932 | : privlib default is /usr/local/lib/$package/$version |
| | 5933 | : archlib default is /usr/local/lib/$package/$version/$archname |
| | 5934 | : privlib may have an optional trailing /share. |
| | 5935 | tdflt=`echo $privlib | $sed 's,/share$,,'` |
| | 5936 | tdflt=$tdflt/$archname |
| | 5937 | case "$archlib" in |
| | 5938 | '') dflt=$tdflt |
| | 5939 | ;; |
| | 5940 | *) dflt="$archlib" |
| | 5941 | ;; |
| | 5942 | esac |
| | 5943 | $cat <<EOM |
| | 5944 | |
| | 5945 | $spackage contains architecture-dependent library files. If you are |
| | 5946 | sharing libraries in a heterogeneous environment, you might store |
| | 5947 | these files in a separate location. Otherwise, you can just include |
| | 5948 | them with the rest of the public library files. |
| | 5949 | |
| | 5950 | EOM |
| | 5951 | fn=d+~ |
| | 5952 | rp='Where do you want to put the public architecture-dependent libraries?' |
| | 5953 | . ./getfile |
| | 5954 | archlib="$ans" |
| | 5955 | archlibexp="$ansexp" |
| | 5956 | if $test X"$archlib" = X"$privlib"; then |
| | 5957 | d_archlib="$undef" |
| | 5958 | else |
| | 5959 | d_archlib="$define" |
| | 5960 | fi |
| | 5961 | : Change installation prefix, if necessary. |
| | 5962 | if $test X"$prefix" != X"$installprefix"; then |
| | 5963 | installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"` |
| | 5964 | else |
| | 5965 | installarchlib="$archlibexp" |
| | 5966 | fi |
| | 5967 | |
| | 5968 | : see if setuid scripts can be secure |
| | 5969 | $cat <<EOM |
| | 5970 | |
| | 5971 | Some kernels have a bug that prevents setuid #! scripts from being |
| | 5972 | secure. Some sites have disabled setuid #! scripts because of this. |
| | 5973 | |
| | 5974 | First let's decide if your kernel supports secure setuid #! scripts. |
| | 5975 | (If setuid #! scripts would be secure but have been disabled anyway, |
| | 5976 | don't say that they are secure if asked.) |
| | 5977 | |
| | 5978 | EOM |
| | 5979 | |
| | 5980 | val="$undef" |
| | 5981 | if $test -d /dev/fd; then |
| | 5982 | echo "#!$ls" >reflect |
| | 5983 | chmod +x,u+s reflect |
| | 5984 | ./reflect >flect 2>&1 |
| | 5985 | if $contains "/dev/fd" flect >/dev/null; then |
| | 5986 | echo "Congratulations, your kernel has secure setuid scripts!" >&4 |
| | 5987 | val="$define" |
| | 5988 | else |
| | 5989 | $cat <<EOM |
| | 5990 | If you are not sure if they are secure, I can check but I'll need a |
| | 5991 | username and password different from the one you are using right now. |
| | 5992 | If you don't have such a username or don't want me to test, simply |
| | 5993 | enter 'none'. |
| | 5994 | |
| | 5995 | EOM |
| | 5996 | rp='Other username to test security of setuid scripts with?' |
| | 5997 | dflt='none' |
| | 5998 | . ./myread |
| | 5999 | case "$ans" in |
| | 6000 | n|none) |
| | 6001 | case "$d_suidsafe" in |
| | 6002 | '') echo "I'll assume setuid scripts are *not* secure." >&4 |
| | 6003 | dflt=n;; |
| | 6004 | "$undef") |
| | 6005 | echo "Well, the $hint value is *not* secure." >&4 |
| | 6006 | dflt=n;; |
| | 6007 | *) echo "Well, the $hint value *is* secure." >&4 |
| | 6008 | dflt=y;; |
| | 6009 | esac |
| | 6010 | ;; |
| | 6011 | *) |
| | 6012 | $rm -f reflect flect |
| | 6013 | echo "#!$ls" >reflect |
| | 6014 | chmod +x,u+s reflect |
| | 6015 | echo >flect |
| | 6016 | chmod a+w flect |
| | 6017 | echo '"su" will (probably) prompt you for '"$ans's password." |
| | 6018 | su $ans -c './reflect >flect' |
| | 6019 | if $contains "/dev/fd" flect >/dev/null; then |
| | 6020 | echo "Okay, it looks like setuid scripts are secure." >&4 |
| | 6021 | dflt=y |
| | 6022 | else |
| | 6023 | echo "I don't think setuid scripts are secure." >&4 |
| | 6024 | dflt=n |
| | 6025 | fi |
| | 6026 | ;; |
| | 6027 | esac |
| | 6028 | rp='Does your kernel have *secure* setuid scripts?' |
| | 6029 | . ./myread |
| | 6030 | case "$ans" in |
| | 6031 | [yY]*) val="$define";; |
| | 6032 | *) val="$undef";; |
| | 6033 | esac |
| | 6034 | fi |
| | 6035 | else |
| | 6036 | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 |
| | 6037 | echo "(That's for file descriptors, not floppy disks.)" |
| | 6038 | val="$undef" |
| | 6039 | fi |
| | 6040 | set d_suidsafe |
| | 6041 | eval $setvar |
| | 6042 | |
| | 6043 | $rm -f reflect flect |
| | 6044 | |
| | 6045 | : now see if they want to do setuid emulation |
| | 6046 | echo " " |
| | 6047 | val="$undef" |
| | 6048 | case "$d_suidsafe" in |
| | 6049 | "$define") |
| | 6050 | val="$undef" |
| | 6051 | echo "No need to emulate SUID scripts since they are secure here." >&4 |
| | 6052 | ;; |
| | 6053 | *) |
| | 6054 | $cat <<EOM |
| | 6055 | Some systems have disabled setuid scripts, especially systems where |
| | 6056 | setuid scripts cannot be secure. On systems where setuid scripts have |
| | 6057 | been disabled, the setuid/setgid bits on scripts are currently |
| | 6058 | useless. It is possible for $package to detect those bits and emulate |
| | 6059 | setuid/setgid in a secure fashion. This emulation will only work if |
| | 6060 | setuid scripts have been disabled in your kernel. |
| | 6061 | |
| | 6062 | EOM |
| | 6063 | case "$d_dosuid" in |
| | 6064 | "$define") dflt=y ;; |
| | 6065 | *) dflt=n ;; |
| | 6066 | esac |
| | 6067 | rp="Do you want to do setuid/setgid emulation?" |
| | 6068 | . ./myread |
| | 6069 | case "$ans" in |
| | 6070 | [yY]*) val="$define";; |
| | 6071 | *) val="$undef";; |
| | 6072 | esac |
| | 6073 | ;; |
| | 6074 | esac |
| | 6075 | set d_dosuid |
| | 6076 | eval $setvar |
| | 6077 | |
| | 6078 | : see if this is a malloc.h system |
| | 6079 | : we want a real compile instead of Inhdr because some systems have a |
| | 6080 | : malloc.h that just gives a compile error saying to use stdlib.h instead |
| | 6081 | echo " " |
| | 6082 | $cat >try.c <<EOCP |
| | 6083 | #include <stdlib.h> |
| | 6084 | #include <malloc.h> |
| | 6085 | int main () { return 0; } |
| | 6086 | EOCP |
| | 6087 | set try |
| | 6088 | if eval $compile; then |
| | 6089 | echo "<malloc.h> found." >&4 |
| | 6090 | val="$define" |
| | 6091 | else |
| | 6092 | echo "<malloc.h> NOT found." >&4 |
| | 6093 | val="$undef" |
| | 6094 | fi |
| | 6095 | $rm -f try.c try |
| | 6096 | set i_malloc |
| | 6097 | eval $setvar |
| | 6098 | |
| | 6099 | : check for void type |
| | 6100 | echo " " |
| | 6101 | echo "Checking to see how well your C compiler groks the void type..." >&4 |
| | 6102 | case "$voidflags" in |
| | 6103 | '') |
| | 6104 | $cat >try.c <<EOCP |
| | 6105 | #$i_stdlib I_STDLIB |
| | 6106 | #ifdef I_STDLIB |
| | 6107 | #include <stdlib.h> |
| | 6108 | #endif |
| | 6109 | #if TRY & 1 |
| | 6110 | void sub() { |
| | 6111 | #else |
| | 6112 | sub() { |
| | 6113 | #endif |
| | 6114 | extern void moo(); /* function returning void */ |
| | 6115 | void (*goo)(); /* ptr to func returning void */ |
| | 6116 | #if TRY & 8 |
| | 6117 | void *hue; /* generic ptr */ |
| | 6118 | #endif |
| | 6119 | #if TRY & 2 |
| | 6120 | void (*foo[10])(); |
| | 6121 | #endif |
| | 6122 | |
| | 6123 | #if TRY & 4 |
| | 6124 | if(goo == moo) { |
| | 6125 | exit(0); |
| | 6126 | } |
| | 6127 | #endif |
| | 6128 | exit(0); |
| | 6129 | } |
| | 6130 | int main() { sub(); } |
| | 6131 | EOCP |
| | 6132 | if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then |
| | 6133 | voidflags=$defvoidused |
| | 6134 | echo "Good. It appears to support void to the level $package wants.">&4 |
| | 6135 | if $contains warning .out >/dev/null 2>&1; then |
| | 6136 | echo "However, you might get some warnings that look like this:" |
| | 6137 | $cat .out |
| | 6138 | fi |
| | 6139 | else |
| | 6140 | echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 |
| | 6141 | if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then |
| | 6142 | echo "It supports 1..." |
| | 6143 | if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then |
| | 6144 | echo "It also supports 2..." |
| | 6145 | if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then |
| | 6146 | voidflags=7 |
| | 6147 | echo "And it supports 4 but not 8 definitely." |
| | 6148 | else |
| | 6149 | echo "It doesn't support 4..." |
| | 6150 | if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then |
| | 6151 | voidflags=11 |
| | 6152 | echo "But it supports 8." |
| | 6153 | else |
| | 6154 | voidflags=3 |
| | 6155 | echo "Neither does it support 8." |
| | 6156 | fi |
| | 6157 | fi |
| | 6158 | else |
| | 6159 | echo "It does not support 2..." |
| | 6160 | if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then |
| | 6161 | voidflags=13 |
| | 6162 | echo "But it supports 4 and 8." |
| | 6163 | else |
| | 6164 | if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then |
| | 6165 | voidflags=5 |
| | 6166 | echo "And it supports 4 but has not heard about 8." |
| | 6167 | else |
| | 6168 | echo "However it supports 8 but not 4." |
| | 6169 | fi |
| | 6170 | fi |
| | 6171 | fi |
| | 6172 | else |
| | 6173 | echo "There is no support at all for void." |
| | 6174 | voidflags=0 |
| | 6175 | fi |
| | 6176 | fi |
| | 6177 | esac |
| | 6178 | case "$voidflags" in |
| | 6179 | "$defvoidused") ;; |
| | 6180 | *) $cat >&4 <<'EOM' |
| | 6181 | Support flag bits are: |
| | 6182 | 1: basic void declarations. |
| | 6183 | 2: arrays of pointers to functions returning void. |
| | 6184 | 4: operations between pointers to and addresses of void functions. |
| | 6185 | 8: generic void pointers. |
| | 6186 | EOM |
| | 6187 | dflt="$voidflags"; |
| | 6188 | rp="Your void support flags add up to what?" |
| | 6189 | . ./myread |
| | 6190 | voidflags="$ans" |
| | 6191 | ;; |
| | 6192 | esac |
| | 6193 | $rm -f try.* .out |
| | 6194 | |
| | 6195 | : check for length of pointer |
| | 6196 | echo " " |
| | 6197 | case "$ptrsize" in |
| | 6198 | '') |
| | 6199 | echo "Checking to see how big your pointers are..." >&4 |
| | 6200 | if test "$voidflags" -gt 7; then |
| | 6201 | echo '#define VOID_PTR char *' > try.c |
| | 6202 | else |
| | 6203 | echo '#define VOID_PTR void *' > try.c |
| | 6204 | fi |
| | 6205 | $cat >>try.c <<EOCP |
| | 6206 | #include <stdio.h> |
| | 6207 | #$i_stdlib I_STDLIB |
| | 6208 | #ifdef I_STDLIB |
| | 6209 | #include <stdlib.h> |
| | 6210 | #endif |
| | 6211 | int main() |
| | 6212 | { |
| | 6213 | printf("%d\n", (int)sizeof(VOID_PTR)); |
| | 6214 | exit(0); |
| | 6215 | } |
| | 6216 | EOCP |
| | 6217 | set try |
| | 6218 | if eval $compile_ok; then |
| | 6219 | ptrsize=`$run ./try` |
| | 6220 | echo "Your pointers are $ptrsize bytes long." |
| | 6221 | else |
| | 6222 | dflt='4' |
| | 6223 | echo "(I can't seem to compile the test program. Guessing...)" >&4 |
| | 6224 | rp="What is the size of a pointer (in bytes)?" |
| | 6225 | . ./myread |
| | 6226 | ptrsize="$ans" |
| | 6227 | fi |
| | 6228 | ;; |
| | 6229 | esac |
| | 6230 | $rm -f try.c try |
| | 6231 | case "$use64bitall" in |
| | 6232 | "$define"|true|[yY]*) |
| | 6233 | case "$ptrsize" in |
| | 6234 | 4) cat <<EOM >&4 |
| | 6235 | |
| | 6236 | *** You have chosen a maximally 64-bit build, |
| | 6237 | *** but your pointers are only 4 bytes wide. |
| | 6238 | *** Please rerun Configure without -Duse64bitall. |
| | 6239 | EOM |
| | 6240 | case "$d_quad" in |
| | 6241 | define) |
| | 6242 | cat <<EOM >&4 |
| | 6243 | *** Since you have quads, you could possibly try with -Duse64bitint. |
| | 6244 | EOM |
| | 6245 | ;; |
| | 6246 | esac |
| | 6247 | cat <<EOM >&4 |
| | 6248 | *** Cannot continue, aborting. |
| | 6249 | |
| | 6250 | EOM |
| | 6251 | |
| | 6252 | exit 1 |
| | 6253 | ;; |
| | 6254 | esac |
| | 6255 | ;; |
| | 6256 | esac |
| | 6257 | |
| | 6258 | |
| | 6259 | : determine which malloc to compile in |
| | 6260 | echo " " |
| | 6261 | case "$usemymalloc" in |
| | 6262 | [yY]*|true|$define) dflt='y' ;; |
| | 6263 | [nN]*|false|$undef) dflt='n' ;; |
| | 6264 | *) case "$ptrsize" in |
| | 6265 | 4) dflt='y' ;; |
| | 6266 | *) dflt='n' ;; |
| | 6267 | esac |
| | 6268 | ;; |
| | 6269 | esac |
| | 6270 | rp="Do you wish to attempt to use the malloc that comes with $package?" |
| | 6271 | . ./myread |
| | 6272 | usemymalloc="$ans" |
| | 6273 | case "$ans" in |
| | 6274 | y*|true) |
| | 6275 | usemymalloc='y' |
| | 6276 | mallocsrc='malloc.c' |
| | 6277 | mallocobj="malloc$_o" |
| | 6278 | d_mymalloc="$define" |
| | 6279 | case "$libs" in |
| | 6280 | *-lmalloc*) |
| | 6281 | : Remove malloc from list of libraries to use |
| | 6282 | echo "Removing unneeded -lmalloc from library list" >&4 |
| | 6283 | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` |
| | 6284 | shift |
| | 6285 | libs="$*" |
| | 6286 | echo "libs = $libs" >&4 |
| | 6287 | ;; |
| | 6288 | esac |
| | 6289 | ;; |
| | 6290 | *) |
| | 6291 | usemymalloc='n' |
| | 6292 | mallocsrc='' |
| | 6293 | mallocobj='' |
| | 6294 | d_mymalloc="$undef" |
| | 6295 | ;; |
| | 6296 | esac |
| | 6297 | |
| | 6298 | : compute the return types of malloc and free |
| | 6299 | echo " " |
| | 6300 | $cat >malloc.c <<END |
| | 6301 | #$i_malloc I_MALLOC |
| | 6302 | #$i_stdlib I_STDLIB |
| | 6303 | #include <stdio.h> |
| | 6304 | #include <sys/types.h> |
| | 6305 | #ifdef I_MALLOC |
| | 6306 | #include <malloc.h> |
| | 6307 | #endif |
| | 6308 | #ifdef I_STDLIB |
| | 6309 | #include <stdlib.h> |
| | 6310 | #endif |
| | 6311 | #ifdef TRY_MALLOC |
| | 6312 | void *malloc(); |
| | 6313 | #endif |
| | 6314 | #ifdef TRY_FREE |
| | 6315 | void free(); |
| | 6316 | #endif |
| | 6317 | END |
| | 6318 | case "$malloctype" in |
| | 6319 | '') |
| | 6320 | if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then |
| | 6321 | malloctype='void *' |
| | 6322 | else |
| | 6323 | malloctype='char *' |
| | 6324 | fi |
| | 6325 | ;; |
| | 6326 | esac |
| | 6327 | echo "Your system wants malloc to return '$malloctype', it would seem." >&4 |
| | 6328 | |
| | 6329 | case "$freetype" in |
| | 6330 | '') |
| | 6331 | if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then |
| | 6332 | freetype='void' |
| | 6333 | else |
| | 6334 | freetype='int' |
| | 6335 | fi |
| | 6336 | ;; |
| | 6337 | esac |
| | 6338 | echo "Your system uses $freetype free(), it would seem." >&4 |
| | 6339 | $rm -f malloc.[co] |
| | 6340 | $cat <<EOM |
| | 6341 | |
| | 6342 | After $package is installed, you may wish to install various |
| | 6343 | add-on modules and utilities. Typically, these add-ons will |
| | 6344 | be installed under $prefix with the rest |
| | 6345 | of this package. However, you may wish to install such add-ons |
| | 6346 | elsewhere under a different prefix. |
| | 6347 | |
| | 6348 | If you do not wish to put everything under a single prefix, that's |
| | 6349 | ok. You will be prompted for the individual locations; this siteprefix |
| | 6350 | is only used to suggest the defaults. |
| | 6351 | |
| | 6352 | The default should be fine for most people. |
| | 6353 | |
| | 6354 | EOM |
| | 6355 | fn=d~+ |
| | 6356 | rp='Installation prefix to use for add-on modules and utilities?' |
| | 6357 | : XXX Here might be another good place for an installstyle setting. |
| | 6358 | case "$siteprefix" in |
| | 6359 | '') dflt=$prefix ;; |
| | 6360 | *) dflt=$siteprefix ;; |
| | 6361 | esac |
| | 6362 | . ./getfile |
| | 6363 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix |
| | 6364 | oldsiteprefix='' |
| | 6365 | case "$siteprefix" in |
| | 6366 | '') ;; |
| | 6367 | *) case "$ans" in |
| | 6368 | "$prefix") ;; |
| | 6369 | *) oldsiteprefix="$prefix";; |
| | 6370 | esac |
| | 6371 | ;; |
| | 6372 | esac |
| | 6373 | siteprefix="$ans" |
| | 6374 | siteprefixexp="$ansexp" |
| | 6375 | |
| | 6376 | : determine where site specific libraries go. |
| | 6377 | : Usual default is /usr/local/lib/perl5/site_perl/$version |
| | 6378 | : The default "style" setting is made in installstyle.U |
| | 6379 | : XXX No longer works with Prefixit stuff. |
| | 6380 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` |
| | 6381 | case "$sitelib" in |
| | 6382 | '') case "$installstyle" in |
| | 6383 | *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;; |
| | 6384 | *) dflt=$siteprefix/lib/site_$prog/$version ;; |
| | 6385 | esac |
| | 6386 | ;; |
| | 6387 | *) dflt="$sitelib" |
| | 6388 | ;; |
| | 6389 | esac |
| | 6390 | $cat <<EOM |
| | 6391 | |
| | 6392 | The installation process will create a directory for |
| | 6393 | site-specific extensions and modules. Most users find it convenient |
| | 6394 | to place all site-specific files in this directory rather than in the |
| | 6395 | main distribution directory. |
| | 6396 | |
| | 6397 | EOM |
| | 6398 | fn=d~+ |
| | 6399 | rp='Pathname for the site-specific library files?' |
| | 6400 | . ./getfile |
| | 6401 | sitelib="$ans" |
| | 6402 | sitelibexp="$ansexp" |
| | 6403 | sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` |
| | 6404 | : Change installation prefix, if necessary. |
| | 6405 | if $test X"$prefix" != X"$installprefix"; then |
| | 6406 | installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"` |
| | 6407 | else |
| | 6408 | installsitelib="$sitelibexp" |
| | 6409 | fi |
| | 6410 | |
| | 6411 | : determine where site specific architecture-dependent libraries go. |
| | 6412 | : sitelib default is /usr/local/lib/perl5/site_perl/$version |
| | 6413 | : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname |
| | 6414 | : sitelib may have an optional trailing /share. |
| | 6415 | case "$sitearch" in |
| | 6416 | '') dflt=`echo $sitelib | $sed 's,/share$,,'` |
| | 6417 | dflt="$dflt/$archname" |
| | 6418 | ;; |
| | 6419 | *) dflt="$sitearch" |
| | 6420 | ;; |
| | 6421 | esac |
| | 6422 | set sitearch sitearch none |
| | 6423 | eval $prefixit |
| | 6424 | $cat <<EOM |
| | 6425 | |
| | 6426 | The installation process will also create a directory for |
| | 6427 | architecture-dependent site-specific extensions and modules. |
| | 6428 | |
| | 6429 | EOM |
| | 6430 | fn=d~+ |
| | 6431 | rp='Pathname for the site-specific architecture-dependent library files?' |
| | 6432 | . ./getfile |
| | 6433 | sitearch="$ans" |
| | 6434 | sitearchexp="$ansexp" |
| | 6435 | : Change installation prefix, if necessary. |
| | 6436 | if $test X"$prefix" != X"$installprefix"; then |
| | 6437 | installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"` |
| | 6438 | else |
| | 6439 | installsitearch="$sitearchexp" |
| | 6440 | fi |
| | 6441 | |
| | 6442 | $cat <<EOM |
| | 6443 | |
| | 6444 | The installation process will also create a directory for |
| | 6445 | vendor-supplied add-ons. Vendors who supply perl with their system |
| | 6446 | may find it convenient to place all vendor-supplied files in this |
| | 6447 | directory rather than in the main distribution directory. This will |
| | 6448 | ease upgrades between binary-compatible maintenance versions of perl. |
| | 6449 | |
| | 6450 | Of course you may also use these directories in whatever way you see |
| | 6451 | fit. For example, you might use them to access modules shared over a |
| | 6452 | company-wide network. |
| | 6453 | |
| | 6454 | The default answer should be fine for most people. |
| | 6455 | This causes further questions about vendor add-ons to be skipped |
| | 6456 | and no vendor-specific directories will be configured for perl. |
| | 6457 | |
| | 6458 | EOM |
| | 6459 | rp='Do you want to configure vendor-specific add-on directories?' |
| | 6460 | case "$usevendorprefix" in |
| | 6461 | define|true|[yY]*) dflt=y ;; |
| | 6462 | *) : User may have set vendorprefix directly on Configure command line. |
| | 6463 | case "$vendorprefix" in |
| | 6464 | ''|' ') dflt=n ;; |
| | 6465 | *) dflt=y ;; |
| | 6466 | esac |
| | 6467 | ;; |
| | 6468 | esac |
| | 6469 | . ./myread |
| | 6470 | case "$ans" in |
| | 6471 | [yY]*) fn=d~+ |
| | 6472 | rp='Installation prefix to use for vendor-supplied add-ons?' |
| | 6473 | case "$vendorprefix" in |
| | 6474 | '') dflt='' ;; |
| | 6475 | *) dflt=$vendorprefix ;; |
| | 6476 | esac |
| | 6477 | . ./getfile |
| | 6478 | : XXX Prefixit unit does not yet support siteprefix and vendorprefix |
| | 6479 | oldvendorprefix='' |
| | 6480 | case "$vendorprefix" in |
| | 6481 | '') ;; |
| | 6482 | *) case "$ans" in |
| | 6483 | "$prefix") ;; |
| | 6484 | *) oldvendorprefix="$prefix";; |
| | 6485 | esac |
| | 6486 | ;; |
| | 6487 | esac |
| | 6488 | usevendorprefix="$define" |
| | 6489 | vendorprefix="$ans" |
| | 6490 | vendorprefixexp="$ansexp" |
| | 6491 | ;; |
| | 6492 | *) usevendorprefix="$undef" |
| | 6493 | vendorprefix='' |
| | 6494 | vendorprefixexp='' |
| | 6495 | ;; |
| | 6496 | esac |
| | 6497 | |
| | 6498 | case "$vendorprefix" in |
| | 6499 | '') d_vendorlib="$undef" |
| | 6500 | vendorlib='' |
| | 6501 | vendorlibexp='' |
| | 6502 | ;; |
| | 6503 | *) d_vendorlib="$define" |
| | 6504 | : determine where vendor-supplied modules go. |
| | 6505 | : Usual default is /usr/local/lib/perl5/vendor_perl/$version |
| | 6506 | case "$vendorlib" in |
| | 6507 | '') |
| | 6508 | prog=`echo $package | $sed 's/-*[0-9.]*$//'` |
| | 6509 | case "$installstyle" in |
| | 6510 | *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; |
| | 6511 | *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; |
| | 6512 | esac |
| | 6513 | ;; |
| | 6514 | *) dflt="$vendorlib" |
| | 6515 | ;; |
| | 6516 | esac |
| | 6517 | fn=d~+ |
| | 6518 | rp='Pathname for the vendor-supplied library files?' |
| | 6519 | . ./getfile |
| | 6520 | vendorlib="$ans" |
| | 6521 | vendorlibexp="$ansexp" |
| | 6522 | ;; |
| | 6523 | esac |
| | 6524 | vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"` |
| | 6525 | : Change installation prefix, if necessary. |
| | 6526 | if $test X"$prefix" != X"$installprefix"; then |
| | 6527 | installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"` |
| | 6528 | else |
| | 6529 | installvendorlib="$vendorlibexp" |
| | 6530 | fi |
| | 6531 | |
| | 6532 | case "$vendorprefix" in |
| | 6533 | '') d_vendorarch="$undef" |
| | 6534 | vendorarch='' |
| | 6535 | vendorarchexp='' |
| | 6536 | ;; |
| | 6537 | *) d_vendorarch="$define" |
| | 6538 | : determine where vendor-supplied architecture-dependent libraries go. |
| | 6539 | : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version |
| | 6540 | : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname |
| | 6541 | : vendorlib may have an optional trailing /share. |
| | 6542 | case "$vendorarch" in |
| | 6543 | '') dflt=`echo $vendorlib | $sed 's,/share$,,'` |
| | 6544 | dflt="$dflt/$archname" |
| | 6545 | ;; |
| | 6546 | *) dflt="$vendorarch" ;; |
| | 6547 | esac |
| | 6548 | fn=d~+ |
| | 6549 | rp='Pathname for vendor-supplied architecture-dependent files?' |
| | 6550 | . ./getfile |
| | 6551 | vendorarch="$ans" |
| | 6552 | vendorarchexp="$ansexp" |
| | 6553 | ;; |
| | 6554 | esac |
| | 6555 | : Change installation prefix, if necessary. |
| | 6556 | if $test X"$prefix" != X"$installprefix"; then |
| | 6557 | installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"` |
| | 6558 | else |
| | 6559 | installvendorarch="$vendorarchexp" |
| | 6560 | fi |
| | 6561 | |
| | 6562 | : Final catch-all directories to search |
| | 6563 | $cat <<EOM |
| | 6564 | |
| | 6565 | Lastly, you can have perl look in other directories for extensions and |
| | 6566 | modules in addition to those already specified. |
| | 6567 | These directories will be searched after |
| | 6568 | $sitearch |
| | 6569 | $sitelib |
| | 6570 | EOM |
| | 6571 | test X"$vendorlib" != "X" && echo ' ' $vendorlib |
| | 6572 | test X"$vendorarch" != "X" && echo ' ' $vendorarch |
| | 6573 | echo ' ' |
| | 6574 | case "$otherlibdirs" in |
| | 6575 | ''|' ') dflt='none' ;; |
| | 6576 | *) dflt="$otherlibdirs" ;; |
| | 6577 | esac |
| | 6578 | $cat <<EOM |
| | 6579 | Enter a colon-separated set of extra paths to include in perl's @INC |
| | 6580 | search path, or enter 'none' for no extra paths. |
| | 6581 | |
| | 6582 | EOM |
| | 6583 | |
| | 6584 | rp='Colon-separated list of additional directories for perl to search?' |
| | 6585 | . ./myread |
| | 6586 | case "$ans" in |
| | 6587 | ' '|''|none) otherlibdirs=' ' ;; |
| | 6588 | *) otherlibdirs="$ans" ;; |
| | 6589 | esac |
| | 6590 | case "$otherlibdirs" in |
| | 6591 | ' ') val=$undef ;; |
| | 6592 | *) val=$define ;; |
| | 6593 | esac |
| | 6594 | set d_perl_otherlibdirs |
| | 6595 | eval $setvar |
| | 6596 | |
| | 6597 | : Cruising for prototypes |
| | 6598 | echo " " |
| | 6599 | echo "Checking out function prototypes..." >&4 |
| | 6600 | $cat >prototype.c <<EOCP |
| | 6601 | #$i_stdlib I_STDLIB |
| | 6602 | #ifdef I_STDLIB |
| | 6603 | #include <stdlib.h> |
| | 6604 | #endif |
| | 6605 | int main(int argc, char *argv[]) { |
| | 6606 | exit(0);} |
| | 6607 | EOCP |
| | 6608 | if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then |
| | 6609 | echo "Your C compiler appears to support function prototypes." |
| | 6610 | val="$define" |
| | 6611 | else |
| | 6612 | echo "Your C compiler doesn't seem to understand function prototypes." |
| | 6613 | val="$undef" |
| | 6614 | fi |
| | 6615 | set prototype |
| | 6616 | eval $setvar |
| | 6617 | $rm -f prototype* |
| | 6618 | |
| | 6619 | case "$prototype" in |
| | 6620 | "$define") ;; |
| | 6621 | *) ansi2knr='ansi2knr' |
| | 6622 | echo " " |
| | 6623 | cat <<EOM >&4 |
| | 6624 | |
| | 6625 | $me: FATAL ERROR: |
| | 6626 | This version of $package can only be compiled by a compiler that |
| | 6627 | understands function prototypes. Unfortunately, your C compiler |
| | 6628 | $cc $ccflags |
| | 6629 | doesn't seem to understand them. Sorry about that. |
| | 6630 | |
| | 6631 | If GNU cc is available for your system, perhaps you could try that instead. |
| | 6632 | |
| | 6633 | Eventually, we hope to support building Perl with pre-ANSI compilers. |
| | 6634 | If you would like to help in that effort, please contact <perlbug@perl.org>. |
| | 6635 | |
| | 6636 | Aborting Configure now. |
| | 6637 | EOM |
| | 6638 | exit 2 |
| | 6639 | ;; |
| | 6640 | esac |
| | 6641 | |
| | 6642 | : determine where public executables go |
| | 6643 | echo " " |
| | 6644 | set dflt bin bin |
| | 6645 | eval $prefixit |
| | 6646 | fn=d~ |
| | 6647 | rp='Pathname where the public executables will reside?' |
| | 6648 | . ./getfile |
| | 6649 | if $test "X$ansexp" != "X$binexp"; then |
| | 6650 | installbin='' |
| | 6651 | fi |
| | 6652 | bin="$ans" |
| | 6653 | binexp="$ansexp" |
| | 6654 | : Change installation prefix, if necessary. |
| | 6655 | : XXX Bug? -- ignores Configure -Dinstallprefix setting. |
| | 6656 | if $test X"$prefix" != X"$installprefix"; then |
| | 6657 | installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"` |
| | 6658 | else |
| | 6659 | installbin="$binexp" |
| | 6660 | fi |
| | 6661 | |
| | 6662 | echo " " |
| | 6663 | case "$extras" in |
| | 6664 | '') dflt='n';; |
| | 6665 | *) dflt='y';; |
| | 6666 | esac |
| | 6667 | cat <<EOM |
| | 6668 | Perl can be built with extra modules or bundles of modules which |
| | 6669 | will be fetched from the CPAN and installed alongside Perl. |
| | 6670 | |
| | 6671 | Notice that you will need access to the CPAN; either via the Internet, |
| | 6672 | or a local copy, for example a CD-ROM or a local CPAN mirror. (You will |
| | 6673 | be asked later to configure the CPAN.pm module which will in turn do |
| | 6674 | the installation of the rest of the extra modules or bundles.) |
| | 6675 | |
| | 6676 | Notice also that if the modules require any external software such as |
| | 6677 | libraries and headers (the libz library and the zlib.h header for the |
| | 6678 | Compress::Zlib module, for example) you MUST have any such software |
| | 6679 | already installed, this configuration process will NOT install such |
| | 6680 | things for you. |
| | 6681 | |
| | 6682 | If this doesn't make any sense to you, just accept the default '$dflt'. |
| | 6683 | EOM |
| | 6684 | rp='Install any extra modules (y or n)?' |
| | 6685 | . ./myread |
| | 6686 | case "$ans" in |
| | 6687 | y|Y) |
| | 6688 | cat <<EOM |
| | 6689 | |
| | 6690 | Please list any extra modules or bundles to be installed from CPAN, |
| | 6691 | with spaces between the names. The names can be in any format the |
| | 6692 | 'install' command of CPAN.pm will understand. (Answer 'none', |
| | 6693 | without the quotes, to install no extra modules or bundles.) |
| | 6694 | EOM |
| | 6695 | rp='Extras?' |
| | 6696 | dflt="$extras" |
| | 6697 | . ./myread |
| | 6698 | extras="$ans" |
| | 6699 | esac |
| | 6700 | case "$extras" in |
| | 6701 | ''|'none') |
| | 6702 | val='' |
| | 6703 | $rm -f ../extras.lst |
| | 6704 | ;; |
| | 6705 | *) echo "(Saving the list of extras for later...)" |
| | 6706 | echo "$extras" > ../extras.lst |
| | 6707 | val="'$extras'" |
| | 6708 | ;; |
| | 6709 | esac |
| | 6710 | set extras |
| | 6711 | eval $setvar |
| | 6712 | echo " " |
| | 6713 | |
| | 6714 | : determine where html pages for programs go |
| | 6715 | set html1dir html1dir none |
| | 6716 | eval $prefixit |
| | 6717 | $cat <<EOM |
| | 6718 | |
| | 6719 | If you wish to install html files for programs in $spackage, indicate |
| | 6720 | the appropriate directory here. To skip installing html files, |
| | 6721 | answer "none". |
| | 6722 | EOM |
| | 6723 | case "$html1dir" in |
| | 6724 | ''|none|$undef|' ') dflt=none ;; |
| | 6725 | *) dflt=$html1dir ;; |
| | 6726 | esac |
| | 6727 | fn=dn+~ |
| | 6728 | rp="Directory for the main $spackage html pages?" |
| | 6729 | . ./getfile |
| | 6730 | html1dir="$ans" |
| | 6731 | html1direxp="$ansexp" |
| | 6732 | : Use ' ' for none so value is preserved next time through Configure |
| | 6733 | $test X"$html1dir" = "X" && html1dir=' ' |
| | 6734 | : Change installation prefix, if necessary. |
| | 6735 | if $test X"$prefix" != X"$installprefix"; then |
| | 6736 | installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"` |
| | 6737 | else |
| | 6738 | installhtml1dir="$html1direxp" |
| | 6739 | fi |
| | 6740 | |
| | 6741 | : determine where html pages for libraries and modules go |
| | 6742 | set html3dir html3dir none |
| | 6743 | eval $prefixit |
| | 6744 | $cat <<EOM |
| | 6745 | |
| | 6746 | If you wish to install html files for modules associated with $spackage, |
| | 6747 | indicate the appropriate directory here. To skip installing html files, |
| | 6748 | answer "none". |
| | 6749 | EOM |
| | 6750 | : There is no obvious default. If they have specified html1dir, then |
| | 6751 | : try to key off that, possibly changing .../html1 into .../html3. |
| | 6752 | case "$html3dir" in |
| | 6753 | '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;; |
| | 6754 | *) dflt=$html3dir ;; |
| | 6755 | esac |
| | 6756 | fn=dn+~ |
| | 6757 | rp="Directory for the $spackage module html pages?" |
| | 6758 | . ./getfile |
| | 6759 | html3dir="$ans" |
| | 6760 | html3direxp="$ansexp" |
| | 6761 | : Use ' ' for none so value is preserved next time through Configure |
| | 6762 | $test X"$html3dir" = "X" && html3dir=' ' |
| | 6763 | : Change installation prefix, if necessary. |
| | 6764 | if $test X"$prefix" != X"$installprefix"; then |
| | 6765 | installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"` |
| | 6766 | else |
| | 6767 | installhtml3dir="$html3direxp" |
| | 6768 | fi |
| | 6769 | |
| | 6770 | : Find perl5.005 or later. |
| | 6771 | echo "Looking for a previously installed perl5.005 or later... " |
| | 6772 | case "$perl5" in |
| | 6773 | '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do |
| | 6774 | : Check if this perl is recent and can load a simple module |
| | 6775 | if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then |
| | 6776 | perl5=$tdir/perl |
| | 6777 | break; |
| | 6778 | elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then |
| | 6779 | perl5=$tdir/perl5 |
| | 6780 | break; |
| | 6781 | fi |
| | 6782 | done |
| | 6783 | ;; |
| | 6784 | *) perl5="$perl5" |
| | 6785 | ;; |
| | 6786 | esac |
| | 6787 | case "$perl5" in |
| | 6788 | '') echo "None found. That's ok.";; |
| | 6789 | *) echo "Using $perl5." ;; |
| | 6790 | esac |
| | 6791 | |
| | 6792 | : Determine list of previous versions to include in @INC |
| | 6793 | $cat > getverlist <<EOPL |
| | 6794 | #!$perl5 -w |
| | 6795 | use File::Basename; |
| | 6796 | \$api_versionstring = "$api_versionstring"; |
| | 6797 | \$version = "$version"; |
| | 6798 | \$stem = "$sitelib_stem"; |
| | 6799 | \$archname = "$archname"; |
| | 6800 | EOPL |
| | 6801 | $cat >> getverlist <<'EOPL' |
| | 6802 | # Can't have leading @ because metaconfig interprets it as a command! |
| | 6803 | ;@inc_version_list=(); |
| | 6804 | # XXX Redo to do opendir/readdir? |
| | 6805 | if (-d $stem) { |
| | 6806 | chdir($stem); |
| | 6807 | ;@candidates = glob("5.*"); |
| | 6808 | } |
| | 6809 | else { |
| | 6810 | ;@candidates = (); |
| | 6811 | } |
| | 6812 | |
| | 6813 | # XXX ToDo: These comparisons must be reworked when two-digit |
| | 6814 | # subversions come along, so that 5.7.10 compares as greater than |
| | 6815 | # 5.7.3! By that time, hope that 5.6.x is sufficiently |
| | 6816 | # widespread that we can use the built-in version vectors rather |
| | 6817 | # than reinventing them here. For 5.6.0, however, we must |
| | 6818 | # assume this script will likely be run by 5.005_0x. --AD 1/2000. |
| | 6819 | foreach $d (@candidates) { |
| | 6820 | if ($d lt $version) { |
| | 6821 | if ($d ge $api_versionstring) { |
| | 6822 | unshift(@inc_version_list, grep { -d } "$d/$archname", $d); |
| | 6823 | } |
| | 6824 | elsif ($d ge "5.005") { |
| | 6825 | unshift(@inc_version_list, grep { -d } $d); |
| | 6826 | } |
| | 6827 | } |
| | 6828 | else { |
| | 6829 | # Skip newer version. I.e. don't look in |
| | 6830 | # 5.7.0 if we're installing 5.6.1. |
| | 6831 | } |
| | 6832 | } |
| | 6833 | |
| | 6834 | if (@inc_version_list) { |
| | 6835 | print join(' ', @inc_version_list); |
| | 6836 | } |
| | 6837 | else { |
| | 6838 | # Blank space to preserve value for next Configure run. |
| | 6839 | print " "; |
| | 6840 | } |
| | 6841 | EOPL |
| | 6842 | chmod +x getverlist |
| | 6843 | case "$inc_version_list" in |
| | 6844 | '') if test -x "$perl5$exe_ext"; then |
| | 6845 | dflt=`$perl5 getverlist` |
| | 6846 | else |
| | 6847 | dflt='none' |
| | 6848 | fi |
| | 6849 | ;; |
| | 6850 | $undef) dflt='none' ;; |
| | 6851 | *) eval dflt=\"$inc_version_list\" ;; |
| | 6852 | esac |
| | 6853 | case "$dflt" in |
| | 6854 | ''|' ') dflt=none ;; |
| | 6855 | esac |
| | 6856 | case "$dflt" in |
| | 6857 | 5.005) dflt=none ;; |
| | 6858 | esac |
| | 6859 | $cat <<EOM |
| | 6860 | |
| | 6861 | In order to ease the process of upgrading, this version of perl |
| | 6862 | can be configured to use modules built and installed with earlier |
| | 6863 | versions of perl that were installed under $prefix. Specify here |
| | 6864 | the list of earlier versions that this version of perl should check. |
| | 6865 | If Configure detected no earlier versions of perl installed under |
| | 6866 | $prefix, then the list will be empty. Answer 'none' to tell perl |
| | 6867 | to not search earlier versions. |
| | 6868 | |
| | 6869 | The default should almost always be sensible, so if you're not sure, |
| | 6870 | just accept the default. |
| | 6871 | EOM |
| | 6872 | |
| | 6873 | rp='List of earlier versions to include in @INC?' |
| | 6874 | . ./myread |
| | 6875 | case "$ans" in |
| | 6876 | [Nn]one|''|' ') inc_version_list=' ' ;; |
| | 6877 | *) inc_version_list="$ans" ;; |
| | 6878 | esac |
| | 6879 | case "$inc_version_list" in |
| | 6880 | ''|' ') |
| | 6881 | inc_version_list_init='0';; |
| | 6882 | *) inc_version_list_init=`echo $inc_version_list | |
| | 6883 | $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'` |
| | 6884 | ;; |
| | 6885 | esac |
| | 6886 | $rm -f getverlist |
| | 6887 | |
| | 6888 | : determine whether to install perl also as /usr/bin/perl |
| | 6889 | |
| | 6890 | echo " " |
| | 6891 | if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then |
| | 6892 | $cat <<EOM |
| | 6893 | Many scripts expect perl to be installed as /usr/bin/perl. |
| | 6894 | |
| | 6895 | If you want to, I can install the perl you are about to compile |
| | 6896 | as /usr/bin/perl (in addition to $bin/perl). |
| | 6897 | EOM |
| | 6898 | if test -f /usr/bin/perl; then |
| | 6899 | $cat <<EOM |
| | 6900 | |
| | 6901 | However, please note that because you already have a /usr/bin/perl, |
| | 6902 | overwriting that with a new Perl would very probably cause problems. |
| | 6903 | Therefore I'm assuming you don't want to do that (unless you insist). |
| | 6904 | |
| | 6905 | EOM |
| | 6906 | case "$installusrbinperl" in |
| | 6907 | "$define"|[yY]*) dflt='y';; |
| | 6908 | *) dflt='n';; |
| | 6909 | esac |
| | 6910 | else |
| | 6911 | $cat <<EOM |
| | 6912 | |
| | 6913 | Since you don't have a /usr/bin/perl I'm assuming creating one is okay. |
| | 6914 | |
| | 6915 | EOM |
| | 6916 | case "$installusrbinperl" in |
| | 6917 | "$undef"|[nN]*) dflt='n';; |
| | 6918 | *) dflt='y';; |
| | 6919 | esac |
| | 6920 | fi |
| | 6921 | rp="Do you want to install perl as /usr/bin/perl?" |
| | 6922 | . ./myread |
| | 6923 | case "$ans" in |
| | 6924 | [yY]*) val="$define";; |
| | 6925 | *) val="$undef" ;; |
| | 6926 | esac |
| | 6927 | else |
| | 6928 | val="$undef" |
| | 6929 | fi |
| | 6930 | set installusrbinperl |
| | 6931 | eval $setvar |
| 5838 | | |
| 5839 | | : see if sqrtl exists |
| 5840 | | set sqrtl d_sqrtl |
| 5841 | | eval $inlibc |
| 5842 | | |
| 5843 | | : check for length of double |
| 5844 | | echo " " |
| 5845 | | case "$doublesize" in |
| 5846 | | '') |
| 5847 | | echo "Checking to see how big your double precision numbers are..." >&4 |
| 5848 | | $cat >try.c <<'EOCP' |
| 5849 | | #include <stdio.h> |
| 5850 | | int main() |
| 5851 | | { |
| 5852 | | printf("%d\n", (int)sizeof(double)); |
| 5853 | | exit(0); |
| 5854 | | } |
| 5855 | | EOCP |
| 5856 | | set try |
| 5857 | | if eval $compile_ok; then |
| 5858 | | doublesize=`$run ./try` |
| 5859 | | echo "Your double is $doublesize bytes long." |
| 5860 | | else |
| 5861 | | dflt='8' |
| 5862 | | echo "(I can't seem to compile the test program. Guessing...)" |
| 5863 | | rp="What is the size of a double precision number (in bytes)?" |
| 5864 | | . ./myread |
| 5865 | | doublesize="$ans" |
| 5866 | | fi |
| 5867 | | ;; |
| 5868 | | esac |
| 5869 | | $rm -f try.c try |
| 5870 | | |
| 5871 | | : check for long doubles |
| 5872 | | echo " " |
| 5873 | | echo "Checking to see if you have long double..." >&4 |
| 5874 | | echo 'int main() { long double x = 7.0; }' > try.c |
| 5875 | | set try |
| 5876 | | if eval $compile; then |
| 5877 | | val="$define" |
| 5878 | | echo "You have long double." |
| 5879 | | else |
| 5880 | | val="$undef" |
| 5881 | | echo "You do not have long double." |
| 5882 | | fi |
| 5883 | | $rm try.* |
| 5884 | | set d_longdbl |
| 5885 | | eval $setvar |
| 5886 | | |
| 5887 | | : check for length of long double |
| 5888 | | case "${d_longdbl}${longdblsize}" in |
| 5889 | | $define) |
| 5890 | | echo " " |
| 5891 | | echo "Checking to see how big your long doubles are..." >&4 |
| 5892 | | $cat >try.c <<'EOCP' |
| 5893 | | #include <stdio.h> |
| 5894 | | int main() |
| 5895 | | { |
| 5896 | | printf("%d\n", sizeof(long double)); |
| 5897 | | } |
| 5898 | | EOCP |
| 5899 | | set try |
| 5900 | | set try |
| 5901 | | if eval $compile; then |
| 5902 | | longdblsize=`$run ./try` |
| 5903 | | echo "Your long doubles are $longdblsize bytes long." |
| 5904 | | else |
| 5905 | | dflt='8' |
| 5906 | | echo " " |
| 5907 | | echo "(I can't seem to compile the test program. Guessing...)" >&4 |
| 5908 | | rp="What is the size of a long double (in bytes)?" |
| 5909 | | . ./myread |
| 5910 | | longdblsize="$ans" |
| 5911 | | fi |
| 5912 | | if $test "X$doublesize" = "X$longdblsize"; then |
| 5913 | | echo "(That isn't any different from an ordinary double.)" |
| 5914 | | fi |
| 5915 | | ;; |
| 5916 | | esac |
| 5917 | | $rm -f try.* try |
| 5918 | | |
| 5919 | | echo " " |
| 5920 | | |
| 5921 | | if $test X"$d_longdbl" = X"$define"; then |
| 5922 | | |
| 5923 | | echo "Checking how to print long doubles..." >&4 |
| 5924 | | |
| 5925 | | if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then |
| 5926 | | $cat >try.c <<'EOCP' |
| 5927 | | #include <sys/types.h> |
| 5928 | | #include <stdio.h> |
| 5929 | | int main() { |
| 5930 | | double d = 123.456; |
| 5931 | | printf("%.3f\n", d); |
| 5932 | | } |
| 5933 | | EOCP |
| 5934 | | set try |
| 5935 | | if eval $compile; then |
| 5936 | | yyy=`$run ./try` |
| 5937 | | case "$yyy" in |
| 5938 | | 123.456) |
| 5939 | | sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"'; |
| 5940 | | sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"'; |
| 5941 | | echo "We will use %f." |
| 5942 | | ;; |
| 5943 | | esac |
| 5944 | | fi |
| 5945 | | fi |
| 5946 | | |
| 5947 | | if $test X"$sPRIfldbl" = X; then |
| 5948 | | $cat >try.c <<'EOCP' |
| 5949 | | #include <sys/types.h> |
| 5950 | | #include <stdio.h> |
| 5951 | | int main() { |
| 5952 | | long double d = 123.456; |
| 5953 | | printf("%.3Lf\n", d); |
| 5954 | | } |
| 5955 | | EOCP |
| 5956 | | set try |
| 5957 | | if eval $compile; then |
| 5958 | | yyy=`$run ./try` |
| 5959 | | case "$yyy" in |
| 5960 | | 123.456) |
| 5961 | | sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"'; |
| 5962 | | sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"'; |
| 5963 | | echo "We will use %Lf." |
| 5964 | | ;; |
| 5965 | | esac |
| 5966 | | fi |
| 5967 | | fi |
| 5968 | | |
| 5969 | | if $test X"$sPRIfldbl" = X; then |
| 5970 | | $cat >try.c <<'EOCP' |
| 5971 | | #include <sys/types.h> |
| 5972 | | #include <stdio.h> |
| 5973 | | int main() { |
| 5974 | | long double d = 123.456; |
| 5975 | | printf("%.3llf\n", d); |
| 5976 | | } |
| 5977 | | EOCP |
| 5978 | | set try |
| 5979 | | if eval $compile; then |
| 5980 | | yyy=`$run ./try` |
| 5981 | | case "$yyy" in |
| 5982 | | 123.456) |
| 5983 | | sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"'; |
| 5984 | | sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"'; |
| 5985 | | echo "We will use %llf." |
| 5986 | | ;; |
| 5987 | | esac |
| 5988 | | fi |
| 5989 | | fi |
| 5990 | | |
| 5991 | | if $test X"$sPRIfldbl" = X; then |
| 5992 | | $cat >try.c <<'EOCP' |
| 5993 | | #include <sys/types.h> |
| 5994 | | #include <stdio.h> |
| 5995 | | int main() { |
| 5996 | | long double d = 123.456; |
| 5997 | | printf("%.3lf\n", d); |
| 5998 | | } |
| 5999 | | EOCP |
| 6000 | | set try |
| 6001 | | if eval $compile; then |
| 6002 | | yyy=`$run ./try` |
| 6003 | | case "$yyy" in |
| 6004 | | 123.456) |
| 6005 | | sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"'; |
| 6006 | | sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"'; |
| 6007 | | echo "We will use %lf." |
| 6008 | | ;; |
| 6009 | | esac |
| 6010 | | fi |
| 6011 | | fi |
| 6012 | | |
| 6013 | | if $test X"$sPRIfldbl" = X; then |
| 6014 | | echo "Cannot figure out how to print long doubles." >&4 |
| 6015 | | else |
| 6016 | | sSCNfldbl=$sPRIfldbl # expect consistency |
| 6017 | | fi |
| 6018 | | |
| 6019 | | $rm -f try try.* |
| 6020 | | |
| 6021 | | fi # d_longdbl |
| 6022 | | |
| 6023 | | case "$sPRIfldbl" in |
| 6024 | | '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; |
| 6025 | | d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef"; |
| 6026 | | d_SCNfldbl="$undef"; |
| 6027 | | ;; |
| 6028 | | *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; |
| 6029 | | d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define"; |
| 6030 | | d_SCNfldbl="$define"; |
| 6031 | | ;; |
| 6032 | | esac |
| 6033 | | |
| 6034 | | : see if modfl exists |
| 6035 | | set modfl d_modfl |
| 6036 | | eval $inlibc |
| 6037 | | |
| 6038 | | d_modfl_pow32_bug="$undef" |
| 6039 | | |
| 6040 | | case "$d_longdbl$d_modfl" in |
| 6041 | | $define$define) |
| 6042 | | $cat <<EOM |
| 6043 | | Checking to see whether your modfl() is okay for large values... |
| 6044 | | EOM |
| 6045 | | $cat >try.c <<EOCP |
| 6046 | | #include <math.h> |
| 6047 | | #include <stdio.h> |
| 6048 | | int main() { |
| 6049 | | long double nv = 4294967303.15; |
| 6050 | | long double v, w; |
| 6051 | | v = modfl(nv, &w); |
| 6052 | | #ifdef __GLIBC__ |
| 6053 | | printf("glibc"); |
| 6054 | | #endif |
| 6055 | | printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w); |
| 6056 | | return 0; |
| 6057 | | } |
| 6058 | | EOCP |
| 6059 | | case "$osname:$gccversion" in |
| 6060 | | aix:) saveccflags="$ccflags" |
| 6061 | | ccflags="$ccflags -qlongdouble" ;; # to avoid core dump |
| 6062 | | esac |
| 6063 | | set try |
| 6064 | | if eval $compile; then |
| 6065 | | foo=`$run ./try` |
| 6066 | | case "$foo" in |
| 6067 | | *" 4294967303.150000 1.150000 4294967302.000000") |
| 6068 | | echo >&4 "Your modfl() is broken for large values." |
| 6069 | | d_modfl_pow32_bug="$define" |
| 6070 | | case "$foo" in |
| 6071 | | glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()." |
| 6072 | | ;; |
| 6073 | | esac |
| 6074 | | ;; |
| 6075 | | *" 4294967303.150000 0.150000 4294967303.000000") |
| 6076 | | echo >&4 "Your modfl() seems okay for large values." |
| 6077 | | ;; |
| 6078 | | *) echo >&4 "I don't understand your modfl() at all." |
| 6079 | | d_modfl="$undef" |
| 6080 | | ;; |
| 6081 | | esac |
| 6082 | | $rm -f try.* try core core.try.* |
| 6083 | | else |
| 6084 | | echo "I cannot figure out whether your modfl() is okay, assuming it isn't." |
| 6085 | | d_modfl="$undef" |
| 6086 | | fi |
| 6087 | | case "$osname:$gccversion" in |
| 6088 | | aix:) ccflags="$saveccflags" ;; # restore |
| 6089 | | esac |
| 6090 | | ;; |
| 6091 | | esac |
| 6092 | | |
| 6093 | | case "$ccflags" in |
| 6094 | | *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;; |
| 6095 | | esac |
| 6096 | | |
| 6097 | | case "$uselongdouble" in |
| 6098 | | $define|true|[yY]*) dflt='y';; |
| 6099 | | *) dflt='n';; |
| 6100 | | esac |
| 6101 | | cat <<EOM |
| 6102 | | |
| 6103 | | Perl can be built to take advantage of long doubles which |
| 6104 | | (if available) may give more accuracy and range for floating point numbers. |
| 6105 | | |
| 6106 | | If this doesn't make any sense to you, just accept the default '$dflt'. |
| 6107 | | EOM |
| 6108 | | rp='Try to use long doubles if available?' |
| 6109 | | . ./myread |
| 6110 | | case "$ans" in |
| 6111 | | y|Y) val="$define" ;; |
| 6112 | | *) val="$undef" ;; |
| 6113 | | esac |
| 6114 | | set uselongdouble |
| 6115 | | eval $setvar |
| 6116 | | |
| 6117 | | case "$uselongdouble" in |
| 6118 | | true|[yY]*) uselongdouble="$define" ;; |
| 6119 | | esac |
| 6120 | | |
| 6121 | | case "$uselongdouble" in |
| 6122 | | $define) |
| 6123 | | : Look for a hint-file generated 'call-back-unit'. If the |
| 6124 | | : user has specified that long doubles should be used, |
| 6125 | | : we may need to set or change some other defaults. |
| 6126 | | if $test -f uselongdouble.cbu; then |
| 6127 | | echo "Your platform has some specific hints for long doubles, using them..." |
| 6128 | | . ./uselongdouble.cbu |
| 6129 | | else |
| 6130 | | $cat <<EOM |
| 6131 | | (Your platform doesn't have any specific hints for long doubles.) |
| 6132 | | EOM |
| 6133 | | fi |
| 6134 | | ;; |
| 6135 | | esac |
| 6136 | | |
| 6137 | | message=X |
| 6138 | | case "$uselongdouble:$d_sqrtl:$d_modfl" in |
| 6139 | | $define:$define:$define) |
| 6140 | | : You have both |
| 6141 | | ;; |
| 6142 | | $define:$define:$undef) |
| 6143 | | message="I could not find modfl" |
| 6144 | | ;; |
| 6145 | | $define:$undef:$define) |
| 6146 | | message="I could not find sqrtl" |
| 6147 | | ;; |
| 6148 | | $define:$undef:$undef) |
| 6149 | | message="I found neither sqrtl nor modfl" |
| 6150 | | ;; |
| 6151 | | esac |
| 6152 | | |
| 6153 | | if $test "$message" != X; then |
| 6154 | | $cat <<EOM >&4 |
| 6155 | | |
| 6156 | | *** You requested the use of long doubles but you do not seem to have |
| 6157 | | *** the mathematic functions for long doubles. |
| 6158 | | *** ($message) |
| 6159 | | *** I'm disabling the use of long doubles. |
| 6160 | | |
| 6161 | | EOM |
| 6162 | | |
| 6163 | | uselongdouble=$undef |
| 6164 | | fi |
| 6165 | | |
| 6166 | | : determine the architecture name |
| 6167 | | echo " " |
| 6168 | | if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then |
| 6169 | | tarch=`arch`"-$osname" |
| 6170 | | elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then |
| 6171 | | if uname -m > tmparch 2>&1 ; then |
| 6172 | | tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \ |
| 6173 | | -e 's/$/'"-$osname/" tmparch` |
| 6174 | | else |
| 6175 | | tarch="$osname" |
| 6176 | | fi |
| 6177 | | $rm -f tmparch |
| 6178 | | else |
| 6179 | | tarch="$osname" |
| 6180 | | fi |
| 6181 | | case "$myarchname" in |
| 6182 | | ''|"$tarch") ;; |
| 6183 | | *) |
| 6184 | | echo "(Your architecture name used to be $myarchname.)" |
| 6185 | | archname='' |
| 6186 | | ;; |
| 6187 | | esac |
| 6188 | | case "$targetarch" in |
| 6189 | | '') ;; |
| 6190 | | *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; |
| 6191 | | esac |
| 6192 | | myarchname="$tarch" |
| 6193 | | case "$archname" in |
| 6194 | | '') dflt="$tarch";; |
| 6195 | | *) dflt="$archname";; |
| 6196 | | esac |
| 6197 | | rp='What is your architecture name' |
| 6198 | | . ./myread |
| 6199 | | archname="$ans" |
| 6200 | | case "$usethreads" in |
| 6201 | | $define) |
| 6202 | | echo "Threads selected." >&4 |
| 6203 | | case "$archname" in |
| 6204 | | *-thread*) echo "...and architecture name already has -thread." >&4 |
| 6205 | | ;; |
| 6206 | | *) archname="$archname-thread" |
| 6207 | | echo "...setting architecture name to $archname." >&4 |
| 6208 | | ;; |
| 6209 | | esac |
| 6210 | | ;; |
| 6211 | | esac |
| 6212 | | case "$usemultiplicity" in |
| 6213 | | $define) |
| 6214 | | echo "Multiplicity selected." >&4 |
| 6215 | | case "$archname" in |
| 6216 | | *-multi*) echo "...and architecture name already has -multi." >&4 |
| 6217 | | ;; |
| 6218 | | *) archname="$archname-multi" |
| 6219 | | echo "...setting architecture name to $archname." >&4 |
| 6220 | | ;; |
| 6221 | | esac |
| 6222 | | ;; |
| 6223 | | esac |
| 6224 | | case "$use64bitint$use64bitall" in |
| 6225 | | *"$define"*) |
| 6226 | | case "$archname64" in |
| 6227 | | '') |
| 6228 | | echo "This architecture is naturally 64-bit, not changing architecture name." >&4 |
| 6229 | | ;; |
| 6230 | | *) |
| 6231 | | case "$use64bitint" in |
| 6232 | | "$define") echo "64 bit integers selected." >&4 ;; |
| 6233 | | esac |
| 6234 | | case "$use64bitall" in |
| 6235 | | "$define") echo "Maximal 64 bitness selected." >&4 ;; |
| 6236 | | esac |
| 6237 | | case "$archname" in |
| 6238 | | *-$archname64*) echo "...and architecture name already has $archname64." >&4 |
| 6239 | | ;; |
| 6240 | | *) archname="$archname-$archname64" |
| 6241 | | echo "...setting architecture name to $archname." >&4 |
| 6242 | | ;; |
| 6243 | | esac |
| 6244 | | ;; |
| 6245 | | esac |
| 6246 | | esac |
| 6247 | | case "$uselongdouble" in |
| 6248 | | $define) |
| 6249 | | echo "Long doubles selected." >&4 |
| 6250 | | case "$longdblsize" in |
| 6251 | | $doublesize) |
| 6252 | | echo "...but long doubles are equal to doubles, not changing architecture name." >&4 |
| 6253 | | ;; |
| 6254 | | *) |
| 6255 | | case "$archname" in |
| 6256 | | *-ld*) echo "...and architecture name already has -ld." >&4 |
| 6257 | | ;; |
| 6258 | | *) archname="$archname-ld" |
| 6259 | | echo "...setting architecture name to $archname." >&4 |
| 6260 | | ;; |
| 6261 | | esac |
| 6262 | | ;; |
| 6263 | | esac |
| 6264 | | ;; |
| 6265 | | esac |
| 6266 | | case "$useperlio" in |
| 6267 | | $define) |
| 6268 | | echo "Perlio selected." >&4 |
| 6269 | | ;; |
| 6270 | | *) |
| 6271 | | echo "Perlio not selected, using stdio." >&4 |
| 6272 | | case "$archname" in |
| 6273 | | *-stdio*) echo "...and architecture name already has -stdio." >&4 |
| 6274 | | ;; |
| 6275 | | *) archname="$archname-stdio" |
| 6276 | | echo "...setting architecture name to $archname." >&4 |
| 6277 | | ;; |
| 6278 | | esac |
| 6279 | | ;; |
| 6280 | | esac |
| 6281 | | |
| 6282 | | : determine root of directory hierarchy where package will be installed. |
| 6283 | | case "$prefix" in |
| 6284 | | '') |
| 6285 | | dflt=`./loc . /usr/local /usr/local /local /opt /usr` |
| 6286 | | ;; |
| 6287 | | *) |
| 6288 | | dflt="$prefix" |
| 6289 | | ;; |
| 6290 | | esac |
| 6291 | | $cat <<EOM |
| 6292 | | |
| 6293 | | By default, $package will be installed in $dflt/bin, manual pages |
| 6294 | | under $dflt/man, etc..., i.e. with $dflt as prefix for all |
| 6295 | | installation directories. Typically this is something like /usr/local. |
| 6296 | | If you wish to have binaries under /usr/bin but other parts of the |
| 6297 | | installation under /usr/local, that's ok: you will be prompted |
| 6298 | | separately for each of the installation directories, the prefix being |
| 6299 | | only used to set the defaults. |
| 6300 | | |
| 6301 | | EOM |
| 6302 | | fn=d~ |
| 6303 | | rp='Installation prefix to use?' |
| 6304 | | . ./getfile |
| 6305 | | oldprefix='' |
| 6306 | | case "$prefix" in |
| 6307 | | '') ;; |
| 6308 | | *) |
| 6309 | | case "$ans" in |
| 6310 | | "$prefix") ;; |
| 6311 | | *) oldprefix="$prefix";; |
| 6312 | | esac |
| 6313 | | ;; |
| 6314 | | esac |
| 6315 | | prefix="$ans" |
| 6316 | | prefixexp="$ansexp" |
| 6317 | | |
| 6318 | | case "$afsroot" in |
| 6319 | | '') afsroot=/afs ;; |
| 6320 | | *) afsroot=$afsroot ;; |
| 6321 | | esac |
| 6322 | | |
| 6323 | | : is AFS running? |
| 6324 | | echo " " |
| 6325 | | case "$afs" in |
| 6326 | | $define|true) afs=true ;; |
| 6327 | | $undef|false) afs=false ;; |
| 6328 | | *) if test -d $afsroot; then |
| 6329 | | afs=true |
| 6330 | | else |
| 6331 | | afs=false |
| 6332 | | fi |
| 6333 | | ;; |
| 6334 | | esac |
| 6335 | | if $afs; then |
| 6336 | | echo "AFS may be running... I'll be extra cautious then..." >&4 |
| 6337 | | else |
| 6338 | | echo "AFS does not seem to be running..." >&4 |
| 6339 | | fi |
| 6340 | | |
| 6341 | | : determine installation prefix for where package is to be installed. |
| 6342 | | if $afs; then |
| 6343 | | $cat <<EOM |
| 6344 | | |
| 6345 | | Since you are running AFS, I need to distinguish the directory in which |
| 6346 | | files will reside from the directory in which they are installed (and from |
| 6347 | | which they are presumably copied to the former directory by occult means). |
| 6348 | | |
| 6349 | | EOM |
| 6350 | | case "$installprefix" in |
| 6351 | | '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;; |
| 6352 | | *) dflt="$installprefix";; |
| 6353 | | esac |
| 6354 | | else |
| 6355 | | $cat <<EOM |
| 6356 | | |
| 6357 | | In some special cases, particularly when building $package for distribution, |
| 6358 | | it is convenient to distinguish between the directory in which files should |
| 6359 | | be installed from the directory ($prefix) in which they |
| 6360 | | will eventually reside. For most users, these two directories are the same. |
| 6361 | | |
| 6362 | | EOM |
| 6363 | | case "$installprefix" in |
| 6364 | | '') dflt=$prefix ;; |
| 6365 | | *) dflt=$installprefix;; |
| 6366 | | esac |
| 6367 | | fi |
| 6368 | | fn=d~ |
| 6369 | | rp='What installation prefix should I use for installing files?' |
| 6370 | | . ./getfile |
| 6371 | | installprefix="$ans" |
| 6372 | | installprefixexp="$ansexp" |
| 6373 | | |
| 6374 | | : set the prefixit variable, to compute a suitable default value |
| 6375 | | prefixit='case "$3" in |
| 6376 | | ""|none) |
| 6377 | | case "$oldprefix" in |
| 6378 | | "") eval "$1=\"\$$2\"";; |
| 6379 | | *) |
| 6380 | | case "$3" in |
| 6381 | | "") eval "$1=";; |
| 6382 | | none) |
| 6383 | | eval "tp=\"\$$2\""; |
| 6384 | | case "$tp" in |
| 6385 | | ""|" ") eval "$1=\"\$$2\"";; |
| 6386 | | *) eval "$1=";; |
| 6387 | | esac;; |
| 6388 | | esac;; |
| 6389 | | esac;; |
| 6390 | | *) |
| 6391 | | eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\""; |
| 6392 | | case "$tp" in |
| 6393 | | --|/*--|\~*--) eval "$1=\"$prefix/$3\"";; |
| 6394 | | /*-$oldprefix/*|\~*-$oldprefix/*) |
| 6395 | | eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";; |
| 6396 | | *) eval "$1=\"\$$2\"";; |
| 6397 | | esac;; |
| 6398 | | esac' |
| 6399 | | |
| 6400 | | : get the patchlevel |
| 6401 | | echo " " |
| 6402 | | echo "Getting the current patchlevel..." >&4 |
| 6403 | | if $test -r $rsrc/patchlevel.h;then |
| 6404 | | revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` |
| 6405 | | patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| 6406 | | subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` |
| 6407 | | api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` |
| 6408 | | api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` |
| 6409 | | api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` |
| 6410 | | perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'` |
| 6411 | | else |
| 6412 | | revision=0 |
| 6413 | | patchlevel=0 |
| 6414 | | subversion=0 |
| 6415 | | api_revision=0 |
| 6416 | | api_version=0 |
| 6417 | | api_subversion=0 |
| 6418 | | perl_patchlevel=0 |
| 6419 | | $echo "(You do not have patchlevel.h. Eek.)" |
| 6420 | | fi |
| 6421 | | if $test -r $rsrc/.patch ; then |
| 6422 | | if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then |
| 6423 | | perl_patchlevel=`cat $rsrc/.patch` |
| 6424 | | fi |
| 6425 | | fi |
| 6426 | | : Define a handy string here to avoid duplication in myconfig.SH and configpm. |
| 6427 | | version_patchlevel_string="version $patchlevel subversion $subversion" |
| 6428 | | case "$perl_patchlevel" in |
| 6429 | | 0|'') ;; |
| 6430 | | *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;; |
| 6431 | | esac |
| 6432 | | |
| 6433 | | $echo "(You have $package $version_patchlevel_string.)" |
| 6434 | | |
| 6435 | | case "$osname" in |
| 6436 | | dos|vms) |
| 6437 | | : XXX Should be a Configure test for double-dots in filenames. |
| 6438 | | version=`echo $revision $patchlevel $subversion | \ |
| 6439 | | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` |
| 6440 | | api_versionstring=`echo $api_revision $api_version $api_subversion | \ |
| 6441 | | $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` |
| 6442 | | ;; |
| 6443 | | *) |
| 6444 | | version=`echo $revision $patchlevel $subversion | \ |
| 6445 | | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` |
| 6446 | | api_versionstring=`echo $api_revision $api_version $api_subversion | \ |
| 6447 | | $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` |
| 6448 | | ;; |
| 6449 | | esac |
| 6450 | | : Special case the 5.005_xx maintenance series, which used 5.005 |
| 6451 | | : without any subversion label as a subdirectory in $sitelib |
| 6452 | | if test "${api_revision}${api_version}${api_subversion}" = "550"; then |
| 6453 | | api_versionstring='5.005' |
| 6454 | | fi |
| 6455 | | |
| 6456 | | : determine installation style |
| 6457 | | : For now, try to deduce it from prefix unless it is already set. |
| 6458 | | : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7. |
| 6459 | | case "$installstyle" in |
| 6460 | | '') case "$prefix" in |
| 6461 | | *perl*) dflt='lib';; |
| 6462 | | *) dflt='lib/perl5' ;; |
| 6463 | | esac |
| 6464 | | ;; |
| 6465 | | *) dflt="$installstyle" ;; |
| 6466 | | esac |
| 6467 | | : Probably not worth prompting for this since we prompt for all |
| 6468 | | : the directories individually, and the prompt would be too long and |
| 6469 | | : confusing anyway. |
| 6470 | | installstyle=$dflt |
| 6471 | | |
| 6472 | | : determine where private library files go |
| 6473 | | : Usual default is /usr/local/lib/perl5/$version. |
| 6474 | | : Also allow things like /opt/perl/lib/$version, since |
| 6475 | | : /opt/perl/lib/perl5... would be redundant. |
| 6476 | | : The default "style" setting is made in installstyle.U |
| 6477 | | case "$installstyle" in |
| 6478 | | *lib/perl5*) set dflt privlib lib/$package/$version ;; |
| 6479 | | *) set dflt privlib lib/$version ;; |
| 6480 | | esac |
| 6481 | | eval $prefixit |
| 6482 | | $cat <<EOM |
| 6483 | | |
| 6484 | | There are some auxiliary files for $package that need to be put into a |
| 6485 | | private library directory that is accessible by everyone. |
| 6486 | | |
| 6487 | | EOM |
| 6488 | | fn=d~+ |
| 6489 | | rp='Pathname where the private library files will reside?' |
| 6490 | | . ./getfile |
| 6491 | | privlib="$ans" |
| 6492 | | privlibexp="$ansexp" |
| 6493 | | : Change installation prefix, if necessary. |
| 6494 | | if $test X"$prefix" != X"$installprefix"; then |
| 6495 | | installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"` |
| 6496 | | else |
| 6497 | | installprivlib="$privlibexp" |
| 6498 | | fi |
| 6499 | | |
| 6500 | | : set the prefixup variable, to restore leading tilda escape |
| 6501 | | prefixup='case "$prefixexp" in |
| 6502 | | "$prefix") ;; |
| 6503 | | *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";; |
| 6504 | | esac' |
| 6505 | | |
| 6506 | | : determine where public architecture dependent libraries go |
| 6507 | | set archlib archlib |
| 6508 | | eval $prefixit |
| 6509 | | : privlib default is /usr/local/lib/$package/$version |
| 6510 | | : archlib default is /usr/local/lib/$package/$version/$archname |
| 6511 | | : privlib may have an optional trailing /share. |
| 6512 | | tdflt=`echo $privlib | $sed 's,/share$,,'` |
| 6513 | | tdflt=$tdflt/$archname |
| 6514 | | case "$archlib" in |
| 6515 | | '') dflt=$tdflt |
| 6516 | | ;; |
| 6517 | | *) dflt="$archlib" |
| 6518 | | ;; |
| 6519 | | esac |
| 6520 | | $cat <<EOM |
| 6521 | | |
| 6522 | | $spackage contains architecture-dependent library files. If you are |
| 6523 | | sharing libraries in a heterogeneous environment, you might store |
| 6524 | | these files in a separate location. Otherwise, you can just include |
| 6525 | | them with the rest of the public library files. |
| 6526 | | |
| 6527 | | EOM |
| 6528 | | fn=d+~ |
| 6529 | | rp='Where do you want to put the public architecture-dependent libraries?' |
| 6530 | | . ./getfile |
| 6531 | | archlib="$ans" |
| 6532 | | archlibexp="$ansexp" |
| 6533 | | if $test X"$archlib" = X"$privlib"; then |
| 6534 | | d_archlib="$undef" |
| 6535 | | else |
| 6536 | | d_archlib="$define" |
| 6537 | | fi |
| 6538 | | : Change installation prefix, if necessary. |
| 6539 | | if $test X"$prefix" != X"$installprefix"; then |
| 6540 | | installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"` |
| 6541 | | else |
| 6542 | | installarchlib="$archlibexp" |
| 6543 | | fi |
| 6544 | | |
| 6545 | | : see if setuid scripts can be secure |
| 6546 | | $cat <<EOM |
| 6547 | | |
| 6548 | | Some kernels have a bug that prevents setuid #! scripts from being |
| 6549 | | secure. Some sites have disabled setuid #! scripts because of this. |
| 6550 | | |
| 6551 | | First let's decide if your kernel supports secure setuid #! scripts. |
| 6552 | | (If setuid #! scripts would be secure but have been disabled anyway, |
| 6553 | | don't say that they are secure if asked.) |
| 6554 | | |
| 6555 | | EOM |
| 6556 | | |
| 6557 | | val="$undef" |
| 6558 | | if $test -d /dev/fd; then |
| 6559 | | echo "#!$ls" >reflect |
| 6560 | | chmod +x,u+s reflect |
| 6561 | | ./reflect >flect 2>&1 |
| 6562 | | if $contains "/dev/fd" flect >/dev/null; then |
| 6563 | | echo "Congratulations, your kernel has secure setuid scripts!" >&4 |
| 6564 | | val="$define" |
| 6565 | | else |
| 6566 | | $cat <<EOM |
| 6567 | | If you are not sure if they are secure, I can check but I'll need a |
| 6568 | | username and password different from the one you are using right now. |
| 6569 | | If you don't have such a username or don't want me to test, simply |
| 6570 | | enter 'none'. |
| 6571 | | |
| 6572 | | EOM |
| 6573 | | rp='Other username to test security of setuid scripts with?' |
| 6574 | | dflt='none' |
| 6575 | | . ./myread |
| 6576 | | case "$ans" in |
| 6577 | | n|none) |
| 6578 | | case "$d_suidsafe" in |
| 6579 | | '') echo "I'll assume setuid scripts are *not* secure." >&4 |
| 6580 | | dflt=n;; |
| 6581 | | "$undef") |
| 6582 | | echo "Well, the $hint value is *not* secure." >&4 |
| 6583 | | dflt=n;; |
| 6584 | | *) echo "Well, the $hint value *is* secure." >&4 |
| 6585 | | dflt=y;; |
| 6586 | | esac |
| 6587 | | ;; |
| 6588 | | *) |
| 6589 | | $rm -f reflect flect |
| 6590 | | echo "#!$ls" >reflect |
| 6591 | | chmod +x,u+s reflect |
| 6592 | | echo >flect |
| 6593 | | chmod a+w flect |
| 6594 | | echo '"su" will (probably) prompt you for '"$ans's password." |
| 6595 | | su $ans -c './reflect >flect' |
| 6596 | | if $contains "/dev/fd" flect >/dev/null; then |
| 6597 | | echo "Okay, it looks like setuid scripts are secure." >&4 |
| 6598 | | dflt=y |
| 6599 | | else |
| 6600 | | echo "I don't think setuid scripts are secure." >&4 |
| 6601 | | dflt=n |
| 6602 | | fi |
| 6603 | | ;; |
| 6604 | | esac |
| 6605 | | rp='Does your kernel have *secure* setuid scripts?' |
| 6606 | | . ./myread |
| 6607 | | case "$ans" in |
| 6608 | | [yY]*) val="$define";; |
| 6609 | | *) val="$undef";; |
| 6610 | | esac |
| 6611 | | fi |
| 6612 | | else |
| 6613 | | echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4 |
| 6614 | | echo "(That's for file descriptors, not floppy disks.)" |
| 6615 | | val="$undef" |
| 6616 | | fi |
| 6617 | | set d_suidsafe |
| 6618 | | eval $setvar |
| 6619 | | |
| 6620 | | $rm -f reflect flect |
| 6621 | | |
| 6622 | | : now see if they want to do setuid emulation |
| 6623 | | echo " " |
| 6624 | | val="$undef" |
| 6625 | | case "$d_suidsafe" in |
| 6626 | | "$define") |
| 6627 | | val="$undef" |
| 6628 | | echo "No need to emulate SUID scripts since they are secure here." >&4 |
| 6629 | | ;; |
| 6630 | | *) |
| 6631 | | $cat <<EOM |
| 6632 | | Some systems have disabled setuid scripts, especially systems where |
| 6633 | | setuid scripts cannot be secure. On systems where setuid scripts have |
| 6634 | | been disabled, the setuid/setgid bits on scripts are currently |
| 6635 | | useless. It is possible for $package to detect those bits and emulate |
| 6636 | | setuid/setgid in a secure fashion. This emulation will only work if |
| 6637 | | setuid scripts have been disabled in your kernel. |
| 6638 | | |
| 6639 | | EOM |
| 6640 | | case "$d_dosuid" in |
| 6641 | | "$define") dflt=y ;; |
| 6642 | | *) dflt=n ;; |
| 6643 | | esac |
| 6644 | | rp="Do you want to do setuid/setgid emulation?" |
| 6645 | | . ./myread |
| 6646 | | case "$ans" in |
| 6647 | | [yY]*) val="$define";; |
| 6648 | | *) val="$undef";; |
| 6649 | | esac |
| 6650 | | ;; |
| 6651 | | esac |
| 6652 | | set d_dosuid |
| 6653 | | eval $setvar |
| 6654 | | |
| 6655 | | : see if this is a malloc.h system |
| 6656 | | set malloc.h i_malloc |
| 6657 | | eval $inhdr |
| 6658 | | |
| 6659 | | : see if stdlib is available |
| 6660 | | set stdlib.h i_stdlib |
| 6661 | | eval $inhdr |
| 6662 | | |
| 6663 | | : check for void type |
| 6664 | | echo " " |
| 6665 | | echo "Checking to see how well your C compiler groks the void type..." >&4 |
| 6666 | | case "$voidflags" in |
| 6667 | | '') |
| 6668 | | $cat >try.c <<'EOCP' |
| 6669 | | #if TRY & 1 |
| 6670 | | void sub() { |
| 6671 | | #else |
| 6672 | | sub() { |
| 6673 | | #endif |
| 6674 | | extern void moo(); /* function returning void */ |
| 6675 | | void (*goo)(); /* ptr to func returning void */ |
| 6676 | | #if TRY & 8 |
| 6677 | | void *hue; /* generic ptr */ |
| 6678 | | #endif |
| 6679 | | #if TRY & 2 |
| 6680 | | void (*foo[10])(); |
| 6681 | | #endif |
| 6682 | | |
| 6683 | | #if TRY & 4 |
| 6684 | | if(goo == moo) { |
| 6685 | | exit(0); |
| 6686 | | } |
| 6687 | | #endif |
| 6688 | | exit(0); |
| 6689 | | } |
| 6690 | | int main() { sub(); } |
| 6691 | | EOCP |
| 6692 | | if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then |
| 6693 | | voidflags=$defvoidused |
| 6694 | | echo "Good. It appears to support void to the level $package wants.">&4 |
| 6695 | | if $contains warning .out >/dev/null 2>&1; then |
| 6696 | | echo "However, you might get some warnings that look like this:" |
| 6697 | | $cat .out |
| 6698 | | fi |
| 6699 | | else |
| 6700 | | echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4 |
| 6701 | | if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then |
| 6702 | | echo "It supports 1..." |
| 6703 | | if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then |
| 6704 | | echo "It also supports 2..." |
| 6705 | | if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then |
| 6706 | | voidflags=7 |
| 6707 | | echo "And it supports 4 but not 8 definitely." |
| 6708 | | else |
| 6709 | | echo "It doesn't support 4..." |
| 6710 | | if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then |
| 6711 | | voidflags=11 |
| 6712 | | echo "But it supports 8." |
| 6713 | | else |
| 6714 | | voidflags=3 |
| 6715 | | echo "Neither does it support 8." |
| 6716 | | fi |
| 6717 | | fi |
| 6718 | | else |
| 6719 | | echo "It does not support 2..." |
| 6720 | | if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then |
| 6721 | | voidflags=13 |
| 6722 | | echo "But it supports 4 and 8." |
| 6723 | | else |
| 6724 | | if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then |
| 6725 | | voidflags=5 |
| 6726 | | echo "And it supports 4 but has not heard about 8." |
| 6727 | | else |
| 6728 | | echo "However it supports 8 but not 4." |
| 6729 | | fi |
| 6730 | | fi |
| 6731 | | fi |
| 6732 | | else |
| 6733 | | echo "There is no support at all for void." |
| 6734 | | voidflags=0 |
| 6735 | | fi |
| 6736 | | fi |
| 6737 | | esac |
| 6738 | | case "$voidflags" in |
| 6739 | | "$defvoidused") ;; |
| 6740 | | *) $cat >&4 <<'EOM' |
| 6741 | | Support flag bits are: |
| 6742 | | 1: basic void declarations. |
| 6743 | | 2: arrays of pointers to functions returning void. |
| 6744 | | 4: operations between pointers to and addresses of void functions. |
| 6745 | | 8: generic void pointers. |
| 6746 | | EOM |
| 6747 | | dflt="$voidflags"; |
| 6748 | | rp="Your void support flags add up to what?" |
| 6749 | | . ./myread |
| 6750 | | voidflags="$ans" |
| 6751 | | ;; |
| 6752 | | esac |
| 6753 | | $rm -f try.* .out |
| 6754 | | |
| 6755 | | : check for length of pointer |
| 6756 | | echo " " |
| 6757 | | case "$ptrsize" in |
| 6758 | | '') |
| 6759 | | echo "Checking to see how big your pointers are..." >&4 |
| 6760 | | if test "$voidflags" -gt 7; then |
| 6761 | | echo '#define VOID_PTR char *' > try.c |
| 6762 | | else |
| 6763 | | echo '#define VOID_PTR void *' > try.c |
| 6764 | | fi |
| 6765 | | $cat >>try.c <<'EOCP' |
| 6766 | | #include <stdio.h> |
| 6767 | | int main() |
| 6768 | | { |
| 6769 | | printf("%d\n", (int)sizeof(VOID_PTR)); |
| 6770 | | exit(0); |
| 6771 | | } |
| 6772 | | EOCP |
| 6773 | | set try |
| 6774 | | if eval $compile_ok; then |
| 6775 | | ptrsize=`$run ./try` |
| 6776 | | echo "Your pointers are $ptrsize bytes long." |
| 6777 | | else |
| 6778 | | dflt='4' |
| 6779 | | echo "(I can't seem to compile the test program. Guessing...)" >&4 |
| 6780 | | rp="What is the size of a pointer (in bytes)?" |
| 6781 | | . ./myread |
| 6782 | | ptrsize="$ans" |
| 6783 | | fi |
| 6784 | | ;; |
| 6785 | | esac |
| 6786 | | $rm -f try.c try |
| 6787 | | case "$use64bitall" in |
| 6788 | | "$define"|true|[yY]*) |
| 6789 | | case "$ptrsize" in |
| 6790 | | 4) cat <<EOM >&4 |
| 6791 | | |
| 6792 | | *** You have chosen a maximally 64-bit build, but your pointers |
| 6793 | | *** are only 4 bytes wide, disabling maximal 64-bitness. |
| 6794 | | |
| 6795 | | EOM |
| 6796 | | use64bitall="$undef" |
| 6797 | | case "$use64bitint" in |
| 6798 | | "$define"|true|[yY]*) ;; |
| 6799 | | *) cat <<EOM >&4 |
| 6800 | | |
| 6801 | | *** Downgrading from maximal 64-bitness to using 64-bit integers. |
| 6802 | | |
| 6803 | | EOM |
| 6804 | | use64bitint="$define" |
| 6805 | | ;; |
| 6806 | | esac |
| 6807 | | ;; |
| 6808 | | esac |
| 6809 | | ;; |
| 6810 | | esac |
| 6811 | | |
| 6812 | | |
| 6813 | | : determine which malloc to compile in |
| 6814 | | echo " " |
| 6815 | | case "$usemymalloc" in |
| 6816 | | [yY]*|true|$define) dflt='y' ;; |
| 6817 | | [nN]*|false|$undef) dflt='n' ;; |
| 6818 | | *) case "$ptrsize" in |
| 6819 | | 4) dflt='y' ;; |
| 6820 | | *) dflt='n' ;; |
| 6821 | | esac |
| 6822 | | ;; |
| 6823 | | esac |
| 6824 | | rp="Do you wish to attempt to use the malloc that comes with $package?" |
| 6825 | | . ./myread |
| 6826 | | usemymalloc="$ans" |
| 6827 | | case "$ans" in |
| 6828 | | y*|true) |
| 6829 | | usemymalloc='y' |
| 6830 | | mallocsrc='malloc.c' |
| 6831 | | mallocobj="malloc$_o" |
| 6832 | | d_mymalloc="$define" |
| 6833 | | case "$libs" in |
| 6834 | | *-lmalloc*) |
| 6835 | | : Remove malloc from list of libraries to use |
| 6836 | | echo "Removing unneeded -lmalloc from library list" >&4 |
| 6837 | | set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'` |
| 6838 | | shift |
| 6839 | | libs="$*" |
| 6840 | | echo "libs = $libs" >&4 |
| 6841 | | ;; |
| 6842 | | esac |
| 6843 | | ;; |
| 6844 | | *) |
| 6845 | | usemymalloc='n' |
| 6846 | | mallocsrc='' |
| 6847 | | mallocobj='' |
| 6848 | | d_mymalloc="$undef" |
| 6849 | | ;; |
| 6850 | | esac |
| 6851 | | |
| 6852 | | : compute the return types of malloc and free |
| 6853 | | echo " " |
| 6854 | | $cat >malloc.c <<END |
| 6855 | | #$i_malloc I_MALLOC |
| 6856 | | #$i_stdlib I_STDLIB |