From 5369be5079fb66300e63d3a52a7735e1504b7073 Mon Sep 17 00:00:00 2001 From: Hartmut Becker Date: Sun, 31 Aug 2014 19:11:08 +0200 Subject: Enhance/fix VMS setting of program name, MAKE/MAKE_COMMAND variables * default.c, main.c, makeint.h, vmsfunctions.c: prefix argv[0] with "mcr " for MAKE/MAKE_COMMAND and set the program name to the image filename (without the .exe;version) * vmsfunctions.c: remove obsolete code * vmsify: use xmalloc --- main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 2e654db..f025122 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,5 @@ /* Argument parsing and main program of GNU Make. -Copyright (C) 1988-2013 Free Software Foundation, Inc. +Copyright (C) 1988-2014 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify it under the @@ -1161,11 +1161,7 @@ main (int argc, char **argv, char **envp) program = "make"; else { -#ifdef VMS - program = strrchr (argv[0], ']'); -#else program = strrchr (argv[0], '/'); -#endif #if defined(__MSDOS__) || defined(__EMX__) if (program == 0) program = strrchr (argv[0], '\\'); @@ -1195,7 +1191,11 @@ main (int argc, char **argv, char **envp) } #endif if (program == 0) +#ifdef VMS + program = vms_progname(argv[0]); +#else program = argv[0]; +#endif else ++program; } @@ -1581,7 +1581,11 @@ main (int argc, char **argv, char **envp) /* The extra indirection through $(MAKE_COMMAND) is done for hysterical raisins. */ +#ifdef VMS + define_variable_cname("MAKE_COMMAND", vms_command(argv[0]), o_default, 0); +#else define_variable_cname ("MAKE_COMMAND", argv[0], o_default, 0); +#endif define_variable_cname ("MAKE", "$(MAKE_COMMAND)", o_default, 1); if (command_variables != 0) -- cgit v1.2.3