Compare commits

..

10 Commits

Author SHA1 Message Date
Tim Magill
646aeb50a1 * remake.c:
(update_file_1):
	(check_dep): fixed problem with double colon rules and circular
	precursor detection.

	* remake.c (update_file_1): simplified handling of files with no
	command into a single block.

	* remake.c (notice_finished_file): fixed obsolete comment.
2000-03-14 04:30:07 +00:00
Tim Magill
fed90f1fa8 * remake.c (update_goal_chain): re-arranged logic so that it makes
more sense.  After update_file(), the target status is used to
	handle the goal and possibly remove it from the goal chain.

	* remake.c (update_file): If -q we can bail as soon as we detect
	that something needs to be remade.
2000-03-12 19:50:20 +00:00
Tim Magill
6a1a4343f3 more cleanup 2000-03-11 23:27:28 +00:00
Tim Magill
e27c3fc91b more cleanup 2000-03-11 23:19:51 +00:00
Tim Magill
9f3539c4ae removed excess loop in update_goal_chain() 2000-03-01 04:46:33 +00:00
Tim Magill
1b40ffb900 changed return type of recursive update functions 2000-02-21 04:17:36 +00:00
Tim Magill
0d621b0627 removed essentially unused variable from update_goal_chain 2000-02-21 02:02:58 +00:00
Tim Magill
5ed230d3f8 cleaned up usage of filedef->update_status 2000-02-13 04:24:24 +00:00
Tim Magill
b0e3148933 minor cleanup 2000-02-12 22:32:30 +00:00
Tim Magill
3b4369f170 removed updated member from struct filedef 2000-02-09 05:49:41 +00:00
59 changed files with 3994 additions and 8968 deletions

497
ChangeLog
View File

@@ -1,426 +1,128 @@
2000-06-23 Paul D. Smith <psmith@gnu.org>
2000-03-13 Tim Magill <magill@gate.net>
* Version 3.79.1 released.
* remake.c:
(update_file_1):
(check_dep): fixed problem with double colon rules and circular
precursor detection.
* configure.in: Add a new option, --disable-nsec-timestamps, to
avoid using sub-second timestamps on systems that support it. It
can lead to problems, e.g. if your makefile relies on "cp -p".
* README.template: Document the issue with "cp -p".
2000-03-12 Tim Magill <magill@gate.net>
* config.guess, config.sub: Updated.
* remake.c (update_goal_chain): re-arranged logic so that it makes
more sense. After update_file(), the target status is used to
handle the goal and possibly remove it from the goal chain.
* remake.c (update_file_1): simplified handling of files with no
command into a single block.
2000-06-22 Paul D. Smith <psmith@gnu.org>
* remake.c (notice_finished_file): fixed obsolete comment.
* job.c (start_job_command): Increment commands_started before the
special check for ":" (empty command) to avoid spurious "is up to
date" messages. Also move the test for question_flag after we
expand arguments, and only stop if the expansion provided an
actual command to run, not just whitespace. This fixes PR/1780.
* remake.c (update_file): If -q we can bail as soon as we detect
that something needs to be remade.
2000-06-21 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): If we find a semicolon in the target
definition, remember where it was. If the line turns out to be a
target-specific variable, add back the semicolon and everything
after it. Fixes PR/1709.
2000-03-11 Tim Magill <magill@gate.net>
2000-06-19 Paul D. Smith <psmith@gnu.org>
* remake.c
(update_file): If not -k, we can bail when a failure is detected.
If we don't, its possible that dependecies of double_colon rules
will get built after a failure has been detected.
(update_goal_chain): removed unused updating_makefiles
(update_file_1): cleaned up post remake_file() handling
* config.h-vms.template: #define uintmax_t for this system.
* config.ami.template: Ditto.
* config.h.W32.template: Ditto.
2000-02-29 Tim Magill <magill@gate.net>
* configure.in: We don't use select(2) anymore, so don't bother
checking for it.
* acconfig.h: Ditto.
* acinclude.m4: Ditto.
* remake.c (update_goal_chain): eliminated double colon loop.
update_file() handles the double colon logic, so
update_goal_chain() doesn't have to.
* file.c (all_secondary): New static global; if 1 it means
.SECONDARY with no prerequisites was seen in the makefile.
(snap_deps): Set it appropriately.
(remove_intermediates): Check it.
(num_intermediates): Remove this global, it's not used anywhere.
(considered): Move this to remake.c and make it static.
* remake.c (update_file):
(update_file_1): Moved consedered test to update_file_1() so
update_file() can more easily return a target_state_t which
represents the state of the entire double colon rule.
* NEWS: Document the change to .SECONDARY.
* make.texinfo (Special Targets): Document the change to .SECONDARY.
* implicit.c (pattern_search): Remove the increment of
num_intermediates; it's not used.
* filedef.h: Remove num_intermediates and considered.
2000-02-20 Tim Magill <magill@gate.net>
* function.c (handle_function): If the last argument was empty, we
were pretending it didn't exist rather than providing an empty
value. Keep looking until we're past the end, not just at the end.
* remake.c (check_dep):
(update_file_1):
(update_goal_chain):
(check_dep): Changed return value of target updating functions to
be enum target_state_t. This allows each caller to know the state
of the target being processed after each call. Thus,
update_goal_chain() can know from the return value of
update_file() whether or not a target has completed and can be
removed from the goal chain.
* implicit.c (pattern_search): Multi-target implicit rules weren't
expanding the "also made" targets correctly if the pattern didn't
contain a slash but the target did; in that case the directory
part wasn't being added back to the stem on the "also made"
targets. Reported by Seth M LaForge <sethml@newtonlabs.com>, with
a patch.
* remake.c (update_goal_chain): removed variable
ocommands_started, it was essentially unused.
2000-02-12 Tim Magill <magill@gate.net>
2000-06-17 Eli Zaretskii <eliz@is.elta.co.il>
* remake.c (update_file_1):
(notice_finished_file):
(remake_file):
* Makefile.DOS.template (DESTDIR, bindir, datadir, libdir)
(infodir, mandir, includedir): Support installation under a
non-default DESTDIR.
* main.c (main):
* remake.c (f_mtime): Fix the spelling of __MSDOS__.
* job.c (reap_children):
(start_job_command):
* configh.DOS.template (HAVE_FDOPEN, HAVE_MKSTEMP): Define.
* file.c (enter_file)
(remove_intermediates):
(print_file):
2000-06-14 Paul D. Smith <psmith@gnu.org>
* filedef.h: converted update_status field from a short int, to an
unsigned int :1. previously, update status indicated whether the
file had actually executed any commands, won, lost, or lost under
-q conditions. command_state indicates more clearly whether or
not any commands have been executed for this file. lost or lost
under -q conditions can be determined by a combination of
question_flag and lost. Thus, update_status needs only indicate
won or lost.
* acinclude.m4 (pds_WITH_GETTEXT): rewrite fp_WITH_GETTEXT and
rename it to avoid confusion. This version is very specific: it
won't accept any gettext that isn't GNU. If the user doesn't
explicitly ask for the included gettext, we look to see if the
system gettext is GNU (testing both the actual libintl library,
and the libintl.h header file). Only if the system gettext is
really GNU gettext will we allow it to be used.
(pds_CHECK_SYSTEM_GETTEXT): A helper function.
2000-06-13 Paul D. Smith <psmith@gnu.org>
* implicit.c (try_implicit_rule):
* remake.c (check_dep):
* remake.c (update_file_1):
move setting of tried_implicit into try_implicit_rule(). It is
only called in two places and the flag is set immediately after.
* gettext.h: If we have libintl.h, use that instead of any of the
contents of gettext.h. We won't check for libintl.h unless we're
using the system gettext.
* function.c (func_word): Clarify error message.
* remake.c (update_file_1): collapsed if statement based on
file->command_state into switch statment which immediately
follows. Removed code that could not be reached.
2000-06-10 Paul Eggert <eggert@twinsun.com>
* remake.c (update_file): advance f pointer so as not to consider
same file twice after breaking loop.
Support nanosecond resolution on hosts with 64-bit time_t and
uintmax_t (e.g. 64-bit Sparc Solaris), by splitting
FILE_TIMESTAMP into a 30-bit part for nanoseconds, with the
rest for seconds, if FILE_TIMESTAMP is at least 64 bits wide.
* file.c (rehash_file): replaced hard coded check_renamed loop
with standard macro. seemed like the right thing to do.
* make.h: Always define FILE_TIMESTAMP to be uintmax_t, for
simplicity.
2000-02-09 Tim Magill <magill@gate.net>
Started branch for cleaning up internal make structure regarding
recursion paths. Branch name is filedef-cleanup and was started
from a point on the mainline at filedef-cleanup-base. either tags
are suitable for cvs commands.
* filedef.h (FILE_TIMESTAMP_HI_RES, FILE_TIMESTAMP_LO_BITS)
(UNKNOWN_MTIME, NONEXISTENT_MTIME, OLD_MTIME)
(ORDINARY_MTIME_MIN, ORDINARY_MTIME_MAX): New macros.
(FILE_TIMESTAMP_STAT_MODTIME): Now takes fname arg. All uses changed.
(FILE_TIMESTAMP_DIV, FILE_TIMESTAMP_MOD)
(FILE_TIMESTAMP_FROM_S_AND_NS): Remove.
(FILE_TIMESTAMP_S, FILE_TIMESTAMP_NS): Use shifts instead of
multiplication and division. Offset the timestamps by
ORDINARY_MTIME_MIN.
(file_timestamp_cons): New decl.
(NEW_MTIME): Now just the maximal timestamp value, as we no longer use
-1 to refer to nonexistent files.
* file.c (snap_deps, print_file): Use NONEXISTENT_MTIME,
UNKNOWN_MTIME, and OLD_MTIME instead of magic constants.
* filedef.h (file_mtime_1): Likewise.
* main.c (main): Likewise.
* remake.c (update_file_1, notice_finished_file, check_dep)
(f_mtime, name_mtime, library_search): Likewise.
* vpath.c (selective_vpath_search): Likewise.
* remake.c (f_mtime): Do not assume that (time_t) -1 equals
NONEXISTENT_MTIME. When futzing with time stamps, adjust by
multiples of 2**30, not 10**9. Do not calculate timestamp
adjustments on DOS unless they are needed.
* commands.c (delete_target): Do not assume that
FILE_TIMESTAMP_S yields -1 for a nonexistent file, as that is
no longer true with the new representation.
* file.c (file_timestamp_cons): New function, replacing
FILE_TIMESTAMP_FROM_S_AND_NS. All uses changed.
(file_timestamp_now): Use FILE_TIMESTAMP_HI_RES instead of 1 <
FILE_TIMESTAMPS_PER_S to determine whether we're using hi-res
timestamps.
(print_file): Print OLD_MTIME values as "very old" instead of
as a timestamp.
2000-05-31 Paul Eggert <eggert@twinsun.com>
* remake.c (name_mtime): Check for stat failures. Retry if EINTR.
2000-05-24 Paul D. Smith <psmith@gnu.org>
* main.c (decode_switches): The "positive_int" switch uses atoi()
which succeeds for any input, and doesn't notice if extra,
non-digit text is after the number. This causes make to mis-parse
command lines like "make -j 5foo" as "make -j5" (ignoring "foo"
completely) instead of "make -j0 5foo" (where "5foo" is a
target). Fix this by checking the value by hand. We could use
strtol() if we were sure of having it; this is the only
questionable use of atoi() I found so we'll just stick with that.
Fixes PR/1716.
* i18n/ja.po, i18n/nl.po, i18n/pt_BR.po: New translation files.
* configure.in (ALL_LINGUAS): Added pt_BR.
2000-05-22 Paul Eggert <eggert@twinsun.com>
* remake.c (f_mtime): Fix bug when handling future odd
timestamps in the WINDOWS32 case. Do not bother initializing
static var to zero. Simplify code that works around WINDOWS32
and __MSDOS__ time skew brain damage.
2000-05-22 Paul Eggert <eggert@twinsun.com>
* job.c: Don't include time.h, as make.h already does this.
2000-05-22 Paul Eggert <eggert@twinsun.com>
* configure.in (AC_CHECK_HEADERS): Add sys/time.h.
(AC_HEADER_TIME): Add.
(clock_gettime): Prefer -lrt to -lposix4, for Solaris 7.
(gettimeofday): Add check for standard version of gettimeofday.
This merges changes written by Paul D. Smith.
* file.c (file_timestamp_now): Use gettimeofday if available
and if clock_gettime does not work. Don't bother with
high-resolution clocks if file timestamps have only one-second
resolution.
* make.h <sys/time.h>: Include, conditionally on the usual
TIME_WITH_SYS_TIME and HAVE_SYS_TIME_H macros. This is needed
for gettimeofday.
2000-05-20 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): We weren't keeping makefile names around
unless there was a rule defined in them; but now we need to keep
them for variables as well. Forget trying to be fancy: just keep
every makefile name we successfully open.
* remote-cstms.c (start_remote_job_p): Change DB_EXTRA (?) to DB_JOBS.
2000-05-17 Paul Eggert <eggert@twinsun.com>
* commands.c (chop_commands): Ensure ctype macro args are nonnegative.
* expand.c (variable_expand_string): Likewise.
* function.c (subst_expand, lookup_function, msdos_openpipe):
Likewise.
* job.c (vms_redirect, start_job_command, new_job, child_execute_job,
construct_command_argv_internal, construct_command_argv): Likewise.
* main.c (decode_env_switches, quote_for_env): Likewise.
* misc.c (collapse_continuations, end_of_token, end_of_token_w32,
next_token): Likewise.
* read.c (read_makefile, do_define, conditional_line,
find_char_unquote,get_next_mword): Likewise.
* variable.c (try_variable_definition): Likewise.
* vpath.c (construct_vpath_list): Likewise.
* w32/pathstuff.c (convert_vpath_to_windows32): Likewise.
2000-05-10 Eli Zaretskii <eliz@is.elta.co.il>
* main.c (main) [__MSDOS__]: Add SIGFPE to signals we block when
running child programs, to prevent Make from dying on Windows 9X
when the child triggers an FP exception.
2000-05-08 Paul D. Smith <psmith@gnu.org>
* dir.c (find_directory) [WINDOWS32]: If we strip a trailing "\"
from the directory name, remember to add it back. The argument
might really be inside a longer string (e.g. %Path%) and if you
don't restore the "\" it'll be truncated permanently. Fixes PR/1722.
Reported by <steven@surfcast.com>
2000-05-02 Paul D. Smith <psmith@gnu.org>
* job.c (construct_command_argv_internal) [WINDOWS32]: Added "rd"
and "rmdir" to the list of command.com commands.
Reported by Elod Horvath <Elod_Horvath@lnotes5.bankofny.com>
2000-04-24 Paul D. Smith <psmith@gnu.org>
* i18n/ja.po: New translation file from the Japanese language team.
2000-04-18 Paul D. Smith <psmith@gnu.org>
* remake.c (f_mtime): If ar_member_date() returns -1 (the member
doesn't exist), then return (FILE_TIMESTAMP)-1 rather than
returning the timestamp calculated from the value -1. Fixes PR/1696.
Reported by Gilles Bourhis <Gilles.Bourhis@univ-rennes1.fr>.
2000-04-17 Paul D. Smith <psmith@gnu.org>
* config.h.W32.template: Add LOCALEDIR macro resolving to "".
* w32/subproc/sub_proc.c (process_begin): Remove reference to
debug_flag; change it to a DB() call. Fixes PR/1700.
Reported by Jim Smith <jwksmith@attglobal.net>
2000-04-17 Bruno Haible <haible@clisp.cons.org>
* arscan.c [BeOS]: Add replacement for nonexistent <ar.h> from GNU
binutils.
2000-04-11 Paul D. Smith <psmith@gnu.org>
* function.c (expand_builtin_function): If no arguments were
provided, just quit early rather than changing each function to
test for this.
(function_table[]): Change the min # of arguments to 0 for all
those functions for which it makes sense (currently everything
that used to take a minimum of 1 argument, except $(call ...)).
Fixes PR/1689.
2000-04-09 Eli Zaretskii <eliz@is.elta.co.il>
* README.DOS: Add instructions to install a binary distro.
Mention latest versions of Windows.
2000-04-07 Eli Zaretskii <eliz@is.elta.co.il>
* main.c (main): Rename TMP_TEMPLATE into DEFAULT_TMPDIR, and use
it for the directory of the temporary file. If P_tmpdir is
defined, use it in preference to "/tmp/". Try $TMPDIR, $TEMP, and
$TMP in the environment before defaulting to DEFAULT_TMPDIR.
(print_version): Add year 2000 to the Copyright line.
2000-04-04 Paul D. Smith <psmith@gnu.org>
* Version 3.79 released.
* make.texinfo: Update documentation with new features for 3.79.
* function.c (func_wordlist): Don't re-order arguments to
wordlist.
2000-04-03 Paul D. Smith <psmith@gnu.org>
* remake.c (f_mtime): Archive member timestamps are stored as
time_t, without nanoseconds. But, f_mtime() wants to return
nanosecond info on those systems that support it. So, convert the
return value of ar_member_date() into a FILE_TIMESTAMP, using 0 as
the nanoseconds.
2000-03-28 Paul D. Smith <psmith@gnu.org>
* Version 3.78.92 released.
* build.template: Updates for gettext support; some bugs fixed.
2000-03-27 Paul D. Smith <psmith@gnu.org>
* config.guess, config.sub: Updated from config CVS archive at
:pserver:anoncvs@subversions.gnu.org:/home/cvs as of today.
* read.c (record_files): Check if expanding a static pattern
rule's prerequisite pattern leaves an empty string as the
prerequisite, and issue an error if so. Fixes PR/1670.
(read_makefile): Store the starting linenumber for a rule in
TGTS_STARTED.
(record_waiting_files): Use the TGTS_STARTED value for the file
location passed to record_file() instead of the current
linenumber, so error messages list the line where the target was
defined instead of the line after the end of the rule definition.
* remake.c (start_updating, finish_updating, is_updating): Fix
PR/1671; circular dependencies in double-colon rules are not
diagnosed. These macros set the updating flag in the root
double-colon file instead of the current one, if it's part of a
double-colon list. This solution provided by Tim Magill
<magill@gate.net>; I just changed the macro names :).
(update_file_1): Call them.
(check_dep): Call them.
The change to not automatically evaluate the $(call ...)
function's arguments breaks recursive use of call. Although using
$(if ...) and $(foreach ...) in $(call ...) macros is important,
the error conditions generated are simply to obscure for me to
feel comfortable with. If a method is devised to get both
working, we'll revisit. For now, remove this change.
* function.c (function_table): Turn on the expand bit for func_call.
(func_call): Don't expand arguments for builtin functions; that
will have already been done.
2000-03-26 Paul D. Smith <psmith@gnu.org>
* file.c (remove_intermediates): Never remove targets explicitly
requested on the command-line by checking the cmd_target flag.
Fixed PR/1669.
2000-03-23 Paul Eggert <eggert@twinsun.com>
* filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Use st_mtime instead of
st_mtim.tv_sec; the latter doesn't work on Unixware.
2000-03-18 Paul D. Smith <psmith@gnu.org>
* file.c (file_hash_enter): If we're trying to change a file into
itself, just return. We used to assert this wasn't true, but
someone came up with a weird case involving archives. After
playing with it for a while I decided it was OK to ignore it.
* default.c: Define COFLAGS to empty to avoid spurious warnings.
* filedef.h: Change #if ST_MTIM_NSEC to #ifdef; this is a macro
containing the name of the nsec field, not true/false.
* make.h: Ditto.
Reported by Marco Franzen <Marco.Franzen@Thyron.com>.
2000-03-08 Tim Magill <magill@gate.net>
* remake.c (update_file): Return the exit status of the pruned
file when pruning, not just 0. Fixes PR/1634.
2000-02-24 Paul D. Smith <psmith@gnu.org>
* configure.in: Close a minor potential security hole; if you're
reading makefiles from stdin (who does that?) you could run into a
race condition with the temp file using mktemp() or tmpnam(). Add
a check for mkstemp() and fdopen().
* main.c (open_tmpfile): New function to open a temporary file.
If we have mkstemp() (and fdopen()), use that. If not use
mktemp() or tmpnam(). If we have fdopen(), use open() to open the
file O_CREAT|O_EXCL. If not, fall back to normal fopen() (insecure).
(main): Call it.
* job.c (child_execute_job) [VMS]: Call it.
* variable.c (lookup_variable): If we find a variable which is
being expanded, then note it but keep looking through the rest of
the set list to see if we can find one that isn't. If we do,
return that. If we don't, return the original. Fix for PR/1610.
While implementing this I realized that it also solves PR/1380 in
a much more elegant way. I don't know what I was smoking before.
So, remove the hackage surrounding the original fix for that (see
below). Change this function back to lookup_variable and remove
the extra setlist argument.
* variable.h (recursively_expand_setlist): Remove the macro,
rename the prototype, and remove the extra setlist argument.
(lookup_variable): Ditto.
* expand.c (recursively_expand): Rename and remove the extra
setlist argument.
(reference_variable): Use lookup_variable() again.
(allocated_variable_append): Remove the extra setlist argument.
2000-02-21 Paul D. Smith <psmith@gnu.org>
* README.template: A few updates.
* i18n/de.po: New version from the German translation team.
2000-02-09 Paul D. Smith <psmith@gnu.org>
* Version 3.78.91 released.
* file.c, filedef.h, main.c, remake.c (updated): Removed updated
member from 'struct filedef'. filedef->command_state fully
contains the same information and more.
2000-02-07 Paul D. Smith <psmith@gnu.org>
* read.c (read_makefile): Reset *p2 to ':', not *colonp. If any
filenames contained backslashes the resulting output (without
backslashes) will be shorter, so setting *colonp doesn't change
the right character. Fix for PR/1586.
For += target-specific variables we need to remember which
variable set we found the variable in, so we can start looking
from there in the next iteration (otherwise we might see it again
in recursively_expand and fail!). This is turning into a hack; if
it gets any worse we'll have to rethink this entire algorithm...
implementing expansion of these references separately from the
"normal" expansion, say, instead of using the same codepath.
Actually, it's already "worse enough" :-/.
Fix for PR/1380.
there in the next iteration (otherwise we'll see it again in
recursively_expand and fail!). This is getting to be a hack; if
it gets any worse we'll have to rethink this entire algorithm;
probably implementing expansion of these separately from the
"normal" expansion, instead of alongside.
* variable.h (recursively_expand_setlist): Rename
recursively_expand to add a struct variable_set_list argument, and
@@ -429,7 +131,8 @@
variable_set_list argument, and make a macro for lookup_variable.
* expand.c (recursively_expand_setlist): Take an extra struct
variable_set_list argument and pass it to allocated_variable_append().
variable_set_list argument and pass it to
allocated_variable_append().
(reference_variable): Use lookup_variable_setlist() and pass the
returned variable_set_list to recursively_expand_setlist.
(allocated_variable_append): Take an extra setlist argument and
@@ -437,7 +140,7 @@
expansion. If it's null, use current_variable_set_list as before.
* variable.c (lookup_variable_setlist): If the LISTP argument is
not nil, set it to the list containing the variable we found.
not nil, return the list where we found the variable in it.
2000-02-04 Paul D. Smith <psmith@gnu.org>
@@ -500,16 +203,6 @@
* default.c (default_variables) [__MSDOS__]: Define CXX to gpp.
2000-01-27 Paul D. Smith <psmith@gnu.org>
* gettext.c: Some warning cleanups, and a fix for systems which
don't define HAVE_ALLOCA (the workaround code was included
twice).
2000-01-26 Paul D. Smith <psmith@gnu.org>
* Version 3.78.90 released.
2000-01-25 Paul D. Smith <psmith@gnu.org>
Change gettext support to use the simplified version in libit 0.7.

View File

@@ -15,25 +15,26 @@ VPATH = $(srcdir)
prefix = /dev/env/DJDIR
exec_prefix = ${prefix}
bindir = /bin
datadir = /share
libdir = /lib
infodir = /info
mandir = /man
includedir = /include
bindir = ${exec_prefix}/bin
datadir = ${prefix}/share
libdir = ${prefix}/lib
infodir = ${prefix}/info
# DJGPP doesn't have separate man tree, use info instead.
mandir = ${prefix}/info
includedir = ${prefix}/include
oldincludedir = c:/djgpp/include
DESTDIR = /dev/env/DJDIR
DESTDIR =
pkgdatadir = $(datadir)/make
pkglibdir = $(libdir)/make
pkgincludedir = $(includedir)/make
localedir = $(datadir)/locale
localedir = $(prefix)/share/locale
INSTALL = ${exec_prefix}/bin/ginstall -c
INSTALL_PROGRAM = ${exec_prefix}/bin/ginstall -c
INSTALL_DATA = ${exec_prefix}/bin/ginstall -c -m 644
INSTALL_SCRIPT = ${exec_prefix}/bin/ginstall -c
INSTALL = ${bindir}/ginstall -c
INSTALL_PROGRAM = ${bindir}/ginstall -c
INSTALL_DATA = ${bindir}/ginstall -c -m 644
INSTALL_SCRIPT = ${bindir}/ginstall -c
transform = s,x,x,
# This will fail even if they don't have a Unix-like shell (stock DOS
@@ -51,7 +52,7 @@ AR = ar
CC = gcc
CPP = gcc -E
LIBOBJS =
MAKEINFO = ${exec_prefix}/bin/makeinfo
MAKEINFO = ${bindir}/makeinfo
PACKAGE = make
PERL = perl
RANLIB = ranlib
@@ -77,7 +78,7 @@ BUILT_SOURCES = README build.sh-in
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
SUBDIRS = glob
mkinstalldirs = ${exec_prefix}/bin/gmkdir -p
mkinstalldirs = ${bindir}/gmkdir -p
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = build.sh
PROGRAMS = $(bin_PROGRAMS)

30
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
23 Jun 2000
25 Jan 2000
Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -12,18 +12,6 @@ Please send GNU make bug reports to <bug-make@gnu.org>.
See the README file and the GNU make manual for details on sending bug
reports.
Version 3.79.1
* .SECONDARY with no prerequisites now prevents any target from being
removed because make thinks it's an intermediate file, not just those
listed in the makefile.
* New configure option --disable-nsec-timestamps will keep make from
using sub-second timestamps on systems which support it. If your
build process depends on proper timestamp-preserving behavior of tools
like "cp -p" you might need this option, since "cp -p" (right now)
doesn't preserve the sub-second portion of the timestamp.
Version 3.79
* GNU make optionally supports internationalization and locales via the
@@ -48,21 +36,23 @@ Version 3.79
current makefile is run serially regardless of the value of -j.
However, submakes are still eligible for parallel execution.
* The $(call ...) function doesn't expand its arguments automatically
anymore. This allows you to put builtin functions like "if" and
"foreach", which also have special expansion rules, in a $(call ...)
function and have it work properly. This was suggested by Damien
GIBOU <damien.gibou@st.com>.
* The --debug option has changed: it now allows optional flags
controlling the amount and type of debugging output. By default only
a minimal amount information is generated, displaying the names of
"normal" targets (not makefiles) that were deemed out of date and in
need of being rebuilt.
"normal" targets (not makefiles) were deemed out of date and in need
of being rebuilt.
Note that the -d option behaves as before: it takes no arguments and
all debugging information is generated.
* The `-p' (print database) output now includes filename and linenumber
information for variable definitions, to aid debugging.
* The wordlist function no longer reverses its arguments if the "start"
value is greater than the "end" value. If that's true, nothing is
returned.
information for variable definitions, to help debugging.
* Hartmut Becker provided many updates for the VMS port of GNU make.
See the readme.vms file for more details.

View File

@@ -34,22 +34,11 @@ New (since 3.74) DOS-specific features:
environment (requires Perl and auxiliary tools; see below).
To install a binary distribution:
Simply unzip the makNNNb.zip file (where NNN is the version number)
preserving the directory structure (-d switch if you use PKUNZIP).
If you are installing Make on Windows 9X or Windows 2000, use an
unzip program that supports long filenames in zip files. After
unzipping, make sure the directory with make.exe is on your PATH,
and that's all you need to use Make.
To build from sources:
To build:
1. Unzip the archive, preserving the directory structure (-d switch
if you use PKUNZIP). If you build Make on Windows 9X or Windows
2000, use an unzip program that supports long filenames in zip
files.
if you use PKUNZIP). If you build Make on Windows 95, use an
unzip program that supports long filenames in zip files.
If you are unpacking an official GNU source distribution, use
either DJTAR (which is part of the DJGPP development
@@ -95,15 +84,6 @@ To build from sources:
will also need GNU Fileutils and GNU Sed for this (they should
be available from the DJGPP sites).
By default, GNU make will install into your DJGPP installation
area. If you wish to use a different directory, override the
DESTDIR variable when invoking "make install", like this:
make install DESTDIR=c:/other/dir
This causes the make executable to be placed in c:/other/dir/bin,
the man pages in c:/other/dir/man, etc.
Without a Unix-style shell, you will have to install programs
and the docs manually. Copy make.exe to a directory on your
PATH, make.i* info files to your Info directory, and update the

View File

@@ -19,13 +19,6 @@ Some systems' Make programs are broken and cannot process the Makefile for
GNU Make. If you get errors from your system's Make when building GNU
Make, try using `build.sh' instead.
GNU Make is free software. See the file COPYING for copying conditions.
Documentation
-------------
GNU make is fully documented in the GNU Make manual, which is contained
in this distribution as the file make.texinfo. You can also find
on-line and preformatted (PostScript and DVI) versions at the FSF's web
@@ -37,22 +30,10 @@ site. There is information there about ordering hardcopy documentation.
You can also find the latest versions of GNU Make from there.
Bug Reporting
-------------
You can send GNU make bug reports to <bug-make@gnu.org>. Please see the
You can send GNU make bug reports to bug-make@gnu.org. Please see the
section of the GNU make manual entitled `Problems and Bugs' for
information on submitting useful and complete bug reports.
You can also use the FSF's online bug tracking system to submit new
problem reports or search for existing ones. A web interface is
available here:
http://www-gnats.gnu.org:8080/cgi-bin/wwwgnats.pl
Use the Category "make".
If you need help using GNU make, try these forums:
help-make@gnu.org
@@ -60,36 +41,15 @@ If you need help using GNU make, try these forums:
news:gnu.utils.help
news:gnu.utils.bug
CVS Access
----------
The GNU make source repository is available via anonymous CVS from the
GNU Subversions CVS server; look here for details:
http://www.gnu.org/software/devel.html
Please note: you won't be able to build GNU make from CVS without
installing appropriate maintainer's tools, such as automake, autoconf,
GNU make, and GCC. There are no instructions on this included with the
tree, so you must be familiar with the installation and use of these
tools. We make no guarantees about the contents or quality of the
latest code in the CVS repository: it is not unheard of for code that is
known to be broken to be checked in. Use at your own risk.
Ports
-----
Also:
- See README.customs for details on integrating GNU make with the
Customs distributed build environment from the Pmake distribution.
- See readme.vms for details about GNU Make on OpenVMS.
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
- See README.Amiga for details about GNU Make on AmigaDOS.
- See README.W32 for details about GNU Make on Windows NT, 95, or 98.
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
using DJGPP tools.
@@ -97,10 +57,8 @@ Ports
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
information.
Please note there are two _separate_ ports of GNU make for Microsoft
systems: a native Windows tool built with (for example) MSVC or Cygwin,
and a DOS-based tool built with DJGPP. Please be sure you are looking
at the right README!
GNU Make is free software. See the file COPYING for copying conditions.
System-specific Notes
@@ -121,14 +79,3 @@ files (LFS) in configure for those operating systems that provide it.
Please report any bugs that you find in this area. If you run into
difficulties, then as a workaround you should be able to disable LFS by
adding the `--disable-largefile' option to the `configure' script.
On systems that support micro- and nano-second timestamp values and
where stat(2) provides this information, GNU make will use it when
comparing timestamps to get the most accurate possible result. However,
at the moment there is no system call (that I'm aware of) that will
allow you to *set* a timestamp to a micro- or nano-second granularity.
This means that "cp -p" and other similar tools (tar, etc.) cannot
exactly duplicate timestamps with micro- and nano-second granularity.
If your build system contains rules that depend on proper behavior of
tools like "cp -p", you should configure make to not use micro- and
nano-second timestamps with the --disable-nsec-timestamps flag.

View File

@@ -4,15 +4,33 @@
/* Version of this package (needed by automake) */
#undef VERSION
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
/* Define as 1 if you have dcgettext. */
#undef HAVE_DCGETTEXT
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to the installation directory for locales. */
#undef LOCALEDIR
/* Define as 1 if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define to the name of the SCCS `get' command. */
#undef SCCS_GET
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
#undef SCCS_GET_MINUS_G
/* Define this to enable job server support in GNU make. */
#undef MAKE_JOBSERVER
/* Define to be the nanoseconds member of struct stat's st_mtim,
if it exists. */
#undef ST_MTIM_NSEC
@@ -23,6 +41,20 @@
/* Define this if the C library defines the variable `_sys_siglist'. */
#undef HAVE__SYS_SIGLIST
/* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#undef uintmax_t
/* These are for AC_FUNC_SELECT */
/* Define if the system doesn't provide fd_set. */
#undef fd_set
/* Define the type of the first arg to select(). */
#undef fd_set_size_t
/* Define this if select() args need to be cast away from fd_set (HP-UX). */
#undef SELECT_FD_SET_CAST

View File

@@ -298,6 +298,95 @@ AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
])
dnl ---------------------------------------------------------------------------
dnl From Steve Robbins <steve@nyongwa.montreal.qc.ca>
dnl From a proposed change made on the autoconf list on 2 Feb 1999
dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html
dnl Patch for AIX 3.2 by Lars Hecking <lhecking@nmrc.ucc.ie> on 17 May 1999
AC_DEFUN(AC_FUNC_SELECT,
[AC_CHECK_FUNCS(select)
if test "$ac_cv_func_select" = yes; then
AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h)
AC_MSG_CHECKING([argument types of select()])
AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl
[AC_CACHE_VAL(ac_cv_type_fd_set,dnl
[for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do
for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do
for ac_type_timeval in 'struct timeval' 'const struct timeval'; do
AC_TRY_COMPILE(dnl
[#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif],
[#ifdef __STDC__
extern select ($ac_cv_type_fd_set_size_t,
$ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *,
$ac_type_timeval *);
#else
extern select ();
$ac_cv_type_fd_set_size_t s;
$ac_cv_type_fd_set *p;
$ac_type_timeval *t;
#endif],
[ac_found=yes ; break 3],ac_found=no)
done
done
done
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
if test "$ac_found" = no; then
AC_MSG_ERROR([can't determine argument types])
fi
AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)])
AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t)
ac_cast=
if test "$ac_cv_type_fd_set" != fd_set; then
# Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for
# FD_SET macros, but insist that you cast the argument to select. I don't
# understand why that might be, but it means we cannot define fd_set.
AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl
changequote([,]),dnl
[#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif],dnl
# We found fd_set type in a header, need special cast
ac_cast="($ac_cv_type_fd_set *)",dnl
# No fd_set type; it is safe to define it
AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set))
fi
AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast)
fi
])
# The following is taken from automake 1.4,
# except that it prefers the compiler option -Ae to "-Aa -D_HPUX_SOURCE"
# because only the former supports 64-bit integral types on HP-UX 10.20.
@@ -396,62 +485,9 @@ esac
dnl ---------------------------------------------------------------------------
dnl Enable internationalization support for GNU make.
dnl Original obtained from the libit 0.7 distribution
dnl Rewritten by Paul D. Smith <psmith@gnu.org>
dnl This version is much more straightforward than the original (I think);
dnl If the user doesn't disable NLS, check whether she asked for the
dnl included gettext. If so, we use that. If not, test to see if the
dnl system gettext is GNU. If not, use the included gettext. If so,
dnl use the system gettext. We are very strict about testing for GNU
dnl gettext; not only must the library be GNU gettext, but the libintl.h
dnl file must also be GNU.
dnl Obtained from the libit 0.7 distribution
dnl
AC_DEFUN(pds_CHECK_SYSTEM_GETTEXT, [
# OK. What we're going to do is see if the system gettext is really
# GNU gettext, and we're going to make _sure_ (as we can) that if
# it's not we'll use the included gettext.
pds_keep_LIBS="$LIBS"
# Look around for gettext() and libintl.h on the system
AC_CHECK_HEADERS(locale.h)
AC_SEARCH_LIBS(gettext, intl)
if test "$ac_cv_search_gettext" = no; then
with_included_gettext=yes
else
# We only want to deal with GNU's gettext; if we don't have that
# we'll just use our own, thanks very much.
AC_CACHE_CHECK([whether the system has GNU gettext],
pds_cv_system_gnu_gettext, [
AC_TRY_LINK([
#include <libintl.h>
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
], [
#if __USE_GNU_GETTEXT
extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr;
#else
not GNU gettext
#endif
],
pds_cv_system_gnu_gettext=yes, pds_cv_system_gnu_gettext=no)])
if test "x$pds_cv_system_gnu_gettext" = xyes; then
with_included_gettext=no
AC_DEFINE(HAVE_LIBINTL_H, 1, [Define if you have <libintl.h>.])
else
with_included_gettext=yes
LIBS="$pds_keep_LIBS"
fi
fi
])
AC_DEFUN(pds_WITH_GETTEXT, [
AC_DEFUN(fp_WITH_GETTEXT, [
AC_MSG_CHECKING(whether NLS is wanted)
AC_ARG_ENABLE(nls,
@@ -462,34 +498,36 @@ AC_DEFUN(pds_WITH_GETTEXT, [
AM_CONDITIONAL(USE_NLS, test $use_nls = yes)
if test $enable_nls = yes; then
AC_DEFINE(ENABLE_NLS, 1, [Define if NLS is requested.])
AC_DEFINE(ENABLE_NLS)
# We don't support catgets at all
if test "x$with_catgets" != x; then
AC_MSG_WARN([catgets not supported; --with-catgets ignored])
AC_ARG_WITH(catgets,
[ --with-catgets say that catgets is not supported],
[AC_MSG_WARN([catgets not supported, --with-catgets ignored])])
AC_CHECK_FUNCS(gettext)
AC_CHECK_LIB(intl, gettext, :)
if test $ac_cv_lib_intl_gettext$ac_cv_func_gettext != nono; then
AC_MSG_CHECKING(whether the included gettext is preferred)
AC_ARG_WITH(included-gettext,
[ --without-included-gettext avoid our provided version of gettext],
with_included_gettext=$withval, with_included_gettext=yes)
AC_MSG_RESULT($with_included_gettext)
if test $with_included_gettext$ac_cv_func_gettext = nono; then
LIBS="$LIBS -lintl"
fi
else
with_included_gettext=yes
fi
# Find out what the user wants.
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
with_included_gettext=yes,
with_included_gettext=maybe)
if test "x$with_included_gettext" != xyes; then
pds_CHECK_SYSTEM_GETTEXT
fi
AC_MSG_CHECKING([whether to use included gettext])
AC_MSG_RESULT($with_included_gettext)
if test "$with_included_gettext" = yes; then
if test $with_included_gettext = yes; then
LIBOBJS="$LIBOBJS gettext.o"
AC_DEFINE(HAVE_GETTEXT)
AC_DEFINE(HAVE_DCGETTEXT)
else
AC_CHECK_HEADERS(libintl.h)
AC_CHECK_FUNCS(dcgettext gettext)
fi
AC_DEFINE(HAVE_GETTEXT, 1, [Define if you have the gettext function.])
AC_DEFINE(HAVE_DCGETTEXT, 1, [Define if you have the dcgettext function.])
AC_CHECK_HEADERS(locale.h)
AC_CHECK_FUNCS(getcwd setlocale stpcpy)
AM_LC_MESSAGES

View File

@@ -232,25 +232,7 @@ ar_scan (archive, function, arg)
#endif
#ifndef WINDOWS32
# ifndef __BEOS__
# include <ar.h>
# else
/* BeOS 5 doesn't have <ar.h> but has archives in the same format
* as many other Unices. This was taken from GNU binutils for BeOS.
*/
# define ARMAG "!<arch>\n" /* String that begins an archive file. */
# define SARMAG 8 /* Size of that string. */
# define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
struct ar_hdr
{
char ar_name[16]; /* Member file name, sometimes / terminated. */
char ar_date[12]; /* File date, decimal seconds since Epoch. */
char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
char ar_mode[8]; /* File mode, in ASCII octal. */
char ar_size[10]; /* File size, in ASCII decimal. */
char ar_fmag[2]; /* Always contains ARFMAG. */
};
# endif
# include <ar.h>
#else
/* These should allow us to read Windows (VC++) libraries (according to Frank
* Libbrecht <frankl@abzx.belgium.hp.com>)

View File

@@ -27,6 +27,7 @@ CC='@CC@'
CFLAGS='@CFLAGS@'
CPPFLAGS='@CPPFLAGS@'
LDFLAGS='@LDFLAGS@'
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
ALLOCA='@ALLOCA@'
LOADLIBES='@LIBS@'
extras='@LIBOBJS@'
@@ -36,17 +37,12 @@ GLOBLIB='@GLOBLIB@'
# Common prefix for machine-independent installed files.
prefix='@prefix@'
# Common prefix for machine-dependent installed files.
exec_prefix=`eval echo @exec_prefix@`
exec_prefix='@exec_prefix@'
# Directory to find libraries in for `-lXXX'.
libdir=${exec_prefix}/lib
# Directory to search by default for included makefiles.
includedir=${prefix}/include
localedir=${prefix}/share/locale
aliaspath=${localedir}:.
defines="-DALIASPATH=\"${aliaspath}\" -DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
# Exit as soon as any command fails.
set -e
@@ -55,14 +51,13 @@ objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
if [ x"$GLOBLIB" != x ]; then
objs="$objs %globobjs%"
globinc=-I${srcdir}/glob
fi
# Compile the source files into those objects.
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
echo compiling ${file}...
$CC $defines $CPPFLAGS $CFLAGS \
-c -I. -I${srcdir} ${globinc} ${srcdir}/$file
-c -I. -I${srcdir} ${srcdir}/$file
done
# The object files were actually all put in the current directory.

View File

@@ -300,7 +300,7 @@ chop_commands (cmds)
int flags = 0;
for (p = lines[idx];
isblank ((unsigned char)*p) || *p == '-' || *p == '@' || *p == '+';
isblank (*p) || *p == '-' || *p == '@' || *p == '+';
++p)
switch (*p)
{
@@ -477,10 +477,7 @@ delete_target (file, on_behalf_of)
#ifndef NO_ARCHIVES
if (ar_name (file->name))
{
time_t file_date = (file->last_mtime == NONEXISTENT_MTIME
? (time_t) -1
: (time_t) FILE_TIMESTAMP_S (file->last_mtime));
if (ar_member_date (file->name) != file_date)
if (ar_member_date (file->name) != FILE_TIMESTAMP_S (file->last_mtime))
{
if (on_behalf_of)
error (NILF, _("*** [%s] Archive member `%s' may be bogus; not deleted"),
@@ -495,7 +492,7 @@ delete_target (file, on_behalf_of)
if (stat (file->name, &st) == 0
&& S_ISREG (st.st_mode)
&& FILE_TIMESTAMP_STAT_MODTIME (file->name, st) != file->last_mtime)
&& FILE_TIMESTAMP_STAT_MODTIME (st) != file->last_mtime)
{
if (on_behalf_of)
error (NILF, _("*** [%s] Deleting file `%s'"), on_behalf_of, file->name);

View File

@@ -26,10 +26,6 @@
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long
/* Define to `int' if <sys/types.h> doesn't define. */
#define gid_t int

405
config.guess vendored
View File

@@ -1,10 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
# Free Software Foundation, Inc.
version='2000-06-13'
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -25,7 +23,8 @@ version='2000-06-13'
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
# Please send patches to <autoconf-patches@gnu.org>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -38,46 +37,6 @@ version='2000-06-13'
# (but try to keep the structure clean).
#
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of this system.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit"
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case "$1" in
--version | --vers* | -V )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
exec >&2
echo "$me: invalid option $1"
echo "$help"
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
@@ -109,43 +68,6 @@ trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# Netbsd (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
# Determine the machine/vendor (is the vendor relevant).
case "${UNAME_MACHINE}" in
amiga) machine=m68k-cbm ;;
arm32) machine=arm-unknown ;;
atari*) machine=m68k-atari ;;
sun3*) machine=m68k-sun ;;
mac68k) machine=m68k-apple ;;
macppc) machine=powerpc-apple ;;
hp3[0-9][05]) machine=m68k-hp ;;
ibmrt|romp-ibm) machine=romp-ibm ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
# The Operating System including object format.
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -155,51 +77,41 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
1-0)
15)
UNAME_MACHINE="alphaev5"
;;
1-1)
14)
UNAME_MACHINE="alphaev56"
;;
1-101)
10)
UNAME_MACHINE="alphapca56"
;;
2-303)
16)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac
fi
rm -f $dummy.s $dummy
@@ -217,6 +129,9 @@ EOF
Amiga*:UNIX_System_V:4.0:*)
echo m68k-cbm-sysv4
exit 0;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -241,12 +156,12 @@ EOF
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
arm32:NetBSD:*:*)
echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
@@ -303,12 +218,15 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
@@ -332,9 +250,15 @@ EOF
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
@@ -347,6 +271,9 @@ EOF
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
macppc:NetBSD:*:*)
echo powerpc-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
@@ -362,7 +289,6 @@ EOF
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
@@ -402,18 +328,15 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
@@ -479,7 +402,7 @@ EOF
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
@@ -500,8 +423,6 @@ EOF
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
@@ -532,7 +453,7 @@ EOF
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
rm -f $dummy.c $dummy
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
@@ -626,13 +547,10 @@ EOF
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*T3E:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
echo alpha-cray-unicosmk${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
@@ -645,10 +563,13 @@ EOF
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
@@ -658,8 +579,17 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
if test -x /usr/bin/objformat; then
if test "elf" = "`/usr/bin/objformat`"; then
echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
exit 0
fi
fi
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
@@ -687,10 +617,13 @@ EOF
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
*:Linux:*:*)
# uname on the ARM produces all sorts of strangeness, and we need to
# filter it out.
case "$UNAME_MACHINE" in
armv*) UNAME_MACHINE=$UNAME_MACHINE ;;
arm* | sa110*) UNAME_MACHINE="arm" ;;
esac
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -703,42 +636,12 @@ EOF
s/ .*//
p'`
case "$ld_supported_emulations" in
*ia64)
echo "${UNAME_MACHINE}-unknown-linux"
exit 0
;;
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
elf_i?86)
echo "${UNAME_MACHINE}-pc-linux"
exit 0
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
*ia64) echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 ;;
i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
elf32ppc | elf32ppclinux)
# Determine Lib Version
cat >$dummy.c <<EOF
@@ -766,65 +669,49 @@ EOF
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0
;;
shelf_linux)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
esac
if test "${UNAME_MACHINE}" = "alpha" ; then
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
sed 's/^ //' <<EOF >$dummy.s
.globl main
.ent main
main:
.frame \$30,0,\$26,0
.prologue 0
.long 0x47e03d80 # implver $0
lda \$2,259
.long 0x47e20c21 # amask $2,$1
srl \$1,8,\$2
sll \$2,2,\$2
sll \$0,3,\$0
addl \$1,\$0,\$0
addl \$2,\$0,\$0
ret \$31,(\$26),1
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
./$dummy
case "$?" in
7)
UNAME_MACHINE="alpha"
;;
1-0)
15)
UNAME_MACHINE="alphaev5"
;;
1-1)
14)
UNAME_MACHINE="alphaev56"
;;
1-101)
10)
UNAME_MACHINE="alphapca56"
;;
2-303)
16)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac
objdump --private-headers $dummy | \
@@ -838,7 +725,6 @@ EOF
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
@@ -854,8 +740,6 @@ EOF
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
elif test "${UNAME_MACHINE}" = "s390"; then
echo s390-ibm-linux && exit 0
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
@@ -877,7 +761,6 @@ EOF
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
@@ -915,21 +798,19 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
@@ -949,11 +830,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i?86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
@@ -1067,27 +944,6 @@ EOF
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
echo `uname -p`-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
if test "${UNAME_MACHINE}" = "x86pc"; then
UNAME_MACHINE=pc
fi
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-W:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1227,47 +1083,6 @@ then
esac
fi
cat >&2 <<EOF
$0: unable to guess system type
The $version version of this script cannot recognize your system type.
Please download the most up to date version of the config scripts:
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess version = $version
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
#echo '(Unable to guess system type)' 1>&2
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "version='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:

View File

@@ -50,10 +50,6 @@
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */

View File

@@ -26,10 +26,6 @@
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
#define gid_t int
@@ -192,21 +188,6 @@
#undef SCCS_GET
#define SCCS_GET "echo no sccs get"
/* Define to 1 if NLS is requested. */
/* #undef ENABLE_NLS */
/* Define as 1 if you have dcgettext. */
/* #undef HAVE_DCGETTEXT */
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* Define if your locale.h file contains LC_MESSAGES. */
/* #undef HAVE_LC_MESSAGES */
/* Define to the installation directory for locales. */
#define LOCALEDIR ""
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
/* #undef SCCS_GET_MINUS_G */

173
config.sub vendored
View File

@@ -1,10 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
version='2000-06-20'
# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -29,8 +25,6 @@ version='2000-06-20'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
@@ -51,61 +45,30 @@ version='2000-06-20'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-V, --version print version number, then exit"
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case "$1" in
--version | --vers* | -V )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
exec >&2
echo "$me: invalid option $1"
echo "$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu*)
linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -131,7 +94,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
-apple)
os=
basic_machine=$1
;;
@@ -206,28 +169,24 @@ case $basic_machine in
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| hppa64 \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | sh[34] \
| powerpc | powerpcle \
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30 | avr)
| thumb | d10v)
basic_machine=$basic_machine-unknown
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i[234567]86)
i[34567]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@@ -237,16 +196,13 @@ case $basic_machine in
;;
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
@@ -254,10 +210,9 @@ case $basic_machine in
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | s390-* | sv1-* | t3e-* \
| f301-* | armv*-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
| bs2000-* | tic54x-* | c54x-*)
| thumb-* | v850-* | d30v-* | tic30-* | c30-* )
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -355,9 +310,6 @@ case $basic_machine in
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -478,6 +430,7 @@ case $basic_machine in
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[34567]86v32)
@@ -558,10 +511,6 @@ case $basic_machine in
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -570,10 +519,6 @@ case $basic_machine in
basic_machine=i386-unknown
os=-msdos
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@@ -583,7 +528,7 @@ case $basic_machine in
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
basic_machine=armv4l-corel
os=-linux
;;
news | news700 | news800 | news900)
@@ -634,9 +579,6 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
@@ -669,7 +611,7 @@ case $basic_machine in
pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
pentiumpro | p6 | 6x86)
basic_machine=i686-pc
;;
pentiumii | pentium2)
@@ -678,7 +620,7 @@ case $basic_machine in
pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
@@ -781,10 +723,6 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
@@ -793,10 +731,6 @@ case $basic_machine in
basic_machine=t3e-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -898,9 +832,6 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sh3 | sh4)
base_machine=sh-unknown
;;
sparc | sparcv9)
basic_machine=sparc-sun
;;
@@ -981,25 +912,12 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit*)
| -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i[34567]86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto*)
os=-nto-qnx
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
| -macos* | -mpw* | -magic* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
@@ -1013,12 +931,6 @@ case $os in
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
@@ -1043,9 +955,6 @@ case $os in
-ns2 )
os=-nextstep2
;;
-nsk)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
@@ -1108,7 +1017,7 @@ case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
arm*-corel)
os=-linux
;;
arm*-semi)
@@ -1282,7 +1191,7 @@ case $basic_machine in
-genix*)
vendor=ns
;;
-mvs* | -opened*)
-mvs*)
vendor=ibm
;;
-ptx*)
@@ -1309,11 +1218,3 @@ case $basic_machine in
esac
echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "version='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:

View File

@@ -23,9 +23,6 @@
#endif
/* Define if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define if you have sigsetmask. */
#define HAVE_SIGSETMASK 1
@@ -35,9 +32,6 @@
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the mkstemp function. */
#define HAVE_MKSTEMP 1
#define SCCS_GET "get"
/* Define to `unsigned long' or `unsigned long long'

View File

@@ -3,7 +3,7 @@ AC_REVISION([$Id$])
AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required.
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
AM_INIT_AUTOMAKE(make, 3.79.1)
AM_INIT_AUTOMAKE(make, 3.78.91)
AM_CONFIG_HEADER(config.h)
dnl Regular configure stuff
@@ -32,30 +32,14 @@ AC_TYPE_UID_T dnl Also does gid_t.
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
memory.h sys/time.h sys/timeb.h)
memory.h sys/timeb.h)
AC_PROG_CC_C_O
AM_PROG_CC_STDC
AC_C_CONST dnl getopt needs this.
AC_C_INLINE dnl gettext needs this.
AC_HEADER_STAT
AC_HEADER_TIME
dnl Handle internationalization
ALL_LINGUAS="de es fr ja ko nl pl pt_BR ru"
pds_WITH_GETTEXT
dnl See if the user wants nsec timestamps
AC_ARG_ENABLE(nsec-timestamps,
[ --disable-nsec-timestamps disable use of sub-second timestamps],
[make_cv_nsec_timestamps="$enableval"],
[make_cv_nsec_timestamps="yes"])
if test "x$make_cv_nsec_timestamps" != xno; then
AC_STRUCT_ST_MTIM_NSEC
fi
AC_STRUCT_ST_MTIM_NSEC
jm_AC_TYPE_UINTMAX_T
AC_SUBST(LIBOBJS)
@@ -73,38 +57,13 @@ changequote([,])dnl
fi
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
# Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
if test "$ac_cv_search_clock_gettime" != no; then
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
[Define if you have the clock_gettime function.])
fi
# See if we have a standard version of gettimeofday(). Since actual
# implementations can differ, just make sure we have the most common
# one.
AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
[ac_cv_func_gettimeofday=no
AC_TRY_RUN([#include <sys/time.h>
int main ()
{
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
exit (gettimeofday (&t, 0) != 0
|| t.tv_sec < 0 || t.tv_usec < 0);
}],
ac_cv_func_gettimeofday=yes,
ac_cv_func_gettimeofday=no,
ac_cv_func_gettimeofday="no (cross-compiling)")])
if test $ac_cv_func_gettimeofday = yes; then
AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
[Define if you have a standard gettimeofday function])
fi
AC_CHECK_FUNCS( memmove memcpy strchr strdup psignal mkstemp mktemp fdopen \
dup2 getcwd sigsetmask sigaction getgroups setlinebuf \
seteuid setegid setreuid setregid pipe strerror strsignal)
# clock_gettime is in -lposix4 in Solaris 2.6.
AC_CHECK_LIB(posix4, clock_gettime)
AC_CHECK_FUNCS(memmove strchr memcpy strdup psignal mktemp pstat_getdynamic \
clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
setlinebuf seteuid setegid setreuid setregid pipe \
strerror strsignal)
AC_CHECK_SYMBOL(sys_siglist)
AC_FUNC_ALLOCA
AC_FUNC_VFORK
@@ -112,9 +71,9 @@ AC_FUNC_VPRINTF
AC_FUNC_STRCOLL
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_SELECT
AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG.
AC_CHECK_FUNCS(pstat_getdynamic) dnl Supposedly in AC_FUNC_GETLOADAVG, but...?
AC_FUNC_GETLOADAVG
# Check out the wait reality.
@@ -142,15 +101,20 @@ pid = waitpid (-1, &status, 0);
],
[make_cv_union_wait=yes], [make_cv_union_wait=no])])
if test "$make_cv_union_wait" = yes; then
AC_DEFINE(HAVE_UNION_WAIT, 1, [Define this if you have the \`union wait' type in <sys/wait.h>.])
AC_DEFINE(HAVE_UNION_WAIT)
fi
AC_MSG_RESULT($make_cv_union_wait)
AC_DECL_SYS_SIGLIST
dnl Handle internationalization
ALL_LINGUAS="de es fr ko nl pl ru"
fp_WITH_GETTEXT
# The presence of the following is not meant to imply
# that make necessarily works on those systems.
AC_SEARCH_LIBS(getpwnam, sun)
AC_CHECK_LIB(sun, getpwnam)
AC_SUBST(REMOTE) REMOTE=stub
make_try_customs=no
@@ -186,8 +150,7 @@ case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
esac
case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$has_wait_nohang/$make_cv_job_server" in
yes/yes/yes/yes) AC_DEFINE(MAKE_JOBSERVER, 1,
[Define this to enable job server support in GNU make.]);;
yes/yes/yes/yes) AC_DEFINE(MAKE_JOBSERVER) ;;
esac
dnl Allow building with dmalloc
@@ -223,8 +186,7 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
make_cv_sys_get_minus_G=no
fi])
case "$make_cv_sys_get_minus_G" in
yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
[Define this if the SCCS \`get' command understands the \`-G<file>' option.]);;
yes) AC_DEFINE(SCCS_GET_MINUS_G);;
esac
fi
rm -f s.conftest conftoast

View File

@@ -396,10 +396,10 @@ static char *default_variables[] =
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
and to the empty string if $@ does exist. */
"CHECKOUT,v", "+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
"CO", "co",
"COFLAGS", "",
"CHECKOUT,v",
"+$(if $(wildcard $@),,$(CO) $(COFLAGS) $< $@)",
"CO", "co",
"CPP", "$(CC) -E",
#ifdef CRAY
"CF77PPFLAGS", "-P",

26
dir.c
View File

@@ -296,7 +296,6 @@ find_directory (name)
register unsigned int hash = 0;
register char *p;
register struct directory *dir;
int r;
#ifdef WINDOWS32
char* w32_path;
char fs_label[BUFSIZ];
@@ -334,28 +333,19 @@ find_directory (name)
/* The directory is not in the name hash table.
Find its device and inode numbers, and look it up by them. */
#ifdef WINDOWS32
#ifdef VMS
if (vmsstat_dir (name, &st) < 0)
#else
# ifdef WINDOWS32
/* Remove any trailing '\'. Windows32 stat fails even on valid
directories if they end in '\'. */
if (p[-1] == '\\')
p[-1] = '\0';
# endif
if (stat (name, &st) < 0)
#endif
#ifdef VMS
r = vmsstat_dir (name, &st);
#else
r = stat (name, &st);
#endif
#ifdef WINDOWS32
/* Put back the trailing '\'. If we don't, we're permanently
truncating the value! */
if (p[-1] == '\0')
p[-1] = '\\';
#endif
if (r < 0)
{
{
/* Couldn't stat the directory. Mark this by
setting the `contents' member to a nil pointer. */
dir->contents = 0;

View File

@@ -17,10 +17,9 @@ along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h"
#include <assert.h>
#include "make.h"
#include "filedef.h"
#include "job.h"
#include "commands.h"
@@ -92,11 +91,13 @@ initialize_variable_output ()
/* Recursively expand V. The returned string is malloc'd. */
static char *allocated_variable_append PARAMS ((struct variable *v));
static char *allocated_variable_append PARAMS ((struct variable *v,
struct variable_set_list *l));
char *
recursively_expand (v)
recursively_expand_setlist (v, list)
register struct variable *v;
struct variable_set_list *list;
{
char *value;
@@ -108,7 +109,7 @@ recursively_expand (v)
v->expanding = 1;
if (v->append)
value = allocated_variable_append (v);
value = allocated_variable_append (v, list);
else
value = allocated_variable_expand (v->value);
v->expanding = 0;
@@ -143,9 +144,10 @@ reference_variable (o, name, length)
unsigned int length;
{
register struct variable *v;
struct variable_set_list *setlist;
char *value;
v = lookup_variable (name, length);
v = lookup_variable_setlist (name, length, &setlist);
if (v == 0)
warn_undefined (name, length);
@@ -153,7 +155,7 @@ reference_variable (o, name, length)
if (v == 0 || *v->value == '\0')
return o;
value = (v->recursive ? recursively_expand (v) : v->value);
value = (v->recursive ? recursively_expand_setlist (v, setlist) : v->value);
o = variable_buffer_output (o, value, strlen (value));
@@ -368,7 +370,7 @@ variable_expand_string (line, string, length)
break;
default:
if (isblank ((unsigned char)p[-1]))
if (isblank (p[-1]))
break;
/* A $ followed by a random char is a variable reference:
@@ -427,9 +429,6 @@ expand_argument (str, end)
{
char *tmp;
if (str == end)
return xstrdup("");
if (!end || *end == '\0')
tmp = str;
else
@@ -473,8 +472,9 @@ variable_expand_for_file (line, file)
context of the next variable set, then we append the expanded value. */
static char *
allocated_variable_append (v)
allocated_variable_append (v, list)
struct variable *v;
struct variable_set_list *list;
{
struct variable_set_list *save;
int len = strlen (v->name);
@@ -486,9 +486,12 @@ allocated_variable_append (v)
variable_buffer = 0;
assert(current_variable_set_list->next != 0);
if (!list)
list = current_variable_set_list;
assert(list->next != 0);
save = current_variable_set_list;
current_variable_set_list = current_variable_set_list->next;
current_variable_set_list = list->next;
var[0] = '$';
var[1] = '(';

147
file.c
View File

@@ -17,10 +17,9 @@ along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h"
#include <assert.h>
#include "make.h"
#include "dep.h"
#include "filedef.h"
#include "job.h"
@@ -35,8 +34,13 @@ Boston, MA 02111-1307, USA. */
#endif
static struct file *files[FILE_BUCKETS];
/* Whether or not .SECONDARY with no prerequisites was given. */
static int all_secondary = 0;
/* Number of files with the `intermediate' flag set. */
unsigned int num_intermediates = 0;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
unsigned int considered = 0;
/* Access the hash table of all file records.
lookup_file given a name, return the struct file * for that name,
@@ -54,7 +58,8 @@ lookup_file (name)
register char *lname, *ln;
#endif
assert (*name != '\0');
if (*name == '\0')
abort ();
/* This is also done in parse_file_seq, so this is redundant
for names read from makefiles. It is here for names passed
@@ -123,7 +128,8 @@ enter_file (name)
char *lname, *ln;
#endif
assert (*name != '\0');
if (*name == '\0')
abort ();
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
lname = (char *)malloc (strlen (name) + 1);
@@ -160,7 +166,7 @@ enter_file (name)
new = (struct file *) xmalloc (sizeof (struct file));
bzero ((char *) new, sizeof (struct file));
new->name = new->hname = name;
new->update_status = -1;
new->update_status = 0; /* assume the file won */
if (f == 0)
{
@@ -193,8 +199,7 @@ rehash_file (file, name)
register unsigned int oldhash;
register char *n;
while (file->renamed != 0)
file = file->renamed;
check_renamed(file);
/* Find the hash values of the old and new names. */
@@ -246,9 +251,8 @@ file_hash_enter (file, name, oldhash, oldname)
if (strieq (oldfile->hname, name))
break;
/* If the old file is the same as the new file, never mind. */
if (oldfile == file)
return;
/* If the old file is the same as the new file, something's wrong. */
assert (oldfile != file);
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
{
@@ -356,7 +360,6 @@ in favor of those for `%s'."),
MERGE (precious);
MERGE (tried_implicit);
MERGE (updating);
MERGE (updated);
MERGE (is_target);
MERGE (cmd_target);
MERGE (phony);
@@ -380,10 +383,8 @@ remove_intermediates (sig)
register struct file *f;
char doneany;
/* If there's no way we will ever remove anything anyway, punt early. */
if (question_flag || touch_flag || all_secondary)
if (question_flag || touch_flag)
return;
if (sig && just_print_flag)
return;
@@ -391,14 +392,14 @@ remove_intermediates (sig)
for (i = 0; i < FILE_BUCKETS; ++i)
for (f = files[i]; f != 0; f = f->next)
if (f->intermediate && (f->dontcare || !f->precious)
&& !f->secondary && !f->cmd_target)
&& !f->secondary)
{
int status;
if (f->update_status == -1)
if (f->command_state == cs_not_started)
/* If nothing would have created this file yet,
don't print an "rm" command for it. */
continue;
if (just_print_flag)
else if (just_print_flag)
status = 0;
else
{
@@ -473,8 +474,8 @@ snap_deps ()
{
/* Mark this file as phony and nonexistent. */
f2->phony = 1;
f2->last_mtime = NONEXISTENT_MTIME;
f2->mtime_before_update = NONEXISTENT_MTIME;
f2->last_mtime = (FILE_TIMESTAMP) -1;
f2->mtime_before_update = (FILE_TIMESTAMP) -1;
}
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
@@ -497,12 +498,19 @@ snap_deps ()
but unlike real intermediate files,
these are not deleted after make finishes. */
if (f->deps)
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->intermediate = f2->secondary = 1;
{
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->intermediate = f2->secondary = 1;
}
/* .SECONDARY with no deps listed marks *all* files that way. */
else
all_secondary = 1;
{
int i;
for (i = 0; i < FILE_BUCKETS; i++)
for (f2 = files[i]; f2; f2= f2->next)
f2->intermediate = f2->secondary = 1;
}
}
f = lookup_file (".EXPORT_ALL_VARIABLES");
@@ -555,73 +563,17 @@ set_command_state (file, state)
d->file->command_state = state;
}
/* Convert an external file timestamp to internal form. */
FILE_TIMESTAMP
file_timestamp_cons (fname, s, ns)
char const *fname;
time_t s;
int ns;
{
int offset = ORDINARY_MTIME_MIN + (FILE_TIMESTAMP_HI_RES ? ns : 0);
FILE_TIMESTAMP product = (FILE_TIMESTAMP) s << FILE_TIMESTAMP_LO_BITS;
FILE_TIMESTAMP ts = product + offset;
if (! (s <= FILE_TIMESTAMP_S (ORDINARY_MTIME_MAX)
&& product <= ts && ts <= ORDINARY_MTIME_MAX))
{
char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
ts = s <= OLD_MTIME ? ORDINARY_MTIME_MIN : ORDINARY_MTIME_MAX;
file_timestamp_sprintf (buf, ts);
error (NILF, _("%s: Timestamp out of range; substituting %s"),
fname ? fname : _("Current time"), buf);
}
return ts;
}
/* Get and print file timestamps. */
FILE_TIMESTAMP
file_timestamp_now ()
{
time_t s;
int ns;
/* Don't bother with high-resolution clocks if file timestamps have
only one-second resolution. The code below should work, but it's
not worth the hassle of debugging it on hosts where it fails. */
if (FILE_TIMESTAMP_HI_RES)
{
#if HAVE_CLOCK_GETTIME && defined CLOCK_REALTIME
{
struct timespec timespec;
if (clock_gettime (CLOCK_REALTIME, &timespec) == 0)
{
s = timespec.tv_sec;
ns = timespec.tv_nsec;
goto got_time;
}
}
struct timespec timespec;
if (clock_gettime (CLOCK_REALTIME, &timespec) == 0)
return FILE_TIMESTAMP_FROM_S_AND_NS (timespec.tv_sec, timespec.tv_nsec);
#endif
#if HAVE_GETTIMEOFDAY
{
struct timeval timeval;
if (gettimeofday (&timeval, 0) == 0)
{
s = timeval.tv_sec;
ns = timeval.tv_usec * 1000;
goto got_time;
}
}
#endif
}
s = time ((time_t *) 0);
ns = 0;
got_time:
return file_timestamp_cons (0, s, ns);
return FILE_TIMESTAMP_FROM_S_AND_NS (time ((time_t *) 0), 0);
}
void
@@ -695,19 +647,17 @@ print_file (f)
printf (" %s", dep_name (d));
putchar ('\n');
}
if (f->last_mtime == UNKNOWN_MTIME)
if (f->last_mtime == 0)
puts (_("# Modification time never checked."));
else if (f->last_mtime == NONEXISTENT_MTIME)
else if (f->last_mtime == (FILE_TIMESTAMP) -1)
puts (_("# File does not exist."));
else if (f->last_mtime == OLD_MTIME)
puts (_("# File is very old."));
else
{
char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
file_timestamp_sprintf (buf, f->last_mtime);
printf (_("# Last modified %s\n"), buf);
}
puts (f->updated
puts ((f->command_state == cs_finished)
? _("# File has been updated.") : _("# File has not been updated."));
switch (f->command_state)
{
@@ -718,26 +668,19 @@ print_file (f)
puts (_("# Dependencies commands running (THIS IS A BUG)."));
break;
case cs_not_started:
break;
case cs_finished:
switch (f->update_status)
{
case -1:
break;
case 0:
/* file won */
puts (_("# Successfully updated."));
break;
case 1:
assert (question_flag);
puts (_("# Needs to be updated (-q is set)."));
/* file lost */
puts (question_flag ? _("# Needs to be updated (-q is set).")
:_("# Failed to be updated."));
break;
case 2:
puts (_("# Failed to be updated."));
break;
default:
puts (_("# Invalid value in `update_status' member!"));
fflush (stdout);
fflush (stderr);
abort ();
}
break;
default:

View File

@@ -60,9 +60,6 @@ struct file
the same file. Otherwise this is null. */
struct file *double_colon;
short int update_status; /* Status of the last attempt to update,
or -1 if none has been made. */
enum /* State of the commands. */
{ /* Note: It is important that cs_not_started be zero. */
cs_not_started, /* Not yet started. */
@@ -71,12 +68,15 @@ struct file
cs_finished /* Commands finished. */
} command_state ENUM_BITFIELD (2);
unsigned int update_status:1; /* update status signifies only
whether the file won or lost */
unsigned int precious:1; /* Non-0 means don't delete file on quit */
unsigned int tried_implicit:1; /* Nonzero if have searched
for implicit rule for making
this file; don't search again. */
unsigned int updating:1; /* Nonzero while updating deps of this file */
unsigned int updated:1; /* Nonzero if this file has been remade. */
unsigned int is_target:1; /* Nonzero if file is described as target. */
unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */
unsigned int phony:1; /* Nonzero if this is a phony file
@@ -94,6 +94,13 @@ struct file
considered on current scan of goal chain */
};
/* Number of intermediate files entered. */
extern unsigned int num_intermediates;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
extern unsigned int considered;
extern struct file *default_goal_file, *suffix_file, *default_file;
@@ -110,29 +117,29 @@ extern void set_command_state PARAMS ((struct file *file, int state));
extern void notice_finished_file PARAMS ((struct file *file));
#ifdef ST_MTIM_NSEC
# define FILE_TIMESTAMP_HI_RES \
(2147483647 < INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) >> 31)
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, (st).st_mtim.ST_MTIM_NSEC)
#if ST_MTIM_NSEC
# define FILE_TIMESTAMP_STAT_MODTIME(st) \
FILE_TIMESTAMP_FROM_S_AND_NS ((st).st_mtim.tv_sec, \
(st).st_mtim.ST_MTIM_NSEC)
# define FILE_TIMESTAMPS_PER_S \
MIN ((FILE_TIMESTAMP) 1000000000, \
(INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
/ INTEGER_TYPE_MAXIMUM (time_t)))
#else
# define FILE_TIMESTAMP_HI_RES 0
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, 0)
# define FILE_TIMESTAMP_STAT_MODTIME(st) ((st).st_mtime)
# define FILE_TIMESTAMPS_PER_S 1
#endif
/* If FILE_TIMESTAMP is 64 bits (or more), use nanosecond resolution.
(Multiply by 2**30 instead of by 10**9 to save time at the cost of
slightly decreasing the number of available timestamps.) With
64-bit FILE_TIMESTAMP, this stops working on 2514-05-30 01:53:04
UTC, but by then uintmax_t should be larger than 64 bits. */
#define FILE_TIMESTAMPS_PER_S (FILE_TIMESTAMP_HI_RES ? 1000000000 : 1)
#define FILE_TIMESTAMP_LO_BITS (FILE_TIMESTAMP_HI_RES ? 30 : 0)
#define FILE_TIMESTAMP_S(ts) (((ts) - ORDINARY_MTIME_MIN) \
>> FILE_TIMESTAMP_LO_BITS)
#define FILE_TIMESTAMP_NS(ts) (((ts) - ORDINARY_MTIME_MIN) \
& ((1 << FILE_TIMESTAMP_LO_BITS) - 1))
#define FILE_TIMESTAMP_FROM_S_AND_NS(s, ns) \
((s) * FILE_TIMESTAMPS_PER_S \
+ (ns) * FILE_TIMESTAMPS_PER_S / 1000000000)
#define FILE_TIMESTAMP_DIV(a, b) ((a)/(b) - ((a)%(b) < 0))
#define FILE_TIMESTAMP_MOD(a, b) ((a)%(b) + ((a)%(b) < 0) * (b))
#define FILE_TIMESTAMP_S(ts) FILE_TIMESTAMP_DIV ((ts), FILE_TIMESTAMPS_PER_S)
#define FILE_TIMESTAMP_NS(ts) \
(((FILE_TIMESTAMP_MOD ((ts), FILE_TIMESTAMPS_PER_S) * 1000000000) \
+ (FILE_TIMESTAMPS_PER_S - 1)) \
/ FILE_TIMESTAMPS_PER_S)
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
representing a file timestamp. The upper bound is not necessarily 19,
@@ -152,48 +159,35 @@ extern void notice_finished_file PARAMS ((struct file *file));
* 302 / 1000) \
+ 1 + 1 + 4 + 25)
extern FILE_TIMESTAMP file_timestamp_cons PARAMS ((char const *,
time_t, int));
extern FILE_TIMESTAMP file_timestamp_now PARAMS ((void));
extern void file_timestamp_sprintf PARAMS ((char *p, FILE_TIMESTAMP ts));
/* Return the mtime of file F (a struct file *), caching it.
The value is NONEXISTENT_MTIME if the file does not exist. */
The value is -1 if the file does not exist. */
#define file_mtime(f) file_mtime_1 ((f), 1)
/* Return the mtime of file F (a struct file *), caching it.
Don't search using vpath for the file--if it doesn't actually exist,
we don't find it.
The value is NONEXISTENT_MTIME if the file does not exist. */
The value is -1 if the file does not exist. */
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
extern FILE_TIMESTAMP f_mtime PARAMS ((struct file *file, int search));
#define file_mtime_1(f, v) \
((f)->last_mtime == UNKNOWN_MTIME ? f_mtime ((f), v) : (f)->last_mtime)
/* Special timestamp values. */
/* The file's timestamp is not yet known. */
#define UNKNOWN_MTIME 0
/* The file does not exist. */
#define NONEXISTENT_MTIME 1
/* The file does not exist, and we assume that it is older than any
actual file. */
#define OLD_MTIME 2
/* The smallest and largest ordinary timestamps. */
#define ORDINARY_MTIME_MIN (OLD_MTIME + 1)
#define ORDINARY_MTIME_MAX ((FILE_TIMESTAMP_S (NEW_MTIME) \
<< FILE_TIMESTAMP_LO_BITS) \
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
((f)->last_mtime ? (f)->last_mtime : f_mtime ((f), v))
/* Modtime value to use for `infinitely new'. We used to get the current time
from the system and use that whenever we wanted `new'. But that causes
trouble when the machine running make and the machine holding a file have
different ideas about what time it is; and can also lose for `force'
targets, which need to be considered newer than anything that depends on
them, even if said dependents' modtimes are in the future. */
#define NEW_MTIME INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP)
them, even if said dependents' modtimes are in the future.
If FILE_TIMESTAMP is unsigned, its maximum value is the same as
((FILE_TIMESTAMP) -1), so use one less than that, because -1 is
used for non-existing files. */
#define NEW_MTIME \
(INTEGER_TYPE_SIGNED (FILE_TIMESTAMP) \
? INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) \
: (INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP) - 1))
#define check_renamed(file) \
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */

View File

@@ -37,7 +37,7 @@ struct function_table_entry
unsigned char minimum_args;
unsigned char maximum_args;
char expand_args;
char *(*func_ptr) PARAMS ((char *output, char **argv, const char *fname));
char *(*func_ptr) PARAMS((char *output, char **argv, const char*funcname));
};
@@ -92,10 +92,10 @@ subst_expand (o, text, subst, replace, slen, rlen, by_word, suffix_only)
/* If we're substituting only by fully matched words,
or only at the ends of words, check that this case qualifies. */
if ((by_word
&& ((p > t && !isblank ((unsigned char)p[-1]))
|| (p[slen] != '\0' && !isblank ((unsigned char)p[slen]))))
&& ((p > t && !isblank (p[-1]))
|| (p[slen] != '\0' && !isblank (p[slen]))))
|| (suffix_only
&& (p[slen] != '\0' && !isblank ((unsigned char)p[slen]))))
&& (p[slen] != '\0' && !isblank (p[slen]))))
/* Struck out. Output the rest of the string that is
no longer to be replaced. */
o = variable_buffer_output (o, subst, slen);
@@ -231,11 +231,11 @@ lookup_function (table, s)
const struct function_table_entry *table;
const char *s;
{
int len = strlen (s);
int len = strlen(s);
for (; table->name != NULL; ++table)
if (table->len <= len
&& (isblank ((unsigned char)s[table->len]) || s[table->len] == '\0')
&& (isblank (s[table->len]) || s[table->len] == '\0')
&& strneq (s, table->name, table->len))
return table;
@@ -386,7 +386,7 @@ func_patsubst (o, argv, funcname)
static char *
func_join (o, argv, funcname)
func_join(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -429,7 +429,7 @@ func_join (o, argv, funcname)
static char *
func_origin (o, argv, funcname)
func_origin(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -483,7 +483,7 @@ func_origin (o, argv, funcname)
static char *
func_notdir_suffix (o, argv, funcname)
func_notdir_suffix(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -492,9 +492,9 @@ func_notdir_suffix (o, argv, funcname)
char *list_iterator = argv[0];
char *p2 =0;
int doneany =0;
unsigned int len=0;
int len=0;
int is_suffix = streq (funcname, "suffix");
int is_suffix = streq(funcname, "suffix");
int is_notdir = !is_suffix;
while ((p2 = find_next_token (&list_iterator, &len)) != 0)
{
@@ -518,7 +518,7 @@ func_notdir_suffix (o, argv, funcname)
}
#if defined(WINDOWS32) || defined(__MSDOS__)
/* Handle the case of "d:foo/bar". */
else if (streq (funcname, "notdir") && p2[0] && p2[1] == ':')
else if (streq(funcname, "notdir") && p2[0] && p2[1] == ':')
{
p = p2 + 2;
o = variable_buffer_output (o, p, len - (p - p2));
@@ -544,7 +544,7 @@ func_notdir_suffix (o, argv, funcname)
static char *
func_basename_dir (o, argv, funcname)
func_basename_dir(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -555,7 +555,7 @@ func_basename_dir (o, argv, funcname)
int doneany=0;
unsigned int len=0;
char *p=0;
int is_basename= streq (funcname, "basename");
int is_basename= streq(funcname, "basename");
int is_dir= !is_basename;
while ((p2 = find_next_token (&p3, &len)) != 0)
@@ -563,7 +563,7 @@ func_basename_dir (o, argv, funcname)
p = p2 + len;
while (p >= p2 && (!is_basename || *p != '.'))
{
if (IS_PATHSEP (*p))
if (IS_PATHSEP(*p))
break;
--p;
}
@@ -603,7 +603,7 @@ func_basename_dir (o, argv, funcname)
}
static char *
func_addsuffix_addprefix (o, argv, funcname)
func_addsuffix_addprefix(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -636,7 +636,7 @@ func_addsuffix_addprefix (o, argv, funcname)
}
static char *
func_subst (o, argv, funcname)
func_subst(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -649,7 +649,7 @@ func_subst (o, argv, funcname)
static char *
func_firstword (o, argv, funcname)
func_firstword(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -666,7 +666,7 @@ func_firstword (o, argv, funcname)
static char *
func_words (o, argv, funcname)
func_words(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -724,7 +724,7 @@ check_numeric (s, message)
static char *
func_word (o, argv, funcname)
func_word(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -738,7 +738,7 @@ func_word (o, argv, funcname)
i = atoi (argv[0]);
if (i == 0)
fatal (reading_file, _("first argument to `word' function must be greater than 0"));
fatal (reading_file, _("the `word' function takes a positive index argument"));
end_p = argv[1];
@@ -758,42 +758,45 @@ func_wordlist (o, argv, funcname)
char **argv;
const char *funcname;
{
int start, count;
int i=0;
int j=0;
/* Check the arguments. */
/* Check the first argument. */
check_numeric (argv[0],
_("non-numeric first argument to `wordlist' function"));
i =atoi(argv[0]);
check_numeric (argv[1],
_("non-numeric second argument to `wordlist' function"));
start = atoi (argv[0]);
count = atoi (argv[1]) - start + 1;
j = atoi(argv[1]);
if (count > 0)
{
char *p;
char *end_p = argv[2];
/* Find the beginning of the "start"th word. */
while (((p = find_next_token (&end_p, 0)) != 0) && --start)
;
{
char *p;
char *end_p = argv[2];
if (p)
{
/* Find the end of the "count"th word from start. */
while (--count && (find_next_token (&end_p, 0) != 0))
;
int start = (i < j) ? i : j;
int count = j -i ;
if (count < 0)
count = - count;
count ++;
/* Return the stuff in the middle. */
o = variable_buffer_output (o, p, end_p - p);
}
}
while (((p = find_next_token (&end_p, 0)) != 0) && --start)
{}
if (p)
{
while (--count && (find_next_token (&end_p, 0) != 0))
{}
o = variable_buffer_output (o, p, end_p - p);
}
}
return o;
}
static char*
func_findstring (o, argv, funcname)
func_findstring(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -885,7 +888,7 @@ func_filter_filterout (o, argv, funcname)
/* Chop ARGV[1] up into words and then run each pattern through. */
while ((p = find_next_token (&word_iterator, &len)) != 0)
{
struct a_word *w = (struct a_word *)alloca (sizeof (struct a_word));
struct a_word *w = (struct a_word *)alloca(sizeof(struct a_word));
if (wordhead == 0)
wordhead = w;
else
@@ -941,7 +944,7 @@ func_filter_filterout (o, argv, funcname)
static char *
func_strip (o, argv, funcname)
func_strip(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -989,18 +992,18 @@ func_error (o, argv, funcname)
another special case where function arguments aren't broken up,
just create a format string that puts them back together. */
for (len=0, argvp=argv; *argvp != 0; ++argvp)
len += strlen (*argvp) + 2;
len += strlen(*argvp) + 2;
p = msg = alloca (len + 1);
for (argvp=argv; argvp[1] != 0; ++argvp)
{
strcpy (p, *argvp);
p += strlen (*argvp);
strcpy(p, *argvp);
p += strlen(*argvp);
*(p++) = ',';
*(p++) = ' ';
}
strcpy (p, *argvp);
strcpy(p, *argvp);
if (*funcname == 'e')
fatal (reading_file, "%s", msg);
@@ -1125,7 +1128,7 @@ func_if (o, argv, funcname)
}
static char *
func_wildcard (o, argv, funcname)
func_wildcard(o, argv, funcname)
char *o;
char **argv;
const char *funcname;
@@ -1194,11 +1197,11 @@ windows32_openpipe (int *pipedes, int *pid_p, char **command_argv, char **envp)
HANDLE hProcess;
saAttr.nLength = sizeof (SECURITY_ATTRIBUTES);
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
if (DuplicateHandle (GetCurrentProcess(),
if (DuplicateHandle(GetCurrentProcess(),
GetStdHandle(STD_INPUT_HANDLE),
GetCurrentProcess(),
&hIn,
@@ -1274,7 +1277,7 @@ msdos_openpipe (int* pipedes, int *pidp, char *text)
extern int dos_command_running, dos_status;
/* Make sure not to bother processing an empty line. */
while (isblank ((unsigned char)*text))
while (isblank (*text))
++text;
if (*text == '\0')
return 0;
@@ -1368,7 +1371,7 @@ func_shell (o, argv, funcname)
/* For error messages. */
if (reading_file != 0)
{
error_prefix = (char *) alloca (strlen (reading_file->filenm)+11+4);
error_prefix = (char *) alloca (strlen(reading_file->filenm)+11+4);
sprintf (error_prefix,
"%s:%lu: ", reading_file->filenm, reading_file->lineno);
}
@@ -1467,8 +1470,8 @@ func_shell (o, argv, funcname)
if (batch_filename) {
DB (DB_VERBOSE, (_("Cleaning up temporary batch file %s\n"),
batch_filename));
remove (batch_filename);
free (batch_filename);
remove(batch_filename);
free(batch_filename);
}
shell_function_pid = 0;
@@ -1533,10 +1536,7 @@ func_shell (char *o, char **argv, const char *funcname)
if (command_argv == 0)
return o;
/* Note the mktemp() is a security hole, but this only runs on Amiga.
Ideally we would use main.c:open_tmpfile(), but this uses a special
Open(), not fopen(), and I'm not familiar enough with the code to mess
with it. */
strcpy (tmp_output, "t:MakeshXXXXXXXX");
mktemp (tmp_output);
child_stdout = Open (tmp_output, MODE_NEWFILE);
@@ -1620,7 +1620,7 @@ func_not (char* o, char **argv, char *funcname)
#endif
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1)
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof(_s)-1)
/* Lookup table for builtin functions.
@@ -1634,7 +1634,7 @@ func_not (char* o, char **argv, char *funcname)
EXPAND_ARGS means that all arguments should be expanded before invocation.
Functions that do namespace tricks (foreach) don't automatically expand. */
static char *func_call PARAMS ((char *o, char **argv, const char *funcname));
static char *func_call PARAMS((char *o, char **argv, const char *funcname));
static struct function_table_entry function_table[] =
@@ -1642,33 +1642,33 @@ static struct function_table_entry function_table[] =
/* Name/size */ /* MIN MAX EXP? Function */
{ STRING_SIZE_TUPLE("addprefix"), 2, 2, 1, func_addsuffix_addprefix},
{ STRING_SIZE_TUPLE("addsuffix"), 2, 2, 1, func_addsuffix_addprefix},
{ STRING_SIZE_TUPLE("basename"), 0, 1, 1, func_basename_dir},
{ STRING_SIZE_TUPLE("dir"), 0, 1, 1, func_basename_dir},
{ STRING_SIZE_TUPLE("notdir"), 0, 1, 1, func_notdir_suffix},
{ STRING_SIZE_TUPLE("basename"), 1, 1, 1, func_basename_dir},
{ STRING_SIZE_TUPLE("dir"), 1, 1, 1, func_basename_dir},
{ STRING_SIZE_TUPLE("notdir"), 1, 1, 1, func_notdir_suffix},
{ STRING_SIZE_TUPLE("subst"), 3, 3, 1, func_subst},
{ STRING_SIZE_TUPLE("suffix"), 0, 1, 1, func_notdir_suffix},
{ STRING_SIZE_TUPLE("suffix"), 1, 1, 1, func_notdir_suffix},
{ STRING_SIZE_TUPLE("filter"), 2, 2, 1, func_filter_filterout},
{ STRING_SIZE_TUPLE("filter-out"), 2, 2, 1, func_filter_filterout},
{ STRING_SIZE_TUPLE("findstring"), 2, 2, 1, func_findstring},
{ STRING_SIZE_TUPLE("firstword"), 0, 1, 1, func_firstword},
{ STRING_SIZE_TUPLE("firstword"), 1, 1, 1, func_firstword},
{ STRING_SIZE_TUPLE("join"), 2, 2, 1, func_join},
{ STRING_SIZE_TUPLE("patsubst"), 3, 3, 1, func_patsubst},
{ STRING_SIZE_TUPLE("shell"), 0, 1, 1, func_shell},
{ STRING_SIZE_TUPLE("sort"), 0, 1, 1, func_sort},
{ STRING_SIZE_TUPLE("strip"), 0, 1, 1, func_strip},
{ STRING_SIZE_TUPLE("wildcard"), 0, 1, 1, func_wildcard},
{ STRING_SIZE_TUPLE("shell"), 1, 1, 1, func_shell},
{ STRING_SIZE_TUPLE("sort"), 1, 1, 1, func_sort},
{ STRING_SIZE_TUPLE("strip"), 1, 1, 1, func_strip},
{ STRING_SIZE_TUPLE("wildcard"), 1, 1, 1, func_wildcard},
{ STRING_SIZE_TUPLE("word"), 2, 2, 1, func_word},
{ STRING_SIZE_TUPLE("wordlist"), 3, 3, 1, func_wordlist},
{ STRING_SIZE_TUPLE("words"), 0, 1, 1, func_words},
{ STRING_SIZE_TUPLE("origin"), 0, 1, 1, func_origin},
{ STRING_SIZE_TUPLE("words"), 1, 1, 1, func_words},
{ STRING_SIZE_TUPLE("origin"), 1, 1, 1, func_origin},
{ STRING_SIZE_TUPLE("foreach"), 3, 3, 0, func_foreach},
{ STRING_SIZE_TUPLE("call"), 1, 0, 1, func_call},
{ STRING_SIZE_TUPLE("error"), 0, 1, 1, func_error},
{ STRING_SIZE_TUPLE("warning"), 0, 1, 1, func_error},
{ STRING_SIZE_TUPLE("call"), 1, 0, 0, func_call},
{ STRING_SIZE_TUPLE("error"), 1, 1, 1, func_error},
{ STRING_SIZE_TUPLE("warning"), 1, 1, 1, func_error},
{ STRING_SIZE_TUPLE("if"), 2, 3, 0, func_if},
#ifdef EXPERIMENTAL
{ STRING_SIZE_TUPLE("eq"), 2, 2, 1, func_eq},
{ STRING_SIZE_TUPLE("not"), 0, 1, 1, func_not},
{ STRING_SIZE_TUPLE("not"), 1, 1, 1, func_not},
#endif
{ 0 }
};
@@ -1688,13 +1688,6 @@ expand_builtin_function (o, argc, argv, entry_p)
_("Insufficient number of arguments (%d) to function `%s'"),
argc, entry_p->name);
/* I suppose technically some function could do something with no
arguments, but so far none do, so just test it for all functions here
rather than in each one. We can change it later if necessary. */
if (!argc)
return o;
if (!entry_p->func_ptr)
fatal (reading_file, _("Unimplemented on this platform: function `%s'"),
entry_p->name);
@@ -1755,7 +1748,7 @@ handle_function (op, stringp)
*stringp = end;
/* Get some memory to store the arg pointers. */
argvp = argv = (char **) alloca (sizeof (char *) * (nargs + 2));
argvp = argv = (char **) alloca (sizeof(char *) * (nargs + 2));
/* Chop the string into arguments, then a nul. As soon as we hit
MAXIMUM_ARGS (if it's >0) assume the rest of the string is part of the
@@ -1776,7 +1769,9 @@ handle_function (op, stringp)
end = beg + len;
}
for (p=beg, nargs=0; p <= end; ++argvp)
p = beg;
nargs = 0;
for (p=beg, nargs=0; p < end; ++argvp)
{
char *next;
@@ -1829,38 +1824,60 @@ func_call (o, argv, funcname)
int i;
const struct function_table_entry *entry_p;
fname = expand_argument (argv[0], NULL);
/* There is no way to define a variable with a space in the name, so strip
leading and trailing whitespace as a favor to the user. */
fname = argv[0];
while (*fname != '\0' && isspace ((unsigned char)*fname))
++fname;
cp = fname;
while (*cp != '\0' && isspace ((unsigned char)*cp))
++cp;
argv[0] = cp;
cp = fname + strlen (fname) - 1;
while (cp > fname && isspace ((unsigned char)*cp))
cp += strlen(cp) - 1;
while (cp > argv[0] && isspace ((unsigned char)*cp))
--cp;
cp[1] = '\0';
/* Calling nothing is a no-op */
if (*fname == '\0')
return o;
if (*argv[0] == '\0')
{
free (fname);
return o;
}
/* Are we invoking a builtin function? */
entry_p = lookup_function (function_table, fname);
entry_p = lookup_function (function_table, argv[0]);
if (entry_p)
{
char **av;
free (fname);
/* How many arguments do we have? */
for (i=0; argv[i+1]; ++i)
;
return expand_builtin_function (o, i, argv+1, entry_p);
/* If we need to expand arguments, do it now. */
if (entry_p->expand_args)
for (av=argv+1; *av; ++av)
*av = expand_argument (*av, NULL);
o = expand_builtin_function (o, i, argv+1, entry_p);
/* What we expanded we must free... */
if (entry_p->expand_args)
for (av=argv+1; *av; ++av)
free (*av);
return o;
}
/* Not a builtin, so the first argument is the name of a variable to be
expanded and interpreted as a function. Create the variable
reference. */
flen = strlen (fname);
flen = strlen (argv[0]);
body = alloca (flen + 4);
body[0] = '$';
@@ -1888,5 +1905,6 @@ func_call (o, argv, funcname)
pop_variable_scope ();
return o + strlen (o);
free (fname);
return o + strlen(o);
}

View File

@@ -563,8 +563,7 @@ _nl_explode_name (name, language, modifier, territory, codeset,
if (*codeset != cp && (*codeset)[0] != '\0')
{
*normalized_codeset = _nl_normalize_codeset ((const unsigned
char *)*codeset,
*normalized_codeset = _nl_normalize_codeset (*codeset,
cp - *codeset);
if (strcmp (*codeset, *normalized_codeset) == 0)
free ((char *) *normalized_codeset);
@@ -1221,13 +1220,13 @@ read_alias_file (fname, fname_len)
unsigned char *value;
unsigned char *cp;
if (fgets ((char *)buf, sizeof buf, fp) == NULL)
if (fgets (buf, sizeof buf, fp) == NULL)
/* EOF reached. */
break;
/* Possibly not the whole line fits into the buffer. Ignore
the rest of the line. */
if (strchr ((char *)buf, '\n') == NULL)
if (strchr (buf, '\n') == NULL)
{
char altbuf[BUFSIZ];
do
@@ -1280,8 +1279,8 @@ read_alias_file (fname, fname_len)
if (nmap >= maxmap)
extend_alias_table ();
alias_len = strlen ((char *)alias) + 1;
value_len = strlen ((char *)value) + 1;
alias_len = strlen (alias) + 1;
value_len = strlen (value) + 1;
if (string_space_act + alias_len + value_len > string_space_max)
{
@@ -1751,6 +1750,41 @@ static const char *guess_category_value PARAMS ((int category,
const char *categoryname))
internal_function;
/* For those loosing systems which don't have `alloca' we have to add
some additional code emulating it. */
#ifdef HAVE_ALLOCA
/* Nothing has to be done. */
# define ADD_BLOCK(list, address) /* nothing */
# define FREE_BLOCKS(list) /* nothing */
#else
struct block_list
{
void *address;
struct block_list *next;
};
# define ADD_BLOCK(list, addr) \
do { \
struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
/* If we cannot get a free block we cannot add the new element to \
the list. */ \
if (newp != NULL) { \
newp->address = (addr); \
newp->next = (list); \
(list) = newp; \
} \
} while (0)
# define FREE_BLOCKS(list) \
do { \
while (list != NULL) { \
struct block_list *old = list; \
list = list->next; \
free (old); \
} \
} while (0)
# undef alloca
# define alloca(size) (malloc (size))
#endif /* have alloca */
/* Names for the libintl functions are a problem. They must not clash
with existing names and they should follow ANSI C. But this source
code is also used in GNU C Library where the names have a __

View File

@@ -17,8 +17,16 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _GETTEXT_H
#define _GETTEXT_H 1
/* Because on some systems (e.g. Solaris) we sometimes have to include
the systems libintl.h as well as this file we have more complex
include protection above. But the systems header might perhaps also
define _LIBINTL_H and therefore we have to protect the definition here. */
#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H
#ifndef _LIBINTL_H
# define _LIBINTL_H 1
#endif
#define _LIBGETTEXT_H 1
/* We define an additional symbol to signal that we use the GNU
implementation of gettext. */
@@ -72,6 +80,10 @@ extern const struct _msg_ent _msg_tbl[];
extern int _msg_tbl_length;
#endif
/* For automatical extraction of messages sometimes no real
translation is needed. Instead the string itself is the result. */
#define gettext_noop(Str) (Str)
/* Look up MSGID in the current default message catalog for the current
LC_MESSAGES locale. If not found, returns MSGID itself (the default
text). */
@@ -160,6 +172,6 @@ extern int _nl_msg_cat_cntr;
}
#endif
#endif /* _GETTEXT_H */
#endif
/* End of libgettext.h */

3463
i18n/de.po

File diff suppressed because it is too large Load Diff

1709
i18n/ja.po

File diff suppressed because it is too large Load Diff

2173
i18n/nl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/* Implicit rule searching for GNU Make.
Copyright (C) 1988,89,90,91,92,93,94,97,2000 Free Software Foundation, Inc.
Copyright (C) 1988,89,90,91,92,93,94,97 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify
@@ -37,6 +37,7 @@ try_implicit_rule (file, depth)
struct file *file;
unsigned int depth;
{
int ret = 0;
DBF (DB_IMPLICIT, _("Looking for an implicit rule for `%s'.\n"));
/* The order of these searches was previously reversed. My logic now is
@@ -45,21 +46,24 @@ try_implicit_rule (file, depth)
should come first. */
if (pattern_search (file, 0, depth, 0))
return 1;
ret = 1;
#ifndef NO_ARCHIVES
/* If this is an archive member reference, use just the
archive member name to search for implicit rules. */
if (ar_name (file->name))
else if (ar_name (file->name))
{
DBF (DB_IMPLICIT,
_("Looking for archive-member implicit rule for `%s'.\n"));
if (pattern_search (file, 1, depth, 0))
return 1;
{
ret = 1;
}
}
#endif
return 0;
file->tried_implicit = 1;
return ret;
}
@@ -117,7 +121,6 @@ pattern_search (file, archive, depth, recursions)
/* The start and length of the stem of FILENAME for the current rule. */
register char *stem = 0;
register unsigned int stemlen = 0;
register unsigned int fullstemlen = 0;
/* Buffer in which we store all the rules that are possibly applicable. */
struct rule **tryrules
@@ -543,6 +546,7 @@ pattern_search (file, archive, depth, recursions)
dep->name = 0;
dep->file->tried_implicit |= dep->changed;
}
num_intermediates++;
}
dep = (struct dep *) xmalloc (sizeof (struct dep));
@@ -582,23 +586,18 @@ pattern_search (file, archive, depth, recursions)
}
if (!checked_lastslash[foundrule])
{
/* Always allocate new storage, since STEM might be
on the stack for an intermediate file. */
file->stem = savestring (stem, stemlen);
fullstemlen = stemlen;
}
/* Always allocate new storage, since STEM might be
on the stack for an intermediate file. */
file->stem = savestring (stem, stemlen);
else
{
int dirlen = (lastslash + 1) - filename;
/* We want to prepend the directory from
the original FILENAME onto the stem. */
fullstemlen = dirlen + stemlen;
file->stem = (char *) xmalloc (fullstemlen + 1);
bcopy (filename, file->stem, dirlen);
bcopy (stem, file->stem + dirlen, stemlen);
file->stem[fullstemlen] = '\0';
file->stem = (char *) xmalloc (((lastslash + 1) - filename)
+ stemlen + 1);
bcopy (filename, file->stem, (lastslash + 1) - filename);
bcopy (stem, file->stem + ((lastslash + 1) - filename), stemlen);
file->stem[((lastslash + 1) - filename) + stemlen] = '\0';
}
file->cmds = rule->cmds;
@@ -611,12 +610,12 @@ pattern_search (file, archive, depth, recursions)
if (i != matches[foundrule])
{
struct dep *new = (struct dep *) xmalloc (sizeof (struct dep));
new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1);
new->name = p = (char *) xmalloc (rule->lens[i] + stemlen + 1);
bcopy (rule->targets[i], p,
rule->suffixes[i] - rule->targets[i] - 1);
p += rule->suffixes[i] - rule->targets[i] - 1;
bcopy (file->stem, p, fullstemlen);
p += fullstemlen;
bcopy (stem, p, stemlen);
p += stemlen;
bcopy (rule->suffixes[i], p,
rule->lens[i] - (rule->suffixes[i] - rule->targets[i]) + 1);
new->file = enter_file (new->name);

125
job.c
View File

@@ -17,10 +17,9 @@ along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "make.h"
#include <assert.h>
#include "make.h"
#include "job.h"
#include "debug.h"
#include "filedef.h"
@@ -75,6 +74,7 @@ static int amiga_batch_file;
#endif /* Amiga. */
#ifdef VMS
# include <time.h>
# ifndef __GNUC__
# include <processes.h>
# endif
@@ -295,10 +295,10 @@ vms_redirect (desc, fname, ibuf)
extern char *vmsify ();
ibuf++;
while (isspace ((unsigned char)*ibuf))
while (isspace (*ibuf))
ibuf++;
fptr = ibuf;
while (*ibuf && !isspace ((unsigned char)*ibuf))
while (*ibuf && !isspace (*ibuf))
ibuf++;
*ibuf = 0;
if (strcmp (fptr, "/dev/null") != 0)
@@ -665,7 +665,7 @@ reap_children (block, err)
delete non-precious targets, and abort. */
static int delete_on_error = -1;
child_error (c->file->name, exit_code, exit_sig, coredump, 0);
c->file->update_status = 2;
c->file->update_status = 1;
if (delete_on_error == -1)
{
struct file *f = lookup_file (".DELETE_ON_ERROR");
@@ -693,7 +693,7 @@ reap_children (block, err)
Since there are more commands that wanted to be run,
the target was not completely remade. So we treat
this as if a command had failed. */
c->file->update_status = 2;
c->file->update_status = 1;
}
else
{
@@ -890,7 +890,7 @@ start_job_command (child)
flags |= COMMANDS_RECURSE;
else if (*p == '-')
child->noerror = 1;
else if (!isblank ((unsigned char)*p))
else if (!isblank (*p))
break;
++p;
}
@@ -898,6 +898,20 @@ start_job_command (child)
/* Update the file's command flags with any new ones we found. */
child->file->cmds->lines_flags[child->command_line - 1] |= flags;
/* If -q was given, just say that updating `failed'. The exit status of
1 tells the user that -q is saying `something to do'; the exit status
for a random error is 2. */
if (question_flag && !(flags & COMMANDS_RECURSE))
{
child->file->update_status = 1;
notice_finished_file (child->file);
return;
}
/* There may be some preceding whitespace left if there
was nothing but a backslash on the first line. */
p = next_token (p);
/* Figure out an argument list from this command line. */
{
@@ -916,31 +930,13 @@ start_job_command (child)
}
}
/* If -q was given, say that updating `failed' if there was any text on the
command line, or `succeeded' otherwise. The exit status of 1 tells the
user that -q is saying `something to do'; the exit status for a random
error is 2. */
if (argv != 0 && question_flag && !(flags & COMMANDS_RECURSE))
{
#ifndef VMS
free (argv[0]);
free ((char *) argv);
#endif
child->file->update_status = 1;
notice_finished_file (child->file);
return;
}
if (touch_flag && !(flags & COMMANDS_RECURSE))
{
/* Go on to the next command. It might be the recursive one.
We construct ARGV only to find the end of the command line. */
#ifndef VMS
if (argv)
{
free (argv[0]);
free ((char *) argv);
}
free (argv[0]);
free ((char *) argv);
#endif
argv = 0;
}
@@ -972,20 +968,8 @@ start_job_command (child)
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
? "%s" : (char *) 0, p);
/* Tell update_goal_chain that a command has been started on behalf of
this target. It is important that this happens here and not in
reap_children (where we used to do it), because reap_children might be
reaping children from a different target. We want this increment to
guaranteedly indicate that a command was started for the dependency
chain (i.e., update_file recursion chain) we are processing. */
++commands_started;
/* Optimize an empty command. People use this for timestamp rules,
so avoid forking a useless shell. Do this after we increment
commands_started so make still treats this special case as if it
performed some action (makes a difference as to what messages are
printed, etc. */
so avoid forking a useless shell. */
#if !defined(VMS) && !defined(_AMIGA)
if (
@@ -1005,6 +989,15 @@ start_job_command (child)
}
#endif /* !VMS && !_AMIGA */
/* Tell update_goal_chain that a command has been started on behalf of
this target. It is important that this happens here and not in
reap_children (where we used to do it), because reap_children might be
reaping children from a different target. We want this increment to
guaranteedly indicate that a command was started for the dependency
chain (i.e., update_file recursion chain) we are processing. */
++commands_started;
/* If -n was given, recurse to get the next line in the sequence. */
if (just_print_flag && !(flags & COMMANDS_RECURSE))
@@ -1257,7 +1250,7 @@ start_job_command (child)
return;
error:
child->file->update_status = 2;
child->file->update_status = 1;
notice_finished_file (child->file);
return;
}
@@ -1418,8 +1411,7 @@ new_job (file)
/* Discard any preceding whitespace that has
already been written to the output. */
while (out > ref
&& isblank ((unsigned char)out[-1]))
while (out > ref && isblank (out[-1]))
--out;
/* Replace it all with a single space. */
@@ -1803,7 +1795,7 @@ child_execute_job (argv, child)
int status;
char *cmd = alloca (strlen (argv) + 512), *p, *q;
char ifile[256], ofile[256], efile[256];
char *comname = 0;
char comname[50];
char procname[100];
/* Parse IO redirection. */
@@ -1814,7 +1806,7 @@ child_execute_job (argv, child)
DB (DB_JOBS, ("child_execute_job (%s)\n", argv));
while (isspace ((unsigned char)*argv))
while (isspace (*argv))
argv++;
if (*argv == 0)
@@ -1839,9 +1831,9 @@ child_execute_job (argv, child)
p++;
if (*p == '\n')
p++;
if (isspace ((unsigned char)*p))
if (isspace (*p))
{
do { p++; } while (isspace ((unsigned char)*p));
do { p++; } while (isspace (*p));
p--;
}
*q = *p;
@@ -1952,6 +1944,8 @@ child_execute_job (argv, child)
is desired. Forcing commands with newlines into DCLs allows to
store search lists on user mode logicals. */
comname[0] = '\0';
if (strlen (cmd) > MAXCMDLEN
|| (have_redirection != 0)
|| (have_newline != 0))
@@ -1968,9 +1962,12 @@ child_execute_job (argv, child)
return 0;
}
outfile = open_tmpfile (&comname, "sys$scratch:CMDXXXXXX.COM");
strcpy (comname, "sys$scratch:CMDXXXXXX.COM");
(void) mktemp (comname);
outfile = fopen (comname, "w");
if (outfile == 0)
pfatal_with_name (_("fopen (temporary file)"));
pfatal_with_name (comname);
if (ifile[0])
{
@@ -2001,11 +1998,11 @@ child_execute_job (argv, child)
case '\n':
/* At a newline, skip any whitespace around a leading $
from the command and issue exactly one $ into the DCL. */
while (isspace ((unsigned char)*p))
while (isspace (*p))
p++;
if (*p == '$')
p++;
while (isspace ((unsigned char)*p))
while (isspace (*p))
p++;
fwrite (p, 1, q - p, outfile);
fputc ('$', outfile);
@@ -2153,7 +2150,7 @@ child_execute_job (argv, child)
fflush (stdout);
}
if (comname && !ISDB (DB_JOBS))
if (comname[0] && !ISDB (DB_JOBS))
unlink (comname);
return (status & 1);
@@ -2405,9 +2402,9 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
"copy", "ctty", "date", "del", "dir", "echo",
"erase", "exit", "for", "goto", "if", "if", "md",
"mkdir", "path", "pause", "prompt", "rd", "rem",
"ren", "rename", "rmdir", "set", "shift", "time",
"type", "ver", "verify", "vol", ":", 0 };
"mkdir", "path", "pause", "prompt", "rem", "ren",
"rename", "set", "shift", "time", "type",
"ver", "verify", "vol", ":", 0 };
static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^";
static char *sh_cmds_sh[] = { "cd", "eval", "exec", "exit", "login",
"logout", "set", "umask", "wait", "while", "for",
@@ -2452,7 +2449,7 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
*restp = NULL;
/* Make sure not to bother processing an empty line. */
while (isblank ((unsigned char)*line))
while (isblank (*line))
++line;
if (*line == '\0')
return 0;
@@ -2468,10 +2465,10 @@ construct_command_argv_internal (line, restp, shell, ifs, batch_filename_ptr)
slow_flag = strcmp((s1 ? s1 : ""), (s2 ? s2 : ""));
if (s1)
free (s1);
if (s2)
free (s2);
if (s1);
free(s1);
if (s2);
free(s2);
}
if (slow_flag)
goto slow;
@@ -2970,12 +2967,12 @@ construct_command_argv (line, restp, file, batch_filename_ptr)
for (;;)
{
while ((*cptr != 0)
&& (isspace ((unsigned char)*cptr)))
&& (isspace (*cptr)))
cptr++;
if (*cptr == 0)
break;
while ((*cptr != 0)
&& (!isspace((unsigned char)*cptr)))
&& (!isspace(*cptr)))
cptr++;
argc++;
}
@@ -2989,14 +2986,14 @@ construct_command_argv (line, restp, file, batch_filename_ptr)
for (;;)
{
while ((*cptr != 0)
&& (isspace ((unsigned char)*cptr)))
&& (isspace (*cptr)))
cptr++;
if (*cptr == 0)
break;
DB (DB_JOBS, ("argv[%d] = [%s]\n", argc, cptr));
argv[argc++] = cptr;
while ((*cptr != 0)
&& (!isspace((unsigned char)*cptr)))
&& (!isspace(*cptr)))
cptr++;
if (*cptr != 0)
*cptr++ = 0;

183
main.c
View File

@@ -68,6 +68,7 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn));
# endif
extern double atof ();
#endif
extern char *mktemp ();
static void print_data_base PARAMS ((void));
static void print_version PARAMS ((void));
@@ -727,51 +728,6 @@ msdos_return_to_initial_directory ()
}
#endif
extern char *mktemp ();
extern int mkstemp ();
FILE *
open_tmpfile(name, template)
char **name;
const char *template;
{
int fd;
#if defined HAVE_MKSTEMP || defined HAVE_MKTEMP
# define TEMPLATE_LEN strlen (template)
#else
# define TEMPLATE_LEN L_tmpnam
#endif
*name = xmalloc (TEMPLATE_LEN + 1);
strcpy (*name, template);
#if defined HAVE_MKSTEMP && defined HAVE_FDOPEN
/* It's safest to use mkstemp(), if we can. */
fd = mkstemp (*name);
if (fd == -1)
return 0;
return fdopen (fd, "w");
#else
# ifdef HAVE_MKTEMP
(void) mktemp (*name);
# else
(void) tmpnam (*name);
# endif
# ifdef HAVE_FDOPEN
/* Can't use mkstemp(), but guard against a race condition. */
fd = open (*name, O_CREAT|O_EXCL|O_WRONLY, 0600);
if (fd == -1)
return 0;
return fdopen (fd, "w");
# else
/* Not secure, but what can we do? */
return fopen (*name, "w");
# endif
#endif
}
#ifndef _AMIGA
int
main (argc, argv, envp)
@@ -853,13 +809,6 @@ int main (int argc, char ** argv)
FATAL_SIG (SIGINT);
FATAL_SIG (SIGTERM);
#ifdef __MSDOS__
/* Windows 9X delivers FP exceptions in child programs to their
parent! We don't want Make to die when a child divides by zero,
so we work around that lossage by catching SIGFPE. */
FATAL_SIG (SIGFPE);
#endif
#ifdef SIGDANGER
FATAL_SIG (SIGDANGER);
#endif
@@ -1202,7 +1151,7 @@ int main (int argc, char ** argv)
/* Figure out the level of recursion. */
{
struct variable *v = lookup_variable ("MAKELEVEL", 9);
if (v != 0 && v->value[0] != '\0' && v->value[0] != '-')
if (v != 0 && *v->value != '\0' && *v->value != '-')
makelevel = (unsigned int) atoi (v->value);
else
makelevel = 0;
@@ -1262,47 +1211,25 @@ int main (int argc, char ** argv)
and thus re-read the makefiles, we read standard input
into a temporary file and read from that. */
FILE *outfile;
char *template, *tmpdir;
/* Make a unique filename. */
#ifdef HAVE_MKTEMP
#ifdef VMS
static char name[] = "sys$scratch:GmXXXXXX";
#else
static char name[] = "/tmp/GmXXXXXX";
#endif
(void) mktemp (name);
#else
static char name[L_tmpnam];
(void) tmpnam (name);
#endif
if (stdin_nm)
fatal (NILF, _("Makefile from standard input specified twice."));
#ifdef VMS
# define DEFAULT_TMPDIR "sys$scratch:"
#else
# ifdef P_tmpdir
# define DEFAULT_TMPDIR P_tmpdir
# else
# define DEFAULT_TMPDIR "/tmp"
# endif
#endif
#define DEFAULT_TMPFILE "GmXXXXXX"
if (((tmpdir = getenv ("TMPDIR")) == NULL || *tmpdir == '\0')
#if defined __MSDOS__ || defined(WINDOWS32)
/* These are also used commonly on these platforms. */
&& ((tmpdir = getenv ("TEMP")) == NULL || *tmpdir == '\0')
&& ((tmpdir = getenv ("TMP")) == NULL || *tmpdir == '\0')
#endif
)
tmpdir = DEFAULT_TMPDIR;
template = (char *) alloca (strlen (tmpdir)
+ sizeof (DEFAULT_TMPFILE) + 1);
strcpy (template, tmpdir);
#if defined __MSDOS__ || defined(WINDOWS32)
if (strchr ("/\\", template[strlen (template) - 1]) == NULL)
strcat (template, "/");
#else
#ifndef VMS
if (template[strlen (template) - 1] != '/')
strcat (template, "/");
#endif /* !VMS */
#endif /* __MSDOS__ || WINDOWS32 */
strcat (template, DEFAULT_TMPFILE);
outfile = open_tmpfile (&stdin_nm, template);
outfile = fopen (name, "w");
if (outfile == 0)
pfatal_with_name (_("fopen (temporary file)"));
while (!feof (stdin))
@@ -1316,11 +1243,17 @@ int main (int argc, char ** argv)
/* Replace the name that read_all_makefiles will
see with the name of the temporary file. */
makefiles->list[i] = xstrdup (stdin_nm);
{
char *temp;
/* SGI compiler requires alloca's result be assigned simply. */
temp = (char *) alloca (sizeof (name));
bcopy (name, temp, sizeof (name));
makefiles->list[i] = temp;
}
/* Make sure the temporary file will not be remade. */
stdin_nm = savestring (name, sizeof (name) -1);
f = enter_file (stdin_nm);
f->updated = 1;
f->update_status = 0;
f->command_state = cs_finished;
/* Can't be intermediate, or it'll be removed too early for
@@ -1575,7 +1508,7 @@ int main (int argc, char ** argv)
build_vpath_lists ();
/* Mark files given with -o flags as very old
/* Mark files given with -o flags as very old (00:00:01.00 Jan 1, 1970)
and as having been updated already, and files given with -W flags as
brand new (time-stamp as far as possible into the future). */
@@ -1583,8 +1516,7 @@ int main (int argc, char ** argv)
for (p = old_files->list; *p != 0; ++p)
{
f = enter_command_line_file (*p);
f->last_mtime = f->mtime_before_update = OLD_MTIME;
f->updated = 1;
f->last_mtime = f->mtime_before_update = (FILE_TIMESTAMP) 1;
f->update_status = 0;
f->command_state = cs_finished;
}
@@ -1672,17 +1604,11 @@ int main (int argc, char ** argv)
switch (update_goal_chain (read_makefiles, 1))
{
case 1:
default:
#define BOGUS_UPDATE_STATUS 0
assert (BOGUS_UPDATE_STATUS);
break;
case -1:
/* Did nothing. */
break;
case 2:
case 1:
/* Failed to update. Figure out if we care. */
{
/* Nonzero if any makefile was successfully remade. */
@@ -1699,7 +1625,7 @@ int main (int argc, char ** argv)
again to print an error. */
d->file->considered = 0;
if (d->file->updated)
if (d->file->command_state == cs_finished)
{
/* This makefile was updated. */
if (d->file->update_status == 0)
@@ -1716,7 +1642,7 @@ int main (int argc, char ** argv)
error (NILF, _("Failed to remake makefile `%s'."),
d->file->name);
mtime = file_mtime_no_search (d->file);
any_remade |= (mtime != NONEXISTENT_MTIME
any_remade |= (mtime != (FILE_TIMESTAMP) -1
&& mtime != makefile_mtimes[i]);
}
}
@@ -1902,18 +1828,19 @@ int main (int argc, char ** argv)
{
case -1:
/* Nothing happened. */
/* FALL THRU */
case 0:
/* Updated successfully. */
status = EXIT_SUCCESS;
break;
case 2:
/* Updating failed. POSIX.2 specifies exit status >1 for this;
but in VMS, there is only success and failure. */
status = EXIT_FAILURE ? 2 : EXIT_FAILURE;
break;
case 1:
if (question_flag)
/* We are under -q and would run some commands. */
status = EXIT_FAILURE;
status = EXIT_FAILURE;
else
/* Updating failed. POSIX.2 specifies exit status >1 for this;
but in VMS, there is only success and failure. */
status = EXIT_FAILURE ? 2 : EXIT_FAILURE;
break;
default:
abort ();
@@ -2256,16 +2183,9 @@ decode_switches (argc, argv, env)
break;
case positive_int:
/* See if we have an option argument; if we do require that
it's all digits, not something like "10foo". */
if (optarg == 0 && argc > optind)
{
const char *cp;
for (cp=argv[optind]; ISDIGIT (cp[0]); ++cp)
;
if (cp[0] == '\0')
optarg = argv[optind++];
}
if (optarg == 0 && argc > optind
&& ISDIGIT (argv[optind][0]))
optarg = argv[optind++];
if (!doit)
break;
@@ -2273,16 +2193,11 @@ decode_switches (argc, argv, env)
if (optarg != 0)
{
int i = atoi (optarg);
const char *cp;
/* Yes, I realize we're repeating this in some cases. */
for (cp = optarg; ISDIGIT (cp[0]); ++cp)
;
if (i < 1 || cp[0] != '\0')
if (i < 1)
{
error (NILF, _("the `-%c' option requires a positive integral argument"),
cs->c);
if (doit)
error (NILF, _("the `-%c' option requires a positive integral argument"),
cs->c);
bad = 1;
}
else
@@ -2374,14 +2289,14 @@ decode_env_switches (envar, len)
{
if (*value == '\\' && value[1] != '\0')
++value; /* Skip the backslash. */
else if (isblank ((unsigned char)*value))
else if (isblank (*value))
{
/* End of the word. */
*p++ = '\0';
argv[++argc] = p;
do
++value;
while (isblank ((unsigned char)*value));
while (isblank (*value));
continue;
}
*p++ = *value++;
@@ -2414,7 +2329,7 @@ quote_for_env (out, in)
{
if (*in == '$')
*out++ = '$';
else if (isblank ((unsigned char)*in) || *in == '\\')
else if (isblank (*in) || *in == '\\')
*out++ = '\\';
*out++ = *in++;
}
@@ -2707,7 +2622,7 @@ print_version ()
printf (_(", by Richard Stallman and Roland McGrath.\n\
%sBuilt for %s\n\
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000\n\
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99\n\
%s\tFree Software Foundation, Inc.\n\
%sThis is free software; see the source for copying conditions.\n\
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
@@ -2761,7 +2676,7 @@ die (status)
print_version ();
/* Wait for children to die. */
for (err = (status != 0); job_slots_used > 0; err = 0)
for (err = status != 0; job_slots_used > 0; err = 0)
reap_children (1, err);
/* Let the remote job module clean up its state. */

49
make.h
View File

@@ -39,33 +39,11 @@ Boston, MA 02111-1307, USA. */
# define PARAMS(protos) ()
#endif /* C++ or ANSI C. */
/* Specify we want GNU source code. This must be defined before any
system headers are included. */
#define _GNU_SOURCE 1
/* Include libintl.h, if it was found: we don't even look for it unless we
want to use the system's gettext(). If not, use the included gettext.h. */
#ifdef HAVE_LIBINTL_H
# include <libintl.h>
# ifdef HAVE_LOCALE_H
# include <locale.h>
# endif
#else
# include "gettext.h"
#endif
#ifndef gettext_noop
/* For automatic extraction of messages sometimes no real translation is
needed. Instead the string itself is the result. */
# define gettext_noop(Str) (Str)
#endif
#include "gettext.h"
#define _(Text) gettext (Text)
#define N_(Text) gettext_noop (Text)
#if !HAVE_SETLOCALE
# define setlocale(Category, Locale) /* empty */
#endif
@@ -82,6 +60,7 @@ Boston, MA 02111-1307, USA. */
# define __NO_STRING_INLINES
#endif
#define _GNU_SOURCE 1
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
@@ -93,18 +72,7 @@ Boston, MA 02111-1307, USA. */
<sys/timeb.h>? If any does not, configure should check for it. */
# include <sys/timeb.h>
#endif
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include <time.h>
#include <errno.h>
#ifndef errno
@@ -307,10 +275,14 @@ extern char *alloca ();
# endif /* HAVE_ALLOCA_H. */
#endif /* GCC. */
#if HAVE_INTTYPES_H
# include <inttypes.h>
#if ST_MTIM_NSEC
# if HAVE_INTTYPES_H
# include <inttypes.h>
# endif
# define FILE_TIMESTAMP uintmax_t
#else
# define FILE_TIMESTAMP time_t
#endif
#define FILE_TIMESTAMP uintmax_t
/* ISDIGIT offers the following features:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
@@ -435,7 +407,6 @@ extern int alpha_compare PARAMS ((const void *, const void *));
extern void print_spaces PARAMS ((unsigned int));
extern char *find_char_unquote PARAMS ((char *, char *, int));
extern char *find_percent PARAMS ((char *));
extern FILE *open_tmpfile PARAMS ((char **, const char *));
#ifndef NO_ARCHIVES
extern int ar_name PARAMS ((char *));

View File

@@ -8,10 +8,10 @@
@c FSF publishers: format makebook.texi instead of using this file directly.
@set RCSID $Id$
@set EDITION 0.55
@set VERSION 3.79
@set UPDATED 04 April 2000
@set UPDATE-MONTH April 2000
@set EDITION 0.54
@set VERSION 3.78.1
@set UPDATED 09 September 1999
@set UPDATE-MONTH September 1999
@comment The ISBN number might need to change on next publication.
@set ISBN 1-882114-80-9 @c CHANGE THIS BEFORE PRINTING AGAIN! --psmith 16jul98
@@ -37,7 +37,7 @@ and issues the commands to recompile them.
This is Edition @value{EDITION}, last updated @value{UPDATED},
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99, 2000
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99
Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
@@ -73,7 +73,7 @@ by the Free Software Foundation.
@author Richard M. Stallman and Roland McGrath
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98, '99, 2000
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97, '98
Free Software Foundation, Inc.
@sp 2
Published by the Free Software Foundation @*
@@ -134,7 +134,7 @@ This manual describes @code{make} and contains the following chapters:@refill
* Missing:: What GNU @code{make} lacks from other @code{make}s.
* Makefile Conventions:: Conventions for makefiles in GNU programs.
* Quick Reference:: A quick reference for experienced users.
* Error Messages:: A list of common errors generated by @code{make}.
* Make Errors:: A list of common errors generated by @code{make}.
* Complex Makefile:: A real example of a straightforward,
but nontrivial, makefile.
* Concept Index:: Index of Concepts
@@ -2396,11 +2396,10 @@ these commands executed on its behalf. @xref{Implicit Rule Search,
The targets which @code{.PRECIOUS} depends on are given the following
special treatment: if @code{make} is killed or interrupted during the
execution of their commands, the target is not deleted.
@xref{Interrupts, ,Interrupting or Killing @code{make}}. Also, if the
target is an intermediate file, it will not be deleted after it is no
longer needed, as is normally done. @xref{Chained Rules, ,Chains of
Implicit Rules}. In this latter respect it overlaps with the
@code{.SECONDARY} special target.
@xref{Interrupts, ,Interrupting or Killing @code{make}}.
Also, if the target is an intermediate file, it will not be deleted
after it is no longer needed, as is normally done.
@xref{Chained Rules, ,Chains of Implicit Rules}.
You can also list the target pattern of an implicit rule (such as
@samp{%.o}) as a prerequisite file of the special target @code{.PRECIOUS}
@@ -2424,9 +2423,8 @@ The targets which @code{.SECONDARY} depends on are treated as
intermediate files, except that they are never automatically deleted.
@xref{Chained Rules, ,Chains of Implicit Rules}.
@code{.SECONDARY} with no prerequisites causes all targets to be treated
as secondary (i.e., no target is removed because it is considered
intermediate).
@code{.SECONDARY} with no prerequisites marks all file targets mentioned
in the makefile as secondary.
@findex .DELETE_ON_ERROR
@item .DELETE_ON_ERROR
@@ -2481,7 +2479,7 @@ Sub-@code{make}}.
If @code{.NOTPARALLEL} is mentioned as a target, then this invocation of
@code{make} will be run serially, even if the @samp{-j} option is
given. Any recursively invoked @code{make} command will still be run in
parallel (unless its makefile contains this target). Any prerequisites
parallel if its makefile doesn't contain this target. Any prerequisites
on this target are ignored.
@end table
@@ -5856,7 +5854,8 @@ ending with word @var{e} (inclusive). The legitimate values of @var{s}
and @var{e} start from 1. If @var{s} is bigger than the number of words
in @var{text}, the value is empty. If @var{e} is bigger than the number
of words in @var{text}, words up to the end of @var{text} are returned.
If @var{s} is greater than @var{e}, nothing is returned. For example,
If @var{s} is greater than @var{e}, @code{make} swaps them for you. For
example,
@example
$(wordlist 2, 3, foo bar baz)
@@ -6061,12 +6060,6 @@ If @var{variable} is the name of a builtin function, the builtin function
is always invoked (even if a @code{make} variable by that name also
exists).
The @code{call} function expands the @var{param} arguments before
assigning them to temporary variables. This means that @var{variable}
values containing references to builtin functions that have special
expansion rules, like @code{foreach} or @code{if}, may not work as you
expect.
Some examples may make this clearer.
This macro simply reverses its arguments:
@@ -6074,11 +6067,12 @@ This macro simply reverses its arguments:
@smallexample
reverse = $(2) $(1)
foo = $(call reverse,a,b)
foo = a b
bar = $(call reverse,$(foo))
@end smallexample
@noindent
Here @var{foo} will contain @samp{b a}.
Here @var{bar} will contain @samp{b a}.
This one is slightly more interesting: it defines a macro to search for
the first instance of a program in @code{PATH}:
@@ -6809,6 +6803,8 @@ This is typically used with recursive invocations of @code{make}
@item -d
@cindex @code{-d}
@itemx --debug
@cindex @code{--debug}
@c Extra blank line here makes the table look better.
Print debugging information in addition to normal processing. The
@@ -6816,46 +6812,7 @@ debugging information says which files are being considered for
remaking, which file-times are being compared and with what results,
which files actually need to be remade, which implicit rules are
considered and which are applied---everything interesting about how
@code{make} decides what to do. The @code{-d} option is equivalent to
@samp{--debug=a} (see below).
@item --debug[=@var{options}]
@cindex @code{--debug}
@c Extra blank line here makes the table look better.
Print debugging information in addition to normal processing. Various
levels and types of output can be chosen. With no arguments, print the
``basic'' level of debugging. Possible arguments are below; only the
first character is considered, and values must be comma- or
space-separated.
@table @code
@item a (@i{all})
All types of debugging output are enabled. This is equivalent to using
@samp{-d}.
@item b (@i{basic})
Basic debugging prints each target that was found to be out-of-date, and
whether the build was successful or not.
@item v (@i{verbose})
A level above @samp{basic}; includes messages about which makefiles were
parsed, prerequisites that did not need to be rebuilt, etc. This option
also enables @samp{basic} messages.
@item i (@i{implicit})
Prints messages describing the implicit rule searches for each target.
This option also enables @samp{basic} messages.
@item j (@i{jobs})
Prints messages giving details on the invocation of specific subcommands.
@item m (@i{makefile})
By default, the above messages are not enabled while trying to remake
the makefiles. This option enables messages while rebuilding makefiles,
too. Note that the @samp{all} option does enable this option. This
option also enables @samp{basic} messages.
@end table
@code{make} decides what to do.
@item -e
@cindex @code{-e}
@@ -6900,7 +6857,7 @@ searched in the order specified.
@item -j [@var{jobs}]
@cindex @code{-j}
@itemx --jobs[=@var{jobs}]
@itemx --jobs=[@var{jobs}]
@cindex @code{--jobs}
Specifies the number of jobs (commands) to run simultaneously. With no
argument, @code{make} runs as many jobs simultaneously as possible. If
@@ -6958,16 +6915,12 @@ Some Files}.@refill
@cindex @code{-p}
@itemx --print-data-base
@cindex @code{--print-data-base}
@cindex data base of @code{make} rules
@cindex predefined rules and variables, printing
Print the data base (rules and variable values) that results from
reading the makefiles; then execute as usual or as otherwise specified.
This also prints the version information given by the @samp{-v} switch
(see below). To print the data base without trying to remake any files,
use @w{@samp{make -qp}}. To print the data base of predefined rules and
variables, use @w{@samp{make -p -f /dev/null}}. The data base output
contains filename and linenumber information for command and variable
definitions, so it can be a useful debugging tool in complex environments.
variables, use @w{@samp{make -p -f /dev/null}}.
@item -q
@cindex @code{-q}
@@ -9154,7 +9107,7 @@ special treatment.
@comment included by standards.texi.
@include make-stds.texi
@node Quick Reference, Error Messages, Makefile Conventions, Top
@node Quick Reference, Make Errors, Makefile Conventions, Top
@appendix Quick Reference
This appendix summarizes the directives, text manipulation functions,
@@ -9449,11 +9402,6 @@ The flags given to @code{make}. You can set this in the environment or
a makefile to set flags.@*
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
It is @emph{never} appropriate to use @code{MAKEFLAGS} directly on a
command line: its contents may not be quoted correctly for use in the
shell. Always allow recursive @code{make}'s to obtain these values
through the environment from its parent.
@item MAKECMDGOALS
The targets given to @code{make} on the command line. Setting this
@@ -9477,11 +9425,11 @@ order.@*
@xref{Libraries/Search, ,Directory Search for Link Libraries}.
@end table
@node Error Messages, Complex Makefile, Quick Reference, Top
@node Make Errors, Complex Makefile, Quick Reference, Top
@comment node-name, next, previous, up
@appendix Errors Generated by Make
Here is a list of the more common errors you might see generated by
Here is a list of the most common errors you might see generated by
@code{make}, and some information about what they mean and how to fix
them.
@@ -9627,7 +9575,7 @@ sequential manner.
@end table
@node Complex Makefile, Concept Index, Error Messages, Top
@node Complex Makefile, Concept Index, Make Errors, Top
@appendix Complex Makefile Example
Here is the makefile for the GNU @code{tar} program. This is a

10
misc.c
View File

@@ -49,7 +49,6 @@ Boston, MA 02111-1307, USA. */
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
# define VA_START(args, lastarg)
# define VA_PRINTF(fp, lastarg, args) fprintf((fp), (lastarg), va_alist)
# define VA_END(args)
#endif
@@ -121,7 +120,7 @@ collapse_continuations (line)
if (backslash)
{
in = next_token (in);
while (out > line && isblank ((unsigned char)out[-1]))
while (out > line && isblank (out[-1]))
--out;
*out++ = ' ';
}
@@ -479,7 +478,7 @@ char *
end_of_token (s)
char *s;
{
while (*s != '\0' && !isblank ((unsigned char)*s))
while (*s != '\0' && !isblank (*s))
++s;
return s;
}
@@ -496,8 +495,7 @@ end_of_token_w32 (s, stopchar)
register char *p = s;
register int backslash = 0;
while (*p != '\0' && *p != stopchar
&& (backslash || !isblank ((unsigned char)*p)))
while (*p != '\0' && *p != stopchar && (backslash || !isblank (*p)))
{
if (*p++ == '\\')
{
@@ -524,7 +522,7 @@ next_token (s)
{
register char *p = s;
while (isblank ((unsigned char)*p))
while (isblank (*p))
++p;
return p;
}

69
read.c
View File

@@ -287,12 +287,13 @@ read_makefile (filename, flags)
unsigned int commands_len = 200;
char *commands;
unsigned int commands_idx = 0;
unsigned int cmds_started, tgts_started;
unsigned int cmds_started;
char *p;
char *p2;
int len, reading_target;
int ignoring = 0, in_ignored_define = 0;
int no_targets = 0; /* Set when reading a rule without targets. */
int using_filename = 0;
struct floc fileinfo;
char *passed_filename = filename;
@@ -312,12 +313,10 @@ read_makefile (filename, flags)
{ \
if (filenames != 0) \
{ \
struct floc fi; \
fi.filenm = fileinfo.filenm; \
fi.lineno = tgts_started; \
record_files (filenames, pattern, pattern_percent, deps, \
cmds_started, commands, commands_idx, two_colon, \
&fi, !(flags & RM_NO_DEFAULT_GOAL)); \
&fileinfo, !(flags & RM_NO_DEFAULT_GOAL)); \
using_filename |= commands_idx > 0; \
} \
filenames = 0; \
commands_idx = 0; \
@@ -328,7 +327,7 @@ read_makefile (filename, flags)
fileinfo.lineno = 1;
pattern_percent = 0;
cmds_started = tgts_started = fileinfo.lineno;
cmds_started = fileinfo.lineno;
if (ISDB (DB_VERBOSE))
{
@@ -548,7 +547,7 @@ read_makefile (filename, flags)
removed), so it could be a complex variable/function
reference that might contain blanks. */
p = strchr (p2, '\0');
while (isblank ((unsigned char)p[-1]))
while (isblank (p[-1]))
--p;
do_define (p2, p - p2, o_file, infile, &fileinfo);
}
@@ -560,8 +559,7 @@ read_makefile (filename, flags)
p2 = next_token (p + 8);
if (*p2 == '\0')
error (&fileinfo, _("empty `override' directive"));
if (strneq (p2, "define", 6)
&& (isblank ((unsigned char)p2[6]) || p2[6] == '\0'))
if (strneq (p2, "define", 6) && (isblank (p2[6]) || p2[6] == '\0'))
{
if (ignoring)
in_ignored_define = 1;
@@ -576,7 +574,7 @@ read_makefile (filename, flags)
removed), so it could be a complex variable/function
reference that might contain blanks. */
p = strchr (p2, '\0');
while (isblank ((unsigned char)p[-1]))
while (isblank (p[-1]))
--p;
do_define (p2, p - p2, o_override, infile, &fileinfo);
}
@@ -701,12 +699,11 @@ read_makefile (filename, flags)
r = read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
| (noerror ? RM_DONTCARE : 0)));
if (!r)
{
if (!noerror)
error (&fileinfo, "%s: %s", name, strerror (errno));
free (name);
}
if (!r && !noerror)
error (&fileinfo, "%s: %s", name, strerror (errno));
if (r < 2)
free (name);
}
/* Free any space allocated by conditional_line. */
@@ -726,7 +723,7 @@ read_makefile (filename, flags)
else if (lb.buffer[0] == '\t')
{
p = collapsed; /* Ignore comments. */
while (isblank ((unsigned char)*p))
while (isblank (*p))
++p;
if (*p == '\0')
/* The line is completely blank; that is harmless. */
@@ -751,14 +748,13 @@ read_makefile (filename, flags)
enum make_word_type wtype;
enum variable_origin v_origin;
char *cmdleft, *semip, *lb_next;
char *cmdleft, *lb_next;
unsigned int len, plen = 0;
char *colonp;
/* Record the previous rule. */
record_waiting_files ();
tgts_started = fileinfo.lineno;
/* Search the line for an unquoted ; that is not after an
unquoted #. */
@@ -772,7 +768,6 @@ read_makefile (filename, flags)
else if (cmdleft != 0)
/* Found one. Cut the line short there before expanding it. */
*(cmdleft++) = '\0';
semip = cmdleft;
collapse_continuations (lb.buffer);
@@ -884,7 +879,7 @@ read_makefile (filename, flags)
sizeof (struct nameseq),
1),
sizeof (struct nameseq));
*p2 = ':';
*colonp = ':';
if (!filenames)
{
@@ -933,14 +928,6 @@ read_makefile (filename, flags)
if (wtype == w_varassign)
{
/* If there was a semicolon found, add it back, plus anything
after it. */
if (semip)
{
*(--semip) = ';';
variable_buffer_output (p2 + strlen (p2),
semip, strlen (semip)+1);
}
record_target_var (filenames, p, two_colon, v_origin, &fileinfo);
filenames = 0;
continue;
@@ -1075,7 +1062,7 @@ read_makefile (filename, flags)
reading_file = 0;
return 1;
return 1+using_filename;
}
/* Execute a `define' directive.
@@ -1117,7 +1104,7 @@ do_define (name, namelen, origin, infile, flocp)
p = next_token (lb.buffer);
len = strlen (p);
if ((len == 5 || (len > 5 && isblank ((unsigned char)p[5])))
if ((len == 5 || (len > 5 && isblank (p[5])))
&& strneq (p, "endef", 5))
{
p += 5;
@@ -1309,7 +1296,7 @@ conditional_line (line, flocp)
{
/* Strip blanks after the first string. */
char *p = line++;
while (isblank ((unsigned char)p[-1]))
while (isblank (p[-1]))
--p;
*p = '\0';
}
@@ -1553,7 +1540,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
char *implicit_percent;
nextf = filenames->next;
free (filenames);
free ((char *) filenames);
implicit_percent = find_percent (name);
implicit |= implicit_percent != 0;
@@ -1621,12 +1608,6 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
continue;
o = patsubst_expand (buffer, name, pattern, d->name,
pattern_percent, percent);
/* If the name expanded to the empty string, that's
illegal. */
if (o == buffer)
fatal (flocp,
_("target `%s' leaves prerequisite pattern empty"),
name);
free (d->name);
d->name = savestring (buffer, o - buffer);
}
@@ -1646,8 +1627,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
/* If CMDS == F->CMDS, this target was listed in this rule
more than once. Just give a warning since this is harmless. */
if (cmds != 0 && cmds == f->cmds)
error (flocp,
_("target `%s' given more than once in the same rule."),
error (flocp, _("target `%s' given more than once in the same rule."),
f->name);
/* Check for two single-colon entries both with commands.
@@ -1656,8 +1636,7 @@ record_files (filenames, pattern, pattern_percent, deps, cmds_started,
else if (cmds != 0 && f->cmds != 0 && f->is_target)
{
error (&cmds->fileinfo,
_("warning: overriding commands for target `%s'"),
f->name);
_("warning: overriding commands for target `%s'"), f->name);
error (&f->cmds->fileinfo,
_("warning: ignoring old commands for target `%s'"),
f->name);
@@ -1833,7 +1812,7 @@ find_char_unquote (string, stopchars, blank)
while (1)
{
while (*p != '\0' && strchr (stopchars, *p) == 0
&& (!blank || !isblank ((unsigned char)*p)))
&& (!blank || !isblank (*p)))
++p;
if (*p == '\0')
break;
@@ -2266,7 +2245,7 @@ get_next_mword (buffer, delim, startp, length)
char c;
/* Skip any leading whitespace. */
while (isblank ((unsigned char)*p))
while (isblank(*p))
++p;
beg = p;

510
remake.c
View File

@@ -43,27 +43,39 @@ Boston, MA 02111-1307, USA. */
extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
/* The test for circular dependencies is based on the 'updating' bit in
`struct file'. However, double colon targets have seperate `struct
file's; make sure we always use the base of the double colon chain. */
/* this enum encapsulates the return status of the recursive update
functions. Note: these values are important so that the state of
precursors can be or'ed together */
typedef enum {
ts_done = 0, /* all precursors and target are complete */
ts_incomplete = 1, /* some precursor or target is still running */
ts_failed = 3, /* some precursor or target failed */
ts_sentinal /* make ANSI happy with non trailing , */
} target_state_t;
#define start_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
->updating = 1)
#define finish_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
->updating = 0)
#define is_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
->updating)
/* the test for circular dependencies is based just on the 'updating'
bit in 'struct file'. However double colon targets have seperate
'struct file's. Therefore, we will lose if we don't notice that a
double colon targets are really the same file. Use the 'struct
file' at the base of the double colon chain. */
#define set_updating(file) (((file)->double_colon ? \
(file)->double_colon : (file))->updating = 1)
#define clr_updating(file) (((file)->double_colon ? \
(file)->double_colon : (file))->updating = 0)
#define tst_updating(file) (((file)->double_colon ? \
(file)->double_colon : (file))->updating)
/* Incremented when a command is started (under -n, when one would be). */
unsigned int commands_started = 0;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
static unsigned int considered;
static int update_file PARAMS ((struct file *file, unsigned int depth));
static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
static int check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make_ptr));
static target_state_t update_file PARAMS ((struct file *file, unsigned int depth));
static target_state_t update_file_1 PARAMS ((struct file *file, unsigned int depth));
static target_state_t check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make_ptr));
static int touch_file PARAMS ((struct file *file));
static void remake_file PARAMS ((struct file *file));
static FILE_TIMESTAMP name_mtime PARAMS ((char *name));
@@ -77,6 +89,7 @@ static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
should only make one goal at a time and return as soon as one goal whose
`changed' member is nonzero is successfully made. */
int
update_goal_chain (goals, makefiles)
register struct dep *goals;
@@ -86,8 +99,6 @@ update_goal_chain (goals, makefiles)
unsigned int j = job_slots;
int status = -1;
#define MTIME(file) (makefiles ? file_mtime_no_search (file) \
: file_mtime (file))
/* Duplicate the chain so we can remove things from it. */
@@ -127,103 +138,73 @@ update_goal_chain (goals, makefiles)
{
/* Iterate over all double-colon entries for this file. */
struct file *file;
int stop = 0, any_not_updated = 0;
target_state_t target_state;
for (file = g->file->double_colon ? g->file->double_colon : g->file;
file != NULL;
file = file->prev)
target_state = ts_done;
file = g->file;
check_renamed (file);
if (makefiles)
{
unsigned int ocommands_started;
int x;
check_renamed (file);
if (makefiles)
if (file->cmd_target)
{
if (file->cmd_target)
{
touch_flag = t;
question_flag = q;
just_print_flag = n;
}
else
touch_flag = question_flag = just_print_flag = 0;
touch_flag = t;
question_flag = q;
just_print_flag = n;
}
/* Save the old value of `commands_started' so we can compare
later. It will be incremented when any commands are
actually run. */
ocommands_started = commands_started;
x = update_file (file, makefiles ? 1 : 0);
check_renamed (file);
/* Set the goal's `changed' flag if any commands were started
by calling update_file above. We check this flag below to
decide when to give an "up to date" diagnostic. */
g->changed += commands_started - ocommands_started;
/* If we updated a file and STATUS was not already 1, set it to
1 if updating failed, or to 0 if updating succeeded. Leave
STATUS as it is if no updating was done. */
stop = 0;
if ((x != 0 || file->updated) && status < 1)
{
if (file->update_status != 0)
{
/* Updating failed, or -q triggered. The STATUS value
tells our caller which. */
status = file->update_status;
/* If -q just triggered, stop immediately. It doesn't
matter how much more we run, since we already know
the answer to return. */
stop = (!keep_going_flag && !question_flag
&& !makefiles);
}
else
{
FILE_TIMESTAMP mtime = MTIME (file);
check_renamed (file);
if (file->updated && g->changed &&
mtime != file->mtime_before_update)
{
/* Updating was done. If this is a makefile and
just_print_flag or question_flag is set (meaning
-n or -q was given and this file was specified
as a command-line target), don't change STATUS.
If STATUS is changed, we will get re-exec'd, and
enter an infinite loop. */
if (!makefiles
|| (!just_print_flag && !question_flag))
status = 0;
if (makefiles && file->dontcare)
/* This is a default makefile; stop remaking. */
stop = 1;
}
}
}
/* Keep track if any double-colon entry is not finished.
When they are all finished, the goal is finished. */
any_not_updated |= !file->updated;
if (stop)
break;
else
touch_flag = question_flag = just_print_flag = 0;
}
/* Reset FILE since it is null at the end of the loop. */
file = g->file;
commands_started = 0;
if (stop || !any_not_updated)
target_state = update_file (file, makefiles ? 1 : 0);
check_renamed (file);
/* Set the goal's `changed' flag if any commands were started
by calling update_file above. We check this flag below to
decide when to give an "up to date" diagnostic. */
g->changed |= commands_started ? 1 : 0;
/* process the file according to its return */
switch (target_state)
{
/* If we have found nothing whatever to do for the goal,
print a message saying nothing needs doing. */
case ts_failed:
/* Bail early? */
if (!keep_going_flag && !question_flag && !makefiles)
return 1;
status = 1; /* mark status failed, keep going */
/* -k, Fall Though !!! */
case ts_done:
{
FILE_TIMESTAMP mtime =
(makefiles ? file_mtime_no_search (file) : file_mtime (file));
check_renamed (file);
if (g->changed && mtime != file->mtime_before_update)
{
/* Updating was done. If this is a makefile and
just_print_flag or question_flag is set (meaning
-n or -q was given and this file was specified
as a command-line target), don't change STATUS.
If STATUS is changed, we will get re-exec'd, and
enter an infinite loop. */
if (status < 0)
{
if (!makefiles || (!just_print_flag && !question_flag))
status = 0;
}
}
}
if (!makefiles
/* If the update_status is zero, we updated successfully
or not at all. G->changed will have been set above if
any commands were actually started for this goal. */
&& file->update_status == 0 && !g->changed
&& !file->update_status && !g->changed
/* Never give a message under -s or -q. */
&& !silent_flag && !question_flag)
message (1, ((file->phony || file->cmds == 0)
@@ -231,24 +212,27 @@ update_goal_chain (goals, makefiles)
: _("`%s' is up to date.")),
file->name);
/* This goal is finished. Remove it from the chain. */
case ts_incomplete:
break; /* do nothing */
}
/* advance to next target in goal chain */
if (target_state == ts_incomplete)
{
lastgoal = g;
g = g->next;
}
else
{
if (lastgoal == 0)
goals = g->next;
else
lastgoal->next = g->next;
/* Free the storage. */
free ((char *) g);
free (g);
g = lastgoal == 0 ? goals : lastgoal->next;
if (stop)
break;
}
else
{
lastgoal = g;
g = g->next;
}
}
@@ -268,9 +252,10 @@ update_goal_chain (goals, makefiles)
return status;
}
/* If FILE is not up to date, execute the commands for it.
Return 0 if successful, 1 if unsuccessful;
but with some flag settings, just call `exit' if unsuccessful.
/* If FILE is not up to date, execute the commands for it. Return
ts_done if FILE has completed successfully, ts_incomplete if FILE
or any of its precursors are incomplete, or ts_failed if FILE or
any of its precursors failed.
DEPTH is the depth in recursions of this function.
We increment it during the consideration of our dependencies,
@@ -280,36 +265,32 @@ update_goal_chain (goals, makefiles)
If there are multiple double-colon entries for FILE,
each is considered in turn. */
static int
static target_state_t
update_file (file, depth)
struct file *file;
unsigned int depth;
{
register int status = 0;
register target_state_t status = ts_done;
register struct file *f;
f = file->double_colon ? file->double_colon : file;
/* Prune the dependency graph: if we've already been here on _this_
pass through the dependency graph, we don't have to go any further.
We won't reap_children until we start the next pass, so no state
change is possible below here until then. */
if (f->considered == considered)
{
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
return f->command_state == cs_finished ? f->update_status : 0;
}
/* This loop runs until we start commands for a double colon rule, or until
the chain is exhausted. */
for (; f != 0; f = f->prev)
{
f->considered = considered;
status |= update_file_1 (f, depth);
check_renamed (f);
if (status != 0 && !keep_going_flag)
if (status == ts_failed)
{
if (!keep_going_flag || question_flag)
return ts_failed;
else
break;
}
if (status == ts_incomplete)
break;
if (f->command_state == cs_running
@@ -317,65 +298,88 @@ update_file (file, depth)
{
/* Don't run the other :: rules for this
file until this rule is finished. */
status = 0;
status = ts_incomplete;
break;
}
}
/* Process the remaining rules in the double colon chain so they're marked
considered. Start their prerequisites, too. */
for (; f != 0 ; f = f->prev)
for (f = (f ? f->prev : 0); f != 0 ; f = f->prev)
{
struct dep *d;
f->considered = considered;
for (d = f->deps; d != 0; d = d->next)
status |= update_file (d->file, depth + 1);
if ((status |= update_file (d->file, depth + 1)) == ts_failed)
{
if (!keep_going_flag || question_flag)
return ts_failed;
}
}
return status;
}
/* Consider a single `struct file' and update it as appropriate. */
/* Consider a single `struct file' and update it as appropriate.
static int
Return ts_done if FILE has completed successfully, ts_incomplete if
FILE or any of its precursors are incomplete, or ts_failed if FILE
or any of its precursors failed.
*/
static target_state_t
update_file_1 (file, depth)
struct file *file;
unsigned int depth;
{
register FILE_TIMESTAMP this_mtime;
int noexist, must_make, deps_changed;
int dep_status = 0;
target_state_t dep_status = ts_done;
register struct dep *d, *lastd;
int running = 0;
/* Prune the dependency graph: if we've already been here on _this_
pass through the dependency graph, we don't have to go any further.
We won't reap_children until we start the next pass, so no state
change is possible below here until then. */
if (file->considered == considered)
{
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
if (file->command_state == cs_finished)
{
return file->update_status ? ts_failed : ts_done;
}
return ts_incomplete;
}
file->considered = considered;
DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
if (file->updated)
{
if (file->update_status > 0)
{
DBF (DB_VERBOSE,
_("Recently tried and failed to update file `%s'.\n"));
return file->update_status;
}
DBF (DB_VERBOSE, _("File `%s' was considered already.\n"));
return 0;
}
switch (file->command_state)
{
case cs_not_started:
case cs_deps_running:
break;
case cs_running:
DBF (DB_VERBOSE, _("Still updating file `%s'.\n"));
return 0;
return ts_incomplete;
case cs_finished:
DBF (DB_VERBOSE, _("Finished updating file `%s'.\n"));
return file->update_status;
if (file->update_status != 0)
{
DBF (DB_VERBOSE,
_("Recently tried and failed to update file `%s'.\n"));
return ts_failed;
}
DBF (DB_VERBOSE, _("File `%s' was considered already.\n"));
return ts_done;
default:
abort ();
}
@@ -383,7 +387,7 @@ update_file_1 (file, depth)
++depth;
/* Notice recursive update of the same file. */
start_updating (file);
set_updating(file);
/* Looking at the file's modtime beforehand allows the possibility
that its name may be changed by a VPATH search, and thus it may
@@ -393,28 +397,30 @@ update_file_1 (file, depth)
this_mtime = file_mtime (file);
check_renamed (file);
noexist = this_mtime == NONEXISTENT_MTIME;
must_make = noexist = this_mtime == (FILE_TIMESTAMP) -1;
if (noexist)
DBF (DB_BASIC, _("File `%s' does not exist.\n"));
must_make = noexist;
/* If file was specified as a target with no commands,
come up with some default commands. */
if (!file->phony && file->cmds == 0 && !file->tried_implicit)
if (file->cmds == 0)
{
if (try_implicit_rule (file, depth))
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
else
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
file->tried_implicit = 1;
}
if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0)
{
DBF (DB_IMPLICIT, _("Using default commands for `%s'.\n"));
file->cmds = default_file->cmds;
if (!file->phony && !file->tried_implicit)
{
if (try_implicit_rule (file, depth))
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
else
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
}
if (!file->is_target
&& default_file != 0 && default_file->cmds != 0)
{
DBF (DB_IMPLICIT, _("Using default commands for `%s'.\n"));
file->cmds = default_file->cmds;
}
}
/* Update all non-intermediate files we depend on, if necessary,
@@ -431,7 +437,7 @@ update_file_1 (file, depth)
mtime = file_mtime (d->file);
check_renamed (d->file);
if (is_updating (d->file))
if (tst_updating(d->file))
{
error (NILF, _("Circular %s <- %s dependency dropped."),
file->name, d->file->name);
@@ -463,7 +469,7 @@ update_file_1 (file, depth)
while (f != 0);
}
if (dep_status != 0 && !keep_going_flag)
if (dep_status == ts_failed && !keep_going_flag)
break;
if (!running)
@@ -500,7 +506,7 @@ update_file_1 (file, depth)
while (f != 0);
}
if (dep_status != 0 && !keep_going_flag)
if (dep_status == ts_failed && !keep_going_flag)
break;
if (!running)
@@ -509,7 +515,7 @@ update_file_1 (file, depth)
}
}
finish_updating (file);
clr_updating(file);
DBF (DB_VERBOSE, _("Finished prerequisites of target file `%s'.\n"));
@@ -518,14 +524,14 @@ update_file_1 (file, depth)
set_command_state (file, cs_deps_running);
--depth;
DBF (DB_VERBOSE, _("The prerequisites of `%s' are being made.\n"));
return 0;
return ts_incomplete;
}
/* If any dependency failed, give up now. */
if (dep_status != 0)
if (dep_status == ts_failed)
{
file->update_status = dep_status;
file->update_status = 1; /* if any precursors failed, so did we */
notice_finished_file (file);
depth--;
@@ -537,7 +543,7 @@ update_file_1 (file, depth)
error (NILF,
_("Target `%s' not remade because of errors."), file->name);
return dep_status;
return ts_failed;
}
if (file->command_state == cs_deps_running)
@@ -563,7 +569,7 @@ update_file_1 (file, depth)
#if 1 /* %%% In version 4, remove this code completely to
implement not remaking deps if their deps are newer
than their parents. */
if (d_mtime == NONEXISTENT_MTIME && !d->file->intermediate)
if (d_mtime == (FILE_TIMESTAMP) -1 && !d->file->intermediate)
/* We must remake if this dep does not
exist and is not intermediate. */
must_make = 1;
@@ -580,7 +586,7 @@ update_file_1 (file, depth)
{
const char *fmt = 0;
if (d_mtime == NONEXISTENT_MTIME)
if (d_mtime == (FILE_TIMESTAMP) -1)
{
if (ISDB (DB_BASIC))
fmt = _("Prerequisite `%s' of target `%s' does not exist.\n");
@@ -642,7 +648,7 @@ update_file_1 (file, depth)
file = file->prev;
}
return 0;
return ts_done;
}
DBF (DB_BASIC, _("Must remake target `%s'.\n"));
@@ -661,32 +667,24 @@ update_file_1 (file, depth)
if (file->command_state != cs_finished)
{
DBF (DB_VERBOSE, _("Commands of `%s' are being run.\n"));
return 0;
return ts_incomplete;
}
switch (file->update_status)
if (file->update_status)
{
case 2:
DBF (DB_BASIC, _("Failed to remake target file `%s'.\n"));
break;
case 0:
DBF (DB_BASIC, _("Successfully remade target file `%s'.\n"));
break;
case 1:
DBF (DB_BASIC, _("Target file `%s' needs remade under -q.\n"));
break;
default:
assert (file->update_status >= 0 && file->update_status <= 2);
break;
DBF (DB_BASIC, (question_flag ? _("Target file `%s' needs remade under -q.\n")
: _("Failed to remake target file `%s'.\n")));
return ts_failed;
}
else
{
DBF (DB_BASIC, _("Successfully remade target file `%s'.\n"));
return ts_done;
}
file->updated = 1;
return file->update_status;
}
/* Set FILE's `updated' flag and re-check its mtime and the mtime's of all
files listed in its `also_make' member. Under -t, this function also
touches FILE.
/* re-check FILE's mtime and the mtime's of all files listed in its
`also_make' member. Under -t, this function also touches FILE.
On return, FILE->update_status will no longer be -1 if it was. */
@@ -698,7 +696,6 @@ notice_finished_file (file)
int ran = file->command_state == cs_running;
file->command_state = cs_finished;
file->updated = 1;
if (touch_flag
/* The update status will be:
@@ -725,11 +722,11 @@ notice_finished_file (file)
file->update_status = 0;
else
/* Should set file's modification date and do nothing else. */
file->update_status = touch_file (file);
file->update_status = touch_file (file) ? 1 : 0;
}
}
if (file->mtime_before_update == UNKNOWN_MTIME)
if (file->mtime_before_update == 0)
file->mtime_before_update = file->last_mtime;
if (ran && !file->phony)
@@ -753,7 +750,7 @@ notice_finished_file (file)
else if (file->is_target && file->cmds == 0)
i = 1;
file->last_mtime = i == 0 ? UNKNOWN_MTIME : NEW_MTIME;
file->last_mtime = i == 0 ? 0 : NEW_MTIME;
/* Propagate the change of modification time to all the double-colon
entries for this file. */
@@ -761,7 +758,7 @@ notice_finished_file (file)
f->last_mtime = file->last_mtime;
}
if (ran && file->update_status != -1)
if (ran)
/* We actually tried to update FILE, which has
updated its also_make's as well (if it worked).
If it didn't work, it wouldn't work again for them.
@@ -769,7 +766,6 @@ notice_finished_file (file)
for (d = file->also_make; d != 0; d = d->next)
{
d->file->command_state = cs_finished;
d->file->updated = 1;
d->file->update_status = file->update_status;
if (ran && !d->file->phony)
@@ -779,10 +775,6 @@ notice_finished_file (file)
never be done because the target is already updated. */
(void) f_mtime (d->file, 0);
}
else if (file->update_status == -1)
/* Nothing was done for FILE, but it needed nothing done.
So mark it now as "succeeded". */
file->update_status = 0;
}
/* Check whether another file (whose mtime is THIS_MTIME)
@@ -790,9 +782,13 @@ notice_finished_file (file)
If it does, store 1 in *MUST_MAKE_PTR.
In the process, update any non-intermediate files
that FILE depends on (including FILE itself).
Return nonzero if any updating failed. */
static int
Return ts_done if FILE has completed successfully, ts_incomplete if
FILE or any of its precursors are incomplete, or ts_failed if FILE
or any of its precursors failed.
*/
static target_state_t
check_dep (file, depth, this_mtime, must_make_ptr)
struct file *file;
unsigned int depth;
@@ -800,10 +796,10 @@ check_dep (file, depth, this_mtime, must_make_ptr)
int *must_make_ptr;
{
register struct dep *d;
int dep_status = 0;
target_state_t dep_status = ts_done;
++depth;
start_updating (file);
set_updating(file);
if (!file->intermediate)
/* If this is a non-intermediate file, update it and record
@@ -814,7 +810,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
check_renamed (file);
mtime = file_mtime (file);
check_renamed (file);
if (mtime == NONEXISTENT_MTIME || mtime > this_mtime)
if (mtime == (FILE_TIMESTAMP) -1 || mtime > this_mtime)
*must_make_ptr = 1;
}
else
@@ -828,7 +824,6 @@ check_dep (file, depth, this_mtime, must_make_ptr)
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
else
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
file->tried_implicit = 1;
}
if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0)
@@ -842,7 +837,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
check_renamed (file);
mtime = file_mtime (file);
check_renamed (file);
if (mtime != NONEXISTENT_MTIME && mtime > this_mtime)
if (mtime != (FILE_TIMESTAMP) -1 && mtime > this_mtime)
*must_make_ptr = 1;
/* Otherwise, update all non-intermediate files we depend on,
if necessary, and see whether any of them is more
@@ -855,7 +850,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
d = file->deps;
while (d != 0)
{
if (is_updating (d->file))
if (tst_updating(d->file))
{
error (NILF, _("Circular %s <- %s dependency dropped."),
file->name, d->file->name);
@@ -878,7 +873,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
dep_status |= check_dep (d->file, depth, this_mtime,
must_make_ptr);
check_renamed (d->file);
if (dep_status != 0 && !keep_going_flag)
if (dep_status == ts_failed && !keep_going_flag)
break;
if (d->file->command_state == cs_running
@@ -894,7 +889,7 @@ check_dep (file, depth, this_mtime, must_make_ptr)
}
}
finish_updating (file);
clr_updating(file);
return dep_status;
}
@@ -995,7 +990,7 @@ remake_file (file)
error (NILF, msg_parent, "*** ",
file->name, file->parent->name, ".");
}
file->update_status = 2;
file->update_status = 1;
}
}
else
@@ -1041,9 +1036,7 @@ f_mtime (file, search)
char *arname, *memname;
struct file *arfile;
time_t memtime;
int arname_used = 0;
time_t member_date;
/* Find the archive's name. */
ar_parse_name (file->name, &arname, &memname);
@@ -1098,21 +1091,18 @@ f_mtime (file, search)
free (arname);
free (memname);
if (mtime == NONEXISTENT_MTIME)
/* The archive doesn't exist, so its members don't exist either. */
return NONEXISTENT_MTIME;
if (mtime == (FILE_TIMESTAMP) -1)
/* The archive doesn't exist, so it's members don't exist either. */
return (FILE_TIMESTAMP) -1;
member_date = ar_member_date (file->hname);
mtime = (member_date == (time_t) -1
? NONEXISTENT_MTIME
: file_timestamp_cons (file->hname, member_date, 0));
mtime = ar_member_date (file->hname);
}
else
#endif
{
mtime = name_mtime (file->name);
if (mtime == NONEXISTENT_MTIME && search && !file->ignore_vpath)
if (mtime == (FILE_TIMESTAMP) -1 && search && !file->ignore_vpath)
{
/* If name_mtime failed, search VPATH. */
char *name = file->name;
@@ -1121,8 +1111,8 @@ f_mtime (file, search)
|| (name[0] == '-' && name[1] == 'l'
&& library_search (&name, &mtime)))
{
if (mtime != UNKNOWN_MTIME)
/* vpath_search and library_search store UNKNOWN_MTIME
if (mtime != 0)
/* vpath_search and library_search store zero in MTIME
if they didn't need to do a stat call for their work. */
file->last_mtime = mtime;
@@ -1150,38 +1140,32 @@ f_mtime (file, search)
We only need to do this once, for now. */
static FILE_TIMESTAMP now = 0;
if (!clock_skew_detected
&& mtime != NONEXISTENT_MTIME
&& !file->updated)
&& mtime != (FILE_TIMESTAMP)-1 && mtime > now
&& !(file->command_state == cs_finished))
{
static FILE_TIMESTAMP now;
/* This file's time appears to be in the future.
Update our concept of the present, and compare again. */
FILE_TIMESTAMP adjusted_mtime = mtime;
now = file_timestamp_now ();
#if defined(WINDOWS32) || defined(__MSDOS__)
FILE_TIMESTAMP adjustment;
#ifdef WINDOWS32
/* FAT filesystems round time to the nearest even second!
Allow for any file (NTFS or FAT) to perhaps suffer from this
brain damage. */
adjustment = (((FILE_TIMESTAMP_S (adjusted_mtime) & 1) == 0
&& FILE_TIMESTAMP_NS (adjusted_mtime) == 0)
? (FILE_TIMESTAMP) 1 << FILE_TIMESTAMP_LO_BITS
: 0);
/*
* FAT filesystems round time to nearest even second(!). Just
* allow for any file (NTFS or FAT) to perhaps suffer from this
* braindamage.
*/
if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now)))
#else
/* On DJGPP under Windows 98 and Windows NT, FAT filesystems can
set file times up to 3 seconds into the future! The bug doesn't
occur in plain DOS or in Windows 95, but we play it safe. */
adjustment = (FILE_TIMESTAMP) 3 << FILE_TIMESTAMP_LO_BITS;
#ifdef __MSDOS__
/* Scrupulous testing indicates that some Windows
filesystems can set file times up to 3 sec into the future! */
if (mtime > now + 3)
#else
if (mtime > now)
#endif
if (ORDINARY_MTIME_MIN + adjustment <= adjusted_mtime)
adjusted_mtime -= adjustment;
#endif
/* If the file's time appears to be in the future, udpate our
concept of the present and try once more. */
if (now < adjusted_mtime
&& (now = file_timestamp_now ()) < adjusted_mtime)
{
char mtimebuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
char nowbuf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
@@ -1206,8 +1190,7 @@ f_mtime (file, search)
been built by us but was found now, it existed before make
started. So, turn off the intermediate bit so make doesn't
delete it, since it didn't create it. */
if (mtime != NONEXISTENT_MTIME && file->command_state == cs_not_started
&& file->command_state == cs_not_started
if (mtime != (FILE_TIMESTAMP)-1 && file->command_state == cs_not_started
&& !file->tried_implicit && file->intermediate)
file->intermediate = 0;
@@ -1228,15 +1211,10 @@ name_mtime (name)
{
struct stat st;
while (stat (name, &st) != 0)
if (errno != EINTR)
{
if (errno != ENOENT && errno != ENOTDIR)
perror_with_name ("stat:", name);
return NONEXISTENT_MTIME;
}
if (stat (name, &st) < 0)
return (FILE_TIMESTAMP) -1;
return FILE_TIMESTAMP_STAT_MODTIME (name, st);
return FILE_TIMESTAMP_STAT_MODTIME (st);
}
@@ -1322,7 +1300,7 @@ library_search (lib, mtime_ptr)
/* Look first for `libNAME.a' in the current directory. */
mtime = name_mtime (libbuf);
if (mtime != NONEXISTENT_MTIME)
if (mtime != (FILE_TIMESTAMP) -1)
{
*lib = xstrdup (libbuf);
if (mtime_ptr != 0)
@@ -1362,7 +1340,7 @@ library_search (lib, mtime_ptr)
{
sprintf (buf, "%s/%s", *dp, libbuf);
mtime = name_mtime (buf);
if (mtime != NONEXISTENT_MTIME)
if (mtime != (FILE_TIMESTAMP) -1)
{
*lib = xstrdup (buf);
if (mtime_ptr != 0)

View File

@@ -83,7 +83,7 @@ start_remote_job_p (first_p)
Customs requires a privileged source port be used. */
make_access ();
if (ISDB (DB_JOBS))
if (ISDB (DB_EXTRA))
Rpc_Debug(1);
/* Ping the daemon once to see if it is there. */
@@ -124,8 +124,8 @@ start_remote_job_p (first_p)
status = Customs_Host (EXPORT_SAME, &permit);
if (status != RPC_SUCCESS)
{
DB (DB_JOBS, (_("Customs won't export: %s\n"),
Rpc_ErrorMessage (status)));
DB (DB_EXTRA, (_("Customs won't export: %s\n"),
Rpc_ErrorMessage (status)));
return 0;
}

View File

@@ -1,97 +1,11 @@
2000-06-22 Paul D. Smith <psmith@gnu.org>
* scripts/options/dash-q: New file; test the -q option. Includes
a test for PR/1780.
2000-06-21 Paul D. Smith <psmith@gnu.org>
* scripts/features/targetvars: Added a test for PR/1709: allowing
semicolons in target-specific variable values.
2000-06-19 Paul D. Smith <psmith@gnu.org>
* scripts/functions/addsuffix: Test for an empty final argument.
Actually this bug might have happened for any function, but this
one was handy.
2000-06-17 Eli Zaretskii <eliz@is.elta.co.il>
* scripts/options/general: If parallel jobs are not supported,
expect a warning message from Make.
2000-06-15 Eli Zaretskii <eliz@is.elta.co.il>
* scripts/options/general: Don't try -jN with N != 1 if parallel
jobs are not supported.
2000-05-24 Paul D. Smith <psmith@gnu.org>
* scripts/options/general: Test general option processing (PR/1716).
2000-04-11 Paul D. Smith <psmith@gnu.org>
* scripts/functions/strip: Test empty value to strip (PR/1689).
2000-04-08 Eli Zaretskii <eliz@is.elta.co.il>
* scripts/features/reinvoke: Sleep before updating the target
files in the first test, to ensure its time stamp really gets
newer; otherwise Make might re-exec more than once.
2000-04-07 Eli Zaretskii <eliz@is.elta.co.il>
* scripts/features/double_colon: Don't run the parallel tests if
parallel jobs aren't supported.
2000-04-04 Paul D. Smith <psmith@gnu.org>
* scripts/functions/word: wordlist doesn't swap arguments anymore.
2000-03-27 Paul D. Smith <psmith@gnu.org>
* scripts/features/statipattrules: Test that static pattern rules
whose prerequisite patterns resolve to empty strings throw an
error (instead of dumping core). Fixes PR/1670.
* scripts/features/reinvoke: Make more robust by touching "b"
first, to ensure it's not newer than "a".
Reported by Marco Franzen <Marco.Franzen@Thyron.com>.
* scripts/options/dash-n: Ditto.
* scripts/functions/call: Whoops. The fix to PR/1527 caused
recursive invocations of $(call ...) to break. I can't come up
with any way to get both working at the same time, so I backed out
the fix to 1527 and added a test case for recursive calls. This
also tests the fix for PR/1610.
* scripts/features/double_colon: Test that circular dependencies
in double-colon rule sets are detected correctly (PR/1671).
2000-03-26 Paul D. Smith <psmith@gnu.org>
* scripts/targets/INTERMEDIATE: Test that make doesn't remove
.INTERMEDIATE files when given on the command line (PR/1669).
2000-03-08 Paul D. Smith <psmith@gnu.org>
* scripts/options/dash-k: Add a test for error detection by
multiple targets depending on the same prerequisite with -k.
For PR/1634.
2000-02-07 Paul D. Smith <psmith@gnu.org>
* scripts/features/escape: Add a test for backslash-escaped spaces
in a target name (PR/1586).
2000-02-04 Paul D. Smith <psmith@gnu.org>
* scripts/features/patspecific_vars: Add a test for pattern-specific
target variables inherited from the parent target (PR/1407).
* scripts/features/patspecific_vars: Add a test for PR/1407.
2000-02-02 Paul D. Smith <psmith@gnu.org>
* run_make_tests.pl (set_more_defaults): Hard-code the LANG to C
to make sure sorting order, etc. is predictable.
to make sure porting order, etc. is predictable.
Reported by Andreas Jaeger <aj@suse.de>.
* run_make_tests.pl (set_more_defaults): Set the $wtime variable
@@ -103,11 +17,6 @@
* scripts/targets/SECONDARY: Ditto.
* scripts/targets/INTERMEDIATE: Ditto.
2000-01-27 Paul D. Smith <psmith@gnu.org>
* test_driver.pl (toplevel): Don't try to run test scripts which
are really directories.
2000-01-23 Paul D. Smith <psmith@gnu.org>
* scripts/features/include: Remove a check; the fix caused more
@@ -118,7 +27,7 @@
* scripts/functions/call: Add a test for PR/1517 and PR/1527: make
sure $(call ...) doesn't eval its arguments and that you can
invoke foreach from it without looping forever.
invoke foreach from it without infinitely looping.
1999-12-15 Paul D. Smith <psmith@gnu.org>

View File

@@ -36,9 +36,6 @@ two: ; @echo two
f1.h f2.h: ; @echo $@
d :: ; @echo ok
d :: d ; @echo oops
EOF
close(MAKEFILE);
@@ -51,11 +48,9 @@ $answer = "aaa\nbbb\n";
# TEST 1: As above, in parallel
if ($parallel_jobs) {
&run_make_with_options($makefile, "-j10 all", &get_logfile, 0);
$answer = "aaa\nbbb\n";
&compare_output($answer, &get_logfile(1));
}
&run_make_with_options($makefile, "-j10 all", &get_logfile, 0);
$answer = "aaa\nbbb\n";
&compare_output($answer, &get_logfile(1));
# TEST 2: A simple double-colon rule that is the goal target
@@ -65,11 +60,9 @@ $answer = "aaa\naaa done\nbbb\n";
# TEST 3: As above, in parallel
if ($parallel_jobs) {
&run_make_with_options($makefile, "-j10 bar", &get_logfile, 0);
$answer = "aaa\naaa done\nbbb\n";
&compare_output($answer, &get_logfile(1));
}
&run_make_with_options($makefile, "-j10 bar", &get_logfile, 0);
$answer = "aaa\naaa done\nbbb\n";
&compare_output($answer, &get_logfile(1));
# TEST 4: Each double-colon rule is supposed to be run individually
@@ -82,11 +75,9 @@ $answer = "f1.h\nfoo FIRST\n";
# TEST 5: Again, in parallel.
if ($parallel_jobs) {
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
$answer = "f1.h\nfoo FIRST\n";
&compare_output($answer, &get_logfile(1));
}
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
$answer = "f1.h\nfoo FIRST\n";
&compare_output($answer, &get_logfile(1));
# TEST 6: Each double-colon rule is supposed to be run individually
@@ -100,27 +91,17 @@ $answer = "f2.h\nfoo SECOND\n";
# TEST 7: Again, in parallel.
if ($parallel_jobs) {
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
$answer = "f2.h\nfoo SECOND\n";
&compare_output($answer, &get_logfile(1));
}
# TEST 8: Test circular dependency check; PR/1671
&run_make_with_options($makefile, "d", &get_logfile, 0);
$answer = "ok\n$make_name: Circular d <- d dependency dropped.\noops\n";
&run_make_with_options($makefile, "-j10 foo", &get_logfile, 0);
$answer = "f2.h\nfoo SECOND\n";
&compare_output($answer, &get_logfile(1));
# TEST 8: I don't grok why this is different than the above, but it is...
#
# Hmm... further testing indicates this might be timing-dependent?
#
#if ($parallel_jobs) {
# &run_make_with_options($makefile, "-j10 biz", &get_logfile, 0);
# $answer = "aaa\ntwo\nbbb\n";
# &compare_output($answer, &get_logfile(1));
#}
#&run_make_with_options($makefile, "-j10 biz", &get_logfile, 0);
#$answer = "aaa\ntwo\nbbb\n";
#&compare_output($answer, &get_logfile(1));
unlink('foo','f1.h','f2.h');

View File

@@ -1,17 +1,11 @@
# -*-perl-*-
$description = "Test various types of escaping in makefiles.";
$details = "\
Make sure that escaping of `:' works in target names.
Also make sure escaping of whitespace works in target names";
$details = "Make sure that escaping of `:' works in target names.";
open(MAKEFILE,"> $makefile");
print MAKEFILE <<'EOF';
$(path)foo : ; @echo cp $^ $@
foo\ bar: ; @echo 'touch "$@"'
EOF
print MAKEFILE '$(path)foo : ; @echo cp $^ $@
';
close(MAKEFILE);
@@ -40,11 +34,5 @@ $answer = "cp p:foo\n";
$answer = "$makefile:1: *** target pattern contains no `%'. Stop.\n";
&compare_output($answer,&get_logfile(1));
# TEST 5: This one should work
&run_make_with_options($makefile, "'foo bar'", &get_logfile, 0);
$answer = "touch \"foo bar\"\n";
&compare_output($answer,&get_logfile(1));
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -18,7 +18,6 @@ all: ; \@echo 'running rules.'
$makefile $makefile2: $makefile_orig
\@echo 'rebuilding \$\@.'
\@sleep $wtime
\@echo >> \$\@
include $makefile2
@@ -31,7 +30,7 @@ close(MAKEFILE);
# Sleep 2 seconds for DOS/Windows FAT volumes which have 2-second
# granularity of file times.
sleep($wtime);
sleep(2);
&touch("$makefile_orig");
@@ -66,9 +65,8 @@ EOM
close(MAKEFILE);
&touch('b');
&touch('a');
sleep($wtime);
&touch('a','b');
sleep(2);
&touch('c');
# First try with the file that's not updated "once removed" from the

View File

@@ -1,67 +1,66 @@
# -*-perl-*-
$description = "Test handling of static pattern rules.";
$description = "The following test creates a makefile to test static \n"
."pattern rules. Static pattern rules are rules which \n"
."specify multiple targets and construct the dependency \n"
."names for each target based on the target name. ";
$details = "\
The makefile created in this test has three targets. The
filter command is used to get those target names ending in
.o and statically creates a compile command with the target
name and the target name with .c. It also does the same thing
for another target filtered with .elc and creates a command
to emacs a .el file";
$details = "The makefile created in this test has three targets. The \n"
."filter command is used to get those target names ending in \n"
.".o and statically creates a compile command with the target\n"
."name and the target name with .c. It also does the same thing\n"
."for another target filtered with .elc and creates a command\n"
."to emacs a .el file";
open(MAKEFILE,"> $makefile");
print MAKEFILE <<'EOF';
files = foo.elc bar.o lose.o
$(filter %.o,$(files)): %.o: %.c ; @echo CC -c $(CFLAGS) $< -o $@
# The Contents of the MAKEFILE ...
print MAKEFILE "files = foo.elc bar.o lose.o \n\n"
."\$(filter %.o,\$(files)): %.o: %.c\n"
."\t\@echo CC -c \$(CFLAGS) \$< -o \$@ \n"
."\$(filter %.elc,\$(files)): %.elc: %.el \n"
."\t\@echo emacs \$< \n";
# END of Contents of MAKEFILE
$(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $<
EOF
close(MAKEFILE);
&touch('bar.c', 'lose.c');
&touch("bar.c","lose.c");
# TEST #1
# -------
&run_make_with_options($makefile, '', &get_logfile);
&run_make_with_options($makefile,
"",
&get_logfile,
0);
# Create the answer to what should be produced by this Makefile
$answer = "CC -c bar.c -o bar.o\n";
&compare_output($answer, &get_logfile(1));
&compare_output($answer,&get_logfile(1));
# TEST #2
# -------
&run_make_with_options($makefile,"lose.o",&get_logfile);
&run_make_with_options($makefile, 'lose.o', &get_logfile);
$answer = "CC -c lose.c -o lose.o\n";
&compare_output($answer, &get_logfile(1));
&compare_output($answer,&get_logfile(1));
# TEST #3
# -------
&touch("foo.el");
&run_make_with_options($makefile, 'foo.elc', &get_logfile);
&run_make_with_options($makefile,"foo.elc",&get_logfile);
$answer = "emacs foo.el\n";
&compare_output($answer, &get_logfile(1));
&compare_output($answer,&get_logfile(1));
unlink('foo.el', 'bar.c', 'lose.c');
# TEST #4 -- PR/1670: don't core dump on invalid static pattern rules
# -------
$makefile2 = &get_tmpfile;
open(MAKEFILE, "> $makefile2");
print MAKEFILE "foo: foo%: % ; \@echo $@\n";
close(MAKEFILE);
&run_make_with_options($makefile2, '', &get_logfile, 512);
$answer = "$makefile2:1: *** target `foo' leaves prerequisite pattern empty. Stop.\n";
&compare_output($answer, &get_logfile(1));
unlink("foo.el","bar.c","lose.c");
1;

View File

@@ -146,27 +146,9 @@ close(MAKEFILE);
$answer = "bar baz biz\nbar baz\n";
&compare_output($answer, &get_logfile(1));
# Test #10
&run_make_with_options("$makefile3", "one", &get_logfile);
$answer = "bar biz\n";
&compare_output($answer, &get_logfile(1));
# Test #11
# PR/1709: Test semicolons in target-specific variable values
$makefile4 = &get_tmpfile;
open(MAKEFILE, "> $makefile4");
print MAKEFILE <<'EOF';
foo : FOO = ; ok
foo : ; @echo '$(FOO)'
EOF
close(MAKEFILE);
&run_make_with_options("$makefile4", "", &get_logfile);
$answer = "; ok\n";
&compare_output($answer, &get_logfile(1));
1;

View File

@@ -1,36 +1,44 @@
# -*-perl-*-
$description = "Test the addsuffix function.";
$description = "The following test creates a makefile to test the addsuffix "
."function.";
$details = "";
# IF YOU NEED >1 MAKEFILE FOR THIS TEST, USE &get_tmpfile; TO GET
# THE NAME OF THE MAKEFILE. THIS INSURES CONSISTENCY AND KEEPS TRACK OF
# HOW MANY MAKEFILES EXIST FOR EASY DELETION AT THE END.
# EXAMPLE: $makefile2 = &get_tmpfile;
open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE <<EOMAKE;
string := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks)
one: ; \@echo \$(string)
print MAKEFILE "string := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks) \n"
."all: \n"
."\t\@echo \$(string) \n";
two: ; \@echo \$(addsuffix foo,)
EOMAKE
# END of Contents of MAKEFILE
close(MAKEFILE);
&run_make_with_options($makefile,"",&get_logfile,0);
# TEST 0
&run_make_with_options($makefile, "", &get_logfile);
# Create the answer to what should be produced by this Makefile
$answer = "src${pathsep}a.b.z.foo.c hacks.c\n";
# COMPARE RESULTS
# In this call to compare output, you should use the call &get_logfile(1)
# to send the name of the last logfile created. You may also use
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
&compare_output($answer,&get_logfile(1));
# TEST 1
&run_make_with_options($makefile, "two", &get_logfile);
$answer = "\n";
&compare_output($answer,&get_logfile(1));
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -26,35 +26,23 @@ my-notdir = $(call notdir,$(1))
my-foreach = $(foreach $(1),$(2),$(3))
my-if = $(if $(1),$(2),$(3))
# Test recursive invocations of call with different arguments
#
one = $(1) $(2) $(3)
two = $(call one,$(1),foo,$(2))
all: ; @echo '$(call reverse,bar,foo)'; \
echo '$(call map,origin,MAKE reverse map)'; \
echo '$(call my-notdir,a/b c/d e/f)'; \
echo '$(call my-foreach)'; \
echo '$(call my-foreach,a,,,)'; \
echo '$(call my-foreach,a,x y z,$(a)$(a))'; \
echo '$(call my-if,a,b,c)'; \
echo '$(call two,bar,baz)'
echo '$(call my-if,,$(warning don't print this),ok)'
EOMAKE
# These won't work until/unless PR/1527 is resolved.
# echo '$(call my-foreach,a,x y z,$(a)$(a))'; \
# echo '$(call my-if,,$(warning don't print this),ok)'
#
# $answer = "xx yy zz\nok\n";
# END of Contents of MAKEFILE
close(MAKEFILE);
&run_make_with_options($makefile, "", &get_logfile);
$answer = "foo bar\ndefault file file\nb d f\n\n\nb\nbar foo baz\n";
$answer = "foo bar\ndefault file file\nb d f\n\n\nxx yy zz\nb\nok\n";
&compare_output($answer, &get_logfile(1));
1;

View File

@@ -34,8 +34,6 @@ all:
@echo '$(strip $(TEST2) )'
@echo '$(strip $(TEST3) )'
space: ; @echo '$(strip ) $(strip )'
EOMAKE
# END of Contents of MAKEFILE
@@ -43,15 +41,13 @@ EOMAKE
close(MAKEFILE);
&run_make_with_options($makefile,"",&get_logfile);
# Create the answer to what should be produced by this Makefile
$answer = "\"Is this TERMINAL fun? What makes you believe is this terminal fun? JAPAN is a WONDERFUL planet -- I wonder if we will ever reach their level of COMPARATIVE SHOPPING...\"
try this and this
and these test out some blank lines
";
&compare_output($answer,&get_logfile(1));
&run_make_with_options($makefile,"space",&get_logfile);
$answer = " \n";
&compare_output($answer,&get_logfile(1));
1;

View File

@@ -1,33 +1,33 @@
# -*-perl-*-
$description = "Test the word, words, and wordlist functions.\n";
$description = "The following test creates a makefile to test the word, words,\n"
."and wordlist functions.\n";
$details = "\
Produce a variable with a large number of words in it,
determine the number of words, and then read each one back.\n";
$details = "The word function will return the number of words in a variable or\n"
."the word specified. The test will produce a variable with a large\n"
."number of words in it, determine the number of word and then read\n"
."each one back.\n";
open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE <<'EOF';
string := word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl
string2 := $(string) $(string) $(string) $(string) $(string) $(string) $(string)
string3 := $(string2) $(string2) $(string2) $(string2) $(string2) $(string2) $(string2)
string4 := $(string3) $(string3) $(string3) $(string3) $(string3) $(string3) $(string3)
all:
@echo $(words $(string))
@echo $(words $(string4))
@echo $(word 1, $(string))
@echo $(word 100, $(string))
@echo $(word 1, $(string))
@echo $(word 1000, $(string3))
@echo $(wordlist 3, 4, $(string))
@echo $(wordlist 4, 3, $(string))
@echo $(wordlist 1, 6, $(string))
@echo $(wordlist 5, 7, $(string))
@echo $(wordlist 100, 110, $(string))
@echo $(wordlist 7, 10, $(string2))
EOF
print MAKEFILE "string := word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl \n"
."string2 := \$(string) \$(string) \$(string) \$(string) \$(string) \$(string) \$(string)\n"
."string3 := \$(string2) \$(string2) \$(string2) \$(string2) \$(string2) \$(string2) \$(string2)\n"
."string4 := \$(string3) \$(string3) \$(string3) \$(string3) \$(string3) \$(string3) \$(string3)\n"
."all: \n"
."\t\@echo \$(words \$(string)) \n"
."\t\@echo \$(words \$(string4)) \n"
."\t\@echo \$(word 1, \$(string)) \n"
."\t\@echo \$(word 100, \$(string)) \n"
."\t\@echo \$(word 1, \$(string)) \n"
."\t\@echo \$(word 1000, \$(string3)) \n"
."\t\@echo \$(wordlist 3, 4, \$(string)) \n"
."\t\@echo \$(wordlist 4, 3, \$(string)) \n"
."\t\@echo \$(wordlist 1, 6, \$(string)) \n"
."\t\@echo \$(wordlist 7, 5, \$(string)) \n"
."\t\@echo \$(wordlist 100, 110, \$(string)) \n"
."\t\@echo \$(wordlist 7, 10, \$(string2)) \n"
;
@@ -35,7 +35,7 @@ EOF
close(MAKEFILE);
&run_make_with_options($makefile, "", &get_logfile);
&run_make_with_options($makefile,"",&get_logfile,0);
# Create the answer to what should be produced by this Makefile
@@ -47,7 +47,7 @@ $answer = "6\n"
."word.pl\n"
."\n"
."FORCE.pl word.pl\n"
."\n"
."FORCE.pl word.pl\n"
."word.pl general_test2.pl FORCE.pl word.pl generic_test.perl MAKEFILES_variable.pl\n"
."generic_test.perl MAKEFILES_variable.pl\n"
."\n"
@@ -58,7 +58,13 @@ $answer = "6\n"
# to send the name of the last logfile created. You may also use
# the special call &get_logfile(1) which returns the same as &get_logfile(1).
&compare_output($answer, &get_logfile(1));
&compare_output($answer,&get_logfile(1));
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -1,37 +1,36 @@
# -*-perl-*-
$description = "The following test creates a makefile to test the -k option.\n"
."Normally, make gives up immediately if an error happens \n"
."that make has not been told to ignore. However, if the -k\n"
."option is specified, make continues to consider the other\n"
."dependencies of the pending targets.";
$description = "Test the make -k (don't stop on error) option.\n";
$details = "\
The makefile created in this test is a simulation of building
a small product. However, the trick to this one is that one
of the dependencies of the main target does not exist.
Without the -k option, make would fail immediately and not
build any part of the target. What we are looking for here,
is that make builds the rest of the dependencies even though
it knows that at the end it will fail to rebuild the main target.";
$details = "The makefile created in this test is a simulation of building \n"
."a small product. However, the trick to this one is that one \n"
."of the dependencies of the main target does not exist. \n"
."Without the -k option, make would fail immediately and not \n"
."build any part of the target. What we are looking for here, \n"
."is that make builds the rest of the dependencies even though \n"
."it knows that at the end it will fail to rebuild the main target.";
open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE <<EOF;
VPATH = $workdir
edit: main.o kbd.o commands.o display.o
\t\@echo cc -o edit main.o kbd.o commands.o display.o
print MAKEFILE "VPATH = $workdir\n";
print MAKEFILE "edit: main.o kbd.o commands.o display.o \n";
print MAKEFILE "\t\@echo cc -o edit main.o kbd.o commands.o display.o \n";
main.o : main.c defs.h
\t\@echo cc -c main.c
print MAKEFILE "main.o : main.c defs.h\n";
print MAKEFILE "\t\@echo cc -c main.c\n";
kbd.o : kbd.c defs.h command.h
\t\@echo cc -c kbd.c
print MAKEFILE "kbd.o : kbd.c defs.h command.h\n";
print MAKEFILE "\t\@echo cc -c kbd.c\n";
commands.o : command.c defs.h command.h
\t\@echo cc -c commands.c
print MAKEFILE "commands.o : command.c defs.h command.h\n";
print MAKEFILE "\t\@echo cc -c commands.c\n";
display.o : display.c defs.h buffer.h
\t\@echo cc -c display.c
EOF
print MAKEFILE "display.o : display.c defs.h buffer.h\n";
print MAKEFILE "\t\@echo cc -c display.c\n";
# END of Contents of MAKEFILE
@@ -46,55 +45,29 @@ close(MAKEFILE);
&touch(@files_to_touch);
if ($vos) {
$error_code = 3307;
if ($vos)
{
$error_code = 3307;
}
else {
$error_code = 512;
else
{
$error_code = 512;
}
&run_make_with_options($makefile, "-k", &get_logfile, $error_code);
&run_make_with_options($makefile,"-k",&get_logfile,$error_code);
# Create the answer to what should be produced by this Makefile
$answer = "cc -c main.c
$make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.
cc -c commands.c
cc -c display.c
$make_name: Target `edit' not remade because of errors.\n";
$answer = "cc -c main.c\n"
."$make_name: *** No rule to make target `kbd.c', needed by `kbd.o'.\n"
."cc -c commands.c\n"
."cc -c display.c\n"
."$make_name: Target `edit' not remade because of errors.\n";
# COMPARE RESULTS
&compare_output($answer, &get_logfile(1));
unlink(@files_to_touch) unless $keep;
# TEST 1: Make sure that top-level targets that depend on targets that
# previously failed to build, aren't attempted. Regression for PR/1634.
$makefile2 = &get_tmpfile;
open(MAKEFILE, "> $makefile2");
print MAKEFILE <<'EOF';
.SUFFIXES:
all: exe1 exe2; @echo making $@
exe1 exe2: lib; @echo cp $^ $@
lib: foo.o; @echo cp $^ $@
foo.o: ; exit 1
EOF
close(MAKEFILE);
&run_make_with_options($makefile2, "-k", &get_logfile, $error_code);
$answer = "exit 1
$make_name: *** [foo.o] Error 1
$make_name: Target `all' not remade because of errors.\n";
&compare_output($answer, &get_logfile(1));
if (&compare_output($answer,&get_logfile(1)))
{
unlink @files_to_touch;
}
1;

View File

@@ -18,20 +18,17 @@ close(MAKEFILE);
&touch('orig');
# TEST 0
&run_make_with_options($makefile, "", &get_logfile);
$answer = "echo >> intermediate\necho >> final\n";
&compare_output($answer, &get_logfile(1));
# TEST 1
&run_make_with_options($makefile, "-Worig -n", &get_logfile);
$answer = "echo >> intermediate\necho >> final\n";
&compare_output($answer, &get_logfile(1));
unlink('orig', 'intermediate', 'final');
# TEST2
# We consider the actual updated timestamp of targets with all
# recursive commands, even with -n.
@@ -49,24 +46,14 @@ EOF
close(MAKEFILE);
&touch('b');
# Sometimes, on my Solaris 2.5.1 box with a NetApp filesystem NFS-mounted,
# just touching b first then a isn't good enough: the nsec field in the
# stat result shows b is _newer_ than a once every 5 or 6 tries!!! I've
# no idea what this is about, but that's why there's a sleep(1) here...
sleep(1);
&touch('a');
&touch('a', 'b');
sleep(1);
&touch('c');
# TEST 2
&run_make_with_options($makefile2, "", &get_logfile);
$answer = "$make_name: `a' is up to date.\n";
&compare_output($answer, &get_logfile(1));
# TEST 3
&run_make_with_options($makefile2, "-n", &get_logfile);
$answer = "$make_name: `a' is up to date.\n";
&compare_output($answer, &get_logfile(1));

View File

@@ -1,70 +0,0 @@
# -*-perl-*-
$description = "Test the -q option.\n";
$details = "Try various uses of -q and ensure they all give the correct results.\n";
open(MAKEFILE, "> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE <<'EOMAKE';
one:
two: ;
three: ; :
four: ; $(.XY)
five: ; \
$(.XY)
six: ; \
$(.XY)
$(.XY)
seven: ; \
$(.XY)
: foo
$(.XY)
EOMAKE
close(MAKEFILE);
# TEST 0
&run_make_with_options($makefile, "-q one", &get_logfile);
$answer = "";
&compare_output($answer, &get_logfile(1));
# TEST 1
&run_make_with_options($makefile, "-q two", &get_logfile);
$answer = "";
&compare_output($answer, &get_logfile(1));
# TEST 2
&run_make_with_options($makefile, "-q three", &get_logfile, 256);
$answer = "";
&compare_output($answer, &get_logfile(1));
# TEST 3
&run_make_with_options($makefile, "-q four", &get_logfile);
$answer = "";
&compare_output($answer, &get_logfile(1));
# TEST 4
&run_make_with_options($makefile, "-q five", &get_logfile);
$answer = "";
&compare_output($answer, &get_logfile(1));
# TEST 5
&run_make_with_options($makefile, "-q six", &get_logfile);
$answer = "";
&compare_output($answer, &get_logfile(1));
# TEST 6
&run_make_with_options($makefile, "-q seven", &get_logfile, 256);
$answer = "";
&compare_output($answer, &get_logfile(1));
1;

View File

@@ -1,35 +0,0 @@
# -*-perl-*-
$description = "Test generic option processing.\n";
open(MAKEFILE, "> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE "foo 1foo: ; \@echo \$\@\n";
close(MAKEFILE);
# TEST 0
&run_make_with_options($makefile, "-j 1foo", &get_logfile);
if (!$parallel_jobs) {
$answer = "$make_name: Parallel jobs (-j) are not supported on this platform.\n$make_name: Resetting to single job (-j1) mode.\n1foo\n";
}
else {
$answer = "1foo\n";
}
# TEST 1
# This test prints the usage string; I don't really know a good way to
# test it. I guess I could invoke make with a known-bad option to see
# what the usage looks like, then compare it to what I get here... :(
# If I were always on UNIX, I could invoke it with 2>/dev/null, then
# just check the error code.
&run_make_with_options($makefile, "-j1foo 2>/dev/null", &get_logfile, 512);
$answer = "";
&compare_output($answer, &get_logfile(1));
1;

View File

@@ -77,15 +77,9 @@ sleep($wtime);
$answer = "cp foo.f foo.e\ncp bar.f bar.e\ncat foo.e bar.e > foo.c\nrm foo.e bar.e\n";
&compare_output($answer, &get_logfile(1));
# TEST #6 -- added for PR/1669: don't remove files mentioned on the cmd line.
&run_make_with_options($makefile,'foo.e',&get_logfile);
$answer = "cp foo.f foo.e\n";
&compare_output($answer, &get_logfile(1));
unlink('foo.f', 'foo.e', 'foo.d', 'foo.c', 'bar.f', 'bar.e', 'bar.d', 'bar.c');
# TEST #7 -- added for PR/1423
# TEST #6 -- added for PR/1423
$makefile2 = &get_tmpfile;
@@ -100,7 +94,7 @@ EOF
close(MAKEFILE);
&run_make_with_options($makefile2, '-R', &get_logfile);
&run_make_with_options($makefile2, "-R", &get_logfile);
$answer = "touch foo.a\ntouch foo\nrm foo.a\n";
&compare_output($answer, &get_logfile(1));

View File

@@ -117,8 +117,7 @@ sub toplevel
closedir (SCRIPTDIR);
foreach $dir (@dirs)
{
next if ($dir =~ /^\.\.?$/ || $dir eq 'CVS' || $dir eq 'RCS'
|| ! -d "$scriptpath/$dir");
next if ! -d "$scriptpath/$dir" || $dir =~ /^\.\.?$/ || $dir eq 'CVS';
push (@rmdirs, $dir);
mkdir ("$workpath/$dir", 0777)
|| &error ("Couldn't mkdir $workpath/$dir: $!\n");
@@ -128,7 +127,7 @@ sub toplevel
closedir (SCRIPTDIR);
foreach $test (@files)
{
next if $test =~ /~$/ || -d $test;
next if $test =~ /^\.\.?$/ || $test =~ /~$/ || $test eq 'CVS';
push (@TESTS, "$dir/$test");
}
}

View File

@@ -136,18 +136,17 @@ define_variable_in_set (name, length, value, origin, recursive, set, flocp)
Returns address of the `struct variable' containing all info
on the variable, or nil if no such variable is defined.
If we find a variable which is in the process of being expanded,
try to find one further up the set_list chain. If we don't find
one that isn't being expanded, return a pointer to whatever we
_did_ find. */
If LISTP is not nil, return a pointer to the setlist where
the variable was found. If the variable wasn't found, the
value of LISTP is unchanged. */
struct variable *
lookup_variable (name, length)
lookup_variable_setlist (name, length, listp)
char *name;
unsigned int length;
struct variable_set_list **listp;
{
register struct variable_set_list *setlist;
struct variable *firstv = 0;
register unsigned int i;
register unsigned int rawhash = 0;
@@ -162,31 +161,21 @@ lookup_variable (name, length)
register unsigned int hashval = rawhash % set->buckets;
register struct variable *v;
/* Look through this set list. */
for (v = set->table[hashval]; v != 0; v = v->next)
if (*v->name == *name
&& strneq (v->name + 1, name + 1, length - 1)
&& v->name[length] == '\0')
break;
/* If we didn't find anything, go to the next set list. */
if (!v)
continue;
/* If it's not being expanded already, we're done. */
if (!v->expanding)
return v;
/* It is, so try to find another one. If this is the first one we've
seen, keep a pointer in case we don't find anything else. */
if (!firstv)
firstv = v;
&& v->name[length] == 0)
{
if (listp)
*listp = setlist;
return v;
}
}
#ifdef VMS
/* since we don't read envp[] on startup, try to get the
variable via getenv() here. */
if (!firstv)
{
char *vname = alloca (length + 1);
char *value;
@@ -240,9 +229,10 @@ lookup_variable (name, length)
return define_variable (vname, length, value, o_env, 1);
}
}
#endif /* VMS */
return firstv;
return 0;
}
/* Lookup a variable whose name is a string starting at NAME
@@ -859,7 +849,7 @@ try_variable_definition (flocp, line, origin, target_var)
}
beg = next_token (line);
while (end > beg && isblank ((unsigned char)end[-1]))
while (end > beg && isblank (end[-1]))
--end;
p = next_token (p);

View File

@@ -95,7 +95,10 @@ extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *
char *pattern_percent, char *replace_percent));
/* expand.c */
extern char *recursively_expand PARAMS ((struct variable *v));
extern char *recursively_expand_setlist PARAMS ((struct variable *v,
struct variable_set_list *l));
#define recursively_expand(v) recursively_expand_setlist((v),(struct variable_set_list *)0)
/* variable.c */
extern struct variable_set_list *create_new_variable_set PARAMS ((void));
@@ -108,7 +111,12 @@ extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix))
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin, int target_var));
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
extern struct variable *lookup_variable_setlist
PARAMS ((char *name, unsigned int length,
struct variable_set_list **lisp));
#define lookup_variable(n,l) lookup_variable_setlist((n),(l),\
(struct variable_set_list **)0)
extern struct variable *define_variable_in_set
PARAMS ((char *name, unsigned int length, char *value,

15
vpath.c
View File

@@ -222,7 +222,7 @@ construct_vpath_list (pattern, dirpath)
maxelem = 2;
p = dirpath;
while (*p != '\0')
if (*p++ == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
if (*p++ == PATH_SEPARATOR_CHAR || isblank (*p))
++maxelem;
vpath = (char **) xmalloc (maxelem * sizeof (char *));
@@ -230,7 +230,7 @@ construct_vpath_list (pattern, dirpath)
/* Skip over any initial separators and blanks. */
p = dirpath;
while (*p == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
++p;
elem = 0;
@@ -241,8 +241,7 @@ construct_vpath_list (pattern, dirpath)
/* Find the end of this entry. */
v = p;
while (*p != '\0' && *p != PATH_SEPARATOR_CHAR
&& !isblank ((unsigned char)*p))
while (*p != '\0' && *p != PATH_SEPARATOR_CHAR && !isblank (*p))
++p;
len = p - v;
@@ -275,7 +274,7 @@ construct_vpath_list (pattern, dirpath)
}
/* Skip over separators and blanks between entries. */
while (*p == PATH_SEPARATOR_CHAR || isblank ((unsigned char)*p))
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
++p;
}
@@ -525,10 +524,10 @@ selective_vpath_search (path, file, mtime_ptr)
if (mtime_ptr != 0)
/* Store the modtime into *MTIME_PTR for the caller.
If we have had no need to stat the file here,
we record UNKNOWN_MTIME to indicate this. */
we record a zero modtime to indicate this. */
*mtime_ptr = (exists_in_cache
? FILE_TIMESTAMP_STAT_MODTIME (name, st)
: UNKNOWN_MTIME);
? FILE_TIMESTAMP_STAT_MODTIME (st)
: (FILE_TIMESTAMP) 0);
free (name);
return 1;

View File

@@ -16,7 +16,7 @@ convert_vpath_to_windows32(char *Path, char to_delim)
* contain blanks get trounced here. Use 8.3 format as a workaround.
*/
for (etok = Path; etok && *etok; etok++)
if (isblank ((unsigned char) *etok))
if (isblank(*etok))
*etok = to_delim;
return (convert_Path_to_windows32(Path, to_delim));
@@ -42,7 +42,7 @@ convert_Path_to_windows32(char *Path, char to_delim)
etok[0] = to_delim;
p = ++etok;
continue; /* ignore empty bucket */
} else if (!isalpha ((unsigned char) *p)) {
} else if (!isalpha(*p)) {
/* found one to count, handle things like '.' */
*etok = to_delim;
p = ++etok;

View File

@@ -7,10 +7,11 @@
#include "proc.h"
#include "w32err.h"
#include "config.h"
#include "debug.h"
static char *make_command_line(char *shell_name, char *exec_path, char **argv);
extern int debug_flag; /* from make */
typedef struct sub_process_t {
int sv_stdin[2];
int sv_stdout[2];
@@ -505,9 +506,10 @@ process_begin(
if (envblk) free(envblk);
return -1;
} else {
DB (DB_JOBS, ("CreateProcess(%s,%s,...)\n",
exec_path ? exec_path : "NULL",
command_line ? command_line : "NULL"));
if (debug_flag)
printf("CreateProcess(%s,%s,...)\n",
exec_path ? exec_path : "NULL",
command_line ? command_line : "NULL");
if (CreateProcess(
exec_path,
command_line,