summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Bailey <bailey@hmivax.humgen.upenn.edu>1997-04-08 12:33:56 -0400
committerChip Salzenberg <chip@atlantic.net>1997-04-07 00:00:00 +0000
commitebec1d4b2ca9c08d24035a369c7aa782aa058e66 (patch)
tree6b0f1776f77cc2f2ff89d59dae365d5e0fc11d25
parentb226d704a95b67a31c9c67a9ab25966507c62295 (diff)
downloadperl-ebec1d4b2ca9c08d24035a369c7aa782aa058e66.tar.gz
Special mkdir() for VMS
Subject: Re: Make failures in perl5.003_96 on AXP/VMS 6.2 Henrik Tougaard <ht.000@foa.dk> wrote: > > When I try to build Perl 5.003_96 on my AXP: > DEC C V5.3-006 on OpenVMS Alpha V6.2-1H3 > > I get the following error: . . . > Writing Descrip.MMS for Fcntl > MMS > %MMS-F-GWKNOPRN, There are no known sources for the current target > [--.LIB].EXISTS. > %MMS-F-ABORT, For target [.LIB]FCNTL.PM, CLI returned abort status: > %X10EE8064. That's a bug introduced with the win32 support in _94 -- it assumes dirname($dir) will return the name of $dir's parent, not $dir itself. I've appended a fix for that, and for a problem with the DECCRTL mkdir() (doesn't like trailing '/') that gets me to a clean build for _94. complex.t fails -- runs out of memory after sucking down around 70 MB, but I don't know whether it's a Perl bug or just a pathological test. I haven't got beyond _94 yet -- I've been swamped for the past couple weeks, and it's going to get worse before it gets better :-/ -- but I'll try to pick up the newer patches and test them as soon as I can. In the meantime, reports from other folks, doc updates (especially for the installation instructions), etc. are most welcome. :-) p5p-msgid: 01IHGOXN6MZM0004K3@hmivax.humgen.upenn.edu
-rw-r--r--dosish.h1
-rw-r--r--lib/ExtUtils/MM_Unix.pm12
-rw-r--r--lib/File/Path.pm2
-rw-r--r--os2/os2ish.h2
-rw-r--r--plan9/plan9ish.h1
-rw-r--r--pp_sys.c2
-rw-r--r--unixish.h1
-rw-r--r--vms/vms.c22
-rw-r--r--vms/vmsish.h5
-rw-r--r--win32/dosish.h1
10 files changed, 45 insertions, 4 deletions
diff --git a/dosish.h b/dosish.h
index 58fdb28aac..088f950f4c 100644
--- a/dosish.h
+++ b/dosish.h
@@ -78,3 +78,4 @@ void Perl_DJGPP_init();
#define Stat(fname,bufptr) stat((fname),(bufptr))
#define Fstat(fd,bufptr) fstat((fd),(bufptr))
#define Fflush(fp) fflush(fp)
+#define Mkdir(path,mode) mkdir((path),(mode))
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
index f4ee44f4b9..395bd8acb3 100644
--- a/lib/ExtUtils/MM_Unix.pm
+++ b/lib/ExtUtils/MM_Unix.pm
@@ -662,11 +662,17 @@ sub dir_target {
# too often :)
my($self,@dirs) = @_;
- my(@m,$dir);
+ my(@m,$dir,$targdir);
foreach $dir (@dirs) {
my($src) = $self->catfile($self->{PERL_INC},'perl.h');
my($targ) = $self->catfile($dir,'.exists');
- my($targdir) = dirname($targ); # Necessary because catfile may have adapted syntax of $dir to target OS
+ # Necessary because catfile may have adapted syntax of $dir to target OS
+ if ($Is_VMS) { # Just remove file name; dirspec is often in macro
+ ($targdir = $targ) =~ s:/?.exists$::;
+ }
+ else { # while elsewhere we expect to see the dir separator in $targ
+ $targdir = dirname($targ);
+ }
next if $self->{DIR_TARGET}{$self}{$targdir}++;
push @m, qq{
$targ :: $src
@@ -1539,7 +1545,7 @@ usually solves this kind of problem.
# all the installation path variables to literally $(PREFIX), so
# the user can still say make PREFIX=foo
my($configure_prefix) = $Config{'prefix'};
- $prefix = VMS::Filespec::unixify($prefix) if $Is_VMS;
+ $configure_prefix = VMS::Filespec::unixify($configure_prefix) if $Is_VMS;
$self->{PREFIX} ||= $configure_prefix;
diff --git a/lib/File/Path.pm b/lib/File/Path.pm
index 137e7bb1ce..edec55d308 100644
--- a/lib/File/Path.pm
+++ b/lib/File/Path.pm
@@ -113,6 +113,8 @@ sub mkpath {
my(@created);
foreach $path (@$paths) {
next if -d $path;
+ # Logic wants Unix paths, so go with the flow.
+ $path = VMS::Filespec::unixify($path) if $Is_VMS;
my $parent = dirname($path);
push(@created,mkpath($parent, $verbose, $mode)) unless (-d $parent);
print "mkdir $path\n" if $verbose;
diff --git a/os2/os2ish.h b/os2/os2ish.h
index 06a92a31fb..f8064d0ee8 100644
--- a/os2/os2ish.h
+++ b/os2/os2ish.h
@@ -156,6 +156,7 @@ void *emx_realloc (void *, size_t);
#define Stat(fname,bufptr) os2_stat((fname),(bufptr))
#define Fstat(fd,bufptr) fstat((fd),(bufptr))
#define Fflush(fp) fflush(fp)
+#define Mkdir(path,mode) mkdir((path),(mode))
#undef S_IFBLK
#undef S_ISBLK
@@ -167,6 +168,7 @@ void *emx_realloc (void *, size_t);
#define Stat(fname,bufptr) stat((fname),(bufptr))
#define Fstat(fd,bufptr) fstat((fd),(bufptr))
#define Fflush(fp) fflush(fp)
+#define Mkdir(path,mode) mkdir((path),(mode))
#endif
diff --git a/plan9/plan9ish.h b/plan9/plan9ish.h
index c225d286a3..69af22c7c9 100644
--- a/plan9/plan9ish.h
+++ b/plan9/plan9ish.h
@@ -113,6 +113,7 @@
#define Stat(fname,bufptr) stat((fname),(bufptr))
#define Fstat(fd,bufptr) fstat((fd),(bufptr))
#define Fflush(fp) fflush(fp)
+#define Mkdir(path,mode) mkdir((path),(mode))
/* getenv related stuff */
#define my_getenv(var) getenv(var)
diff --git a/pp_sys.c b/pp_sys.c
index f99bf29ab3..201a37623d 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2710,7 +2710,7 @@ PP(pp_mkdir)
TAINT_PROPER("mkdir");
#ifdef HAS_MKDIR
- SETi( mkdir(tmps, mode) >= 0 );
+ SETi( Mkdir(tmps, mode) >= 0 );
#else
SETi( dooneliner("mkdir", tmps) );
oldumask = umask(0);
diff --git a/unixish.h b/unixish.h
index c6cb272104..1a515cfa94 100644
--- a/unixish.h
+++ b/unixish.h
@@ -104,6 +104,7 @@
#define Stat(fname,bufptr) stat((fname),(bufptr))
#define Fstat(fd,bufptr) fstat((fd),(bufptr))
#define Fflush(fp) fflush(fp)
+#define Mkdir(path,mode) mkdir((path),(mode))
#ifdef PERL_SCO5
# define PERL_SYS_INIT(c,v) fpsetmask(0)
diff --git a/vms/vms.c b/vms/vms.c
index 8d957df4ca..e287d867f7 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -455,6 +455,28 @@ kill_file(char *name)
} /* end of kill_file() */
/*}}}*/
+
+/*{{{int my_mkdir(char *,mode_t)*/
+int
+my_mkdir(char *dir, mode_t mode)
+{
+ STRLEN dirlen = strlen(dir);
+
+ /* CRTL mkdir() doesn't tolerate trailing /, since that implies
+ * null file name/type. However, it's commonplace under Unix,
+ * so we'll allow it for a gain in portability.
+ */
+ if (dir[dirlen-1] == '/') {
+ char *newdir = savepvn(dir,dirlen-1);
+ int ret = mkdir(newdir,mode);
+ Safefree(newdir);
+ return ret;
+ }
+ else return mkdir(dir,mode);
+} /* end of my_mkdir */
+/*}}}*/
+
+
static void
create_mbx(unsigned short int *chan, struct dsc$descriptor_s *namdsc)
{
diff --git a/vms/vmsish.h b/vms/vmsish.h
index fd4434efb2..f5ef7a53ce 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -88,6 +88,7 @@
# define my_gconvert Perl_my_gconvert
# define do_rmdir Perl_do_rmdir
# define kill_file Perl_kill_file
+# define my_mkdir Perl_my_mkdir
# define my_utime Perl_my_utime
# define rmsexpand Perl_rmsexpand
# define rmsexpand_ts Perl_rmsexpand_ts
@@ -349,6 +350,9 @@ struct utimbuf {
/* Ditto for sys$hash_passwrod() . . . */
#define crypt my_crypt
+/* Tweak arg to mkdir first, so we can tolerate trailing /. */
+#define Mkdir(dir,mode) my_mkdir((dir),(mode))
+
/* Use our own stat() clones, which handle Unix-style directory names */
#define Stat(name,bufptr) flex_stat(name,bufptr)
#define Fstat(fd,bufptr) flex_fstat(fd,bufptr)
@@ -506,6 +510,7 @@ Pid_t my_waitpid _((Pid_t, int *, int));
char * my_gconvert _((double, int, int, char *));
int do_rmdir _((char *));
int kill_file _((char *));
+int my_mkdir _((char *, mode_t));
int my_utime _((char *, struct utimbuf *));
char * rmsexpand _((char *, char *, char *, unsigned));
char * rmsexpand_ts _((char *, char *, char *, unsigned));
diff --git a/win32/dosish.h b/win32/dosish.h
index 8e423fa8fa..7a312ebe81 100644
--- a/win32/dosish.h
+++ b/win32/dosish.h
@@ -78,6 +78,7 @@ void Perl_DJGPP_init();
#define Stat(fname,bufptr) win32_stat((fname),(bufptr))
#define Fstat(fd,bufptr) fstat((fd),(bufptr))
#define Fflush(fp) fflush(fp)
+#define Mkdir(path,mode) mkdir((path),(mode))
#define my_getenv(var) getenv(var)
/*