* src/makeint.h: Set MK_OS_VMS to 1 if we're on VMS.
* src/*: Convert all #if references to VMS, to use MK_OS_VMS.
* gl/lib/*: Ditto.
# endif
#endif
-#if !defined _AMIGA && !defined VMS && !defined WINDOWS32
+#if !defined _AMIGA && !MK_OS_VMS && !defined WINDOWS32
# include <pwd.h>
#endif
oldcount = pglob->gl_pathc;
-#ifndef VMS
+#if !MK_OS_VMS
if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
if (dirname[1] == '\0' || dirname[1] == '/')
{
/* Look up home directory. */
-#ifdef VMS
+#if MK_OS_VMS
/* This isn't obvious, RTLs of DECC and VAXC know about "HOME" */
const char *home_dir = getenv ("SYS$LOGIN");
#else
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "c:/users/default"; /* poor default */
# else
-# ifdef VMS
+# if MK_OS_VMS
/* Again, this isn't obvious, if "HOME" isn't known "SYS$LOGIN" should be set */
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS$DISK:[]";
else
home_dir = "~"; /* No luck. */
}
-# endif /* VMS */
+# endif /* MK_OS_VMS */
# endif /* WINDOWS32 */
# endif
/* Now construct the full directory. */
dirname = newp;
}
}
-# if !defined _AMIGA && !defined WINDOWS32 && !defined VMS
+# if !defined _AMIGA && !defined WINDOWS32 && !MK_OS_VMS
else
{
char *end_name = strchr (dirname, '/');
home directory. */
return GLOB_NOMATCH;
}
-# endif /* Not Amiga && not WINDOWS32 && not VMS. */
+# endif /* Not Amiga && not WINDOWS32 && not MK_OS_VMS. */
}
-#endif /* Not VMS. */
+#endif /* Not MK_OS_VMS. */
/* Now test whether we looked for "~" or "~NAME". In this case we
can give the answer now. */
int meta;
int save;
-#ifdef VMS
+#if MK_OS_VMS
if (*directory == 0)
directory = "[]";
#endif
#endif
/* Structure describing a globbing run. */
-#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
+#if !defined _AMIGA && !MK_OS_VMS /* Buggy compiler. */
struct stat;
#endif
typedef struct
struct dirent *(*gl_readdir) (void *);
void * (*gl_opendir) (const char *);
int (*gl_lstat) (const char *, struct stat *);
-#if defined(VMS) && defined(__DECC) && !defined(_POSIX_C_SOURCE)
+#if MK_OS_VMS && defined(__DECC) && !defined(_POSIX_C_SOURCE)
int (*gl_stat) (const char *, struct stat *, ...);
#else
int (*gl_stat) (const char *, struct stat *);
\f
/* Set the archive-member NAME's modtime to now. */
-#ifdef VMS
+#if MK_OS_VMS
int
ar_touch (const char *name)
{
return val;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
\f
/* State of an 'ar_glob' run, passed to 'ar_glob_match'. */
{
const char *arname;
const char *pattern;
-#ifdef VMS
+#if MK_OS_VMS
char *suffix;
#endif
size_t size;
{
/* We have a match. Add it to the chain. */
struct nameseq *new = xcalloc (state->size);
-#ifdef VMS
+#if MK_OS_VMS
if (state->suffix)
new->name = strcache_add(
concat(5, state->arname, "(", mem, state->suffix, ")"));
struct nameseq *n;
const char **names;
unsigned int i;
-#ifdef VMS
+#if MK_OS_VMS
char *vms_member_pattern;
#endif
if (! ar_glob_pattern_p (member_pattern, 1))
ar_glob_match will accumulate them in STATE.chain. */
state.arname = arname;
state.pattern = member_pattern;
-#ifdef VMS
+#if MK_OS_VMS
{
/* In a copy of the pattern, find the suffix, save it and remove it from
the pattern */
state.n = 0;
ar_scan (arname, ar_glob_match, &state);
-#ifdef VMS
+#if MK_OS_VMS
/* Deallocate any duplicated string */
free(vms_member_pattern);
if (state.suffix)
#ifndef NO_ARCHIVES
-#ifdef VMS
+#if MK_OS_VMS
#include <lbrdef.h>
#include <mhddef.h>
#include <credef.h>
return -2;
}
-#else /* !VMS */
+#else /* !MK_OS_VMS */
/* SCO Unix's compiler defines both of these. */
#ifdef M_UNIX
close (desc);
return -2;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
\f
/* Return nonzero iff NAME matches MEM.
If TRUNCATED is nonzero, MEM may be truncated to
if (p != 0)
name = p + 1;
-#ifndef VMS
+#if !MK_OS_VMS
if (truncated)
{
#ifdef AIAMAG
match = !strcasecmp (name, mem);
return match;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
\f
-#ifndef VMS
+#if !MK_OS_VMS
/* ARGSUSED */
static intmax_t
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
#include "w32err.h"
#endif
-#if VMS
+#if MK_OS_VMS
# define FILE_LIST_SEPARATOR (vms_comma_separator ? ',' : ' ')
#else
# define FILE_LIST_SEPARATOR ' '
#include "mkconfig.h"
-#define MK_VMS 1
+#define MK_OS_VMS 1
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
compiler which don't define it. */
a '.c' or '.p' or ... file rather than from a .s file. */
static char default_suffixes[]
-#ifdef VMS
+#if MK_OS_VMS
/* VMS should include all UNIX/POSIX + some VMS extensions */
= ".out .exe .a .olb .hlb .tlb .mlb .ln .o .obj .c .cxx .cc .cpp .pas .p \
.for .f .r .y .l .ym .yl .mar .s .ss .i .ii .mod .sym .def .h .info .dvi \
static struct pspec default_pattern_rules[] =
{
-#ifdef VMS
+#if MK_OS_VMS
{ "(%)", "%",
"@if f$$search(\"$@\") .eqs. \"\" then $(LIBRARY)/CREATE/"
"$(or "
/* The X.out rules are only in BSD's default set because
BSD Make has no null-suffix rules, so 'foo.out' and
'foo' are the same thing. */
-#ifdef VMS
+#if MK_OS_VMS
{ "%.exe", "%",
"$(CP) $< $@" },
static struct pspec default_terminal_rules[] =
{
-#ifdef VMS
+#if MK_OS_VMS
/* RCS. */
{ "%", "%$$5lv", /* Multinet style */
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
{ "%", "SCCS/s.%",
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
{ 0, 0, 0 }
};
static const char *default_suffix_rules[] =
{
-#ifdef VMS
+#if MK_OS_VMS
".o",
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".obj",
".l.ln",
"@$(RM) $*.c\n $(LEX.l) $< > $*.c\n$(LINT.c) -i $*.c -o $@\n $(RM) $*.c",
-#else /* ! VMS */
+#else /* ! MK_OS_VMS */
".o",
"$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".web.tex",
"$(WEAVE) $<",
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
0, 0,
};
static const char *default_variables[] =
{
-#ifdef VMS
+#if MK_OS_VMS
#ifdef __ALPHA
"ARCH", "ALPHA",
#endif
"CP", "copy",
".LIBPATTERNS", "%.olb lib%.a",
-#else /* !VMS */
+#else /* !MK_OS_VMS */
"AR", "ar",
#ifdef _AIX
".LIBPATTERNS", "lib%.so lib%.a",
#endif
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* Make this assignment to avoid undefined variable warnings. */
GNUMAKEFLAGS_NAME, "",
0, 0
#define PARSE_SIMPLE_SEQ(_s,_t) \
(_t *)parse_file_seq ((_s),sizeof (_t),MAP_NUL,NULL,PARSEFS_NONE)
-#ifdef VMS
+#if MK_OS_VMS
void *parse_file_seq ();
#else
void *parse_file_seq (char **stringp, size_t size,
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
-# ifdef VMS
+# if MK_OS_VMS
/* its prototype is in vmsdir.h, which is not needed for HAVE_DIRENT_H */
const char *vmsify (const char *name, int type);
# endif
# define NAMLEN(d) _D_NAMLEN(d)
#endif
-#if (defined (POSIX) || defined (VMS) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
+#if (defined (POSIX) || MK_OS_VMS || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
}
#endif /* HAVE_CASE_INSENSITIVE_FS */
-#ifdef VMS
+#if MK_OS_VMS
static char *
downcase_inplace(char *filename)
# define stat(__path, __sbuf) vmsstat_dir (__path, __sbuf)
#endif /* _USE_STD_STAT */
-#endif /* VMS */
+#endif /* MK_OS_VMS */
\f
/* Never have more than this many directories open at once. */
# define FS_NTFS 0x2
# define FS_UNKNOWN 0x4
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
ino_t ino[3];
# else
ino_t ino;
ISTRING_HASH_1 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) key->ctime;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
hash = (((unsigned int) key->dev << 4)
^ ((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
ISTRING_HASH_2 (key->path_key, hash);
hash ^= ((unsigned int) key->dev << 4) ^ (unsigned int) ~key->ctime;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
hash = (((unsigned int) key->dev << 4)
^ ~((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
if (result)
return result;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
result = MAKECMP(x->ino[0], y->ino[0]);
if (result)
return result;
size_t len = strlen (name);
dir = xmalloc (sizeof (struct directory));
-#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+#if defined(HAVE_CASE_INSENSITIVE_FS) && MK_OS_VMS
/* Todo: Why is this only needed on VMS? */
{
char *lname = downcase_inplace (xstrdup (name));
dc_key.path_key = w32_path = w32ify (name, 1);
dc_key.ctime = st.st_ctime;
#else
-# ifdef VMS_INO_T
+# if MK_OS_VMS_INO_T
dc_key.ino[0] = st.st_ino[0];
dc_key.ino[1] = st.st_ino[1];
dc_key.ino[2] = st.st_ino[2];
break;
}
-#if defined(VMS) && defined(HAVE_DIRENT_H)
+#if MK_OS_VMS && defined(HAVE_DIRENT_H)
/* In VMS we get file versions too, which have to be stripped off.
Some versions of VMS return versions on Unix files even when
the feature option to strip them is set. */
#endif
{
df = xmalloc (sizeof (struct dirfile));
-#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+#if MK_OS_VMS && defined(HAVE_CASE_INSENSITIVE_FS)
/* TODO: Why is this only needed on VMS? */
df->name = strcache_add_len (downcase_inplace (d->d_name), len);
#else
int
dir_file_exists_p (const char *dirname, const char *filename)
{
-#ifdef VMS
+#if MK_OS_VMS
if (filename && dirname && strpbrk (dirname, ":<[") != NULL)
filename = vmsify (filename, 0);
#endif
#endif
dirend = strrchr (name, '/');
-#ifdef VMS
+#if MK_OS_VMS
if (dirend == NULL)
{
dirend = strrchr (name, ']');
dirend = strrchr (name, ':');
dirend == NULL ? dirend : dirend++;
}
-#endif /* VMS */
+#endif /* MK_OS_VMS */
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
p[dirend - name] = '\0';
dirname = p;
}
-#ifdef VMS
+#if MK_OS_VMS
if (*slash == '/')
slash++;
#else
struct dirfile *new;
dirend = strrchr (p, '/');
-#ifdef VMS
+#if MK_OS_VMS
if (dirend == NULL)
{
dirend = strrchr (p, ']');
dirname = cp;
}
dir = find_directory (dirname);
-#ifdef VMS
+#if MK_OS_VMS
if (*slash == '/')
filename = p = slash + 1;
else
new = xmalloc (sizeof (struct dirfile));
new->length = strlen (filename);
-#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
+#if defined(HAVE_CASE_INSENSITIVE_FS) && MK_OS_VMS
/* todo: Why is this only needed on VMS? */
new->name = strcache_add_len (downcase (filename), new->length);
#else
struct directory_contents *dir;
struct dirfile *dirfile;
struct dirfile dirfile_key;
-#ifdef VMS
+#if MK_OS_VMS
int want_vmsify = 0;
#endif
dirend = strrchr (filename, '/');
-#ifdef VMS
+#if MK_OS_VMS
if (dirend == NULL)
{
want_vmsify = (strpbrk (filename, "]>:^") != NULL);
dirname = cp;
}
dir = find_directory (dirname)->contents;
-#ifdef VMS
+#if MK_OS_VMS
if (*slash == '/')
filename = slash + 1;
else
#ifdef HAVE_CASE_INSENSITIVE_FS
filename = downcase (filename);
#endif
-#ifdef VMS
+#if MK_OS_VMS
if (want_vmsify)
filename = vmsify (filename, 1);
#endif
* On MS-Windows, stat() "succeeds" for foo/bar/. where foo/bar is a
* regular file; fix that here.
*/
-#if !defined(stat) && !defined(WINDOWS32) || defined(VMS)
-# ifndef VMS
+#if !defined(stat) && !defined(WINDOWS32) || MK_OS_VMS
+# if !MK_OS_VMS
# ifndef HAVE_SYS_STAT_H
int stat (const char *path, struct stat *sbuf);
# endif
#endif
/* Similarly for lstat. */
-#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
-# ifndef VMS
+#if !defined(lstat) && !defined(WINDOWS32) || MK_OS_VMS
+# if !MK_OS_VMS
# ifndef HAVE_SYS_STAT_H
int lstat (const char *path, struct stat *sbuf);
# endif
{
struct file *f;
struct file file_key;
-#ifdef VMS
+#if MK_OS_VMS
int want_vmsify;
#ifndef WANT_CASE_SENSITIVE_TARGETS
char *lname;
/* This is also done in parse_file_seq, so this is redundant
for names read from makefiles. It is here for names passed
on the command line. */
-#ifdef VMS
+#if MK_OS_VMS
want_vmsify = (strpbrk (name, "]>:^") != NULL);
# ifndef WANT_CASE_SENSITIVE_TARGETS
if (*name != '.')
{
/* It was all slashes after a dot. */
name = "./";
-#if defined(VMS)
+#if MK_OS_VMS
/* TODO - This section is probably not needed. */
if (want_vmsify)
name = "[]";
}
file_key.hname = name;
f = hash_find_item (&files, &file_key);
-#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
+#if MK_OS_VMS && !defined(WANT_CASE_SENSITIVE_TARGETS)
if (*name != '.')
free (lname);
#endif
assert (*name != '\0');
assert (! verify_flag || strcache_iscached (name));
-#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
+#if MK_OS_VMS && !defined(WANT_CASE_SENSITIVE_TARGETS)
if (*name != '.')
{
const char *n;
int is_suffix = funcname[0] == 's';
int is_notdir = !is_suffix;
int stop = MAP_DIRSEP | (is_suffix ? MAP_DOT : 0);
-#ifdef VMS
+#if MK_OS_VMS
/* For VMS list_iterator points to a comma separated list. To use the common
[find_]next_token, create a local copy and replace the commas with
spaces. Obviously, there is a problem if there is a ',' in the VMS filename
if (is_notdir || p >= p2)
{
-#ifdef VMS
+#if MK_OS_VMS
if (vms_comma_separator)
o = variable_buffer_output (o, ",", 1);
else
int is_basename = funcname[0] == 'b';
int is_dir = !is_basename;
int stop = MAP_DIRSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
-#ifdef VMS
+#if MK_OS_VMS
/* As in func_notdir_suffix ... */
char *vms_p3 = alloca (strlen(p3) + 1);
int i;
o = variable_buffer_output (o, p2, 2);
#endif
else if (is_dir)
-#ifdef VMS
+#if MK_OS_VMS
{
extern int vms_report_unix_paths;
if (vms_report_unix_paths)
}
#else
o = variable_buffer_output (o, "./", 2);
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
else
/* The entire name is the basename. */
o = variable_buffer_output (o, p2, len);
-#ifdef VMS
+#if MK_OS_VMS
if (vms_comma_separator)
o = variable_buffer_output (o, ",", 1);
else
Do shell spawning, with the naughty bits for different OSes.
*/
-#ifdef VMS
+#if MK_OS_VMS
/* VMS can't do $(shell ...) */
{
return func_shell_base (o, argv, 1);
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
#ifdef EXPERIMENTAL
# include <unistd.h>
#endif /* GNU C library. */
-#ifdef VMS
+#if MK_OS_VMS
# include <unixlib.h>
# if HAVE_STRING_H - 0
# include <string.h>
but not counting any slash at the end. (foo/bar/ counts as
bar/ in directory foo/, not empty in directory foo/bar/.) */
lastslash = memrchr (filename, '/', namelen - 1);
-#ifdef VMS
+#if MK_OS_VMS
if (lastslash == NULL)
lastslash = strrchr (filename, ']');
if (lastslash == NULL)
check_lastslash = 0;
if (lastslash)
{
-#ifdef VMS
+#if MK_OS_VMS
check_lastslash = strpbrk (target, "/]>:") == NULL;
#else
check_lastslash = strchr (target, '/') == 0;
const char *default_shell = "/bin/sh";
int batch_mode_shell = 0;
-#elif defined (VMS)
+#elif MK_OS_VMS
# include <descrip.h>
# include <stsdef.h>
int dos_command_running;
#endif /* __MSDOS__ */
-#ifdef VMS
+#if MK_OS_VMS
# ifndef __GNUC__
# include <processes.h>
# endif
int dup2 ();
int execve ();
void _exit ();
-# ifndef VMS
+# if !MK_OS_VMS
int geteuid ();
int getegid ();
int setgid ();
DB (DB_JOBS, (_("Live child %p (%s) PID %s %s\n"),
c, c->file->name, pid2str (c->pid),
c->remote ? _(" (remote)") : ""));
-#ifdef VMS
+#if MK_OS_VMS
break;
#endif
}
#if !defined(__MSDOS__) && !defined(WINDOWS32)
if (any_local)
{
-#ifdef VMS
+#if MK_OS_VMS
/* Todo: This needs more untangling multi-process support */
/* Just do single child process support now */
vmsWaitForChildren (&status);
else
#endif
EINTRLOOP (pid, wait (&status));
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
else
pid = 0;
{
int flags;
char *p;
-#ifdef VMS
+#if MK_OS_VMS
# define FREE_ARGV(_a)
char *argv;
#else
/* Figure out an argument list from this command line. */
{
char *end = 0;
-#ifdef VMS
+#if MK_OS_VMS
/* Skip any leading whitespace */
while (*p)
{
if (argv != 0 && question_flag && NONE_SET (flags, COMMANDS_RECURSE))
{
FREE_ARGV (argv);
-#ifdef VMS
+#if MK_OS_VMS
/* On VMS, argv[0] can be a null string here */
if (argv[0] != 0)
{
child->file->update_status = us_question;
notice_finished_file (child->file);
return;
-#ifdef VMS
+#if MK_OS_VMS
}
#endif
}
performed some action (makes a difference as to what messages are
printed, etc. */
-#if !defined(VMS)
+#if !MK_OS_VMS
if (
#if defined __MSDOS__ || defined (__EMX__)
unixy_shell /* the test is complicated and we already did it */
FREE_ARGV (argv);
goto next_command;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* If -n was given, recurse to get the next line in the sequence. */
#if !defined(__MSDOS__) && !defined(WINDOWS32)
-#ifndef VMS
+#if !MK_OS_VMS
/* start_waiting_job has set CHILD->remote if we can start a remote job. */
if (child->remote)
{
}
}
else
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
{
/* Fork the child process. */
run_local:
child->remote = 0;
-#ifdef VMS
+#if MK_OS_VMS
child->pid = child_execute_job ((struct childbase *)child, 1, argv);
#else
jobserver_post_child (ANY_SET (flags, COMMANDS_RECURSE));
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
#else /* __MSDOS__ or WINDOWS32 */
static int
load_too_high (void)
{
-#if defined(__MSDOS__) || defined(VMS) || defined(__riscos__)
+#if defined(__MSDOS__) || MK_OS_VMS || defined(__riscos__)
return 1;
#else
static double last_sec;
return pid;
}
-#elif !defined (__MSDOS__) && !defined (VMS)
+#elif !defined (__MSDOS__) && !MK_OS_VMS
/* POSIX:
Create a child process executing the command in ARGV.
return pid;
}
-#endif /* !__MSDOS__ && !VMS */
+#endif /* !__MSDOS__ && !MK_OS_VMS */
#endif /* !WINDOWS32 */
\f
/* Replace the current process with one running the command in ARGV,
pid_t
exec_command (char **argv, char **envp)
{
-#ifdef VMS
+#if MK_OS_VMS
/* to work around a problem with signals and execve: ignore them */
#ifdef SIGCHLD
signal (SIGCHLD,SIG_IGN);
return pid;
#endif /* !WINDOWS32 */
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
}
\f
-#ifndef VMS
+#if !MK_OS_VMS
/* Figure out the argument list necessary to run LINE as a command. Try to
avoid using a shell. This routine handles only ' quoting, and " quoting
when no backslash, $ or ' characters are seen in the quotes. Starting
return new_argv;
}
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
/* Figure out the argument list necessary to run LINE as a command. Try to
avoid using a shell. This routine handles only ' quoting, and " quoting
/* On VMS systems, include special VMS functions. */
-#ifdef VMS
+#if MK_OS_VMS
#include "vmsjobs.c"
#endif
/* Structure describing a running or dead child process. */
-#ifdef VMS
+#if MK_OS_VMS
#define VMSCHILD \
char *comname; /* Temporary command file name */ \
int efn; /* Completion event flag number */ \
# include <fcntl.h>
#endif
-#ifdef VMS
+#if MK_OS_VMS
int vms_use_mcr_command = 0;
int vms_always_use_cmd_file = 0;
int vms_gnv_shell = 0;
stopchar_map[(int)'\t'] = MAP_BLANK;
stopchar_map[(int)'/'] = MAP_DIRSEP;
-#if defined(VMS)
+#if MK_OS_VMS
stopchar_map[(int)':'] |= MAP_DIRSEP;
stopchar_map[(int)']'] |= MAP_DIRSEP;
stopchar_map[(int)'>'] |= MAP_DIRSEP;
program = xstrndup (program, len - 4);
}
}
-#elif defined(VMS)
+#elif MK_OS_VMS
set_program_name (argv[0]);
program = program_name;
{
fflush (stdout);
}
-#ifndef VMS
+#if !MK_OS_VMS
/* Set the "MAKE_COMMAND" variable to the name we were invoked with.
(If it is a relative pathname with a slash, prepend our directory name
so the result will run the same program regardless of the current dir.
/* The extra indirection through $(MAKE_COMMAND) is done
for hysterical raisins. */
-#ifdef VMS
+#if MK_OS_VMS
if (vms_use_mcr_command)
define_variable_cname ("MAKE_COMMAND", vms_command (argv[0]), o_default, 0);
else
a reference to this hidden variable is written instead. */
define_variable_cname ("MAKEOVERRIDES", "${-*-command-variables-*-}",
o_default, 1);
-#ifdef VMS
+#if MK_OS_VMS
vms_export_dcl_symbol ("MAKEOVERRIDES", "${-*-command-variables-*-}");
#endif
}
no_default_sh_exe = !find_and_set_default_shell (NULL);
#endif /* WINDOWS32 */
-#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
+#if defined (__MSDOS__) || defined (__EMX__) || MK_OS_VMS
/* We need to know what kind of shell we will be using. */
{
extern int _is_unixy_shell (const char *_path);
else
job_slots = arg_job_slots;
-#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
+#if defined (__MSDOS__) || defined (__EMX__) || MK_OS_VMS
if (job_slots != 1
# ifdef __EMX__
&& _osmode != OS2_MODE /* turn off -j if we are in DOS mode */
{
*p = alloca (40);
sprintf (*p, "%s=%u", MAKELEVEL_NAME, makelevel);
-#ifdef VMS
+#if MK_OS_VMS
vms_putenv_symbol (*p);
#endif
}
/* Ignore plain '-' for compatibility. */
return;
-#ifdef VMS
+#if MK_OS_VMS
{
/* VMS DCL quoting can result in foo="bar baz" showing up here.
Need to remove the double quotes from the value. */
#endif
#ifdef __VMS
+# define MK_OS_VMS 1
/* 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.
*/
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */
-# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
+# if defined (_POSIX_VERSION) && !defined (ultrix) && !MK_OS_VMS
# define POSIX 1
# endif
#endif
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
#endif
-#ifdef VMS
+#if MK_OS_VMS
# include <fcntl.h>
# include <types.h>
# include <unixlib.h>
/* The set of characters which are directory separators is OS-specific. */
#define MAP_DIRSEP 0x8000
-#ifdef VMS
+#if MK_OS_VMS
# define MAP_VMSCOMMA MAP_COMMA
#else
# define MAP_VMSCOMMA 0x0000
# define PATH_SEPARATOR_CHAR ';'
# define MAP_PATHSEP MAP_SEMI
#elif !defined(PATH_SEPARATOR_CHAR)
-# if defined (VMS)
+# if MK_OS_VMS
# define PATH_SEPARATOR_CHAR (vms_comma_separator ? ',' : ':')
# define MAP_PATHSEP (vms_comma_separator ? MAP_COMMA : MAP_SEMI)
# else
# define TTYNAME(_f) DEFAULT_TTYNAME
#endif
-#ifdef VMS
+#if MK_OS_VMS
# define DEFAULT_TMPDIR "/sys$scratch/"
#elif defined(P_tmpdir)
# define DEFAULT_TMPDIR P_tmpdir
intmax_t ar_scan (const char *archive, ar_member_func_t function,
const void *arg);
int ar_name_equal (const char *name, const char *mem, int truncated);
-#ifndef VMS
+#if !MK_OS_VMS
int ar_member_touch (const char *arname, const char *memname);
#endif
#endif
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
-# ifndef VMS
+# if !MK_OS_VMS
long int lseek ();
# endif
# ifdef HAVE_GETCWD
-# if !defined(VMS) && !defined(__DECC)
+# if !MK_OS_VMS && !defined(__DECC)
char *getcwd (void);
# endif
# else
extern const char *program;
-#ifdef VMS
+#if MK_OS_VMS
const char *vms_command (const char *argv0);
const char *vms_progname (const char *argv0);
}
#endif
-#ifdef VMS
+#if MK_OS_VMS
# define DEFAULT_TMPFILE "sys$scratch:gnv$make_cmdXXXXXX.com"
#else
# define DEFAULT_TMPFILE "GmXXXXXX"
template = xmalloc (strlen (tmpdir) + CSTRLEN (DEFAULT_TMPFILE) + 2);
cp = stpcpy (template, tmpdir);
-#if !defined VMS
+#if !MK_OS_VMS
/* It's not possible for tmpdir to be empty. */
if (! ISDIRSEP (cp[-1]))
*(cp++) = '/';
#define IO_STDOUT_OK 0x0008
#define IO_STDERR_OK 0x0010
-#if defined(VMS) || defined(__MSDOS__)
+#if MK_OS_VMS || defined(__MSDOS__)
# define check_io_state() (IO_STDIN_OK|IO_STDOUT_OK|IO_STDERR_OK)
# define fd_inherit(_i) (0)
# define fd_noinherit(_i) (0)
#endif /* NO_OUTPUT_SYNC */
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
-#if defined(VMS) || defined(WINDOWS32) || defined(__MSDOS__)
+#if MK_OS_VMS || defined(WINDOWS32) || defined(__MSDOS__)
# define get_bad_stdin() (-1)
#else
int get_bad_stdin (void);
#ifdef WINDOWS32
# include <windows.h>
# include "sub_proc.h"
-#elif defined(VMS)
+#elif MK_OS_VMS
struct passwd *getpwnam (char *name);
#else
# include <pwd.h>
if (num_makefiles == 0)
{
static const char *default_makefiles[] =
-#ifdef VMS
+#if MK_OS_VMS
/* all lower case since readdir() (the vms version) 'lowercasifies' */
/* TODO: Above is not always true, this needs more work */
{ "makefile.vms", "gnumakefile", "makefile", 0 };
#else
#ifdef WINDOWS32
{ "GNUmakefile", "makefile", "Makefile", "makefile.mak", 0 };
-#else /* !VMS && !WINDOWS32 */
+#else /* !MK_OS_VMS && !WINDOWS32 */
{ "GNUmakefile", "makefile", "Makefile", 0 };
-#endif /* !VMS && !WINDOWS32 */
-#endif /* VMS */
+#endif /* !MK_OS_VMS && !WINDOWS32 */
+#endif /* MK_OS_VMS */
const char **p = default_makefiles;
while (*p != 0 && !file_exists_p (*p))
++p;
char *
tilde_expand (const char *name)
{
-#if !defined(VMS)
+#if !MK_OS_VMS
if (name[1] == '/' || name[1] == '\0')
{
char *home_dir;
*userend = '/';
}
# endif /* !WINDOWS32 */
-#endif /* !VMS */
+#endif /* !MK_OS_VMS */
return 0;
}
\f
s = p;
p = find_map_unquote (p, findmap);
-#ifdef VMS
+#if MK_OS_VMS
/* convert comma separated list to space separated */
if (p && *p == ',')
*p =' ';
/* Strip leading "this directory" references. */
if (NONE_SET (flags, PARSEFS_NOSTRIP))
-#ifdef VMS
+#if MK_OS_VMS
/* Skip leading '[]'s. should only be one set or bug somewhere else */
if (p - s > 2 && s[0] == '[' && s[1] == ']')
s += 2;
}
else
{
-#ifdef VMS
+#if MK_OS_VMS
/* VMS filenames can have a ':' in them but they have to be '\'ed but we need
* to remove this '\' before we can use the filename.
* xstrdup called because S may be read-only string constant.
#include <sys/file.h>
#endif
-#ifdef VMS
+#if MK_OS_VMS
#include <starlet.h>
#endif
#ifdef WINDOWS32
/* If we found it in VPATH, see if it's in GPATH too; if so,
change the name right now; if not, defer until after the
dependencies are updated. */
-#ifndef VMS
+#if !MK_OS_VMS
name_len = strlen (name) - strlen (file->name) - 1;
#else
name_len = strlen (name) - strlen (file->name);
const char *dname = dep_name (dep);
size_t len = strlen (dname);
-#ifdef VMS
+#if MK_OS_VMS
const char *p = strrchr (dname, ']');
const char *p2;
if (p == 0)
{
/* Special case: TARGET being nil means we are defining a '.X.a' suffix
rule; the target pattern is always '(%.o)'. */
-#ifdef VMS
+#if MK_OS_VMS
*names = strcache_add_len ("(%.obj)", 7);
#else
*names = strcache_add_len ("(%.o)", 5);
var_slot = (struct variable **) hash_find_slot (&set->table, &var_key);
v = *var_slot;
-#ifdef VMS
+#if MK_OS_VMS
/* VMS does not populate envp[] with DCL symbols and logical names which
historically are mapped to environment variables.
If the variable is not yet defined, then we need to check if getenv()
is_parent |= setlist->next_is_parent;
}
-#ifdef VMS
+#if MK_OS_VMS
/* VMS doesn't populate envp[] with DCL symbols and logical names, which
historically are mapped to environment variables and returned by
getenv(). */
return define_variable (vname, length, value, o_env, 1);
}
}
-#endif /* VMS */
+#endif /* MK_OS_VMS */
return 0;
}
#include "makeint.h"
-#if VMS
+#if MK_OS_VMS
#include <unixlib.h>
#include <stdlib.h>
#include <jpidef.h>
/* Add the directory prefix already in *FILE. */
if (name_dplen > 0)
{
-#ifndef VMS
+#if !MK_OS_VMS
*p++ = '/';
#else
/* VMS: if this is not in VMS format, treat as Unix format */
p[-1] = '/';
#endif
/* Now add the name-within-directory at the end of NAME. */
-#ifndef VMS
+#if !MK_OS_VMS
if (p != name && p[-1] != '/')
{
*p = '/';
/* That file wasn't mentioned in the makefile.
See if it actually exists. */
-#ifdef VMS
+#if MK_OS_VMS
/* For VMS syntax just use the original vpath */
if (*p != '/')
exists_in_cache = exists = dir_file_exists_p (vpath[i], filename);
struct stat st;
-#ifndef VMS
+#if !MK_OS_VMS
/* Put the slash back in NAME. */
*p = '/';
#else