From: Jarkko Hietaniemi Date: Wed, 13 Oct 1999 16:18:58 +0000 (+0000) Subject: Integrate with Sarathy. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dfed14d211a4828e9d879513466e41afb47fa3fb;hp=c6edd1b70d14150d131fd75a659861624fe0aa6f;p=p5sagit%2Fp5-mst-13.2.git Integrate with Sarathy. p4raw-id: //depot/cfgperl@4369 --- diff --git a/MANIFEST b/MANIFEST index 9669df8..aebd662 100644 --- a/MANIFEST +++ b/MANIFEST @@ -207,6 +207,7 @@ ext/DB_File/DB_File_BS Berkeley DB extension mkbootstrap fodder ext/DB_File/Makefile.PL Berkeley DB extension makefile writer ext/DB_File/dbinfo Berkeley DB database version checker ext/DB_File/hints/dynixptx.pl Hint for DB_File for named architecture +ext/DB_File/hints/sco.pl Hint for DB_File for named architecture ext/DB_File/typemap Berkeley DB extension interface types ext/DB_File/version.c Berkeley DB extension interface version check ext/Data/Dumper/Changes Data pretty printer, changelog diff --git a/ext/DB_File/hints/sco.pl b/ext/DB_File/hints/sco.pl new file mode 100644 index 0000000..ff60440 --- /dev/null +++ b/ext/DB_File/hints/sco.pl @@ -0,0 +1,2 @@ +# osr5 needs to explicitly link against libc to pull in some static symbols +$self->{LIBS} = ['-ldb -lc'] if $Config{'osvers'} =~ '3\.2v5\.0\..' ; diff --git a/hints/aix.sh b/hints/aix.sh index bd1d859..60ca22a 100644 --- a/hints/aix.sh +++ b/hints/aix.sh @@ -230,29 +230,15 @@ EOCBU # terminateAndUnload() which work correctly with C++ statics while libc # load() and unload() do not. See ext/DynaLoader/dl_aix.xs. # The C-to-C_r switch is done by usethreads.cbu, if needed. -if test -f /lib/libC.a; then - case "$cc" in - xlC*) - # Cify libswanted for xlC. - set `echo X "$libswanted "| sed -e 's/ c / C /'` - shift - libswanted="$*" - # Cify lddlflags for xlC. - set `echo X "$lddlflags "| sed -e 's/ -lc / -lC /'` - shift - lddlflags="$*" - ;; - *) - # Cify libswanted for non-xlC. - set `echo X "$libswanted "| sed -e 's/ c / c C /'` - shift - libswanted="$*" - # Cify lddlflags for non-xlC. - set `echo X "$lddlflags "| sed -e 's/ -lc / -lc -lC /'` - shift - lddlflags="$*" - ;; - esac +if test -f /lib/libC.a -a X"$gccversion" = X; then + # Cify libswanted. + set `echo X "$libswanted "| sed -e 's/ c / C c /'` + shift + libswanted="$*" + # Cify lddlflags. + set `echo X "$lddlflags "| sed -e 's/ -lc / -lC -lc /'` + shift + lddlflags="$*" fi # EOF diff --git a/hints/linux.sh b/hints/linux.sh index c1172ca..e9af509 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -258,6 +258,15 @@ fi #'osfmach3ppc') ccdlflags='-Wl,-E' ;; #esac +case "`uname -r`" in +sparc-linux) + case "$cccdlflags" in + *-fpic*) cccdlflags="`echo $cccdlflags|sed 's/-fpic/-fPIC/'`" ;; + *) cccdlflags="$cccdlflags -fPIC" ;; + esac + ;; +esac + # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. cat > UU/usethreads.cbu <<'EOCBU' diff --git a/hints/svr5.sh b/hints/svr5.sh index 44c03c9..6a76ea5 100644 --- a/hints/svr5.sh +++ b/hints/svr5.sh @@ -1,57 +1,72 @@ -# svr5 hints, System V Release 5.x -# Last modified 1999/09/21 by Boyd Gerber, gerberb@zenez.com +# svr5 hints, System V Release 5.x (UnixWare 7) +# Reworked by hops@sco.com Sept 1999 for better platform support +# Boyd Gerber, gerberb@zenez.com 1999/09/21 for threads support. +# Originally taken from svr4 hints.sh 21-Sep-98 hops@sco.com +# which was version of 1996/10/25 by Tye McQueen, tye@metronet.com +# Use Configure -Dusethreads to enable threads. # Use Configure -Dcc=gcc to use gcc. case "$cc" in '') cc='/bin/cc' test -f $cc || cc='/usr/ccs/bin/cc' ;; - *) - case "$gccversion" in - *2.95*) - ccflags='-fno-strict-aliasing' - ;; - *);; +*gcc*) + # "$gccversion" not set yet + vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'` + case $vers in + *2.95*) + ccflags='-fno-strict-aliasing' + # More optimisation provided in gcc-2.95 causes miniperl to segv. + # -fno-strict-aliasing is supposed to correct this but + # if it doesn't and you get segv when the build runs miniperl then + # disable optimisation as below + # optimize=' ' + ;; esac - ;; + ;; esac -# want_ucb='' -# want_dbm='yes' -want_gdbm='yes' - -# We include support for using libraries in /usr/ucblib, but the setting -# of libswanted excludes some libraries found there. If you run into -# problems, you may have to remove "ucb" from libswanted. Just delete -# the comment '#' from the sed command below. -# ldflags='-L/usr/ccs/lib -L/usr/ucblib' -# ccflags='-I/usr/include -I/usr/ucbinclude' -# Don't use problematic libraries: -libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'` -# libmalloc.a - Probably using Perl's malloc() anyway. -# libucb.a - Remove it if you have problems ld'ing. We include it because -# it is needed for ODBM_File and NDBM_File extensions. +# Hardwire the processor to 586 for consistancy with autoconf +# archname='i586-svr5' +# -- seems this is generally disliked by perl porters so leave it to float + +# Our default setup excludes anything from /usr/ucblib (and consequently dbm) +# as later modules assume symbols found are available in shared libs +# On svr5 these are static archives which causes problems for +# dynamic modules loaded later (and ucblib is a bad dream anyway) +# +# However there is a dbm library built from the ucb sources outside ucblib +# at http://www.sco.com/skunkware (installing into /usr/local) so if we +# detect this we'll use it. You can change the default +# (to allow ucblib and its dbm or disallowing non ucb dbm) by +# changing 'want_*' config values below to '' to disable or otherwise to enable + +# Leave leading tabs so Configure doesn't propagate variables to config.sh + + want_ucb='' # don't use anything from /usr/ucblib - icky + want_dbm='yes' # use dbm if can find library in /usr/local/lib + want_gdbm='yes' # use gdbm if can find library in /usr/local/lib + want_udk70='' # link with old static libc pieces + # link with udk70 if want resulting binary to run on uw7.0* + # - it will link in referenced static symbols of libc that are (now) + # in the shared libc.so on 7.1 but were not in 7.0. + # There are still scenarios where this is still insufficient so + # overall it is preferable to get ptf7051e + # ftp://ftp.sco.com/SLS/ptf7051e.Z + # installed on any/all 7.0 systems. if [ "$want_ucb" ] ; then - ldflags= '-L/usr/ccs/lib -L/usr/ucblib' - ccflags='-I/usr/include -I/usr/ucbinclude' - if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library: - d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert(). - # Use the "native" counterparts, not the BSD emulation stuff: - d_bcmp='undef' d_bcopy='undef' d_bzero='undef' d_safebcpy='undef' - d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef' - d_setlinebuf='undef' - # d_setregid='undef' d_setreuid='undef' # ??? - fi + ldflags= '-L/usr/ucblib' + ccflags='-I/usr/ucbinclude' + # /usr/ccs/include and /usr/ccs/lib are used implicitly by cc as reqd else -# libswanted=`echo " $libswanted " | sed -e 's/ ucb / /' -e 's/ dbm / /'` libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'` glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'` - # a non ucb native version of libdbm for /usr/local is available from - # http://www.sco.com/skunkware - # if its installed (and not overidden) we'll use it. + # If see libdbm in /usr/local and not overidden assume its the + # non ucblib rebuild from skunkware and use it if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then + i_dbm='undef' libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'` fi fi @@ -63,38 +78,32 @@ else libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'` fi + # Don't use problematic libraries: # libmalloc.a - Probably using Perl's malloc() anyway. -# libc: on UW7 don't want -lc explicitly - cc gives warnings/errors +# libc: on UW7 don't want -lc explicitly as native cc gives warnings/errors libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'` +# Don't use irrelevant (but existing) lib dirs +# don't want /usr/gnu/lib - original(older) system supplied distrib of perl5 +loclibpth=`echo " $loclibpth " | sed -e 's@ /usr/gnu/lib @ @'` + # remove /shlib and /lib from library search path as both symlink to /usr/lib # where runtime shared libc is glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /` -# UnixWare has /usr/lib/libc.so.1, /usr/lib/libc.so.1.1, and -# /usr/ccs/lib/libc.so. Configure chooses libc.so.1.1 while it -# appears that /usr/ccs/lib/libc.so contains more symbols: -# -# Try the following if you want to use nm-extraction. We'll just -# skip the nm-extraction phase, since searching for all the different -# library versions will be hard to keep up-to-date. -# -# if [ "" = "$libc" -a -f /usr/ccs/lib/libc.so -a \ -# -f /usr/lib/libc.so.1 -a -f /usr/lib/libc.so.1.1 ]; then -# if nm -h /usr/ccs/lib/libc.so | egrep '\<_?select$' >/dev/null; then -# if nm -h /usr/lib/libc.so.1 | egrep '\<_?select$'` >/dev/null || -# nm -h /usr/lib/libc.so.1.1 | egrep '\<_?select$'` >/dev/null; then -# : -# else -# libc=/usr/ccs/lib/libc.so -# fi -# fi -# fi -# -# Don't bother with nm. Just compile & link a small C program. +# Don't use BSD emulation pieces (/usr/ucblib) regardless +# these would probably be autonondetected anyway but ... +d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert(). +d_bcopy='undef' d_bcmp='undef' d_bzero='undef' d_safebcpy='undef' +d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef' +d_setlinebuf='undef' +d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1 + + +# use nm to probe libs - its fast enough on uw7 case "$usenm" in -'') usenm=false;; +'') usenm=true;; esac # Broken C-Shell tests (Thanks to Tye McQueen): @@ -107,18 +116,34 @@ if [ "$sh_cnt" -ne "$csh_cnt" ]; then d_csh='undef' fi -# Unixware-specific problems. The undocumented -X argument to uname -# is probably a reasonable way of detecting UnixWare. +# Unixware-specific problems. UW7 give correctname with uname -s # UnixWare has a broken csh. (This might already be detected above). # Configure can't detect memcpy or memset on Unixware 2 or 7 # # Leave leading tabs on the next two lines so Configure doesn't # propagate these variables to config.sh uw_ver=`uname -v` - uw_isuw=`uname -X 2>&1 | grep Release` + uw_isuw=`uname -s 2>&1` -if [ "$uw_isuw" = "Release = 5" ]; then +if [ "$uw_isuw" = "UnixWare" ]; then case $uw_ver in + 7.1*) + d_csh='undef' + d_memcpy='define' + d_memset='define' + stdio_cnt='((fp)->__cnt)' + d_stdio_cnt_lval='define' + stdio_ptr='((fp)->__ptr)' + d_stdio_ptr_lval='define' + + d_bcopy='define' # In /usr/lib/libc.so.1 + d_setregid='define' # " + d_setreuid='define' # " + + if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then + libswanted=" $libswanted cudk70" + fi + ;; 7*) d_csh='undef' d_memcpy='define' @@ -130,6 +155,7 @@ if [ "$uw_isuw" = "Release = 5" ]; then ;; esac fi +# End of Unixware-specific tests. ############################################################### # Dynamic loading section: @@ -150,9 +176,10 @@ case "$cc" in cccdlflags='-fpic' lddlflags='-G -L/usr/local/lib' ;; + *) ccdlflags='-Wl,-Bexport -L/usr/local/lib' - cccdlflags='-KPIC' + cccdlflags='-Kpic' lddlflags='-G -Wl,-Bexport -L/usr/local/lib' ;; esac @@ -163,29 +190,10 @@ usedl='define' dlext='so' dlsrc='dl_dlopen.xs' -# Configure may fail to find lstat() since it's a static/inline function -# in on Unisys U6000 SVR4, UnixWare 2.x, and possibly other -# SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.) -d_lstat=define - - -# DDE SMES Supermax Enterprise Server -case "`uname -sm`" in -"UNIX_SV SMES") - # the *grent functions are in libgen. - libswanted="$libswanted gen" - # csh is broken (also) in SMES - # This may already be detected by the generic test above. - d_csh='undef' - case "$cc" in - *gcc*) ;; - *) # for cc we need -K PIC (not -K pic) - cccdlflags="$cccdlflags -K PIC" - ;; - esac - ;; -esac +############################################################################ +# Thread support +# use Configure -Dusethreads to enable # This script UU/usethreads.cbu will get 'called-back' by Configure # after it has prompted the user for whether to use threads. cat > UU/usethreads.cbu <<'EOCBU' @@ -206,17 +214,14 @@ $define|true|[yY]*) ccdlflags='-Kthread -Wl,-Bexport -L/usr/local/lib' cccdlflags='-KPIC -Kthread' lddlflags='-G -Kthread -Wl,-Bexport -L/usr/local/lib' - ldflags='-Kthread -L/usr/local/lib -L/usr/gnu/lib' + ldflags='-Kthread -L/usr/local/lib' ;; esac esac EOCBU -# End of Unixware-specific tests. -# Configure may fail to find lstat() since it's a static/inline function -# in on Unisys U6000 SVR4, UnixWare 2.x, and possibly other -# SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.) -d_lstat=define -d_suidsafe='define' # "./Configure -d" can't figure this out easilly +# Just in case Configure fails to find lstat() Its in /usr/lib/libc.so.1. +d_lstat=define +d_suidsafe='define' # "./Configure -d" can't figure this out easily diff --git a/perlapi.c b/perlapi.c old mode 100644 new mode 100755 diff --git a/perlapi.h b/perlapi.h old mode 100644 new mode 100755 diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 527f73b..8988730 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1683,8 +1683,7 @@ by Perl or by a user-supplied handler. See L. =item invalid [] range in regexp (F) The range specified in a character class had a minimum character -greater than the maximum character, or the range didn't start/end with -a literal character. See L. +greater than the maximum character. See L. =item Invalid conversion in %s: "%s" diff --git a/pod/perlop.pod b/pod/perlop.pod index 01074b3..e563888 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -173,7 +173,7 @@ $_. The return value indicates the success of the operation. (If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search pattern at run time. This can be is less efficient than an explicit search, because the -pattern must be compiled every time the expression is evaluated. +pattern must be compiled every time the expression is evaluated). Binary "!~" is just like "=~" except the return value is negated in the logical sense. diff --git a/pod/perlre.pod b/pod/perlre.pod index 9a06305..1610254 100644 --- a/pod/perlre.pod +++ b/pod/perlre.pod @@ -185,8 +185,9 @@ Use C<\w+> to match a string of Perl-identifier characters (which isn't the same as matching an English word). If C is in effect, the list of alphabetic characters generated by C<\w> is taken from the current locale. See L. You may use C<\w>, C<\W>, C<\s>, C<\S>, -C<\d>, and C<\D> within character classes (though not as either end of -a range). See L for details about C<\pP>, C<\PP>, and C<\X>. +C<\d>, and C<\D> within character classes, but if you try to use them +as endpoints of a range, that's not a range, the "-" is understood literally. +See L for details about C<\pP>, C<\PP>, and C<\X>. The POSIX character class syntax @@ -940,6 +941,9 @@ at the start or end of the list, or escape it with a backslash. (The following all specify the same class of three characters: C<[-az]>, C<[az-]>, and C<[a\-z]>. All are different from C<[a-z]>, which specifies a class containing twenty-six characters.) +Also, if you try to use the character classes C<\w>, C<\W>, C<\s>, +C<\S>, C<\d>, or C<\D> as endpoints of a range, that's not a range, +the "-" is understood literally. Note also that the whole range idea is rather unportable between character sets--and even within character sets they may cause results diff --git a/regcomp.c b/regcomp.c index 99423e1..02dca51 100644 --- a/regcomp.c +++ b/regcomp.c @@ -2364,8 +2364,10 @@ S_regclass(pTHX) } } if (!SIZE_ONLY && namedclass > OOB_NAMEDCLASS) { - if (range) - FAIL("invalid [] range in regexp"); /* [a-\w], [a-[:word:]] */ + if (range) { + ANYOF_BITMAP_SET(opnd, lastvalue); + ANYOF_BITMAP_SET(opnd, '-'); + } switch (namedclass) { case ANYOF_ALNUM: if (LOC) @@ -2608,6 +2610,8 @@ S_regclass(pTHX) ANYOF_FLAGS(opnd) |= ANYOF_CLASS; continue; } + if (range && namedclass > OOB_NAMEDCLASS) + range = 0; /* [a-\d], [a-[:digit:]], not a true range. */ if (range) { if (lastvalue > value) FAIL("invalid [] range in regexp"); /* [b-a] */ @@ -2617,8 +2621,6 @@ S_regclass(pTHX) lastvalue = value; if (*PL_regcomp_parse == '-' && PL_regcomp_parse+1 < PL_regxend && PL_regcomp_parse[1] != ']') { - if (namedclass > OOB_NAMEDCLASS) - FAIL("invalid [] range in regexp"); /* [\w-a] */ PL_regcomp_parse++; range = 1; continue; /* do it next time */ @@ -2777,9 +2779,10 @@ S_regclassutf8(pTHX) } } if (!SIZE_ONLY && namedclass > OOB_NAMEDCLASS) { - if (range) - FAIL("invalid [] range in regexp"); /* [a-\w], [a-[:word:]] */ - switch (namedclass) { + if (range) /* [a-\d], [a-[:digit:]] */ + Perl_sv_catpvf(aTHX_ listsv, /* 0x002D is Unicode for '-' */ + "%04"UVxf"\n%002D\n", (UV)lastvalue); + switch (namedclass) { case ANYOF_ALNUM: Perl_sv_catpvf(aTHX_ listsv, "+utf8::IsWord\n"); break; case ANYOF_NALNUM: @@ -2835,6 +2838,8 @@ S_regclassutf8(pTHX) } continue; } + if (range && namedclass > OOB_NAMEDCLASS) + range = 0; /* [a-\d], [a-[:digit:]], not a true range. */ if (range) { if (lastvalue > value) FAIL("invalid [] range in regexp"); /* [b-a] */ @@ -2846,8 +2851,6 @@ S_regclassutf8(pTHX) lastvalue = value; if (*PL_regcomp_parse == '-' && PL_regcomp_parse+1 < PL_regxend && PL_regcomp_parse[1] != ']') { - if (namedclass > OOB_NAMEDCLASS) - FAIL("invalid [] range in regexp"); /* [\w-a] */ PL_regcomp_parse++; range = 1; continue; /* do it next time */ diff --git a/t/op/filetest.t b/t/op/filetest.t old mode 100755 new mode 100644 diff --git a/t/op/re_tests b/t/op/re_tests index 695672d..974bec5 100644 --- a/t/op/re_tests +++ b/t/op/re_tests @@ -735,8 +735,10 @@ foo.bart foo.bart y - - .[X](.+)+[X][X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - - .[X][X](.+)+[X] bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa n - - tt+$ xxxtt y - - -[a-\w] - c - /[a-\w]/: invalid [] range in regexp -[\w-z] - c - /[\w-z]/: invalid [] range in regexp -[0-[:digit:]] - c - /[0-[:digit:]]/: invalid [] range in regexp -[[:digit:]-9] - c - /[[:digit:]-9]/: invalid [] range in regexp +([a-\d]+) za-9z y $1 a-9 +([\d-\s]+) a0- z y $1 0- +([\d-z]+) a0-za y $1 0-z +([a-[:digit:]]+) za-9z y $1 a-9 +([[:digit:]-[:alpha:]]+) =0-z= y $1 0-z +([[:digit:]-z]+) =0-z= y $1 0-z \GX.*X aaaXbX n - - diff --git a/t/op/subst_amp.t b/t/op/subst_amp.t old mode 100755 new mode 100644 diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 7d72e8a..730a730 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -630,14 +630,13 @@ warn "Writing $ext$modpname/$modfname.pm\n"; print PM <<"END"; package $module; -require 5.005_62; use strict; END if( $opt_X || $opt_c || $opt_A ){ # we won't have our own AUTOLOAD(), so won't have $AUTOLOAD print PM <<'END'; -our @EXPORT_OK; +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); END } else{ @@ -645,7 +644,7 @@ else{ # will want Carp. print PM <<'END'; use Carp; -our @EXPORT_OK; +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD); END } @@ -670,7 +669,7 @@ unless ($opt_A) { # no autoloader whatsoever. } # Determine @ISA. -my $myISA = 'our @ISA = qw(Exporter'; # We seem to always want this. +my $myISA = '@ISA = qw(Exporter'; # We seem to always want this. $myISA .= ' DynaLoader' unless $opt_X; # no XS $myISA .= ');'; print PM "\n$myISA\n\n"; @@ -685,16 +684,16 @@ print PM<<"END"; # This allows declaration use $module ':all'; # If you do not need this, moving things directly into \@EXPORT or \@EXPORT_OK # will save memory. -our %EXPORT_TAGS = ( 'all' => [ qw( +%EXPORT_TAGS = ( 'all' => [ qw( @exported_names ) ] ); -our \@EXPORT_OK = ( \@{ \$EXPORT_TAGS{'all'} } ); +\@EXPORT_OK = ( \@{ \$EXPORT_TAGS{'all'} } ); + +\@EXPORT = ( -our \@EXPORT = qw( - @const_names ); -our \$VERSION = '$TEMPLATE_VERSION'; +\$VERSION = '$TEMPLATE_VERSION'; END @@ -705,7 +704,6 @@ sub AUTOLOAD { # to the AUTOLOAD in AutoLoader. my \$constname; - our $AUTOLOAD; (\$constname = \$AUTOLOAD) =~ s/.*:://; croak "&$module::constant not defined" if \$constname eq 'constant'; my \$val = constant(\$constname, \@_ ? \$_[0] : 0);