bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] tar.1.19 changes needed for VMS so far.


From: John E. Malmberg
Subject: [patch] tar.1.19 changes needed for VMS so far.
Date: Mon, 03 Mar 2008 00:01:46 -0600
User-agent: Mozilla/5.0 (X11; U; OpenVMS AlphaServer_DS10_617_MHz; en-US; rv:1.7) Gecko/20040621

I have TAR passing the pipe test, so I though it would be a good point to pass the source changes I needed so far.

TODO: I still have to add the vfork/exec/pipe code from the VMS bash port so that the compression options work.

In lib/alloca.in.h :

VMS needs a definition for the built-in __ALLOCA when using the DECC compiler.

This may also be the case on Tru64 using the DECC compiler, but I can not test this.


In lib/sys_stat.in :

The VMS DECC compiler needs to test the undefined macros with !defined.


In lib/getopt.c :

Remove the old VMS specific code as it now breaks building on VMS.


In src/names.c

The declarations for getgrnam and getpwnam interfere with the ones in the system supplied headers.


In tests/testsuite :

VMS can not deal with having a file/directory named testname and testname.dir in the same directory.

This is because all directories are named .dir, and to be more POSIX friendly, VMS hides the ".dir" part of the directory when using UNIX syntax.

So testname and testname.dir appear to be the same filename when testname.dir is a directory.

I can not automatically run the test suite because I do not have Autotest, and even if I find a tarball for it, I am not sure that it will run on VMS.

-John
address@hidden
Personal Opinion Only

--- /src_root/tar-1.19/lib/alloca.in.h  Wed Oct  3 12:11:13 2007
+++ lib/alloca.in.h     Sun Mar  2 23:07:07 2008
@@ -47,7 +47,11 @@
 #  ifdef  __cplusplus
 extern "C"
 #  endif
+#  if defined(__DECC) && defined(__VMS) /* DEC VMS compiler */
+#   define alloca __ALLOCA
+#  else
 void *alloca (size_t);
+#  endif
 # endif
 #endif
 
--- /src_root/tar-1.19/lib/getopt.c     Fri Sep 28 08:11:36 2007
+++ lib/getopt.c        Sun Mar  2 23:05:02 2008
@@ -31,10 +31,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef __VMS
-# include <unixlib.h>
-#endif
-
 #ifdef _LIBC
 # include <libintl.h>
 #else
--- /src_root/tar-1.19/src/names.c      Sun Aug 12 02:46:25 2007
+++ src/names.c Mon Dec 17 19:53:01 2007
@@ -27,6 +27,7 @@
 
 /* User and group names.  */
 
+#ifndef __VMS /* These conflict with the VMS system supplied headers */
 struct group *getgrnam ();
 struct passwd *getpwnam ();
 #if ! HAVE_DECL_GETPWUID
@@ -35,6 +36,7 @@
 #if ! HAVE_DECL_GETGRGID
 struct group *getgrgid ();
 #endif
+#endif
 
 /* Make sure you link with the proper libraries if you are running the
    Yellow Peril (thanks for the good laugh, Ian J.!), or, euh... NIS.
--- /src_root/tar-1.19/lib/sys_stat.in.h        Wed Oct  3 12:11:13 2007
+++ lib/sys_stat.in.h   Mon Dec 24 20:11:30 2007
@@ -185,10 +185,10 @@
 
 /* If any of the following are undefined,
    define them to their de facto standard values.  */
-#if !S_ISUID
+#ifndef S_ISUID
 # define S_ISUID 04000
 #endif
-#if !S_ISGID
+#ifndef S_ISGID
 # define S_ISGID 02000
 #endif
 
@@ -197,57 +197,57 @@
 # define S_ISVTX 01000
 #endif
 
-#if !S_IRUSR && S_IREAD
+#if !defined(S_IRUSR) && defined(S_IREAD)
 # define S_IRUSR S_IREAD
 #endif
-#if !S_IRUSR
+#ifndef S_IRUSR
 # define S_IRUSR 00400
 #endif
-#if !S_IRGRP
+#ifndef S_IRGRP
 # define S_IRGRP (S_IRUSR >> 3)
 #endif
-#if !S_IROTH
+#ifndef S_IROTH
 # define S_IROTH (S_IRUSR >> 6)
 #endif
 
-#if !S_IWUSR && S_IWRITE
+#if !defined(S_IWUSR) && defined(S_IWRITE)
 # define S_IWUSR S_IWRITE
 #endif
-#if !S_IWUSR
+#ifndef S_IWUSR
 # define S_IWUSR 00200
 #endif
-#if !S_IWGRP
+#ifndef S_IWGRP
 # define S_IWGRP (S_IWUSR >> 3)
 #endif
-#if !S_IWOTH
+#ifndef S_IWOTH
 # define S_IWOTH (S_IWUSR >> 6)
 #endif
 
-#if !S_IXUSR && S_IEXEC
+#if !defined(S_IXUSR) && defined(S_IEXEC)
 # define S_IXUSR S_IEXEC
 #endif
-#if !S_IXUSR
+#ifndef S_IXUSR
 # define S_IXUSR 00100
 #endif
-#if !S_IXGRP
+#ifndef S_IXGRP
 # define S_IXGRP (S_IXUSR >> 3)
 #endif
-#if !S_IXOTH
+#ifndef S_IXOTH
 # define S_IXOTH (S_IXUSR >> 6)
 #endif
 
-#if !S_IRWXU
+#ifndef S_IRWXU
 # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
 #endif
-#if !S_IRWXG
+#ifndef S_IRWXG
 # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
 #endif
-#if !S_IRWXO
+#ifndef S_IRWXO
 # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
 #endif
 
 /* S_IXUGO is a common extension to POSIX.  */
-#if !S_IXUGO
+#ifndef S_IXUGO
 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
 #endif
 
--- /src_root/tar-1.19/tests/testsuite  Wed Oct 10 06:05:23 2007
+++ tests/testsuite     Sun Mar  2 23:30:25 2008
@@ -604,6 +604,12 @@
 # The directory the whole suite works in.
 # Should be absolutely to let the user `cd' at will.
 at_suite_dir=$at_dir/$as_me.dir
+if [ $OSTYPE = 'VMS' ]
+then
+   # VMS has problems with both testname and testname.dir in same
+   # directory.
+   at_suite_dir=$at_dir/${as_me}_dir
+fi
 # The file containing the suite.
 at_suite_log=$at_dir/$as_me.log
 # The file containing the location of the last AT_CHECK.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]