summaryrefslogtreecommitdiff
path: root/makeint.h
diff options
context:
space:
mode:
authorJohn Malmberg <wb8tyw@qsl.net>2014-09-13 20:20:22 -0500
committerPaul Smith <psmith@gnu.org>2014-10-20 01:28:46 -0400
commit894ee7f6c8b96ed89d4672da6cde4105c15cbf31 (patch)
tree1d10c4e86225e29358467266a4eb8b8e9a9ade1a /makeint.h
parente75662bc6a96571f041bdad799eb557ff580135c (diff)
downloadgunmake-894ee7f6c8b96ed89d4672da6cde4105c15cbf31.tar.gz
[SV 42447]: VMS simulate exporting symbols
This also includes fixing the most of the exit handling code for VMS. Self tests: Previously about 94 Tests in 36 categories fail. Now about 45 tests in 22 categories fail. Because some tests do not properly clean up, the number of tests that fail can vary by one or two test cases between consecutive runs. * Makefile.am: Add new VMS files. * job.c: add prototype for vms_strsignal(). * job.c: (child_error): Remove VMS specific code as no longer needed. * job.c: (reap_children): The VMS specific code was setting the status to 0 instead of setting it to the proper exit status. * job.h: Add vms_launch_status to struct child. * main.c: (main): Use environment variables for options to use MCR * instead of a foreign command, and to always use command files for subprocesses. For VMS use (set_program_name) routine which is common to ports of other GNU packages to VMS to set the program name used internally. Use (vms_putenv_symbol) to set up symbols to be visible in child programs, including recursive make launched by execve() Start of Bash shell detection code for VMS. * makefile.com: Need nested_include=none for building on VMS search lists. Add vms_progname, vms_exit, and vms_export_symbol. * makefile.vms: Need nested_include=none for building on VMS search lists. Add vms_progname, vms_exit, vms_export_symbol. * makeint.h: Make sure non-standard "VMS" macro is defined. Add prototypes for new VMS routines. Remove VMS-specific failure codes. * vmsjobs.c: Add VMS POSIX exit code constants. (_is_unixy_shell): Detect Bash shell. (vms_strsignal): simulate strsignal() on VMS. (vmsHandleChildTerm): fix to properly report failed LIB$SPAWN() exit status codes. Remove code that duplicated code in job.c. (child_execute_job): Export environment symbols before spawning a child and restore afterward unless option to use command files for subprocesses is set. Improve handling of UNIX null commands ":". * vms_exit.c: Provides vms_exit() to detect if an exit code is UNIX or VMS, and converts the UNIX code into a VMS exit code. * vms_export_symbol.c: Routines to create DCL symbols that work like shell aliases or exported shell symbols and clean them up on exit. * vms_export_symbol_test.com: Unit test for vms_export_symbol.c * vms_progname.c: New file: VMS specific replace for progname.c that is used in some GNU projects.
Diffstat (limited to 'makeint.h')
-rw-r--r--makeint.h56
1 files changed, 42 insertions, 14 deletions
diff --git a/makeint.h b/makeint.h
index fdcae75..6223936 100644
--- a/makeint.h
+++ b/makeint.h
@@ -99,6 +99,15 @@ extern int errno;
# define isblank(c) ((c) == ' ' || (c) == '\t')
#endif
+#ifdef __VMS
+/* In strict ANSI mode, VMS compilers should not be defining the
+ VMS macro. Define it here instead of a bulk edit for the correct code.
+ */
+# ifndef VMS
+# define VMS
+# endif
+#endif
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
@@ -201,6 +210,9 @@ unsigned int get_path_max (void);
# include <perror.h>
/* Needed to use alloca on VMS. */
# include <builtins.h>
+
+extern int vms_use_mcr_command;
+extern int vms_always_use_cmd_file;
#endif
#ifndef __attribute__
@@ -622,8 +634,33 @@ extern const char *program;
#endif
#ifdef VMS
-const char *vms_command(const char *argv0);
-const char *vms_progname(const char *argv0);
+const char *vms_command (const char *argv0);
+const char *vms_progname (const char *argv0);
+
+void vms_exit (int);
+# define _exit(foo) vms_exit(foo)
+# define exit(foo) vms_exit(foo)
+
+extern char *program_name;
+
+void
+set_program_name (const char *arv0);
+
+int
+need_vms_symbol (void);
+
+int
+create_foreign_command (const char *command, const char *image);
+
+int
+vms_export_dcl_symbol (const char *name, const char *value);
+
+int
+vms_putenv_symbol (const char *string);
+
+void
+vms_restore_symbol (const char *string);
+
#endif
extern char *starting_directory;
@@ -643,18 +680,9 @@ extern int handling_fatal_signal;
#endif
-#ifdef VMS
-/* These are the VMS __posix_exit compliant exit codes, constructed out of
- STS$M_INHIB_MSG, C facility code, a POSIX condition code mask, MAKE_NNN<<3 and
- the coresponding VMS severity, here STS$K_SUCCESS and STS$K_ERROR. */
-# define MAKE_SUCCESS 0x1035a001
-# define MAKE_TROUBLE 0x1035a00a
-# define MAKE_FAILURE 0x1035a012
-#else
-# define MAKE_SUCCESS 0
-# define MAKE_TROUBLE 1
-# define MAKE_FAILURE 2
-#endif
+#define MAKE_SUCCESS 0
+#define MAKE_TROUBLE 1
+#define MAKE_FAILURE 2
/* Set up heap debugging library dmalloc. */