Compare commits

...

21 Commits
3.70.2 ... 3.71

Author SHA1 Message Date
Roland McGrath
e72213687f [GETLOADAVG_PRIVILEGED] [POSIX]: Don't test [HAVE_SETUID] and [HAVE_SETGID].
Every system has those, and configure doesn't check for them.
1994-05-21 20:28:10 +00:00
Roland McGrath
491d66a916 [_POSIX_VERSION]: Don't #define POSIX #ifdef ultrix. 1994-05-21 20:27:18 +00:00
Roland McGrath
f4fb1be3d8 (loadavg): Depend on and use loadavg.c instead of getloadavg.c.
(loadavg.c): Link or copy it from getloadavg.c.
(distclean): Remove loadavg.c.
1994-05-21 20:26:33 +00:00
Roland McGrath
10abeb4a08 (AC_MACRODIR): Don't define it.
[AC_MACRODIR]: Protect deps using it with ifdef.
1994-05-19 00:35:53 +00:00
Roland McGrath
a369402d11 Correct update date updated in last change. 1994-05-17 03:50:09 +00:00
Roland McGrath
fe3962cf54 Update update date for last change. 1994-05-17 03:46:27 +00:00
Roland McGrath
cf76b42f2b [GETLOADAVG_PRIVILEGED] [! POSIX]: Undefine HAVE_SETEUID and HAVE_SETEGID. 1994-05-17 03:09:02 +00:00
Roland McGrath
fb088e4526 (SCCS_GET_MINUS_G check): Put -G flag before file name. 1994-05-17 02:59:57 +00:00
Roland McGrath
f2804372bd (default_terminal_rules): In SCCS rules, put $(SCCS_OUTPUT_OPTION) before
$<.  On some systems -G is grokked only before the file name.
1994-05-17 02:58:49 +00:00
Roland McGrath
c25db14264 (Overriding Makefiles): Don't suggest using .DEFAULT; that loses if the
target file exists.  Instead recommend the combination of a match-anything
rule and a force target.
1994-05-11 01:42:43 +00:00
Roland McGrath
e83c7d40cd (construct_command_argv_internal): Swallow backslash-newline combinations
inside '' strings too.
1994-05-10 20:27:17 +00:00
Roland McGrath
65d0cd98a9 (do_define): Call collapse_continuations on each line before all else. 1994-05-05 08:15:00 +00:00
Roland McGrath
ec505152e0 (AC_MACRODIR): Change default back. 1994-05-02 23:45:18 +00:00
Roland McGrath
0d2488a804 Note that dirs in VPATH, vpath can be separated by blanks as well as
colons.
1994-05-02 23:00:39 +00:00
Roland McGrath
bc5f054132 (config.h.in): Use $(AC_MACRODIR) in dep. 1994-05-02 22:32:54 +00:00
Roland McGrath
e812d40f9f (AC_MACRODIR): Define if undefined.
(ACFLAGS, configure, config.h.in): Use that value.
1994-05-02 22:29:56 +00:00
Roland McGrath
b12c639bb2 (ARCH==hp300): Disabled customs. 1994-04-25 23:37:12 +00:00
Roland McGrath
dd841ded6f (construct_command_argv_internal): Notice newline inside '' string when
RESTP is non-null.
1994-04-25 23:31:55 +00:00
Roland McGrath
3c9e8b266a (update_goal_chain): Reset FILE to G->file after the double-colon loop so
it is never null for following code.
1994-04-22 21:58:26 +00:00
Roland McGrath
e6bce5ef88 (read_makefile): Fix `override define' parsing to skip whitespace after
`define' properly.
1994-04-22 21:57:47 +00:00
Roland McGrath
bdff21b09a (srcdir): Define as @srcdir@; don't reference $(VPATH).
(glob/Makefile): New target.
1994-04-22 21:33:25 +00:00
10 changed files with 95 additions and 45 deletions

View File

@@ -31,7 +31,7 @@ override srcdir := .
override CC := $(CC) override CC := $(CC)
ifeq ($(ARCH),hp300) ifeq ($(ARCH),hp300)
customs=yes #customs=yes
endif endif
ifdef customs ifdef customs
override REMOTE := cstms override REMOTE := cstms
@@ -49,11 +49,10 @@ extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
LOADLIBES := $(filter-out @%@,$(LOADLIBES)) LOADLIBES := $(filter-out @%@,$(LOADLIBES))
ALLOCA := $(filter-out @%@,$(ALLOCA)) ALLOCA := $(filter-out @%@,$(ALLOCA))
# Tell autoconf/autoheader to use m4 files from the master source. ifdef AC_MACRODIR
ACFLAGS := -m /home/gd/gnu/autoconf configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
configure config.h.in: $(patsubst %,/home/gd/gnu/autoconf/%.m4,\ config.h.in: $(AC_MACRODIR)/acconfig.h
acspecific acgeneral) endif
config.h.in: /home/gd/gnu/autoconf/acconfig.h
configure: configure.in; autoconf $(ACFLAGS) configure: configure.in; autoconf $(ACFLAGS)
config.h.in: configure.in; autoheader $(ACFLAGS) config.h.in: configure.in; autoheader $(ACFLAGS)

View File

@@ -24,7 +24,8 @@
# Ultrix 2.2 make doesn't expand the value of VPATH. # Ultrix 2.2 make doesn't expand the value of VPATH.
VPATH = @srcdir@ VPATH = @srcdir@
srcdir = $(VPATH) # This must repeat the value, because configure will remove `VPATH = .'.
srcdir = @srcdir@
CC = @CC@ CC = @CC@
@@ -228,9 +229,14 @@ $(mandir)/$(manprefix)make.$(manext): make.man
$(INSTALL_DATA) $(srcdir)/make.man $@ $(INSTALL_DATA) $(srcdir)/make.man $@
loadavg: getloadavg.c config.h loadavg: loadavg.c config.h
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \ $(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
$(srcdir)/getloadavg.c $(LOADLIBES) -o $@ loadavg.c $(LOADLIBES) -o $@
# We copy getloadavg.c into a different file rather than compiling it
# directly because some compilers clobber getloadavg.o in the process.
loadavg.c: getloadavg.c
ln $(srcdir)/getloadavg.c loadavg.c || \
cp $(srcdir)/getloadavg.c loadavg.c
check-loadavg: loadavg check-loadavg: loadavg
@echo The system uptime program believes the load average to be: @echo The system uptime program believes the load average to be:
-uptime -uptime
@@ -246,6 +252,7 @@ distclean: clean glob-realclean
-rm -f Makefile config.h config.status build.sh stamp-config -rm -f Makefile config.h config.status build.sh stamp-config
-rm -f TAGS tags -rm -f TAGS tags
-rm -f make.?? make.??s make.log make.toc make.*aux -rm -f make.?? make.??s make.log make.toc make.*aux
-rm -f loadavg.c
realclean: distclean realclean: distclean
mostlyclean: clean mostlyclean: clean
@@ -255,6 +262,8 @@ glob-clean glob-realclean:
Makefile: config.status $(srcdir)/Makefile.in Makefile: config.status $(srcdir)/Makefile.in
$(SHELL) config.status $(SHELL) config.status
glob/Makefile: config.status $(srcdir)/glob/Makefile.in
$(SHELL) config.status
config.h: stamp-config ; config.h: stamp-config ;
stamp-config: config.status $(srcdir)/config.h.in stamp-config: config.status $(srcdir)/config.h.in
$(SHELL) config.status $(SHELL) config.status

View File

@@ -81,7 +81,7 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
test -f s.conftest; then test -f s.conftest; then
# We successfully created an SCCS file. # We successfully created an SCCS file.
echo checking if SCCS get command understands -G echo checking if SCCS get command understands -G
if $SCCS_GET s.conftest -Gconftoast >/dev/null 2>&1 && if $SCCS_GET -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast; then test -f conftoast; then
AC_DEFINE(SCCS_GET_MINUS_G) AC_DEFINE(SCCS_GET_MINUS_G)
fi fi

View File

@@ -63,9 +63,9 @@ static struct pspec default_terminal_rules[] =
/* SCCS. */ /* SCCS. */
{ "%", "s.%", { "%", "s.%",
"$(GET) $(GFLAGS) $< $(SCCS_OUTPUT_OPTION)" }, "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
{ "%", "SCCS/s.%", { "%", "SCCS/s.%",
"$(GET) $(GFLAGS) $< $(SCCS_OUTPUT_OPTION)" }, "$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
{ 0, 0, 0 } { 0, 0, 0 }
}; };

30
job.c
View File

@@ -1241,9 +1241,18 @@ construct_command_argv_internal (line, restp, shell, ifs)
if (instring) if (instring)
{ {
/* Inside a string, just copy any char except a closing quote. */ /* Inside a string, just copy any char except a closing quote
or a backslash-newline combination. */
if (*p == '\'') if (*p == '\'')
instring = 0; instring = 0;
else if (*p == '\\' && p[1] == '\n')
goto swallow_escaped_newline;
else if (*p == '\n' && restp != NULL)
{
/* End of the command line. */
*restp = p;
goto end_of_line;
}
else else
*ap++ = *p; *ap++ = *p;
} }
@@ -1269,6 +1278,8 @@ construct_command_argv_internal (line, restp, shell, ifs)
/* Backslash-newline combinations are eaten. */ /* Backslash-newline combinations are eaten. */
if (p[1] == '\n') if (p[1] == '\n')
{ {
swallow_escaped_newline:
/* Eat the backslash, the newline, and following whitespace, /* Eat the backslash, the newline, and following whitespace,
replacing it all with a single space. */ replacing it all with a single space. */
p += 2; p += 2;
@@ -1280,13 +1291,18 @@ construct_command_argv_internal (line, restp, shell, ifs)
if (*p == '\t') if (*p == '\t')
strcpy (p, p + 1); strcpy (p, p + 1);
if (ap != new_argv[i]) if (instring)
/* Treat this as a space, ending the arg. *ap++ = *p;
But if it's at the beginning of the arg, it should
just get eaten, rather than becoming an empty arg. */
goto end_of_arg;
else else
p = next_token (p) - 1; {
if (ap != new_argv[i])
/* Treat this as a space, ending the arg.
But if it's at the beginning of the arg, it should
just get eaten, rather than becoming an empty arg. */
goto end_of_arg;
else
p = next_token (p) - 1;
}
} }
else if (p[1] != '\0') else if (p[1] != '\0')
/* Copy and skip the following char. */ /* Copy and skip the following char. */

4
make.h
View File

@@ -59,7 +59,9 @@ extern int errno;
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#ifdef _POSIX_VERSION /* 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)
#define POSIX #define POSIX
#endif #endif
#endif #endif

View File

@@ -10,8 +10,8 @@
@set RCSID $Id$ @set RCSID $Id$
@set EDITION 0.45 @set EDITION 0.45
@set VERSION 3.71 Beta @set VERSION 3.71 Beta
@set UPDATED 20 April 1994 @set UPDATED 11 May 1994
@set UPDATE-MONTH April 1994 @set UPDATE-MONTH May 1994
@c finalout @c finalout
@@ -1247,13 +1247,12 @@ include one in the other, and add more targets or variable definitions.
However, if the two makefiles give different commands for the same However, if the two makefiles give different commands for the same
target, @code{make} will not let you just do this. But there is another way. target, @code{make} will not let you just do this. But there is another way.
@cindex @code{.DEFAULT}, used to override @cindex match-anything rule, used to override
In the containing makefile (the one that wants to include the other), In the containing makefile (the one that wants to include the other),
you can use the @code{.DEFAULT} special target to say that to remake you can use a match-anything pattern rule to say that to remake any
any target that cannot be made from the information in the containing target that cannot be made from the information in the containing
makefile, @code{make} should look in another makefile. makefile, @code{make} should look in another makefile.
@xref{Last Resort, , Defining Last-Resort Default Rules}, @xref{Pattern Rules}, for more information on pattern rules.
for more information on @code{.DEFAULT}.
For example, if you have a makefile called @file{Makefile} that says how For example, if you have a makefile called @file{Makefile} that says how
to make the target @samp{foo} (and other targets), you can write a to make the target @samp{foo} (and other targets), you can write a
@@ -1263,18 +1262,27 @@ makefile called @file{GNUmakefile} that contains:
foo: foo:
frobnicate > foo frobnicate > foo
.DEFAULT: %: force
@@$(MAKE) -f Makefile $@@ @@$(MAKE) -f Makefile $@@
force: ;
@end example @end example
If you say @samp{make foo}, @code{make} will find @file{GNUmakefile}, If you say @samp{make foo}, @code{make} will find @file{GNUmakefile},
read it, and see that to make @file{foo}, it needs to run the command read it, and see that to make @file{foo}, it needs to run the command
@samp{frobnicate > foo}. If you say @samp{make bar}, @code{make} will @samp{frobnicate > foo}. If you say @samp{make bar}, @code{make} will
find no way to make @file{bar} in @file{GNUmakefile}, so it will use the find no way to make @file{bar} in @file{GNUmakefile}, so it will use the
commands from @code{.DEFAULT}: @samp{make -f Makefile bar}. If commands from the pattern rule: @samp{make -f Makefile bar}. If
@file{Makefile} provides a rule for updating @file{bar}, @code{make} @file{Makefile} provides a rule for updating @file{bar}, @code{make}
will apply the rule. And likewise for any other target that will apply the rule. And likewise for any other target that
@file{GNUmakefile} does not say how to make.@refill @file{GNUmakefile} does not say how to make.
The way this works is that the pattern rule has a pattern of just
@samp{%}, so it matches any target whatever. The rule specifies a
dependency @file{force}, to guarantee that the commands will be run even
if the target file already exists. We give @file{force} target empty
commands to prevent @code{make} from searching for an implicit rule to
build it---otherwise it would apply the same match-anything rule to
@file{force} itself and create a dependency loop!
@node Rules, Commands, Makefiles, Top @node Rules, Commands, Makefiles, Top
@chapter Writing Rules @chapter Writing Rules
@@ -1666,9 +1674,9 @@ names of source files in the dependencies as if they all existed in the
current directory. @xref{Commands/Search, ,Writing Shell Commands with current directory. @xref{Commands/Search, ,Writing Shell Commands with
Directory Search}. Directory Search}.
In the @code{VPATH} variable, directory names are separated by colons. In the @code{VPATH} variable, directory names are separated by colons or
The order in which directories are listed is the order followed by blanks. The order in which directories are listed is the order followed
@code{make} in its search. by @code{make} in its search.
For example, For example,
@@ -1714,9 +1722,9 @@ There are three forms of the @code{vpath} directive:
Specify the search path @var{directories} for file names that match Specify the search path @var{directories} for file names that match
@var{pattern}. @var{pattern}.
The search path, @var{directories}, is a colon-separated list of The search path, @var{directories}, is a list of directories to be
directories to be searched, just like the search path used in the searched, separated by colons or blanks, just like the search path used
@code{VPATH} variable. in the @code{VPATH} variable.
@item vpath @var{pattern} @item vpath @var{pattern}
Clear out the search path associated with @var{pattern}. Clear out the search path associated with @var{pattern}.

18
misc.c
View File

@@ -454,19 +454,31 @@ dep_name (dep)
#ifdef GETLOADAVG_PRIVILEGED #ifdef GETLOADAVG_PRIVILEGED
#ifdef POSIX #ifdef POSIX
/* Hopefully if a system says it's POSIX.1 and has the setuid and setgid /* Hopefully if a system says it's POSIX.1 and has the setuid and setgid
functions, they work as POSIX.1 says. Some systems (Alpha OSF/1 1.2, functions, they work as POSIX.1 says. Some systems (Alpha OSF/1 1.2,
for example) which claim to be POSIX.1 also have the BSD setreuid and for example) which claim to be POSIX.1 also have the BSD setreuid and
setregid functions, but they don't work as in BSD and only the POSIX.1 setregid functions, but they don't work as in BSD and only the POSIX.1
way works. */ way works. */
#if defined (HAVE_SETREUID) && defined (HAVE_SETUID) #ifndef HAVE_SETREUID
#undef HAVE_SETREUID #undef HAVE_SETREUID
#endif #endif
#if defined (HAVE_SETREGID) && defined (HAVE_SETGID) #ifndef HAVE_SETREGID
#undef HAVE_SETREGID #undef HAVE_SETREGID
#endif #endif
#endif
#else /* Not POSIX. */
/* Some POSIX.1 systems have the seteuid and setegid functions. In a
POSIX-like system, they are the best thing to use. However, some
non-POSIX systems have them too but they do not work in the POSIX style
and we must use setreuid and setregid instead. */
#undef HAVE_SETEUID
#undef HAVE_SETEGID
#endif /* POSIX. */
#ifndef HAVE_UNISTD_H #ifndef HAVE_UNISTD_H
extern int getuid (), getgid (), geteuid (), getegid (); extern int getuid (), getgid (), geteuid (), getegid ();

11
read.c
View File

@@ -434,7 +434,7 @@ read_makefile (filename, flags)
in_ignored_define = 1; in_ignored_define = 1;
else else
{ {
p2 = end_of_token (p2); p2 = next_token (p2 + 6);
/* Let the variable name be the whole rest of the line, /* Let the variable name be the whole rest of the line,
with trailing blanks stripped (comments have already been with trailing blanks stripped (comments have already been
removed), so it could be a complex variable/function removed), so it could be a complex variable/function
@@ -811,12 +811,13 @@ do_define (name, namelen, origin, lineno, infile, filename)
{ {
lineno += nlines; lineno += nlines;
nlines = readline (&lb, infile, filename, lineno); nlines = readline (&lb, infile, filename, lineno);
p = next_token (lb.buffer);
collapse_continuations (lb.buffer);
p = next_token (lb.buffer);
if ((p[5] == '\0' || isblank (p[5])) && !strncmp (p, "endef", 5)) if ((p[5] == '\0' || isblank (p[5])) && !strncmp (p, "endef", 5))
{ {
p += 5; p += 5;
collapse_continuations (p);
remove_comments (p); remove_comments (p);
if (*next_token (p) != '\0') if (*next_token (p) != '\0')
makefile_error (filename, lineno, makefile_error (filename, lineno,
@@ -833,7 +834,7 @@ do_define (name, namelen, origin, lineno, infile, filename)
} }
else else
{ {
unsigned int len = strlen (p); unsigned int len = strlen (lb.buffer);
/* Increase the buffer size if necessary. */ /* Increase the buffer size if necessary. */
if (idx + len + 1 > length) if (idx + len + 1 > length)
@@ -842,7 +843,7 @@ do_define (name, namelen, origin, lineno, infile, filename)
definition = (char *) xrealloc (definition, length + 1); definition = (char *) xrealloc (definition, length + 1);
} }
bcopy (p, &definition[idx], len); bcopy (lb.buffer, &definition[idx], len);
idx += len; idx += len;
/* Separate lines with a newline. */ /* Separate lines with a newline. */
definition[idx++] = '\n'; definition[idx++] = '\n';

View File

@@ -179,6 +179,9 @@ update_goal_chain (goals, makefiles)
break; break;
} }
/* Reset FILE since it is null at the end of the loop. */
file = g->file;
if (stop || !any_not_updated) if (stop || !any_not_updated)
{ {
/* If we have found nothing whatever to do for the goal, /* If we have found nothing whatever to do for the goal,