Eliminate the define for POSIX and build with Posix behaviour.

Our make has been build with POSIX enabled from the first day
and the ifdef'ed out code served no purpose.
This commit is contained in:
Hartmut Brandt 2004-11-17 11:32:46 +00:00
parent 5f26d98581
commit 33ece31cca
3 changed files with 12 additions and 62 deletions

View File

@ -77,15 +77,6 @@
#define LIBSUFF ".a"
#define RECHECK
/*
* POSIX
* Adhere to the POSIX 1003.2 draft for the make(1) program.
* - Use MAKEFLAGS instead of MAKE to pick arguments from the
* environment.
* - Allow empty command lines if starting with tab.
*/
#define POSIX
/*
* SYSVINCLUDE
* Recognize system V like include directives [include "filename"]

View File

@ -612,11 +612,7 @@ main(int argc, char **argv)
* (Note this is *not* MAKEFLAGS since /bin/make uses that and it's
* in a different format).
*/
#ifdef POSIX
Main_ParseArgLine(getenv("MAKEFLAGS"));
#else
Main_ParseArgLine(getenv("MAKE"));
#endif
MainParseArgs(argc, argv);
@ -766,11 +762,7 @@ main(int argc, char **argv)
/* Install all the flags into the MAKE envariable. */
if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p)
#ifdef POSIX
setenv("MAKEFLAGS", p, 1);
#else
setenv("MAKE", p, 1);
#endif
free(p1);
/*

View File

@ -143,9 +143,7 @@ typedef enum {
Parallel, /* .PARALLEL */
ExPath, /* .PATH */
Phony, /* .PHONY */
#ifdef POSIX
Posix, /* .POSIX */
#endif
Precious, /* .PRECIOUS */
ExShell, /* .SHELL */
Silent, /* .SILENT */
@ -199,9 +197,7 @@ static struct {
{ ".PARALLEL", Parallel, 0 },
{ ".PATH", ExPath, 0 },
{ ".PHONY", Phony, OP_PHONY },
#ifdef POSIX
{ ".POSIX", Posix, 0 },
#endif
{ ".PRECIOUS", Precious, OP_PRECIOUS },
{ ".RECURSIVE", Attribute, OP_MAKE },
{ ".SHELL", ExShell, 0 },
@ -1034,11 +1030,9 @@ ParseDoDependency (char *line)
case ExPath:
Lst_ForEach(paths, ParseClearPath, (void *)NULL);
break;
#ifdef POSIX
case Posix:
Var_Set("%POSIX", "1003.2", VAR_GLOBAL);
break;
#endif
default:
break;
}
@ -2428,9 +2422,6 @@ Parse_File(char *name, FILE *stream)
* If a line starts with a tab, it can only hope to be
* a creation command.
*/
#ifndef POSIX
shellCommand:
#endif
for (cp = line + 1; isspace ((unsigned char) *cp); cp++) {
continue;
}
@ -2474,10 +2465,6 @@ Parse_File(char *name, FILE *stream)
* line's script, we assume it's actually a shell command
* and add it to the current list of targets.
*/
#ifndef POSIX
Boolean nonSpace = FALSE;
#endif
cp = line;
if (isspace((unsigned char) line[0])) {
while ((*cp != '\0') && isspace((unsigned char) *cp)) {
@ -2486,44 +2473,24 @@ Parse_File(char *name, FILE *stream)
if (*cp == '\0') {
goto nextLine;
}
#ifndef POSIX
while ((*cp != ':') && (*cp != '!') && (*cp != '\0')) {
nonSpace = TRUE;
cp++;
}
#endif
}
#ifndef POSIX
if (*cp == '\0') {
if (inLine) {
Parse_Error (PARSE_WARNING,
"Shell command needs a leading tab");
goto shellCommand;
} else if (nonSpace) {
Parse_Error (PARSE_FATAL, "Missing operator");
}
} else {
#endif
ParseFinishLine();
ParseFinishLine();
cp = Var_Subst (NULL, line, VAR_CMD, TRUE);
free (line);
line = cp;
cp = Var_Subst (NULL, line, VAR_CMD, TRUE);
free (line);
line = cp;
/*
* Need a non-circular list for the target nodes
*/
if (targets)
Lst_Destroy(targets, NOFREE);
/*
* Need a non-circular list for the target nodes
*/
if (targets)
Lst_Destroy(targets, NOFREE);
targets = Lst_Init (FALSE);
inLine = TRUE;
targets = Lst_Init (FALSE);
inLine = TRUE;
ParseDoDependency (line);
#ifndef POSIX
}
#endif
ParseDoDependency (line);
}
nextLine: