diff options
author | Craig A. Berry <craigberry@mac.com> | 2016-09-01 13:30:28 -0500 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2016-09-01 17:38:15 -0500 |
commit | 483efd0abe32386a3d82710532464cf4e9a0124b (patch) | |
tree | c70971a6c178b727d01f7c349caee4ad750abaaa | |
parent | 7c280bee056f2462f4b4aa2150a160fb9176601e (diff) | |
download | perl-483efd0abe32386a3d82710532464cf4e9a0124b.tar.gz |
Make PERLLIB_SEP dynamic on VMS.
Because if we're running under a Unix shell, the path separator is
likely to meet the expectations of Unix shell scripts better if it's
the Unix ':' rather than the VMS '|'. There is no change when
running under DCL.
-rw-r--r-- | embedvar.h | 4 | ||||
-rw-r--r-- | makedef.pl | 1 | ||||
-rw-r--r-- | perl.c | 4 | ||||
-rw-r--r-- | perlapi.h | 2 | ||||
-rw-r--r-- | perlvars.h | 7 | ||||
-rw-r--r-- | pod/perldelta.pod | 12 | ||||
-rw-r--r-- | pod/perlvms.pod | 6 | ||||
-rwxr-xr-x | regen/embed.pl | 2 | ||||
-rw-r--r-- | vms/vms.c | 4 |
9 files changed, 36 insertions, 6 deletions
diff --git a/embedvar.h b/embedvar.h index 18f2c99547..6092318911 100644 --- a/embedvar.h +++ b/embedvar.h @@ -414,6 +414,10 @@ #define PL_Gperlio_fd_refcnt_size (my_vars->Gperlio_fd_refcnt_size) #define PL_perlio_mutex (my_vars->Gperlio_mutex) #define PL_Gperlio_mutex (my_vars->Gperlio_mutex) +#ifdef __VMS +#define PL_perllib_sep (my_vars->Gperllib_sep) +#define PL_Gperllib_sep (my_vars->Gperllib_sep) +#endif #define PL_ppaddr (my_vars->Gppaddr) #define PL_Gppaddr (my_vars->Gppaddr) #ifdef OS2 diff --git a/makedef.pl b/makedef.pl index 80723ca9ff..cb11e7e07c 100644 --- a/makedef.pl +++ b/makedef.pl @@ -206,6 +206,7 @@ if ($ARGS{PLATFORM} ne 'os2') { ++$skip{Perl_my_symlink} unless $Config{d_symlink}; } else { ++$skip{PL_statusvalue_vms}; + ++$skip{PL_perllib_sep}; if ($ARGS{PLATFORM} ne 'aix') { ++$skip{$_} foreach qw( PL_DBcv @@ -4655,8 +4655,8 @@ S_init_perllib(pTHX) #if defined(DOSISH) || defined(__SYMBIAN32__) # define PERLLIB_SEP ';' #else -# if defined(VMS) -# define PERLLIB_SEP '|' +# if defined(__VMS) +# define PERLLIB_SEP PL_perllib_sep # else # define PERLLIB_SEP ':' # endif @@ -149,6 +149,8 @@ END_EXTERN_C #define PL_perlio_fd_refcnt_size (*Perl_Gperlio_fd_refcnt_size_ptr(NULL)) #undef PL_perlio_mutex #define PL_perlio_mutex (*Perl_Gperlio_mutex_ptr(NULL)) +#undef PL_perllib_sep +#define PL_perllib_sep (*Perl_Gperllib_sep_ptr(NULL)) #undef PL_ppaddr #define PL_ppaddr (*Perl_Gppaddr_ptr(NULL)) #undef PL_sh_path diff --git a/perlvars.h b/perlvars.h index 89e2e1eb52..884d57c504 100644 --- a/perlvars.h +++ b/perlvars.h @@ -248,3 +248,10 @@ PERLVAR(G, malloc_mutex, perl_mutex) /* Mutex for malloc */ PERLVARI(G, hash_seed_set, bool, FALSE) /* perl.c */ PERLVARA(G, hash_seed, PERL_HASH_SEED_BYTES, unsigned char) /* perl.c and hv.h */ + +/* The path separator can vary depending on whether we're running under DCL or + * a Unix shell. + */ +#ifdef __VMS +PERLVAR(G, perllib_sep, char) +#endif diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 89d810d81b..0898ab108c 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -305,9 +305,17 @@ L</Modules and Pragmata> section. =over 4 -=item XXX-some-platform +=item VMS -XXX +=over 4 + +=item * + +The path separator for the C<PERL5LIB> and C<PERLLIB> environment entries is +now a colon (C<:>) when running under a Unix shell. There is no change when +running under DCL (it's still C<|>). + +=back =back diff --git a/pod/perlvms.pod b/pod/perlvms.pod index 2208257039..e0d9803917 100644 --- a/pod/perlvms.pod +++ b/pod/perlvms.pod @@ -326,8 +326,10 @@ improve performance at the expense of the BYTLM UAF quota. =head1 PERL5LIB and PERLLIB -The PERL5LIB and PERLLIB logical names work as documented in L<perl>, -except that the element separator is '|' instead of ':'. The +The PERL5LIB and PERLLIB environment elements work as documented in L<perl>, +except that the element separator is, by default, '|' instead of ':'. +However, when running under a Unix shell as determined by the logical +name C<GNV$UNIX_SHELL>, the separator will be ':' as on Unix systems. The directory specifications may use either VMS or Unix syntax. =head1 The Perl Forked Debugger diff --git a/regen/embed.pl b/regen/embed.pl index 342e0171f2..0b1ed0d943 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -481,9 +481,11 @@ END for $sym (@globvar) { print $em "#ifdef OS2\n" if $sym eq 'sh_path'; + print $em "#ifdef __VMS\n" if $sym eq 'perllib_sep'; print $em multon($sym, 'G','my_vars->'); print $em multon("G$sym",'', 'my_vars->'); print $em "#endif\n" if $sym eq 'sh_path'; + print $em "#endif\n" if $sym eq 'perllib_sep'; } print $em <<'END'; @@ -13986,6 +13986,9 @@ vmsperl_set_features(void) vms_unlink_all_versions = 0; } + /* The path separator in PERL5LIB is '|' unless running under a Unix shell. */ + PL_perllib_sep = '|'; + /* Detect running under GNV Bash or other UNIX like shell */ gnv_unix_shell = 0; status = simple_trnlnm("GNV$UNIX_SHELL", val_str, sizeof(val_str)); @@ -14000,6 +14003,7 @@ vmsperl_set_features(void) /* Reverse default ordering of PERL_ENV_TABLES. */ defenv[0] = &crtlenvdsc; defenv[1] = &fildevdsc; + PL_perllib_sep = ':'; } /* Some reasonable defaults that are not CRTL defaults */ set_feature_default("DECC$EFS_CASE_PRESERVE", 1); |