Integrate with Sarathy.
Jarkko Hietaniemi [Fri, 28 Apr 2000 20:28:21 +0000 (20:28 +0000)]
p4raw-id: //depot/cfgperl@6004

18 files changed:
Configure
INSTALL
Porting/Glossary
Porting/config.sh
Porting/config_H
config_h.SH
epoc/config.sh
perl.c
sv.c
t/pragma/warn/toke
toke.c
vms/subconfigure.com
vos/config.def
vos/config_h.SH_orig
win32/config.bc
win32/config.gc
win32/config.vc
win32/win32.c

index 7c5c134..a271f8c 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -779,6 +779,8 @@ hostcat=''
 passcat=''
 orderlib=''
 ranlib=''
+d_perl_otherlibdirs=''
+otherlibdirs=''
 package=''
 spackage=''
 pager=''
@@ -5370,6 +5372,41 @@ else
        installvendorarch="$vendorarchexp"
 fi
 
+: Final catch-all directories to search
+$cat <<EOM
+
+Lastly, you can have perl look in other directories for extensions and
+modules in addition to those already specified.
+These directories will be searched after 
+       $sitearch 
+       $sitelib 
+EOM
+test X"$vendorlib" != "X" && echo '    ' $vendorlib
+test X"$vendorarch" != "X" && echo '   ' $vendorarch
+echo ' '
+case "$otherlibdirs" in
+''|' ') dflt='none' ;;
+*)     dflt="$otherlibdirs" ;;
+esac
+$cat <<EOM
+Enter a colon-separated set of extra paths to include in perl's @INC
+search path, or enter 'none' for no extra paths.
+
+EOM
+
+rp='Colon-separated list of additional directories for perl to search?'
+. ./myread
+case "$ans" in
+' '|''|none)   otherlibdirs=' ' ;;     
+*)     otherlibdirs="$ans" ;;
+esac
+case "$otherlibdirs" in
+' ') val=$undef ;;
+*)     val=$define ;;
+esac
+set d_perl_otherlibdirs
+eval $setvar
+
 : Cruising for prototypes
 echo " "
 echo "Checking out function prototypes..." >&4
@@ -15303,6 +15340,7 @@ d_oldsock='$d_oldsock'
 d_open3='$d_open3'
 d_pathconf='$d_pathconf'
 d_pause='$d_pause'
+d_perl_otherlibdirs='$d_perl_otherlibdirs'
 d_phostname='$d_phostname'
 d_pipe='$d_pipe'
 d_poll='$d_poll'
@@ -15661,6 +15699,7 @@ optimize='$optimize'
 orderlib='$orderlib'
 osname='$osname'
 osvers='$osvers'
+otherlibdirs='$otherlibdirs'
 package='$package'
 pager='$pager'
 passcat='$passcat'
diff --git a/INSTALL b/INSTALL
index 712c04f..2b21edb 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -497,9 +497,9 @@ network.  One way to do that would be something like
 
 As a final catch-all, Configure also offers an $otherlibdirs
 variable.  This variable contains a colon-separated list of additional
-directories to add to @INC.  By default, it will be set to
-$prefix/site_perl if Configure detects that you have 5.004-era modules
-installed there.  However, you can set it to anything you like.
+directories to add to @INC.  By default, it will be empty.
+Perl will search these directories (including architecture and
+version-specific subdirectories) for add-on modules and extensions.
 
 =item Man Pages
 
index d60a168..f5ac6da 100644 (file)
@@ -1052,6 +1052,11 @@ d_pause (d_pause.U):
        indicates to the C program that the pause() routine is available
        to suspend a process until a signal is received.
 
+d_perl_otherlibdirs (otherlibdirs.U):
+       This variable conditionally defines PERL_OTHERLIBDIRS, which
+       contains a colon-separated set of paths for the perl binary to
+       include in @INC.  See also otherlibdirs.
+
 d_phostname (d_gethname.U):
        This variable conditionally defines the HAS_PHOSTNAME symbol, which
        contains the shell command which, when fed to popen(), may be
@@ -2757,6 +2762,16 @@ osvers (Oldconfig.U):
        same for this package, hints files might just be os_4.0 or
        os_4.1, etc., not keeping separate files for each little release.
 
+otherlibdirs (otherlibdirs.U):
+       This variable contains a colon-separated set of paths for the perl
+       binary to search for additional library files or modules.
+       These directories will be tacked to the end of @INC.
+       Perl will automatically search below each path for version-
+       and architecture-specific directories.  See inc_version_list
+       for more details.
+       A value of ' ' means 'none' and is used to preserve this value
+       for the next run through Configure.
+
 package (package.U):
        This variable contains the name of the package being constructed.
        It is primarily intended for the use of later Configure units.
index a658cc2..15d7893 100644 (file)
@@ -253,6 +253,7 @@ d_oldsock='undef'
 d_open3='define'
 d_pathconf='define'
 d_pause='define'
+d_perl_otherlibdirs='undef'
 d_phostname='undef'
 d_pipe='define'
 d_poll='define'
@@ -611,6 +612,7 @@ optimize='-O'
 orderlib='false'
 osname='dec_osf'
 osvers='4.0'
+otherlibdirs=' '
 package='perl5'
 pager='/c/bin/less'
 passcat='cat /etc/passwd'
index 130a613..8657341 100644 (file)
  */
 #define INSTALL_USR_BIN_PERL   /**/
 
+/* PERL_OTHERLIBDIRS:
+ *     This variable contains a colon-separated set of paths for the perl
+ *     binary to search for additional library files or modules.
+ *     These directories will be tacked to the end of @INC.
+ *     Perl will automatically search below each path for version-
+ *     and architecture-specific directories.  See PERL_INC_VERSION_LIST
+ *     for more details.
+ */
+/*#define PERL_OTHERLIBDIRS " "                / **/
+
 /* PERL_PRIfldbl:
  *     This symbol, if defined, contains the string used by stdio to
  *     format long doubles (format 'f') for output.
index 08a1cf5..cc35077 100644 (file)
@@ -2732,6 +2732,16 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
  */
 #define Pid_t $pidtype         /* PID type */
 
+/* PERL_OTHERLIBDIRS:
+ *     This variable contains a colon-separated set of paths for the perl
+ *     binary to search for additional library files or modules.
+ *     These directories will be tacked to the end of @INC.
+ *     Perl will automatically search below each path for version-
+ *     and architecture-specific directories.  See PERL_INC_VERSION_LIST
+ *     for more details.
+ */
+#$d_perl_otherlibdirs PERL_OTHERLIBDIRS "$otherlibdirs"                /**/
+
 /* PRIVLIB:
  *     This symbol contains the name of the private library for this package.
  *     The library is private in the sense that it needn't be in anyone's
index b1fee71..714185a 100644 (file)
@@ -247,6 +247,7 @@ d_oldsock='undef'
 d_open3='define'
 d_pathconf='undef'
 d_pause='undef'
+d_perl_otherlibdirs='undef'
 d_phostname='undef'
 d_pipe='undef'
 d_poll='undef'
@@ -569,6 +570,7 @@ optimize='-fomit-frame-pointer -DNDEBUG -O'
 orderlib=''
 osname='epoc'
 osvers=''
+otherlibdirs=''
 package=''
 pager=''
 passcat=''
diff --git a/perl.c b/perl.c
index f81648c..dce558f 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3324,6 +3324,10 @@ S_init_perllib(pTHX)
     incpush(PERL_VENDORLIB_STEM, FALSE, TRUE);
 #endif
 
+#ifdef PERL_OTHERLIBDIRS
+    incpush(PERL_OTHERLIBDIRS, TRUE, TRUE);
+#endif
+
     if (!PL_tainting)
        incpush(".", FALSE, FALSE);
 }
diff --git a/sv.c b/sv.c
index b83444a..65e2837 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2724,7 +2724,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr)
        if (sflags & SVp_IOK) {
            (void)SvIOK_on(dstr);
            SvIVX(dstr) = SvIVX(sstr);
-           if (SvIsUV(sstr))
+           if (sflags & SVf_IVisUV)
                SvIsUV_on(dstr);
        }
        if (SvAMAGIC(sstr)) {
@@ -2762,7 +2762,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr)
                SvUTF8_off(dstr);
 
            SvTEMP_off(dstr);
-           (void)SvOK_off(sstr);
+           (void)SvOK_off(sstr);               /* NOTE: nukes most SvFLAGS on sstr */
            SvPV_set(sstr, Nullch);
            SvLEN_set(sstr, 0);
            SvCUR_set(sstr, 0);
@@ -2787,25 +2787,25 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr)
        if (sflags & SVp_IOK) {
            (void)SvIOK_on(dstr);
            SvIVX(dstr) = SvIVX(sstr);
-           if (SvIsUV(sstr))
+           if (sflags & SVf_IVisUV)
                SvIsUV_on(dstr);
        }
     }
     else if (sflags & SVp_NOK) {
        SvNVX(dstr) = SvNVX(sstr);
        (void)SvNOK_only(dstr);
-       if (SvIOK(sstr)) {
+       if (sflags & SVf_IOK) {
            (void)SvIOK_on(dstr);
            SvIVX(dstr) = SvIVX(sstr);
            /* XXXX Do we want to set IsUV for IV(ROK)?  Be extra safe... */
-           if (SvIsUV(sstr))
+           if (sflags & SVf_IVisUV)
                SvIsUV_on(dstr);
        }
     }
     else if (sflags & SVp_IOK) {
        (void)SvIOK_only(dstr);
        SvIVX(dstr) = SvIVX(sstr);
-       if (SvIsUV(sstr))
+       if (sflags & SVf_IVisUV)
            SvIsUV_on(dstr);
     }
     else {
index f001ff7..8db8027 100644 (file)
@@ -437,13 +437,14 @@ Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4.
 # toke.c
 use warnings ;
 eval <<'EOE';
+#  line 30 "foo"
+warn "yelp";
 {
-#line 30 "foo"
   $_ = " \x{123} " ;
 }
 EOE
 EXPECT
-
+yelp at foo line 30.
 ########
 # toke.c
 my $a = rand + 4 ;
diff --git a/toke.c b/toke.c
index 5c1b945..737c9ae 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2656,6 +2656,11 @@ Perl_yylex(pTHX)
     case '#':
     case '\n':
        if (PL_lex_state != LEX_NORMAL || (PL_in_eval && !PL_rsfp)) {
+           if (*s == '#' && s == PL_linestart && PL_in_eval && !PL_rsfp) {
+               /* handle eval qq[#line 1 "foo"\n ...] */
+               CopLINE_dec(PL_curcop);
+               incline(s);
+           }
            d = PL_bufend;
            while (s < d && *s != '\n')
                s++;
index 479d315..3e3a828 100644 (file)
@@ -401,6 +401,8 @@ $ perl_lseektype="int"
 $ perl_i_values="undef"
 $ perl_malloctype="void *"
 $ perl_freetype="void"
+$ perl_d_perl_otherlibdirs="undef"
+$ perl_otherlibdirs=""
 $ IF mymalloc
 $ THEN
 $ perl_d_mymalloc="define"
@@ -3820,6 +3822,8 @@ $ WC "d_mkdir='" + perl_d_mkdir + "'"
 $ WC "d_msg='" + perl_d_msg + "'"
 $ WC "d_open3='" + perl_d_open3 + "'"
 $ WC "d_poll='" + perl_d_poll + "'"
+$ WC "d_perl_otherlibdirs='" + perl_d_perl_otherlibdirs + "'"
+$ WC "otherlibdirs='" + perl_otherlibdirs + "'"
 $ WC "d_readdir='" + perl_d_readdir + "'"
 $ WC "d_seekdir='" + perl_d_seekdir + "'"
 $ WC "d_telldir='" + perl_d_telldir + "'"
index e66c87a..092d76a 100644 (file)
@@ -161,6 +161,7 @@ $d_old_pthread_create_joinable='undef'
 $d_oldpthreads='undef'
 $d_open3='define'
 $d_pathconf='define'
+$d_perl_otherlibdirs='undef'
 $d_pause='define'
 $d_phostname='undef'
 $d_pipe='define'
@@ -392,6 +393,7 @@ $nvtype='double'
 $o_nonblock='O_NONBLOCK'
 $old_pthread_create_joinable=''
 $osname='VOS'
+$otherlibdirs=''
 $package='perl5'
 $pidtype='pid_t'
 $pm_apiversion='5.00563'
index 08a1cf5..cc35077 100755 (executable)
@@ -2732,6 +2732,16 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
  */
 #define Pid_t $pidtype         /* PID type */
 
+/* PERL_OTHERLIBDIRS:
+ *     This variable contains a colon-separated set of paths for the perl
+ *     binary to search for additional library files or modules.
+ *     These directories will be tacked to the end of @INC.
+ *     Perl will automatically search below each path for version-
+ *     and architecture-specific directories.  See PERL_INC_VERSION_LIST
+ *     for more details.
+ */
+#$d_perl_otherlibdirs PERL_OTHERLIBDIRS "$otherlibdirs"                /**/
+
 /* PRIVLIB:
  *     This symbol contains the name of the private library for this package.
  *     The library is private in the sense that it needn't be in anyone's
index e737ae7..ae854b4 100644 (file)
@@ -242,6 +242,7 @@ d_oldsock='undef'
 d_open3='undef'
 d_pathconf='undef'
 d_pause='define'
+d_perl_otherlibdirs='undef'
 d_phostname='undef'
 d_pipe='define'
 d_poll='undef'
@@ -602,6 +603,7 @@ optimize='-O2'
 orderlib='false'
 osname='MSWin32'
 osvers='4.0'
+otherlibdirs=''
 package='perl5'
 pager='more /e'
 passcat=''
index a926ac5..f63813e 100644 (file)
@@ -242,6 +242,7 @@ d_oldsock='undef'
 d_open3='undef'
 d_pathconf='undef'
 d_pause='define'
+d_perl_otherlibdirs='undef'
 d_phostname='undef'
 d_pipe='define'
 d_poll='undef'
@@ -602,6 +603,7 @@ optimize='-O2'
 orderlib='false'
 osname='MSWin32'
 osvers='4.0'
+otherlibdirs=''
 package='perl5'
 pager='more /e'
 passcat=''
index 2437be2..db52680 100644 (file)
@@ -242,6 +242,7 @@ d_oldsock='undef'
 d_open3='undef'
 d_pathconf='undef'
 d_pause='define'
+d_perl_otherlibdirs='undef'
 d_phostname='undef'
 d_pipe='define'
 d_poll='undef'
@@ -602,6 +603,7 @@ optimize='-O'
 orderlib='false'
 osname='MSWin32'
 osvers='4.0'
+otherlibdirs=''
 package='perl5'
 pager='more /e'
 passcat=''
index 840274b..e10b115 100644 (file)
@@ -177,7 +177,9 @@ get_regstr_from(HKEY hkey, const char *valuename, SV **svp)
     if (retval == ERROR_SUCCESS) {
        DWORD datalen;
        retval = RegQueryValueEx(handle, valuename, 0, &type, NULL, &datalen);
-       if (retval == ERROR_SUCCESS && type == REG_SZ) {
+       if (retval == ERROR_SUCCESS
+           && (type == REG_SZ || type == REG_EXPAND_SZ))
+       {
            dTHXo;
            if (!*svp)
                *svp = sv_2mortal(newSVpvn("",0));