From: Jarkko Hietaniemi Date: Fri, 25 Feb 2000 05:57:59 +0000 (+0000) Subject: Megalopatch for Configure: Andy's new installation schemes; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49c10eea37fecdc3f701b564ab530e9176f545c4;p=p5sagit%2Fp5-mst-13.2.git Megalopatch for Configure: Andy's new installation schemes; introduce usefull64bits, beautify and regularize the various type probes; introduce d_lseekproto. p4raw-id: //depot/cfgperl@5253 --- diff --git a/Configure b/Configure index b801ab8..126ff93 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 Thu Feb 24 20:37:06 EET 2000 [metaconfig 3.0 PL70] +# Generated on Fri Feb 25 07:45:17 EET 2000 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <&4 +echo "Checking to see how big your file offsets are..." >&4 $cat >try.c < #include @@ -4234,7 +4238,7 @@ EOCP set try if eval $compile_ok; then lseeksize=`./try` - $echo " $lseeksize bytes." >&4 + echo "Your file offsets are $lseeksize bytes long." else dflt=$longsize echo " " @@ -4255,7 +4259,7 @@ case "$fpostype" in *_t) zzz="$fpostype" ;; *) zzz="fpos_t" ;; esac -$echo $n "Checking the size of $zzz...$c" >&4 +echo "Checking the size of $zzz..." >&4 cat > try.c < #include @@ -4269,11 +4273,10 @@ if eval $compile_ok; then yyy=`./try` case "$yyy" in '') fpossize=4 - echo " " >&4 echo "(I can't execute the test program--guessing $fpossize.)" >&4 ;; *) fpossize=$yyy - echo " $fpossize bytes." >&4 + echo "Your $zzz is bytes long." >&4 ;; esac else @@ -4323,7 +4326,7 @@ case "$uselargefiles" in 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 + echo "Rechecking to see how big your file offsets are..." >&4 $cat >try.c < #include @@ -4336,7 +4339,7 @@ EOCP set try if eval $compile_ok; then lseeksize=`./try` - $echo " $lseeksize bytes." >&4 + $echo "Your file offsets are now $lseeksize bytes long." else dflt="$lseeksize" echo " " @@ -4367,7 +4370,7 @@ EOCP echo "(I can't execute the test program--guessing $fpossize.)" >&4 ;; *) fpossize=$yyy - echo " $fpossize bytes." + echo " $fpossize bytes." >&4 ;; esac else @@ -4395,28 +4398,40 @@ case "$usemorebits" in esac -case "$intsize:$longsize" in -8:*|*:8) cat <&4 + +*** Configure -Duselonglong is deprecated, using the -Duse64bits instead. -You have natively 64-bit integers. +EOM + use64bits="$define" + ;; +esac +case "$ccflags" in +*-DUSE_LONG_LONG*|*-DUSE_64_BITS*|*-DUSE_FULL_64_BITS*) use64bits="$define";; +esac +case "$usefull64bits" in +"$define"|true|[yY]*) use64bits="$define" ;; +esac + +case "$longsize" in +8) cat <&4 if $test -r $rsrc/patchlevel.h;then + revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h` patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h` api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h` api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h` else + revision=0 patchlevel=0 subversion=0 api_revision=0 api_version=0 api_subversion=0 fi -$echo $n "(You have $package" $c -case "$package" in -"*$baserev") ;; -*) $echo $n " $baserev" $c ;; -esac +$echo $n "(You have $package revision $revision" $c $echo $n " patchlevel $patchlevel" $c test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c echo ".)" case "$osname" in dos|vms) : XXX Should be a Configure test for double-dots in filenames. - version=`echo $baserev $patchlevel $subversion | \ + version=`echo $revision $patchlevel $subversion | \ $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` api_versionstring=`echo $api_revision $api_version $api_subversion | \ $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'` ;; *) - version=`echo $baserev $patchlevel $subversion | \ + version=`echo $revision $patchlevel $subversion | \ $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` api_versionstring=`echo $api_revision $api_version $api_subversion | \ $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'` @@ -5146,7 +5195,12 @@ EOM rp='Do you want to configure vendor-specific add-on directories?' case "$usevendorprefix" in define|true|[yY]*) dflt=y ;; -*) dflt=n ;; +*) : User may have set vendorprefix directly on Configure command line. + case "$vendorprefix" in + ''|' ') dflt=n ;; + *) dflt=y ;; + esac + ;; esac . ./myread case "$ans" in @@ -5157,6 +5211,7 @@ case "$ans" in *) dflt=$vendorprefix ;; esac . ./getfile + : XXX Prefixit unit does not yet support siteprefix and vendorprefix oldvendorprefix='' case "$vendorprefix" in '') ;; @@ -5184,24 +5239,30 @@ case "$vendorprefix" in *) d_vendorlib="$define" : determine where vendor-supplied modules go. : Usual default is /usr/local/lib/perl5/vendor_perl/$version - prog=`echo $package | $sed 's/-*[0-9.]*$//'` - case "$installstyle" in - *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; - *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; + case "$vendorlib" in + '') + prog=`echo $package | $sed 's/-*[0-9.]*$//'` + case "$installstyle" in + *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;; + *) dflt=$vendorprefix/lib/vendor_$prog/$version ;; + esac + ;; + *) dflt="$vendorlib" + ;; esac fn=d~+ rp='Pathname for the vendor-supplied library files?' . ./getfile vendorlib="$ans" vendorlibexp="$ansexp" - : Change installation prefix, if necessary. - if $test X"$prefix" != X"$installprefix"; then - installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"` - else - installvendorlib="$vendorlibexp" - fi ;; esac +: Change installation prefix, if necessary. +if $test X"$prefix" != X"$installprefix"; then + installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"` +else + installvendorlib="$vendorlibexp" +fi : Cruising for prototypes echo " " @@ -5264,6 +5325,28 @@ else installbin="$binexp" fi +: Find perl5.005 or later. +echo "Looking for a previously installed perl5.005 or later... " +case "$perl5" in +'') for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do + : Check if this perl is recent and can load a simple module + if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then + perl5=$tdir/perl + break; + elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then + perl5=$tdir/perl + break; + fi + done + ;; +*) perl5="$perl5" + ;; +esac +case "$perl5" in +'') echo "None found. That's ok.";; +*) echo "Using $perl5." ;; +esac + $cat < getverlist <&4 + echo "Checking to see how big your double precision numbers are..." >&4 $cat >try.c <<'EOCP' #include int main() @@ -7145,7 +7240,7 @@ EOCP set try if eval $compile_ok; then doublesize=`./try` - $echo " $doublesize bytes." >&4 + echo "Your double is $doublesize bytes long." else dflt='8' echo "(I can't seem to compile the test program. Guessing...)" @@ -7177,7 +7272,7 @@ eval $setvar case "${d_longdbl}${longdblsize}" in $define) echo " " - $echo $n "Checking to see how big your long doubles are..." $c >&4 + echo "Checking to see how big your long doubles are..." >&4 $cat >try.c <<'EOCP' #include int main() @@ -7189,7 +7284,7 @@ EOCP set try if eval $compile; then longdblsize=`./try$exe_ext` - $echo " $longdblsize bytes." >&4 + echo "Your long doubles are $longdblsize bytes long." else dflt='8' echo " " @@ -9416,7 +9511,7 @@ eval $setvar case "${d_longlong}${longlongsize}" in $define) echo " " - $echo $n "Checking to see how big your long longs are..." $c >&4 + echo "Checking to see how big your long longs are..." >&4 $cat >try.c <<'EOCP' #include int main() @@ -9428,7 +9523,7 @@ EOCP set try if eval $compile_ok; then longlongsize=`./try$exe_ext` - $echo " $longlongsize bytes." >&4 + echo "Your long longs are $longlongsize bytes long." else dflt='8' echo " " @@ -9444,6 +9539,11 @@ EOCP esac $rm -f try.* try +: see if prototype for lseek is available +echo " " +set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h +eval $hasproto + : see if lstat exists set lstat d_lstat eval $inlibc @@ -11595,6 +11695,9 @@ EOCP esac +: set the base revision +baserev=5.0 + : check for ordering of bytes in a long echo " " case "$crosscompile$multiarch" in @@ -12371,7 +12474,7 @@ if eval $compile_ok; then echo "(I can't execute the test program--guessing $gidsize.)" >&4 ;; *) gidsize=$yyy - echo "Your $zzz size is $gidsize bytes." + echo "Your $zzz is $gidsize bytes long." ;; esac else @@ -12916,7 +13019,7 @@ pm_apiversion='5.005' echo " " case "$ptrsize" in '') - $echo $n "Checking to see how big your pointers are...$c" >&4 + echo "Checking to see how big your pointers are..." >&4 if test "$voidflags" -gt 7; then echo '#define VOID_PTR char *' > try.c else @@ -12933,7 +13036,7 @@ EOCP set try if eval $compile_ok; then ptrsize=`./try` - $echo " $ptrsize bytes." >&4 + echo "Your pointers are $ptrsize bytes long." else dflt='4' echo "(I can't seem to compile the test program. Guessing...)" >&4 @@ -13512,7 +13615,7 @@ if eval $compile_ok; then echo "(I can't execute the test program--guessing $uidsize.)" >&4 ;; *) uidsize=$yyy - echo "Your $zzz size is $uidsize bytes." + echo "Your $zzz is $uidsize bytes long." ;; esac else @@ -14739,6 +14842,7 @@ d_locconv='$d_locconv' d_lockf='$d_lockf' d_longdbl='$d_longdbl' d_longlong='$d_longlong' +d_lseekproto='$d_lseekproto' d_lstat='$d_lstat' d_mblen='$d_mblen' d_mbstowcs='$d_mbstowcs' @@ -15136,6 +15240,7 @@ pager='$pager' passcat='$passcat' patchlevel='$patchlevel' path_sep='$path_sep' +perl5='$perl5' perl='$perl' perladmin='$perladmin' perlpath='$perlpath' @@ -15159,6 +15264,7 @@ randfunc='$randfunc' randseedtype='$randseedtype' ranlib='$ranlib' rd_nodata='$rd_nodata' +revision='$revision' rm='$rm' rmail='$rmail' runnm='$runnm' @@ -15259,6 +15365,7 @@ uquadtype='$uquadtype' use5005threads='$use5005threads' use64bits='$use64bits' usedl='$usedl' +usefull64bits='$usefull64bits' useithreads='$useithreads' uselargefiles='$uselargefiles' uselongdouble='$uselongdouble' diff --git a/INSTALL b/INSTALL index d387783..5fe174d 100644 --- a/INSTALL +++ b/INSTALL @@ -369,13 +369,13 @@ be used for installing those add-on modules and scripts. Configure variable Default value $siteprefix $prefix $sitebin $siteprefix/bin - $sitescriptdir $siteprefix/bin + $sitescript $siteprefix/bin $sitelib $siteprefix/lib/perl5/site_perl/$version $sitearch $siteprefix/lib/perl5/site_perl/$version/$archname - $siteman1dir $siteprefix/man/man1 - $siteman3dir $siteprefix/man/man3 - $sitehtml1dir (none) - $sitehtml3dir (none) + $siteman1 $siteprefix/man/man1 + $siteman3 $siteprefix/man/man3 + $sitehtml1 (none) + $sitehtml3 (none) By default, ExtUtils::MakeMaker will install architecture-independent modules into $sitelib and architecture-dependent modules into $sitearch. @@ -390,13 +390,13 @@ for you to use to distribute add-on modules. $vendorprefix (none) (The next ones are set only if vendorprefix is set.) $vendorbin $vendorprefix/bin - $vendorscriptdir $vendorprefix/bin + $vendorscript $vendorprefix/bin $vendorlib $vendorprefix/lib/perl5/vendor_perl/$version $vendorarch $vendorprefix/lib/perl5/vendor_perl/$version/$archname - $vendorman1dir $vendorprefix/man/man1 - $vendorman3dir $vendorprefix/man/man3 - $vendorhtml1dir (none) - $vendorhtml3dir (none) + $vendorman1 $vendorprefix/man/man1 + $vendorman3 $vendorprefix/man/man3 + $vendorhtml1 (none) + $vendorhtml3 (none) These are normally empty, but may be set as needed. For example, a vendor might choose the following settings: @@ -415,18 +415,18 @@ This would have the effect of setting the following: $man3dir /usr/man/man3 $sitebin /usr/local/bin - $sitescriptdir /usr/local/bin + $sitescript /usr/local/bin $sitelib /usr/local/lib/perl5/site_perl/$version $sitearch /usr/local/lib/perl5/site_perl/$version/$archname - $siteman1dir /usr/local/man/man1 - $siteman3dir /usr/local/man/man3 + $siteman1 /usr/local/man/man1 + $siteman3 /usr/local/man/man3 - $vendorbin /usr/bin - $vendorscriptdir /usr/bin + $vendorbin /usr/bin + $vendorscript /usr/bin $vendorlib /usr/lib/perl5/vendor_perl/$version $vendorarch /usr/lib/perl5/vendor_perl/$version/$archname - $vendorman1dir /usr/man/man1 - $vendorman3dir /usr/man/man3 + $vendorman1 /usr/man/man1 + $vendorman3 /usr/man/man3 Note how in this example, the vendor-supplied directories are in the /usr hierarchy, while the directories reserved for the end-user are in diff --git a/Policy_sh.SH b/Policy_sh.SH index b953046..0d9c1df 100644 --- a/Policy_sh.SH +++ b/Policy_sh.SH @@ -86,8 +86,8 @@ esac for var in \ bin scriptdir privlib archlib man1dir man3dir html1dir html3dir \ - sitebin sitescriptdir sitelib sitearch \ - siteman1dir siteman3dir sitehtml1dir sitehtml3dir \ + sitebin sitescript sitelib sitearch \ + siteman1 siteman3 sitehtml1 sitehtml3 \ vendorbin vendorscript vendorlib vendorarch \ vendorman1 vendorman3 vendorhtml1 vendorhtml3 do @@ -124,8 +124,7 @@ do # Directories for site-specific add-on files sitebin) dflt=$siteprefix/bin ;; - # The scriptdir test is more complex, but this is probably usually ok. - sitescriptdir) + sitescript) if $test -d $siteprefix/script; then dflt=$siteprefix/script else @@ -140,10 +139,10 @@ do ;; sitearch) dflt="$sitelib/$archname" ;; - siteman1dir) dflt="$siteprefix/man/man1" ;; - siteman3dir) dflt="$siteprefix/man/man3" ;; + siteman1) dflt="$siteprefix/man/man1" ;; + siteman3) dflt="$siteprefix/man/man3" ;; # We don't know what to do with these yet. - sitehtml1dir) dflt='' ;; + sitehtml1) dflt='' ;; sitehtm31dir) dflt='' ;; # Directories for vendor-supplied add-on files @@ -154,10 +153,7 @@ do else case "$var" in vendorbin) dflt=$vendorprefix/bin ;; - - # The scriptdir test is more complex, - # but this is probably usually ok. - vendorscriptdir) + vendorscript) if $test -d $vendorprefix/script; then dflt=$vendorprefix/script else @@ -172,11 +168,11 @@ do ;; vendorarch) dflt="$vendorlib/$archname" ;; - vendorman1dir) dflt="$vendorprefix/man/man1" ;; - vendorman3dir) dflt="$vendorprefix/man/man3" ;; + vendorman1) dflt="$vendorprefix/man/man1" ;; + vendorman3) dflt="$vendorprefix/man/man3" ;; # We don't know what to do with these yet. - vendorhtml1dir) dflt='' ;; - vendorhtm31dir) dflt='' ;; + vendorhtml1) dflt='' ;; + vendorhtm3) dflt='' ;; esac # End of vendorprefix != '' fi diff --git a/config_h.SH b/config_h.SH index cd14526..a65d0b8 100644 --- a/config_h.SH +++ b/config_h.SH @@ -2858,12 +2858,20 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- /* USE_64_BITS: * This symbol, if defined, indicates that 64-bit integers should * be used when available. If not defined, the native integers - * will be used (be they 32 or 64 bits). + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. + * To go all the way, use Configure -Dusefull64bits. */ #ifndef USE_64_BITS #$use64bits USE_64_BITS /**/ #endif +#ifndef USE_FULL_64_BITS +#$usefull64bits USE_FULL_64_BITS /**/ +#endif + /* USE_LARGE_FILES: * This symbol, if defined, indicates that large file support * should be used when available. The USE_64_BITS symbol will @@ -2999,5 +3007,13 @@ sed <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #define PERL_XS_APIVERSION "$xs_apiversion" #define PERL_PM_APIVERSION "$pm_apiversion" +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek(int, off_t, int); + */ +#$d_lseekproto HAS_LSEEK_PROTO /**/ + #endif !GROK!THIS! diff --git a/perl.h b/perl.h index ad5af2f..73a67f4 100644 --- a/perl.h +++ b/perl.h @@ -2108,7 +2108,7 @@ char *crypt (const char*, const char*); # ifndef getenv char *getenv (const char*); # endif /* !getenv */ -# if !defined(EPOC) && !(defined(__hpux) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) +# if !defined(EPOC) && !(defined(__hpux) && defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64) && !defined(HAS_LSEEK_PROTO) Off_t lseek (int,Off_t,int); # endif # endif /* !DONT_DECLARE_STD */ diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 4fd3ce4..90c81de 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -386,12 +386,20 @@ process starts. Run C to find out the full C<-A> syntax. =head2 Enhanced Installation Directories -The installation structure has been enriched to improve the support for -maintaining multiple versions of perl, to provide locations for -vendor-supplied modules and scripts, and to ease maintenance of -locally-added modules and scripts. See the section on Installation -Directories in the INSTALL file for complete details. For most users -building and installing from source, the defaults should be fine. +The installation structure has been enriched to improve the support +for maintaining multiple versions of perl, to provide locations for +vendor-supplied modules, scripts, and manpages, and to ease maintenance +of locally-added modules, scripts, and manpages. See the section on +Installation Directories in the INSTALL file for complete details. +For most users building and installing from source, the defaults should +be fine. + +If you previously used C or C<-Dsitearch> to set +special values for library directories, you might wish to consider using +the new C<-Dsiteprefix> setting instead. Also, if you wish to re-use a +config.sh file from an earlier version of perl, you should be sure to +check that Configure makes sensible choices for the new directories. +See INSTALL for complete details. =head1 Core Changes @@ -672,6 +680,22 @@ change. Bit arithmetics for bit vector scalars (created by vec()) are not limited in their width, you can use the & | ^ ~ operators on such scalars. +There are actually two modes of 64-bitness: the first one is achieved +using Configure -Duse64bits and the second one using Configure +-Dusefull64bits. The difference is that the first one is minimal and +the second one maximal. The first one does only as much as is +required to get 64-bit integers into Perl (this may mean, for example, +using "long longs") while your memory may still be limited to 2 +gigabytes (because your pointers most likely are 32-bit); the second +one goes all the way by attempting to switch also longs (and pointers) +being 64-bit. This may create an even more binary incompatible Perl +than -Duse64bits: the resulting executable may not run at all in a +CPU-bit box, or you may have to reboot/reconfigure/rebuild your +operating system to be 64-bit aware. + +Natively 64-bit systems like Alpha and Cray need neither -Duse64bits +nor -Dusefull64bits. + Last but not least: note that due to Perl's habit of always using floating point numbers the quads are still not true integers. When quads overflow their limits (0...18_446_744_073_709_551_615 unsigned,