mirror of
https://github.com/mirror/make.git
synced 2026-08-20 08:53:28 +08:00
Compare commits
138 Commits
moved-to-g
...
3.99.92
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a3436c65d | ||
|
|
fd30db1290 | ||
|
|
c3524b83b9 | ||
|
|
0296e40fc7 | ||
|
|
f69922b335 | ||
|
|
65931ce7a9 | ||
|
|
1a991ada47 | ||
|
|
7e77685bc3 | ||
|
|
300d1296fb | ||
|
|
822f8dae41 | ||
|
|
d2d44f76c4 | ||
|
|
6c3e88e60f | ||
|
|
9cd01958da | ||
|
|
4120f91846 | ||
|
|
30a5ee0d85 | ||
|
|
8a6205b43f | ||
|
|
bc120f27bd | ||
|
|
5c0fba7240 | ||
|
|
fa0f2c516a | ||
|
|
20ecc58126 | ||
|
|
1b90248893 | ||
|
|
a4d8444b59 | ||
|
|
0a81d50d66 | ||
|
|
3aa2aa7e82 | ||
|
|
29a94ceb76 | ||
|
|
ab78cbc71c | ||
|
|
c5bfa40044 | ||
|
|
deff9dacc9 | ||
|
|
40a49f244d | ||
|
|
87ac68fe79 | ||
|
|
72462ef1e1 | ||
|
|
f80222c15b | ||
|
|
4b81f5ca92 | ||
|
|
5601726151 | ||
|
|
9453a7451d | ||
|
|
5e7bf7c554 | ||
|
|
138d020e1b | ||
|
|
5b65c5b916 | ||
|
|
cc85b927cd | ||
|
|
bee4d93a59 | ||
|
|
353fcfdb30 | ||
|
|
d4043519f7 | ||
|
|
ef11217de7 | ||
|
|
e8f5d322cf | ||
|
|
dc922e3f4c | ||
|
|
c11024b3b3 | ||
|
|
2fc0f614be | ||
|
|
bf60bbd67a | ||
|
|
d2eaed1f0a | ||
|
|
8ab3564a71 | ||
|
|
ecf307bb0b | ||
|
|
a674abe702 | ||
|
|
80183457ad | ||
|
|
cece7ad61f | ||
|
|
943c06de47 | ||
|
|
171eb41908 | ||
|
|
9babfe49a5 | ||
|
|
b16852a77f | ||
|
|
96cf67bd29 | ||
|
|
5370238316 | ||
|
|
398058a873 | ||
|
|
b730fbc6b8 | ||
|
|
c21c1455fd | ||
|
|
58dae24352 | ||
|
|
c7732bd5ad | ||
|
|
2627d83221 | ||
|
|
381baeef7a | ||
|
|
5367d393dd | ||
|
|
f0529daced | ||
|
|
a668c520b2 | ||
|
|
c8bf04e141 | ||
|
|
0a56034aac | ||
|
|
94735f0ad7 | ||
|
|
7c77486d1f | ||
|
|
13f13b96b3 | ||
|
|
c3cd78066c | ||
|
|
15f7957939 | ||
|
|
1d992d8fe7 | ||
|
|
3484c9675a | ||
|
|
a0c5d0c63f | ||
|
|
64dd61bcb8 | ||
|
|
75336026ae | ||
|
|
b8467292c9 | ||
|
|
e44c51ce41 | ||
|
|
cb2be0db36 | ||
|
|
01bad6f73a | ||
|
|
82793f85f5 | ||
|
|
a66469e003 | ||
|
|
b5ea49bae7 | ||
|
|
2926f7b466 | ||
|
|
a87ff20158 | ||
|
|
9acb657eb1 | ||
|
|
19a69bafc0 | ||
|
|
9a7fe22b19 | ||
|
|
9253a34a57 | ||
|
|
f88eb23b02 | ||
|
|
441b643355 | ||
|
|
8b034b7d18 | ||
|
|
5667376edc | ||
|
|
93843ccd08 | ||
|
|
7f01830927 | ||
|
|
30843dea3a | ||
|
|
14d7654551 | ||
|
|
054d6d91e7 | ||
|
|
e56aad4061 | ||
|
|
049f8e88fc | ||
|
|
da7df54309 | ||
|
|
f3a4b4ce6f | ||
|
|
0daa9d37c4 | ||
|
|
50e2cb1b1a | ||
|
|
330d97a9ba | ||
|
|
b5d017c624 | ||
|
|
79e9347892 | ||
|
|
2bd957a89d | ||
|
|
7f7e6f80c5 | ||
|
|
af87d56157 | ||
|
|
4bf3c33f83 | ||
|
|
cb64352c75 | ||
|
|
6a52395ed1 | ||
|
|
29cd1e9699 | ||
|
|
450b7e1a3d | ||
|
|
5058a94ee7 | ||
|
|
4baf9ab456 | ||
|
|
ac1c6b404a | ||
|
|
51fb930ef2 | ||
|
|
a45f25ece3 | ||
|
|
b70aa3709e | ||
|
|
8e0a5645b8 | ||
|
|
7899c6f383 | ||
|
|
6ca41d9b17 | ||
|
|
686a74bfb2 | ||
|
|
ca17e5538f | ||
|
|
5c69b3fe53 | ||
|
|
1d298acf9d | ||
|
|
5a5a1aff6a | ||
|
|
002702c89c | ||
|
|
a3bd466e25 | ||
|
|
97fe6e7dd1 |
37
.cvsignore
37
.cvsignore
@@ -1,37 +0,0 @@
|
||||
*.gz *.Z *.tar *.tgz
|
||||
=*
|
||||
TODO COPYING* ABOUT-NLS
|
||||
make-3* make-test*
|
||||
*.info *.info-*
|
||||
stamp-*
|
||||
makebook*
|
||||
|
||||
.*gdbinit
|
||||
.gdb_history
|
||||
|
||||
*.dep *.dvi *.toc *.aux *.log
|
||||
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
|
||||
|
||||
README README.DOS README.W32 README.OS2
|
||||
aclocal.m4 autom4te.cache
|
||||
config.h.in config.h config.status config.cache configure
|
||||
Makefile.in Makefile
|
||||
build.sh.in build.sh
|
||||
SMakefile NMakefile Makefile.DOS
|
||||
config.ami configh.dos config.h.W32 config.h-vms
|
||||
|
||||
loadavg loadavg.c make
|
||||
|
||||
gmk-default.h
|
||||
|
||||
.deps .dep_segment ID TAGS
|
||||
|
||||
_*
|
||||
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
|
||||
hp700 hp834 mips sol2 i486-linux
|
||||
|
||||
customs
|
||||
|
||||
install-sh mkinstalldirs
|
||||
|
||||
.directive.asc
|
||||
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# Development artifacts
|
||||
ID
|
||||
TAGS
|
||||
.*gdbinit
|
||||
.gdb_history
|
||||
*~
|
||||
#*
|
||||
.#*
|
||||
|
||||
# Configure artifacts
|
||||
ABOUT-NLS
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
configure
|
||||
stamp-h1
|
||||
|
||||
# Build artifacts
|
||||
.deps
|
||||
gmk-default.h
|
||||
loadavg
|
||||
make
|
||||
*.o
|
||||
|
||||
# Distribution artifacts
|
||||
.dep_segment
|
||||
Makefile.DOS
|
||||
NMakefile
|
||||
README
|
||||
README.DOS
|
||||
README.OS2
|
||||
README.W32
|
||||
SMakefile
|
||||
build.sh
|
||||
build.sh.in
|
||||
config.ami
|
||||
config.h-vms
|
||||
config.h.W32
|
||||
configh.dos
|
||||
make-[0-9]*/
|
||||
make-[0-9]*.tar.*
|
||||
7
AUTHORS
7
AUTHORS
@@ -37,10 +37,11 @@ GNU make porting efforts:
|
||||
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
|
||||
DJ Delorie <dj@delorie.com>
|
||||
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||
Eli Zaretskii <eliz@is.elta.co.il>
|
||||
Eli Zaretskii <eliz@gnu.org>
|
||||
Jonathan Grant <jg@jguk.org>
|
||||
Andreas Beuning <andreas.buening@nexgo.de>
|
||||
Earnie Boyd <earnie@uses.sf.net>
|
||||
Troy Runkel <Troy.Runkel@mathworks.com>
|
||||
|
||||
-----------------------------------
|
||||
Other contributors:
|
||||
@@ -64,12 +65,14 @@ Other contributors:
|
||||
Carl Staelin (Princeton University)
|
||||
Ian Stewartson (Data Logic Limited)
|
||||
David A. Wheeler <dwheeler@dwheeler.com>
|
||||
David Boyce <dsb@boyski.com>
|
||||
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
||||
|
||||
With suggestions/comments/bug reports from a cast of ... well ...
|
||||
hundreds, anyway :)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
946
ChangeLog
946
ChangeLog
@@ -1,3 +1,941 @@
|
||||
2013-09-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* configure.ac: Update version to 3.99.92.
|
||||
* NEWS: Ditto.
|
||||
|
||||
* implicit.c (pattern_search): After second expansion be sure to
|
||||
handle order-only markers inside the expansion properly.
|
||||
Fixes Savannah bug #31155.
|
||||
|
||||
* guile.c (guile_define_module): Technically a void* cannot
|
||||
contain a pointer-to-function and some compilers warn about this.
|
||||
Cast the function pointers.
|
||||
* load.c (load_object): Ditto.
|
||||
|
||||
* read.c (eval): If load_file() returns -1, don't add this to the
|
||||
"to be rebuilt" list.
|
||||
* doc/make.texi (load Directive): Document it.
|
||||
|
||||
* guile.c (guile_gmake_setup): Don't initialize Guile so early.
|
||||
(func_guile): Lazily initialize Guile the first time the $(guile ..)
|
||||
function is invoked. Guile can steal file descriptors which
|
||||
confuses our jobserver FD checking, so we don't want to initialize
|
||||
it before we have to.
|
||||
|
||||
VMS port updates by Hartmut Becker <becker.ismaning@freenet.de>
|
||||
|
||||
* makefile.com: Add output to the filelist.
|
||||
* output.c (va_copy): Add an implementation of this macro for VMS.
|
||||
* commands.c: Ensure filedef.h is #included before dep.h.
|
||||
* dir.c: Ditto.
|
||||
* file.c: Ditto.
|
||||
* guile.c: Ditto.
|
||||
* main.c: Ditto.
|
||||
* misc.c: Ditto.
|
||||
* read.c: Ditto.
|
||||
* rule.c: Ditto.
|
||||
* variable.c: Ditto.
|
||||
* readme.vms: Renamed to README.VMS and updates for this release.
|
||||
* Makefile.am: Ditto.
|
||||
* NEWS: Ditto.
|
||||
* README.template: Ditto.
|
||||
* Makefile.DOS.template: Ditto.
|
||||
|
||||
2013-09-21 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* maintMakefile (check-alt-config): Create a target to test
|
||||
alternative configurations. Each one will build make with a
|
||||
different configuration then run the test suite.
|
||||
|
||||
Invert the output-sync #define to NO_OUTPUT_SYNC
|
||||
|
||||
* configure.ac: Don't set OUTPUT_SYNC.
|
||||
* makeint.h: Ditto.
|
||||
* main.c: Use NO_OUTPUT_SYNC instead of OUTPUT_SYNC.
|
||||
* output.c: Ditto.
|
||||
* output.h: Ditto.
|
||||
* job.h: Ditto.
|
||||
* job.c: Ditto.
|
||||
* config.ami.template: Set NO_OUTPUT_SYNC.
|
||||
* config.h-vms.template: Ditto.
|
||||
* config.h.W32.template: Ditto.
|
||||
* configh.dos.template: Ditto.
|
||||
|
||||
Output generated while reading makefiles should be synced.
|
||||
|
||||
* main.c (make_sync): Define a context for syncing while reading
|
||||
makefiles and other top-level operations.
|
||||
(main): If we request syncing, enable it while we are parsing
|
||||
options, reading makefiles, etc. to capture that output. Just
|
||||
before we start to run rules, dump the output if any.
|
||||
(die): Dump any output we've been syncing before we die
|
||||
* output.h (OUTPUT_SET): Disable output_context if not syncout.
|
||||
|
||||
Stderr generated from shell functions in recipes should be synced.
|
||||
|
||||
* job.h (FD_STDIN, FD_STDOUT, FD_STDERR): Create new macros to
|
||||
avoid magic numbers.
|
||||
(child_execute_job): Take a FD for stderr.
|
||||
* job.c (child_execute_job): Handle STDERR FD's in addition to
|
||||
stdin and stdout.
|
||||
(start_job_command): Call child_execute_job() with the new STDERR
|
||||
parameter. Instead of performing the dup() here, send it to
|
||||
child_execute_job() where it's already being done.
|
||||
* function.c (func_shell_base): Pass the OUTPUT_CONTEXT stderr to
|
||||
child_execute_job() if it's set, otherwise FD_STDERR.
|
||||
* main.c (main): Pass FD_STDERR to child_execute_job().
|
||||
|
||||
2013-09-19 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (main): Set MAKE_RESTARTS to negative before re-exec if
|
||||
we've already generated an "Entering" message. If we are started
|
||||
and notice that MAKE_RESTARTS is negative, assume we already wrote
|
||||
"Entering" and don't write it again.
|
||||
|
||||
2013-09-18 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (main): Set starting_directory before we write any
|
||||
errors. Fixes Savannah bug #40043.
|
||||
|
||||
2013-09-16 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* output.c [WINDOWS32]: Include windows.h and sub_proc.h, to avoid
|
||||
compiler warnings for CLOSE_ON_EXEC.
|
||||
|
||||
2013-09-16 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* configure.ac: Update version to 3.99.91.
|
||||
* NEWS: Ditto.
|
||||
|
||||
2013-09-15 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi (Error Messages): Add a bit more info to the
|
||||
section on static pattern errors, since they're common.
|
||||
Fixes Savannah bug #31326.
|
||||
|
||||
* read.c (eval_makefile): If the file open fails with an
|
||||
unrecoverable error, stop now rather than trying to make it.
|
||||
Fixes Savannah bug #27374.
|
||||
|
||||
* main.c (main): Perform the validation of the jobserver FDs
|
||||
early, before we read makefiles, to ensure that something hasn't
|
||||
opened and used those FDs for some other reason.
|
||||
Fixes Savannah bug #39934.
|
||||
|
||||
* main.c (main): Don't set MAKEFLAGS in the environment when we
|
||||
restart. We have the original command line flags so keep the
|
||||
original MAKEFLAGS settings as well.
|
||||
Fixes Savannah bug #39203.
|
||||
|
||||
2013-09-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (decode_debug_flags): Add support for the "n" flag to
|
||||
disable all debugging.
|
||||
* make.1: Document the "n" (none) flag.
|
||||
* doc/make.texi (Options Summary): Ditto.
|
||||
* NEWS: Ditto.
|
||||
Fixes Savannah bug #35248.
|
||||
|
||||
* misc.c (close_stdout): Move to output.c.
|
||||
* main.c (main): Move atexit call to output_init().
|
||||
* makeint.h: Remove close_stdout() declaration.
|
||||
* output.c (output_init): Add close_stdout at exit only if it's open.
|
||||
Fixes Savannah bug #33134. Suggested by David Boyce <dsb@boyski.com>.
|
||||
|
||||
2013-09-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* misc.c (set_append_mode, open_tmpfd, open_tmpfile): Move to output.c.
|
||||
* misc.h: Ditto.
|
||||
* output.h: Ditto.
|
||||
* main.c (main): Move stdio init into output.c:output_init().
|
||||
Change open_tmpfile() to output_tmpfile().
|
||||
* output.c: Rename open_*() to output_*(). set_append_mode() and
|
||||
open_tmpfd() are static.
|
||||
(_outputs, log_working_directory): Accept a struct output and
|
||||
print to that rather than the global context.
|
||||
(output_dump): In recurse mode print enter/leave once for the
|
||||
whole makefile.
|
||||
(output_init): Initialize this processes stdio as well as child's.
|
||||
|
||||
* vmsjobs.c: Reformat to be closer to convention.
|
||||
|
||||
2013-09-12 Paul Smith <psmith@gnu.org>
|
||||
|
||||
Rework output to handle synchronization and directory logging more
|
||||
reliably.
|
||||
|
||||
* output.c: New file. Implement lazy synchronization and
|
||||
directory logging so that we manage them "just in time", and the
|
||||
destination of the output is set via a global state variable.
|
||||
* output.h: New file.
|
||||
* function.c (func_shell_base): Ensure the output is set up before
|
||||
running a shell command, in case it writes to stderr.
|
||||
(func_error): Use outputs() to generate output.
|
||||
* job.h (struct child): Add struct output to track the child's output.
|
||||
* job.c: Use struct output in the child structure to track output.
|
||||
(child_out, sync_init, assign_child_tempfiles, pump_from_tmp)
|
||||
(acquire_semaphore, release_semaphore, sync_output): Move most of
|
||||
the output_sync handling to output.c.
|
||||
(child_error): Set output, then use simple message() and error()
|
||||
not _s versions.
|
||||
* main.c (log_working_directory): Moved to output.c
|
||||
(trace_option, decode_trace_flags) Remove. Remove support for
|
||||
different trace modes; we don't use it anymore.
|
||||
(die) Invoke output_close() before we exit.
|
||||
* misc.c (message_s, error_s): Removed; no longer needed.
|
||||
(message, error, fatal, perror_with_name, pfatal_with_name): Moved
|
||||
to output.c.
|
||||
* makeint.h: Remove message_s(), error_s(), and
|
||||
log_working_directory(). Remove the TRACE_* macros.
|
||||
* doc/make.texi: Enhance documentation for output sync, and remove
|
||||
MODE assignment for --trace.
|
||||
* make.1: Remove MODE assignment for --trace.
|
||||
* Makefile.am: Add new files.
|
||||
* NMakefile.template: Ditto.
|
||||
* SMakefile.template: Ditto.
|
||||
* build_w32.bat: Ditto.
|
||||
* dosbuild.bat: Ditto.
|
||||
* make.lnk: Ditto.
|
||||
* make_nsvc_net2003.vcproj: Ditto.
|
||||
* makefile.vms: Ditto.
|
||||
* po/POTFILES.in: Ditto.
|
||||
|
||||
2013-08-22 Petr Machata <pmachata@redhat.com>
|
||||
|
||||
* function.c (func_shell_base): Get rid of any avoidable limit on
|
||||
stack size for processes spawned via $(shell).
|
||||
|
||||
2013-07-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* implicit.c (pattern_search): Use PARSE_SIMPLE_SEQ() even for
|
||||
non-second expansion prerequisites, to handle globbing in patterns.
|
||||
Fixes Savannah bug #39310.
|
||||
|
||||
* dep.h (PARSE_SIMPLE_SEQ): Macro for simple file sequence parsing.
|
||||
* default.c (set_default_suffixes): Use it.
|
||||
* file.c (split_prereqs): Ditto.
|
||||
* main.c (main): Ditto.
|
||||
* read.c (eval): Ditto.
|
||||
* rule.c (install_pattern_rule): Ditto.
|
||||
* file.c (split_prereqs): Use PARSEFS_NONE instead of 0.
|
||||
|
||||
2013-07-21 Paul Smith <psmith@gnu.org>
|
||||
|
||||
Cleanups detected by cppcheck. Fixes Savannah bug #39158.
|
||||
* arscan.c (ar_scan): Reduce the scope of local variables.
|
||||
* dir.c (vms_hash): Ditto.
|
||||
(find_directory): Ditto.
|
||||
(file_impossible_p): Ditto.
|
||||
* expand.c (variable_expand_string): Ditto.
|
||||
* function.c (func_sort): Ditto.
|
||||
(func_and): Ditto.
|
||||
* job.c (reap_children): Ditto.
|
||||
(exec_command): Ditto.
|
||||
* main.c (main): Ditto.
|
||||
* misc.c (collapse_continuations): Ditto.
|
||||
* read.c (eval): Ditto.
|
||||
(parse_file_seq): Ditto.
|
||||
* vpath.c (gpath_search): Ditto.
|
||||
(selective_vpath_search): Ditto.
|
||||
* job.c (is_bourne_compatible_shell): Simplify for non-Windows systems.
|
||||
* remake.c (f_mtime): Remove duplicate test.
|
||||
* signame.c (strsignal): Fix bogus conditional.
|
||||
|
||||
* job.c (assign_child_tempfiles): Assign OUTFD to -1 for safety.
|
||||
(start_job_command): Don't test output_sync and sync_cmd: redundant.
|
||||
Changes suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
|
||||
|
||||
2013-07-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* filedef.h (update_status): Convert UPDATE_STATUS from a char to
|
||||
an enumeration. Some systems declare "char" to be "unsigned"
|
||||
which broke the code (which expected to be able to use -1 as a
|
||||
flag). Using magic values was unpleasant, so rather than just
|
||||
force "signed char" I reworked it to use an enum.
|
||||
|
||||
* dep.h (update_goal_chain): Return an update_status value not int.
|
||||
* remake.c (touch_file): Ditto.
|
||||
(update_goal_chain): Track the update_status enum.
|
||||
|
||||
* file.c (enter_file): Use new enumeration values with update_status.
|
||||
(remove_intermediates): Ditto.
|
||||
(print_file): Ditto.
|
||||
* commands.c (execute_file_commands): Ditto.
|
||||
* job.c (reap_children): Ditto.
|
||||
(start_job_command): Ditto.
|
||||
(start_waiting_job): Ditto.
|
||||
* main.c (main): Ditto.
|
||||
* remake.c (update_file): Ditto.
|
||||
(complain): Ditto.
|
||||
(update_file_1): Ditto.
|
||||
(notice_finished_file): Ditto.
|
||||
(remake_file): Ditto.
|
||||
* vmsjobs.c (vmsHandleChildTerm): Ditto.
|
||||
|
||||
2013-07-09 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* implicit.c (pattern_search): Keep a local copy of the number of
|
||||
deps in deplist: the global max might change due to recursion.
|
||||
Fixes a bug reported by Martin d'Anjou <martin.danjou14@gmail.com>.
|
||||
|
||||
2013-06-28 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* misc.c (set_append_mode): Set the O_APPEND flag on a file descriptor.
|
||||
(open_tmpfd): Set append mode on the temporary file descriptor.
|
||||
* main.c (main): Set append mode on stdout and stderr.
|
||||
* makeint.h (set_append_mode): Declare it.
|
||||
|
||||
2013-06-22 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* build_w32.bat (LinkGCC): Prevent a comment from being displayed
|
||||
at build time.
|
||||
|
||||
* job.c (construct_command_argv_internal) [WINDOWS32]: Use
|
||||
case-insensitive comparison with internal commands of non-Unix
|
||||
shells.
|
||||
|
||||
* main.c (find_and_set_default_shell): Don't use file_exists_p or
|
||||
dir_file_exists_p, as those call readdir, which can fail if PATH
|
||||
includes directories with non-ASCII characters, and that would
|
||||
cause Make to fail at startup with confusing diagnostics. See
|
||||
https://sourceforge.net/mailarchive/message.php?msg_id=30846737
|
||||
for the details.
|
||||
|
||||
2013-06-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
Improve performance by using a character map to determine where we
|
||||
want to stop searching strings, rather than discrete comparisons.
|
||||
|
||||
* read.c (find_char_unquote): Pass a stop map instead of various
|
||||
flags and use that to check when to stop parsing the string.
|
||||
(eval): Use the new find_char_unquote() calling signature.
|
||||
(remove_comments): Ditto.
|
||||
(unescape_char): Ditto.
|
||||
(find_percent_cached): Ditto.
|
||||
(parse_file_seq): Use a stop-map flag.
|
||||
* main.c (stopchar_map): Character map definition.
|
||||
(initialize_stopchar_map): Initialize the map definition.
|
||||
(main): Invoke the map initialization function.
|
||||
* misc.c (end_of_token_w32): Remove unused function.
|
||||
* dir.c (dosify): Use STOP_SET to check for stop chars.
|
||||
* main.c (main): Ditto.
|
||||
* misc.c (end_of_token): Ditto.
|
||||
* function.c (subst_expand): Ditto.
|
||||
(func_notdir_suffix): Ditto.
|
||||
(func_basename_dir): Ditto.
|
||||
(abspath): Ditto.
|
||||
* job.c (is_bourne_compatible_shell): Ditto.
|
||||
* variable.c (parse_variable_definition): Ditto.
|
||||
* read.c (eval): Ditto.
|
||||
(conditional_line): Ditto.
|
||||
(find_percent_cached): Ditto.
|
||||
* dep.h (PARSE_FILE_SEQ): Update function declaration.
|
||||
* default.c (set_default_suffixes): Update PARSE_FILE_SEQ() call.
|
||||
* file.c (split_prereqs): Ditto.
|
||||
* function.c (string_glob): Ditto.
|
||||
* implicit.c (pattern_search): Ditto.
|
||||
* rule.c (install_pattern_rule): Ditto.
|
||||
* main.c (main): Ditto.
|
||||
|
||||
2013-06-21 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (verify_flag): Global variable to determine whether to
|
||||
verify the database or not.
|
||||
(decode_debug_flags): If debug mode, enable verify_flag.
|
||||
(main): If MAKE_MAINTAINER_MODE, enable verify_flag, otherwise not.
|
||||
(die): Only verify the database if verify_flag is set.
|
||||
* file.c (enter_file): Don't check caching unless verify_flag.
|
||||
* makeint.h: Export verify_flag.
|
||||
|
||||
2013-05-27 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* variable.c (define_automatic_variables): Create a new variable
|
||||
MAKE_HOST.
|
||||
|
||||
2013-05-27 Hartmut Becker <becker.ismaning@freenet.de>
|
||||
|
||||
* function.c (func_shell_base) [VMS]: Support VMS.
|
||||
* makefile.com [VMS]: Ditto.
|
||||
* makefile.vms [VMS]: Ditto.
|
||||
* makeint.h [VMS]: Ditto.
|
||||
* vmsjobs.c [VMS]: Ditto.
|
||||
* job.h: Define RECORD_SYNC_MUTEX() when OUTPUT_SYNC is not set.
|
||||
* load.c (unload_file): Fix signature if MAKE_LOAD is not set.
|
||||
|
||||
2013-05-26 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* remake.c (f_mtime): Ensure that archive file names are in the
|
||||
string cache. Fixes Savannah bug #38442.
|
||||
|
||||
* read.c (readline): To be safe, move the entire buffer if we
|
||||
detect a CR. Fixes Savannah bug #38945.
|
||||
|
||||
* job.c (new_job): Compare OUT to the beginning of the OUT
|
||||
var/function, not IN. Fixes Savannah bug #39035.
|
||||
|
||||
2013-05-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (switches[]): Order switches so simple flags all come first.
|
||||
(define_makeflags): Rework to make option passing more
|
||||
reliable and the code less tricksy. Ensure simple flags are kept
|
||||
in the initial batch of flags. Do not allow any flags with
|
||||
options in that batch. If there are only non-simple flags MAKEFLAGS
|
||||
begins with ' '.
|
||||
(print_data_base): Print the version. Fixes part of Savannah #35336.
|
||||
|
||||
* read.c (eval_buffer): Initialize lineno.
|
||||
|
||||
2013-05-18 Alexey Pavlov <alexpux@gmail.com> (tiny change)
|
||||
|
||||
* w32/Makefile.am (libw32_a_SOURCES): Add compat/posixfcn.c.
|
||||
|
||||
* configure.ac (OUTPUT_SYNC): Define for mingw32 target.
|
||||
|
||||
* job.c (construct_command_argv_internal) <sh_cmds_dos>
|
||||
[WINDOWS32]: Add "move". Fixes Savannah bug #30714.
|
||||
|
||||
* guile.c: Move inclusion of makeint.h before gnumake.h. This
|
||||
order must be observed when building Make, because gnumake.h must
|
||||
be included with GMK_BUILDING_MAKE defined, which makeint.h
|
||||
already does. Otherwise, the linker will look for, and fail to
|
||||
find, gmk_* functions in some external dynamic library.
|
||||
|
||||
2013-05-17 Benno Schulenberg <bensberg@justemail.net>
|
||||
|
||||
* main.c (decode_output_sync_flags): Fix output message.
|
||||
* read.c (EXTRANEOUS): Ditto.
|
||||
(record_files): Ditto.
|
||||
* remake.c (update_file_1): Ditto.
|
||||
|
||||
2013-05-17 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* main.c (prepare_mutex_handle_string): Define conditioned on
|
||||
OUTPUT_SYNC.
|
||||
|
||||
* build_w32.bat: Copy config.h.W32 to config.h regardless of
|
||||
whether or not we are building from SCM.
|
||||
|
||||
2013-05-17 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* configure.ac: Update version to 3.99.90.
|
||||
* NEWS: Ditto.
|
||||
|
||||
* Source (*.[ch]): Remove TABs, use GNU coding styles.
|
||||
|
||||
* ALL: Update copyright.
|
||||
|
||||
* hash.c (CALLOC): Use xcalloc() to handle out of memory errors.
|
||||
|
||||
* makeint.h: Prototype new unload_file() function.
|
||||
* load.c (unload_file): Create a function to unload a file.
|
||||
(struct load_list): Type to remember loaded objects.
|
||||
(loaded_syms): Global variable of remembered loaded objects so we
|
||||
can unload them later. We don't have to remove from the list
|
||||
because the only time we unload is if we're about to re-exec.
|
||||
(load_object): Remove unneeded extra DLP argument.
|
||||
(load_file): Remove unneeded extra DLP argument.
|
||||
* filedef.h (struct file): Remove the DLP pointer and add the
|
||||
LOADED bit flag. Saves 32/64 bytes per file, as this pointer is
|
||||
almost never needed.
|
||||
* read.c (eval): Set the new LOADED bit flag on the file.
|
||||
* file.c (rehash_file): Merge the loaded bitfield.
|
||||
* commands.c (execute_file_commands): Call unload_file() instead
|
||||
of dlclose() directly.
|
||||
|
||||
2013-05-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi (Loaded Object API): Document the requirement for
|
||||
the plugin_is_GPL_compatible symbol.
|
||||
* load.c (load_object): Check for plugin_is_GPL_compatible symbol.
|
||||
|
||||
2013-05-13 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* filedef.h (struct file): Add a builtin flag.
|
||||
* file.c (enter_file): Unset the builtin flag.
|
||||
(rehash_file): Ditto.
|
||||
(print_file): Don't print builtin files if we've omitted them.
|
||||
* default.c (undefine_default_variables): New function: go through
|
||||
the default variables and undefine them.
|
||||
(set_default_suffixes): Mark these suffix rules as builtin.
|
||||
* makeint.h: Prototype.
|
||||
* main.c (main): Handle addition of -r and -R to MAKEFLAGS in the
|
||||
makefile. Fixes Savannah bug #20501.
|
||||
|
||||
* main.c (define_makeflags): Assign o_env_override level to
|
||||
MAKEFLAGS to ensure it's set even in the presence of -e.
|
||||
Fixes Savannah bug #2216.
|
||||
|
||||
* makeint.h (TRACE_NONE, TRACE_RULE, TRACE_DIRECTORY): Define
|
||||
constants for the trace mode.
|
||||
* main.c: Add new --trace mode parsing.
|
||||
(decode_trace_flags): New function.
|
||||
(decode_switches): Call it.
|
||||
(define_makeflags): Fix a bug with long-name options.
|
||||
* misc.c (fatal): Remove special output-sync handling.
|
||||
* make.1: Document new --trace mode flags.
|
||||
* doc/make.texi (Options Summary): Ditto.
|
||||
|
||||
2013-05-11 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* job.c (child_out): Output the newline following the message
|
||||
before fllush-ing the stream. Avoids displaying the following
|
||||
failure message, which goes to stderr, on the same line.
|
||||
|
||||
2013-05-06 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* gnumake.h (GMK_EXPORT) [_WIN32]: Move the dllexport declaration
|
||||
here from makeint.h.
|
||||
|
||||
* makeint.h (GMK_BUILDING_MAKE) [WINDOWS32]: Define before
|
||||
including gnumake.h.
|
||||
|
||||
* doc/make.texi (Loaded Object Example): Add a note about building
|
||||
shared objects on MS-Windows.
|
||||
|
||||
2013-05-05 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* makeint.h (OUTPUT_SYNC_LINE, OUTPUT_SYNC_RECURSE): Rename
|
||||
output-sync options "job" to "line" and "make" to "recurse".
|
||||
* main.c (decode_output_sync_flags): Ditto.
|
||||
* job.c (reap_children): Ditto.
|
||||
(start_job_command): Ditto.
|
||||
* make.1: Ditto.
|
||||
* doc/make.texi (Parallel Output): Ditto.
|
||||
|
||||
* job.c (child_out): Write newlines explicitly, and don't do
|
||||
anything if the message is empty.
|
||||
(sync_output): Put working dir messages around stdout AND stderr.
|
||||
(start_job_command): Move the tmp file assignment earlier. After
|
||||
we do it, write the command line to the temp file to get the order
|
||||
correct.
|
||||
|
||||
* misc.c (message): Remove special handling for output_sync.
|
||||
(error): Ditto.
|
||||
|
||||
2013-05-04 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* loadapi.c (gmk_alloc): New function.
|
||||
* gnumake.h: Add gmk_alloc(). Clean GMK_EXPORT a bit to avoid MAIN.
|
||||
* makeint.h (GMK_EXPORT): New handling, vs. MAIN.
|
||||
* doc/make.texi (Loaded Object API): Add information on the memory
|
||||
handling functions.
|
||||
(Loaded Object Example): Create an example.
|
||||
|
||||
* job.c (pump_from_tmp): (Rename) Write to stdout/stderr using
|
||||
FILE* rather than fd. It's not a good idea to mix and match.
|
||||
|
||||
2013-05-04 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* makeint.h (ftruncate) [_MSC_VER]: Redirect to _chsize.
|
||||
(_S_ISDIR): If not defined (MinGW64), define to S_ISDIR.
|
||||
|
||||
2013-05-04 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* job.c (child_out): Handle EINTR and incomplete write scenarios.
|
||||
(sync_init): New function: separate the initialization code.
|
||||
(assign_child_tempfiles): Remove truncation from this function,
|
||||
(sync_output): and add it here after output is generated.
|
||||
(reap_children): Always call sync_output() in case output_sync was
|
||||
reset after the child started, due to error.
|
||||
(start_job_command): Create new sync_cmd variable. Use new method
|
||||
for initializing the handle.
|
||||
If we're not syncing the output be sure any output we've saved is
|
||||
dumped immediately before starting the child.
|
||||
|
||||
2013-05-04 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* job.c (start_job_command): Make the condition for creating a
|
||||
temporary output file be identical to the Posix code branch.
|
||||
Suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
|
||||
|
||||
2013-05-03 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* w32/subproc/sub_proc.c: Include makeint.h. Remove a private
|
||||
incompatible prototype of xmalloc.
|
||||
(batch_file_with_spaces): New function, detects Windows batch
|
||||
files whose names include whitespace characters.
|
||||
(process_begin): If exec_name is a batch file with whitespace
|
||||
characters in its name, pass NULL as the first argument to
|
||||
CreateProcess. This avoids weird failures due to buggy quoting by
|
||||
CreateProcess. For the details, see the discussion starting at
|
||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
|
||||
|
||||
* load.c (load_object, load_file): Accept an additional argument
|
||||
DLP and return in it a pointer that can be used to unload the
|
||||
dynamic object.
|
||||
|
||||
* read.c (eval): Call load_file with an additional argument, and
|
||||
record the pointer returned there in the 'struct file' object of
|
||||
dynamic objects in that object's 'struct file'.
|
||||
|
||||
* commands.c (execute_file_commands): Unload dynamic objects
|
||||
before remaking them, to avoid failure to remake if the OS doesn't
|
||||
allow overwriting objects that are in use.
|
||||
|
||||
* filedef.h (struct file): New member dlopen_ptr.
|
||||
|
||||
* gnumake.h (GMK_EXPORT): Define to dllexport/dllimport
|
||||
decorations for Windows and to nothing on other platforms.
|
||||
(gmk_eval, gmk_expand, gmk_add_function): Add GMK_EXPORT qualifier
|
||||
to prototypes.
|
||||
|
||||
* makeint.h (MAIN): Define before including gnumake.h, to give
|
||||
correct dllexport decorations to exported functions.
|
||||
(load_file): Adjust prototype.
|
||||
|
||||
* loadapi.c: Don't include gnumake.h, since makeint.h already
|
||||
includes it, and takes care of defining MAIN before doing so.
|
||||
|
||||
* build_w32.bat (LinkGCC): Produce an import library for functions
|
||||
exported by Make for loadable dynamic objects.
|
||||
|
||||
* w32/compat/posixfcn.c (dlclose): New function.
|
||||
|
||||
* w32/include/dlfcn.h (dlclose): Add prototype.
|
||||
|
||||
2013-05-01 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* job.c (start_job_command) [WINDOWS32]: Make the same fix for
|
||||
MS-Windows as the previous commit did for Posix platforms.
|
||||
(construct_command_argv_internal): Don't treat a backslash as an
|
||||
escape character before whitespace, if the shell is not a Posix
|
||||
shell. For the description of the problem, see
|
||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
|
||||
|
||||
2013-05-01 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* job.c (start_job_command): Don't redirect output for recursive
|
||||
make jobs, unless we're in makefile synchronization mode.
|
||||
|
||||
2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
|
||||
|
||||
build: enable the 'silent-rules' automake options
|
||||
|
||||
* configure.ac (AM_INIT_AUTOMAKE): Here. The future major Automake
|
||||
version 2.0 (ETA about one, one and half year from now) will enable
|
||||
it by default, so better prepare ourselves.
|
||||
|
||||
2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
|
||||
|
||||
build: require Autoconf >= 2.62 and Automake >= 1.11.1
|
||||
|
||||
Older versions of those tools should be considered fully obsolete.
|
||||
Also, GNU make already requires Gettext >= 0.18.1, which has been
|
||||
released six months after Automake 1.11.1 and two years after
|
||||
Autoconf 2.62; so the new requirement shouldn't be problematic
|
||||
for people already bootstrapping GNU make from the Git repository.
|
||||
|
||||
* configure.ac (AC_PREREQ): Require Autoconf 2.62 or later.
|
||||
(AM_INIT_AUTOMAKE): Require Automake 1.11.1 or later (1.11 had
|
||||
some serious bugs, and should not be used).
|
||||
|
||||
2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
|
||||
|
||||
build: get rid of 'HAVE_ANSI_COMPILER' C preprocessor conditional
|
||||
|
||||
GNU make already assume C89 or later throughout the codebase, and
|
||||
that preprocessor conditional was no longer used anyway.
|
||||
|
||||
* configure.ac: Remove AC_DEFINE of HAVE_ANSI_COMPILER.
|
||||
* config.ami.template: Remove #define of HAVE_ANSI_COMPILER.
|
||||
* config.h-vms.template: Likewise.
|
||||
* config.h.W32.template: Likewise.
|
||||
* configh.dos.template: Likewise.
|
||||
|
||||
2013-04-30 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
|
||||
|
||||
cosmetics: fix few innocuous typos
|
||||
|
||||
Most of these were found using Lucas De Marchi's 'codespell' tool.
|
||||
|
||||
* ChangeLog: Fix minor typos.
|
||||
* ChangeLog.2: Likewise.
|
||||
* README.Amiga: Likewise.
|
||||
* TODO.private: Likewise.
|
||||
* function.c: Likewise.
|
||||
* glob/glob.h: Likewise.
|
||||
* job.c: Likewise.
|
||||
* main.c: Likewise.
|
||||
* readme.vms: Likewise.
|
||||
* remake.c: Likewise.
|
||||
* tests/ChangeLog: Likewise.
|
||||
* tests/NEWS: Likewise.
|
||||
* tests/README: Likewise.
|
||||
* tests/scripts/variables/private: Likewise.
|
||||
* vmsdir.h: Likewise.
|
||||
* signame.c: Likewise. While at it, improve line wrapping in the
|
||||
touched comment.
|
||||
|
||||
2013-04-29 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* w32/include/dlfcn.h: New file.
|
||||
|
||||
* w32/compat/posixfcn.c: Include dlfcn.h.
|
||||
(dlopen, dlerror, dlsym) [MAKE_LOAD]: New functions, in support of
|
||||
dynamic loading.
|
||||
|
||||
* config.h.W32.template (MAKE_LOAD): Define.
|
||||
|
||||
* load.c (load_object) [HAVE_DOS_PATHS]: Support backslashes and
|
||||
drive letters in file names of dynamic objects.
|
||||
|
||||
* job.c (construct_command_argv_internal) [WINDOWS32]: Return
|
||||
right after generating new_argv for one_shell case. This fixes
|
||||
the Windows build for both Unixy shell and stock Windows shells.
|
||||
|
||||
2013-04-28 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* dir.c (local_stat) [WINDOWS32]: Use the wrapper on MS-Windows.
|
||||
If the argument ends in "dir/.", make sure the parent dir exists
|
||||
and is indeed a directory. Fixes Savannah bug #37065.
|
||||
|
||||
2013-04-28 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* makeint.h (message_s, error_s): Functions that print to strings
|
||||
rather than directly to files.
|
||||
* misc.c (message_s, error_s): Create them.
|
||||
* job.c (child_error): Print error messages to the output sync
|
||||
logs, if one exists, rather then directly to the terminal.
|
||||
(reap_children): Move the per-line sync after child_error().
|
||||
|
||||
* configure.ac: Remove support for pre-ANSI variadic function calls.
|
||||
* makeint.h: Ditto.
|
||||
* misc.c: Ditto.
|
||||
* config.ami.template: Ditto.
|
||||
* config.h-vms.template: Ditto.
|
||||
* config.h.W32.template: Ditto.
|
||||
* configh.dos.template: Ditto.
|
||||
|
||||
Implement a "per-job" output synchronization option.
|
||||
|
||||
* main.c (decode_output_sync_flags): Recognize the new option.
|
||||
* makeint.h (OUTPUT_SYNC_JOB): Add new values for "job"
|
||||
* job.c (assign_child_tempfiles): In per-job mode, truncate the
|
||||
temp file for re-use by the next job.
|
||||
(sync_output): Don't close the temp files as we may still use them.
|
||||
(free_child): Close the temp files here as we definitely don't
|
||||
need them.
|
||||
(new_job): In per-job output mode, sync_output() after each job.
|
||||
* job.h (struct child): Avoid ifdefs.
|
||||
* make.1: Add new options to the man page.
|
||||
* doc/make.texi (Parallel Output): Break documentation on input
|
||||
and output into separate sections for readability. Document the
|
||||
new "job" and "none" modes.
|
||||
|
||||
2013-04-27 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* job.c (construct_command_argv_internal): Fix oneshell support
|
||||
for non-POSIX-sh shells.
|
||||
|
||||
* load.c (load_object): Extract all POSIX-isms into a separate
|
||||
function for portability.
|
||||
(load_file): Check the .LOADED variable first and don't invoke
|
||||
load_object() if it's already been loaded.
|
||||
|
||||
2013-04-27 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* read.c (record_files): Pay attention to .ONESHELL in MS-Windows.
|
||||
|
||||
* job.c (construct_command_argv_internal): Support .ONESHELL on
|
||||
MS-Windows, when the shell is not a Unixy shell.
|
||||
|
||||
2013-04-27 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* job.c: Fix compilation error on GNU/Linux due to "label at end
|
||||
of compound statement".
|
||||
|
||||
2013-04-27 Frank Heckenbach <f.heckenbach@fh-soft.de> (tiny change)
|
||||
|
||||
* job.c (sync_output): Don't discard the output if
|
||||
acquire_semaphore fails; instead, dump the output unsynchronized.
|
||||
|
||||
2013-04-27 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
Support --output-sync on MS-Windows.
|
||||
* w32/compat/posixfcn.c: New file, with emulations of Posix
|
||||
functions and Posix functionality for MS-Windows.
|
||||
|
||||
* w32/subproc/sub_proc.c: Include io.h.
|
||||
(process_noinherit): New function, forces a file descriptor to not
|
||||
be inherited by child processes.
|
||||
(process_easy): Accept two additional arguments, and use them to
|
||||
set up the standard output and standard error handles of the child
|
||||
process.
|
||||
|
||||
* w32/include/sub_proc.h (process_easy): Adjust prototype.
|
||||
(process_noinherit): Add prototype.
|
||||
|
||||
* read.c [WINDOWS32]: Include windows.h and sub_proc.h.
|
||||
|
||||
* makeint.h (LOCALEDIR) [WINDOWS32}: Define to NULL if not
|
||||
defined. This is needed because the MS-Windows build doesn't have
|
||||
a canonical place for LOCALEDIR.
|
||||
(WIN32_LEAN_AND_MEAN) [WINDOWS32]: Define, to avoid getting from
|
||||
windows.h header too much stuff that could conflict with the code.
|
||||
|
||||
* main.c <sync_mutex>: New static variable.
|
||||
<switches>: Add support for "--sync-mutex" switch.
|
||||
(decode_output_sync_flags): Decode the --sync-mutex= switch.
|
||||
(prepare_mutex_handle_string) [WINDOWS32]: New function.
|
||||
(main): Add "output-sync" to .FEATURES.
|
||||
|
||||
* job.h (CLOSE_ON_EXEC) [WINDOWS32]: Define to call
|
||||
process_noinherit.
|
||||
(F_GETFD, F_SETLKW, F_WRLCK, F_UNLCK, struct flock) [WINDOWS32]:
|
||||
New macros.
|
||||
(RECORD_SYNC_MUTEX): New macro, a no-op for Posix platforms.
|
||||
(sync_handle_t): New typedef.
|
||||
|
||||
* job.c <sync_handle>: Change type to sync_handle_t.
|
||||
(FD_NOT_EMPTY): Seek to the file's end. Suggested by Frank
|
||||
Heckenbach <f.heckenbach@fh-soft.de>.
|
||||
(pump_from_tmp_fd) [WINDOWS32]: Switch to_fd to binary mode for
|
||||
the duration of this function, and then change back before
|
||||
returning.
|
||||
(start_job_command) [WINDOWS32]: Support output_sync mode on
|
||||
MS-Windows. Use a system-wide mutex instead of locking
|
||||
stdout/stderr. Call process_easy with two additional arguments:
|
||||
child->outfd and child->errfd.
|
||||
(exec_command) [WINDOWS32]: Pass two additional arguments, both
|
||||
-1, to process_easy, to adjust for the changed function signature.
|
||||
|
||||
* function.c (windows32_openpipe) [WINDOWS32]: This function now
|
||||
returns an int, which is -1 if it fails and zero otherwise. It
|
||||
also calls 'error' instead of 'fatal', to avoid exiting
|
||||
prematurely.
|
||||
(func_shell_base) [WINDOWS32]: Call perror_with_name if
|
||||
windows32_openpipe fails, now that it always returns. This avoids
|
||||
a compiler warning that error_prefix is not used in the MS-Windows
|
||||
build.
|
||||
|
||||
* config.h.W32.template (OUTPUT_SYNC): Define.
|
||||
|
||||
* build_w32.bat: Add w32/compat/posixfcn.c to compilation and
|
||||
linking commands.
|
||||
|
||||
2013-04-20 Stefano Lattarini <stefano.lattarini@gmail.com> (tiny change)
|
||||
|
||||
* README.git: Our autoconf input file is 'configure.ac', not
|
||||
'configure.in'. Adjust accordingly.
|
||||
* build_w32.bat: Likewise.
|
||||
* config.h-vms.template: Likewise.
|
||||
* Makefile.DOS.template: Likewise.
|
||||
|
||||
2013-04-16 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* misc.c (open_tmpfd): Add a new function that returns a temporary
|
||||
file by file descriptor.
|
||||
(open_tmpfile): Move here from main.c.
|
||||
* job.c (assign_child_tempfiles): Use the new open_tmpfd().
|
||||
|
||||
2013-04-15 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* makeint.h (OUTPUT_SYNC_TARGET, OUTPUT_SYNC_MAKE): Rename.
|
||||
* job.c (start_job_command): Use new constants.
|
||||
* main.c: New -O argument format.
|
||||
|
||||
* doc/make.texi (Options Summary): Document the argument to -O.
|
||||
* make.1: Ditto.
|
||||
|
||||
* main.c (define_makeflags): Don't add space between a single-char
|
||||
option and its argument.
|
||||
|
||||
2013-04-06 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi (Implicit Variables): Clarify LDFLAGS vs. LDLIBS.
|
||||
Fixes Savannah bug #37970.
|
||||
|
||||
* remake.c (check_dep): Reconsider files waiting on prerequisites,
|
||||
as they may have finished. Fixes Savannah bug #37703.
|
||||
|
||||
2013-02-28 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* function.c (func_realpath): On Solaris (at least) realpath() can
|
||||
fail due to EINTR, so loop it. Fixes Savannah bug #38420.
|
||||
|
||||
2013-02-25 Paul Smith <psmith@gnu.org>
|
||||
|
||||
Add a proposed supported API for GNU make loaded objects.
|
||||
|
||||
* doc/make.texi (Loaded Object API): Document it.
|
||||
* Makefile.am (make_SOURCES): Add new loadapi.c.
|
||||
* dep.h: Remove eval_buffer(); moved to loadapi.c:gmk_eval().
|
||||
* read.c (eval_buffer): Change eval_buffer() signature.
|
||||
* main.c (main): Change eval_buffer() signature.
|
||||
* variable.h (define_new_function): Change func_ptr signature.
|
||||
* load.c (SYMBOL_EXTENSION): Change the extension.
|
||||
* loadapi.c: Implement the new API.
|
||||
* gnumake.h (gmk_eval): New function prototype.
|
||||
(gmk_expand) Ditto.
|
||||
(gmk_add_function) Ditto.
|
||||
* gmk-default.scm (gmk-eval): Remove: now implemented in guile.c.
|
||||
* guile.c (guile_expand_wrapper): Use gmk_expand()
|
||||
(guile_eval_wrapper): Implement eval here to avoid double-expansion.
|
||||
(guile_define_module): Define gmk-eval.
|
||||
(func_guile): Use new func_ptr calling model.
|
||||
(guile_gmake_setup): Use gmk_add_function() to declare $(guile ...)
|
||||
* function.c (function_table_entry): Provide alternative func_ptr.
|
||||
(func_eval): New signature for eval_buffer();
|
||||
(function_table_init): New initialization for function_table_entry.
|
||||
(expand_builtin_function): Support alternative invocation signature.
|
||||
(define_new_function): Ditto.
|
||||
|
||||
2013-01-20 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* gnumake.h: New file to contain externally-visible content.
|
||||
* makeint.h: Include gnumake.h. Move gmk_floc type to gnumake.h.
|
||||
* Makefile.am (include_HEADERS): Install the gnumake.h header.
|
||||
|
||||
* makeint.h: Change struct floc to gmk_floc typedef.
|
||||
* Many: Use the new typedef.
|
||||
|
||||
* make.h: Rename to makeint.h.
|
||||
* Many: Use the new name makeint.h.
|
||||
|
||||
2013-01-19 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi (load Directive): Update to discuss location of
|
||||
loaded object file.
|
||||
(Remaking Loaded Objects): Document remaking of loaded objects.
|
||||
|
||||
* main.c (main): Rename READ_MAKEFILES to READ_FILES.
|
||||
* read.c: Change READ_MAKEFILES to READ_FILES since it now
|
||||
contains loaded object files as well.
|
||||
(read_all_makefiles): Ditto.
|
||||
(eval_makefile): Ditto.
|
||||
(eval): Add any loaded file to the READ_FILES list, so that it
|
||||
will be considered for re-build.
|
||||
|
||||
* load.c (load_file): Return the simple filename (no symbol) in
|
||||
the LDNAME argument (now a const char **).
|
||||
This filename should no longer have "./" prepended: modify the
|
||||
function to always check the current directory if the name has no
|
||||
"/", before using the normal methods.
|
||||
* make.h: Change the load_file() prototype.
|
||||
|
||||
* README.git: Add a bit more documentation on Git workflow & rules.
|
||||
|
||||
2013-01-13 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* main.c (main): Restore all make flags after re-exec is complete.
|
||||
Fixes Savannah bug #38051.
|
||||
|
||||
2013-01-12 Paul Smith <psmith@gnu.org>
|
||||
|
||||
Convert CVS archive to Git.
|
||||
|
||||
* configure.in: Rename to configure.ac.
|
||||
* README.cvs: Rename to README.git and rework for Git.
|
||||
* maintMakefile: Use git clean for cleanup.
|
||||
* ChangeLog: Use new Git repository URL.
|
||||
* ChangeLog.2: Ditto.
|
||||
* Makefile.am: Change documentation for Git
|
||||
* Makefile.DOS.template: Ditto.
|
||||
* README.template: Ditto.
|
||||
* build_w32.bat: Ditto.
|
||||
* prepare_w32.bat: Ditto.
|
||||
* .cvsignore: Rename to .gitignore, and change to Git format.
|
||||
|
||||
2012-12-08 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* job.c (create_batch_file): Fix last change: always increment the
|
||||
@@ -8,7 +946,7 @@
|
||||
* job.c (construct_command_argv_internal): Remove " from
|
||||
sh_chars_dos[]. Ignore an escaped backslash inside a string
|
||||
quoted with "..". This lifts the 4KB or 8KB command-line length
|
||||
limitation imposed by the Windows shell when a command uses quoted
|
||||
limitation imposed by the Windows shells when a command uses quoted
|
||||
strings, because we now don't call the shell in that case.
|
||||
|
||||
* job.c (create_batch_file): Declare the counter of batch files
|
||||
@@ -4566,14 +5504,14 @@
|
||||
|
||||
|
||||
|
||||
See ChangeLog.2, available in the CVS repository at:
|
||||
See ChangeLog.2, available in the Git repository at:
|
||||
|
||||
http://savannah.gnu.org/cvs/?group=make
|
||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
|
||||
for earlier changes.
|
||||
|
||||
|
||||
Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -3080,7 +3080,7 @@ Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
|
||||
* main.c: (main), variable.c Changed handling of ENV-vars. Make
|
||||
stores now the names of the variables only and reads their contents
|
||||
when they are accessed to reflect that these variables are really
|
||||
global (ie. they CAN change WHILE make runs !) This handling is
|
||||
global (i.e., they CAN change WHILE make runs !) This handling is
|
||||
made in lookup_variable()
|
||||
|
||||
* Makefile.ami: renamed file.h to filedep.h
|
||||
@@ -6630,9 +6630,9 @@ Fri Nov 1 19:34:28 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
|
||||
|
||||
See ChangeLog.1, available in the CVS repository at:
|
||||
See ChangeLog.1, available in the Git repository at:
|
||||
|
||||
http://savannah.gnu.org/cvs/?group=make
|
||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
|
||||
for earlier changes.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*-Makefile-*- template for DJGPP
|
||||
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||
#
|
||||
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -88,7 +88,7 @@ INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(prefix)$(libdir)\" -DINCLUDEDIR=\"$(pre
|
||||
|
||||
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 gmk-default.scm gmk-default.h
|
||||
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 gmk-default.scm gmk-default.h
|
||||
|
||||
SUBDIRS = glob doc
|
||||
mkinstalldirs = ${exec_prefix}/bin/gmkdir -p
|
||||
@@ -122,7 +122,7 @@ man1dir = $(mandir)/man1
|
||||
MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.in getloadavg.c
|
||||
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.ac getloadavg.c
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
@@ -506,7 +506,7 @@ html
|
||||
#
|
||||
dist-hook:
|
||||
(cd $(srcdir); \
|
||||
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \
|
||||
w32=`find w32 -follow \( -name .git -prune \) -o -type f -print`; \
|
||||
tar chf - $$w32) \
|
||||
| (cd $(distdir); tar xfBp -)
|
||||
|
||||
|
||||
29
Makefile.am
29
Makefile.am
@@ -1,6 +1,6 @@
|
||||
# This is a -*-Makefile-*-, or close enough
|
||||
#
|
||||
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -31,6 +31,7 @@ endif
|
||||
SUBDIRS = glob config po doc $(MAYBE_W32)
|
||||
|
||||
bin_PROGRAMS = make
|
||||
include_HEADERS = gnumake.h
|
||||
|
||||
if USE_CUSTOMS
|
||||
remote = remote-cstms.c
|
||||
@@ -39,9 +40,9 @@ else
|
||||
endif
|
||||
|
||||
make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
|
||||
function.c getopt.c getopt1.c implicit.c job.c load.c main.c \
|
||||
misc.c read.c remake.c rule.c signame.c \
|
||||
strcache.c variable.c version.c vpath.c hash.c \
|
||||
function.c getopt.c getopt1.c implicit.c job.c load.c \
|
||||
loadapi.c main.c misc.c output.c read.c remake.c rule.c \
|
||||
signame.c strcache.c variable.c version.c vpath.c hash.c \
|
||||
$(remote)
|
||||
|
||||
if HAVE_GUILE
|
||||
@@ -50,8 +51,8 @@ endif
|
||||
|
||||
EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
|
||||
|
||||
noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
||||
debug.h getopt.h gettext.h hash.h
|
||||
noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \
|
||||
debug.h getopt.h gettext.h hash.h output.h
|
||||
|
||||
make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \
|
||||
$(GUILE_LIBS)
|
||||
@@ -81,7 +82,7 @@ EXTRA_DIST = README build.sh.in $(man_MANS) \
|
||||
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
||||
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
|
||||
make_msvc_net2003.sln make_msvc_net2003.vcproj \
|
||||
readme.vms makefile.vms makefile.com config.h-vms \
|
||||
README.VMS makefile.vms makefile.com config.h-vms \
|
||||
vmsdir.h vmsfunctions.c vmsify.c \
|
||||
gmk-default.scm gmk-default.h
|
||||
|
||||
@@ -144,7 +145,7 @@ gmk-default.h: $(srcdir)/gmk-default.scm
|
||||
#
|
||||
dist-hook:
|
||||
(cd $(srcdir); \
|
||||
sub=`find w32 tests -follow \( -name CVS -o -name .deps -o -name work -o -name .cvsignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
|
||||
sub=`find w32 tests -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
|
||||
tar chf - $$sub) \
|
||||
| (cd $(distdir); tar xfBp -)
|
||||
|
||||
@@ -183,18 +184,18 @@ loadavg_LDADD = @GETLOADAVG_LIBS@
|
||||
MAKETESTFLAGS =
|
||||
|
||||
check-regression:
|
||||
@if test -f "$(srcdir)/tests/run_make_tests"; then \
|
||||
@if test -f '$(srcdir)/tests/run_make_tests'; then \
|
||||
if $(PERL) -v >/dev/null 2>&1; then \
|
||||
case `cd $(srcdir); pwd` in `pwd`) : ;; \
|
||||
case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
|
||||
*) test -d tests || mkdir tests; \
|
||||
rm -f srctests; \
|
||||
if ln -s "$(srcdir)/tests" srctests; then \
|
||||
if ln -s '$(srcdir)/tests' srctests; then \
|
||||
for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
|
||||
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
|
||||
done; fi ;; \
|
||||
esac; \
|
||||
echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
||||
cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \
|
||||
echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
||||
cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
|
||||
else \
|
||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||
fi; \
|
||||
@@ -206,7 +207,7 @@ check-regression:
|
||||
# --------------- Maintainer's Section
|
||||
|
||||
# Tell automake that I haven't forgotten about this file and it will be
|
||||
# created before we build a distribution (see maintMakefile in the CVS
|
||||
# created before we build a distribution (see maintMakefile in the Git
|
||||
# distribution).
|
||||
|
||||
README:
|
||||
|
||||
46
Makefile.ami
46
Makefile.ami
@@ -3,7 +3,7 @@
|
||||
# NOTE: If you have no 'make' program at all to process this makefile, run
|
||||
# 'build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -134,7 +134,7 @@ srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
||||
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
|
||||
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
|
||||
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
|
||||
$(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \
|
||||
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
||||
|
||||
|
||||
@@ -273,36 +273,36 @@ $(objs): config.h
|
||||
# Automatically generated dependencies will be put at the end of the file.
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
|
||||
commands.o: commands.c makeint.h dep.h filedef.h variable.h job.h \
|
||||
commands.h
|
||||
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
||||
dir.o: dir.c make.h
|
||||
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||
misc.o: misc.c make.h dep.h
|
||||
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
||||
job.o: job.c makeint.h job.h filedef.h commands.h variable.h
|
||||
dir.o: dir.c makeint.h
|
||||
file.o: file.c makeint.h dep.h filedef.h job.h commands.h variable.h
|
||||
misc.o: misc.c makeint.h dep.h
|
||||
main.o: main.c makeint.h dep.h filedef.h variable.h job.h commands.h \
|
||||
getopt.h
|
||||
guile.o: guile.c make.h dep.h debug.h variable.h gmk-default.h
|
||||
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
guile.o: guile.c makeint.h dep.h debug.h variable.h gmk-default.h
|
||||
read.o: read.c makeint.h dep.h filedef.h job.h commands.h variable.h \
|
||||
glob/glob.h
|
||||
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
||||
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||
remake.o: remake.c makeint.h filedef.h job.h commands.h dep.h
|
||||
rule.o: rule.c makeint.h dep.h filedef.h job.h commands.h variable.h \
|
||||
rule.h
|
||||
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
||||
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
||||
implicit.o: implicit.c makeint.h rule.h dep.h filedef.h
|
||||
default.o: default.c makeint.h rule.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
||||
variable.o: variable.c makeint.h dep.h filedef.h job.h commands.h \
|
||||
variable.h
|
||||
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
||||
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
||||
expand.o: expand.c makeint.h filedef.h job.h commands.h variable.h
|
||||
function.o: function.c makeint.h filedef.h variable.h dep.h job.h \
|
||||
commands.h amiga.h
|
||||
vpath.o: vpath.c make.h filedef.h variable.h
|
||||
strcache.o: strcache.c make.h hash.h
|
||||
vpath.o: vpath.c makeint.h filedef.h variable.h
|
||||
strcache.o: strcache.c makeint.h hash.h
|
||||
version.o: version.c
|
||||
ar.o: ar.c make.h filedef.h dep.h
|
||||
arscan.o: arscan.c make.h
|
||||
ar.o: ar.c makeint.h filedef.h dep.h
|
||||
arscan.o: arscan.c makeint.h
|
||||
signame.o: signame.c signame.h
|
||||
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
||||
remote-stub.o: remote-stub.c makeint.h filedef.h job.h commands.h
|
||||
getopt.o: getopt.c
|
||||
getopt1.o : getopt1.c getopt.h
|
||||
getloadavg.o: getloadavg.c
|
||||
amiga.o: amiga.c make.h variable.h amiga.h
|
||||
amiga.o: amiga.c makeint.h variable.h amiga.h
|
||||
|
||||
92
NEWS
92
NEWS
@@ -1,6 +1,6 @@
|
||||
GNU make NEWS -*-indented-text-*-
|
||||
History of user-visible changes.
|
||||
05 March 2012
|
||||
23 Sep 2013
|
||||
|
||||
See the end of this file for copyrights and conditions.
|
||||
|
||||
@@ -9,7 +9,7 @@ manual, which is contained in this distribution as the file doc/make.texi.
|
||||
See the README file and the GNU make manual for instructions for
|
||||
reporting bugs.
|
||||
|
||||
Version 3.99.90
|
||||
Version 3.99.92
|
||||
|
||||
A complete list of bugs fixed in this version is available here:
|
||||
|
||||
@@ -23,15 +23,28 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
* Each backslash/newline (plus subsequent whitespace) is converted to a
|
||||
single space
|
||||
|
||||
* New command line option: --output-sync (-O) enables grouping of output by
|
||||
target or by recursive make. This is useful during parallel builds to avoid
|
||||
mixing output from different jobs together giving hard-to-understand
|
||||
results. Original implementation by David Boyce <dsb@boyski.com>.
|
||||
Reworked and enhanced by Frank Heckenbach <f.heckenbach@fh-soft.de>.
|
||||
Windows support by Eli Zaretskii <eliz@gnu.org>.
|
||||
|
||||
* New command line option: --trace enables tracing of targets. When enabled
|
||||
the recipe to be invoked is printed even if it would otherwise be suppressed
|
||||
by .SILENT or a "@" prefix character. Also before each recipe is run the
|
||||
makefile name and linenumber where it was defined are shown as well as the
|
||||
prerequisites that caused the target to be considered out of date.
|
||||
|
||||
* New command line option argument: --debug now accepts a "n" (none) flag
|
||||
which disables all debugging settings that are currently enabled.
|
||||
|
||||
* New feature: The "job server" capability is now supported on Windows.
|
||||
Implementation contributed by Troy Runkel <Troy.Runkel@mathworks.com>
|
||||
|
||||
* New feature: The .ONESHELL capability is now supported on Windows. Support
|
||||
added by Eli Zaretskii <eliz@gnu.org>.
|
||||
|
||||
* New feature: "!=" shell assignment operator as an alternative to the
|
||||
$(shell ...) function. Implemented for compatibility with BSD makefiles.
|
||||
WARNING: Backward-incompatibility!
|
||||
@@ -57,8 +70,24 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
|
||||
* New function: $(file ...) writes to a file.
|
||||
|
||||
* On failure, the makefile name and linenumber of the recipe that failed are
|
||||
shown.
|
||||
* New variable: $(GNUMAKEFLAGS) will be parsed for make flags, just like
|
||||
MAKEFLAGS is. It can be set in the environment or the makefile, containing
|
||||
GNU make-specific flags to allow your makefile to be portable to other
|
||||
versions of make. GNU make never sets or modifies GNUMAKEFLAGS.
|
||||
|
||||
* New variable: `MAKE_HOST' gives the name of the host architecture
|
||||
make was compiled for. This is the same value you see after 'Built for'
|
||||
when running 'make --version'.
|
||||
|
||||
* Behavior of MAKEFLAGS and MFLAGS is more rigorously defined. All simple
|
||||
flags are grouped together in the first word of MAKEFLAGS. No options that
|
||||
accept arguments appear there. If no simple flags are present MAKEFLAGS
|
||||
begins with a space. MFLAGS never begins with "- ".
|
||||
|
||||
* Setting the -r and -R options in MAKEFLAGS inside a makefile now works as
|
||||
expected, removing all built-in rules and variables, respectively.
|
||||
|
||||
* If a recipe fails, the makefile name and linenumber of the recipe are shown.
|
||||
|
||||
* A .RECIPEPREFIX setting is remembered per-recipe and variables expanded
|
||||
in that recipe also use that recipe prefix setting.
|
||||
@@ -66,8 +95,17 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
* In -p output, .RECIPEPREFIX settings are shown and all target-specific
|
||||
variables are output as if in a makefile, instead of as comments.
|
||||
|
||||
* On MS-Windows, recipes that use ".." quoting will no longer force
|
||||
invocation of commands via temporary batch files and stock Windows
|
||||
shells, they will be short-circuited and invoked directly. (In
|
||||
other words, " is no longer a special character for stock Windows
|
||||
shells.) This avoids hitting shell limits for command length when
|
||||
quotes are used, but nothing else in the command requires the shell.
|
||||
This change could potentially mean some minor incompatibilities in
|
||||
behavior when the recipe uses quoted string on shell command lines.
|
||||
|
||||
|
||||
Version 3.82
|
||||
Version 3.82 (28 Jul 2010)
|
||||
|
||||
A complete list of bugs fixed in this version is available here:
|
||||
|
||||
@@ -180,7 +218,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
|
||||
multi-line variable assignment.
|
||||
|
||||
|
||||
Version 3.81
|
||||
Version 3.81 (01 Apr 2006)
|
||||
|
||||
* GNU make is ported to OS/2.
|
||||
|
||||
@@ -303,7 +341,7 @@ Version 3.81
|
||||
could be found on the system.
|
||||
|
||||
* On VMS there is now support for case-sensitive filesystems such as ODS5.
|
||||
See the readme.vms file for information.
|
||||
See the README.VMS file for information.
|
||||
|
||||
* Parallel builds (-jN) no longer require a working Bourne shell on
|
||||
Windows platforms. They work even with the stock Windows shells, such
|
||||
@@ -321,7 +359,7 @@ A complete list of bugs fixed in this version is available here:
|
||||
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
|
||||
|
||||
|
||||
Version 3.80
|
||||
Version 3.80 (03 Oct 2002)
|
||||
|
||||
* A new feature exists: order-only prerequisites. These prerequisites
|
||||
affect the order in which targets are built, but they do not impact
|
||||
@@ -403,7 +441,7 @@ A complete list of bugs fixed in this version is available here:
|
||||
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
|
||||
|
||||
|
||||
Version 3.79.1
|
||||
Version 3.79.1 (23 Jun 2000)
|
||||
|
||||
* .SECONDARY with no prerequisites now prevents any target from being
|
||||
removed because make thinks it's an intermediate file, not just those
|
||||
@@ -412,7 +450,7 @@ Version 3.79.1
|
||||
* New configure option --disable-nsec-timestamps, but this was
|
||||
superseded in later versions by the .LOW_RESOLUTION_TIME pseudo-target.
|
||||
|
||||
Version 3.79
|
||||
Version 3.79 (04 Apr 2000)
|
||||
|
||||
* GNU make optionally supports internationalization and locales via the
|
||||
GNU gettext (or local gettext if suitable) package. See the ABOUT-NLS
|
||||
@@ -453,9 +491,9 @@ Version 3.79
|
||||
returned.
|
||||
|
||||
* Hartmut Becker provided many updates for the VMS port of GNU make.
|
||||
See the readme.vms file for more details.
|
||||
See the README.VMS file for more details.
|
||||
|
||||
Version 3.78
|
||||
Version 3.78 (22 Sep 1999)
|
||||
|
||||
* Two new functions, $(error ...) and $(warning ...) are available. The
|
||||
former will cause make to fail and exit immediately upon expansion of
|
||||
@@ -511,7 +549,7 @@ Version 3.78
|
||||
by running "make check" in the distribution. Note that it requires
|
||||
Perl (either Perl 4 or Perl 5) to run.
|
||||
|
||||
Version 3.77
|
||||
Version 3.77 (28 Jul 1998)
|
||||
|
||||
* Implement BSD make's "?=" variable assignment operator. The variable
|
||||
is assigned the specified value only if that variable is not already
|
||||
@@ -557,11 +595,11 @@ Version 3.77
|
||||
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
|
||||
and to the DOS port from Eli Zaretski (see README.DOS).
|
||||
|
||||
Version 3.76.1
|
||||
Version 3.76.1 (19 Sep 1997)
|
||||
|
||||
* Small (but serious) bug fix. Quick rollout to get into the GNU source CD.
|
||||
|
||||
Version 3.76
|
||||
Version 3.76 (16 Sep 1997)
|
||||
|
||||
* GNU make now uses automake to control Makefile.in generation. This
|
||||
should make it more consistent with the GNU standards.
|
||||
@@ -606,7 +644,7 @@ Version 3.76
|
||||
|
||||
* John W. Eaton has updated the VMS port to support libraries and VPATH.
|
||||
|
||||
Version 3.75
|
||||
Version 3.75 (27 Aug 1996)
|
||||
|
||||
* The directory messages printed by `-w' and implicitly in sub-makes,
|
||||
are now omitted if Make runs no commands and has no other messages to print.
|
||||
@@ -627,7 +665,7 @@ Version 3.75
|
||||
See README.W32 for details, and direct all Windows-related questions to
|
||||
<rob_tulloh@tivoli.com>.
|
||||
|
||||
Version 3.73
|
||||
Version 3.73 (05 Apr 1995)
|
||||
|
||||
* Converted to use Autoconf version 2, so `configure' has some new options.
|
||||
See INSTALL for details.
|
||||
@@ -635,7 +673,7 @@ Version 3.73
|
||||
* You can now send a SIGUSR1 signal to Make to toggle printing of debugging
|
||||
output enabled by -d, at any time during the run.
|
||||
|
||||
Version 3.72
|
||||
Version 3.72 (04 Nov 1994)
|
||||
|
||||
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
|
||||
He is maintaining the DOS port, not the GNU Make maintainer;
|
||||
@@ -669,7 +707,7 @@ Version 3.72
|
||||
of `.SILENT', then the recipe to update that file will not be printed
|
||||
before it is run. (This change was made to conform to POSIX.2.)
|
||||
|
||||
Version 3.71
|
||||
Version 3.71 (21 May 1994)
|
||||
|
||||
* The automatic variables `$(@D)', `$(%D)', `$(*D)', `$(<D)', `$(?D)', and
|
||||
`$(^D)' now omit the trailing slash from the directory name. (This change
|
||||
@@ -691,7 +729,7 @@ Version 3.71
|
||||
The exit status is 1 only when using -q and some target is not up to date.
|
||||
(This change was made to comply with POSIX.2.)
|
||||
|
||||
Version 3.70
|
||||
Version 3.70 (03 Jan 1994)
|
||||
|
||||
* It is no longer a fatal error to have a NUL character in a makefile.
|
||||
You should never put a NUL in a makefile because it can have strange
|
||||
@@ -702,7 +740,7 @@ Version 3.70
|
||||
makefile name and line number where the `include' appeared, so Emacs's
|
||||
C-x ` command takes you there (in case it's a typo you need to fix).
|
||||
|
||||
Version 3.69
|
||||
Version 3.69 (07 Nov 1993)
|
||||
|
||||
* Implicit rule search for archive member references is now done in the
|
||||
opposite order from previous versions: the whole target name `LIB(MEM)'
|
||||
@@ -732,7 +770,7 @@ Version 3.69
|
||||
* The recipe given for `.DEFAULT' is now used for phony targets with no
|
||||
recipe.
|
||||
|
||||
Version 3.68
|
||||
Version 3.68 (28 Jul 1993)
|
||||
|
||||
* You can list several archive member names inside parenthesis:
|
||||
`lib(mem1 mem2 mem3)' is equivalent to `lib(mem1) lib(mem2) lib(mem3)'.
|
||||
@@ -758,16 +796,16 @@ Version 3.68
|
||||
to set up variables for them. They used to run with the environment
|
||||
that `make' started with.
|
||||
|
||||
Version 3.66
|
||||
Version 3.66 (21 May 1993)
|
||||
|
||||
* `make --version' (or `make -v') now exits immediately after printing
|
||||
the version number.
|
||||
|
||||
Version 3.65
|
||||
Version 3.65 (09 May 1993)
|
||||
|
||||
* Make now supports long-named members in `ar' archive files.
|
||||
|
||||
Version 3.64
|
||||
Version 3.64 (21 Apr 1993)
|
||||
|
||||
* Make now supports the `+=' syntax for a variable definition which appends
|
||||
to the variable's previous value. See the section `Appending More Text
|
||||
@@ -781,7 +819,7 @@ Version 3.64
|
||||
* The built-in implicit rules now support the alternative extension
|
||||
`.txinfo' for Texinfo files, just like `.texinfo' and `.texi'.
|
||||
|
||||
Version 3.63
|
||||
Version 3.63 (22 Jan 1993)
|
||||
|
||||
* Make now uses a standard GNU `configure' script. See the new file
|
||||
INSTALL for the new (and much simpler) installation procedure.
|
||||
@@ -1161,7 +1199,7 @@ Version 3.05
|
||||
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# NOTE: If you have no 'make' program at all to process this makefile,
|
||||
# run 'build_w32.bat' instead.
|
||||
#
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -91,6 +91,7 @@ OBJS = \
|
||||
$(OUTDIR)/job.obj \
|
||||
$(OUTDIR)/main.obj \
|
||||
$(OUTDIR)/misc.obj \
|
||||
$(OUTDIR)/output.obj \
|
||||
$(OUTDIR)/read.obj \
|
||||
$(OUTDIR)/remake.obj \
|
||||
$(OUTDIR)/remote-stub.obj \
|
||||
|
||||
26
README.Amiga
26
README.Amiga
@@ -11,7 +11,7 @@ GNU make):
|
||||
- Can run multi-line statements
|
||||
- Allows to use Device-Names in targets:
|
||||
|
||||
c:make : make.o
|
||||
c:make : make.o
|
||||
|
||||
is ok. To distinguish between device-names and target : or ::, MAKE
|
||||
looks for spaces. If there are any around :, it's taken as a target
|
||||
@@ -19,14 +19,14 @@ GNU make):
|
||||
that "make:make.o" tries to create "make.o" on the device "make:".
|
||||
- Replaces @@ by a newline in any command line:
|
||||
|
||||
if exists make @@\
|
||||
delete make.bak quiet @@\
|
||||
rename make make.bak @@\
|
||||
endif @@\
|
||||
$(CC) Link Make.o To make
|
||||
if exists make @@\
|
||||
delete make.bak quiet @@\
|
||||
rename make make.bak @@\
|
||||
endif @@\
|
||||
$(CC) Link Make.o To make
|
||||
|
||||
works. Note that the @@ must stand alone (ie. "make@@\" is illegal).
|
||||
Also be carefull that there is a space after the "\" (ie, at the
|
||||
works. Note that the @@ must stand alone (i.e., "make@@\" is illegal).
|
||||
Also be careful that there is a space after the "\" (i.e., at the
|
||||
beginning of the next line).
|
||||
- Can be made resident to save space and time
|
||||
- Amiga specific wildcards can be used in $(wildcard ...)
|
||||
@@ -36,17 +36,17 @@ BUGS:
|
||||
|
||||
dummy.h : src/*.c
|
||||
|
||||
tries to make dummy.h from "src/*.c" (ie. no wildcard-expansion takes
|
||||
tries to make dummy.h from "src/*.c" (i.e., no wildcard-expansion takes
|
||||
place). You have to use "$(wildcard src/*.c)" instead.
|
||||
|
||||
COMPILING FROM SCRATCH
|
||||
----------------------
|
||||
|
||||
To recompile, you need SAS/C 6.51. make itself is not neccessary, there
|
||||
To recompile, you need SAS/C 6.51. make itself is not necessary, there
|
||||
is an smakefile.
|
||||
|
||||
1. Copy config.ami to config.h
|
||||
2. If you use make to compie, copy Makefile.ami to Makefile and
|
||||
2. If you use make to compile, copy Makefile.ami to Makefile and
|
||||
glob/Makefile.ami to glob/Makefile. Copy make into the current
|
||||
directory.
|
||||
|
||||
@@ -54,14 +54,14 @@ is an smakefile.
|
||||
|
||||
INSTALLATION
|
||||
|
||||
Copy make somewhere in your search path (eg. sc:c or sc:bin).
|
||||
Copy make somewhere in your search path (e.g., sc:c or sc:bin).
|
||||
If you plan to use recursive makes, install make resident:
|
||||
|
||||
Resident make Add
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -62,7 +62,7 @@ To build from sources:
|
||||
[Enter]. Otherwise, you need to supply the path to the source
|
||||
directory as an argument to the batch file, like this:
|
||||
|
||||
c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
|
||||
c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
|
||||
|
||||
Note the forward slashes in the source path argument: you MUST
|
||||
use them here.
|
||||
@@ -84,7 +84,7 @@ To build from sources:
|
||||
If you are building from outside of the source directory, you
|
||||
need to tell Make where the sources are, like this:
|
||||
|
||||
make srcdir=c:/djgpp/gnu/make-%VERSION%
|
||||
make srcdir=c:/djgpp/gnu/make-%VERSION%
|
||||
|
||||
(configure.bat will tell you this when it finishes). You MUST
|
||||
use a full, not relative, name of the source directory here, or
|
||||
@@ -99,7 +99,7 @@ To build from sources:
|
||||
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
|
||||
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.
|
||||
@@ -110,12 +110,12 @@ To build from sources:
|
||||
file 'dir' in your Info directory by adding the following item
|
||||
to the main menu:
|
||||
|
||||
* Make: (make.info). The GNU make utility.
|
||||
* Make: (make.info). The GNU make utility.
|
||||
|
||||
If you have the 'install-info' program (from the GNU Texinfo
|
||||
package), it will do that for you if you invoke it like this:
|
||||
|
||||
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
|
||||
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
|
||||
|
||||
(If your Info directory is other than C:\DJGPP\INFO, change this
|
||||
command accordingly.)
|
||||
@@ -320,11 +320,11 @@ Bug reports:
|
||||
|
||||
|
||||
Enjoy,
|
||||
Eli Zaretskii <eliz@is.elta.co.il>
|
||||
Eli Zaretskii <eliz@is.elta.co.il>
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -160,7 +160,7 @@ from the make source tree.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2003-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -1,23 +1,33 @@
|
||||
This is the VMS version of GNU Make, updated by Hartmut Becker
|
||||
|
||||
Changes are based on GNU make 3.82.
|
||||
|
||||
This version was built and tested on OpenVMS V7.3 (VAX), V7.3-2 (Alpha) and
|
||||
V8.3-1H1 (I64).
|
||||
This version of GNU make has been tested on
|
||||
OpenVMS V8.3 (Alpha) and V8.4 (Integrity).
|
||||
|
||||
Build instructions
|
||||
------------------
|
||||
Make a 1st version
|
||||
$ @makefile.com ! ignore any compiler and/or linker warning
|
||||
$ rena make.exe 1st-make.exe
|
||||
Use the 1st version to generate a 2nd version
|
||||
$ mc sys$disk:[]1st-make clean
|
||||
$ copy make.exe 1st-make.exe
|
||||
Use the 1st version to generate a 2nd version
|
||||
$ mc sys$disk:[]1st-make clean ! ignore any file not found messages
|
||||
$ mc sys$disk:[]1st-make
|
||||
Verify your 2nd version
|
||||
$ rena make.exe 2nd-make.exe
|
||||
Verify your 2nd version
|
||||
$ copy make.exe 2nd-make.exe
|
||||
$ mc sys$disk:[]2nd-make clean
|
||||
$ mc sys$disk:[]2nd-make
|
||||
Don't use the HP C V7.2-001 compiler, which has an incompatible change
|
||||
how __STDC__ is defined. This results at least in compile time warnings.
|
||||
|
||||
Changes since GNU make 3.82
|
||||
---------------------------
|
||||
|
||||
Changes (3.81.90)
|
||||
Fix build problems.
|
||||
|
||||
The new feature "Loadable objects" is not yet supported. If you need it,
|
||||
please send a change request or submit a bug report.
|
||||
|
||||
The new option --output-sync (-O) is accepted but has no effect: GNU make
|
||||
for VMS does not support running multiple commands simultaneously.
|
||||
|
||||
Changes for GNU make 3.82
|
||||
|
||||
Michael Gehre (at VISTEC-SEMI dot COM) supplied a fix for a problem with
|
||||
timestamps of object modules in OLBs. The timestamps were not correctly
|
||||
@@ -34,30 +44,6 @@ systems.
|
||||
|
||||
Build fixes for const-ified code in VMS specific sources.
|
||||
|
||||
Build notes:
|
||||
- Try to avoid HP C V7.2-001, which has an incompatible change
|
||||
how __STDC__ is defined. This results at least in compile time warnings.
|
||||
|
||||
- On V8.3-1H1, if you press Ctrl+C you may see a traceback, starting with
|
||||
%SYSTEM-F-CONTROLC, operation completed under CTRL/C
|
||||
%TRACE-F-TRACEBACK, symbolic stack dump follows
|
||||
image module routine line rel PC abs PC
|
||||
|
||||
DECC$SHR C$SIGNAL gsignal 27991 0000000000001180
|
||||
FFFFFFFF84AB2DA0
|
||||
DECC$SHR C$SIGNAL raise 28048 0000000000001280
|
||||
FFFFFFFF84AB2EA0
|
||||
DECC$SHR C$SIGPENDING decc$$deliver_signals
|
||||
12475 0000000000000890
|
||||
FFFFFFFF84C13690
|
||||
...
|
||||
This looks like an incompatibility to the Alpha and VAX behavior, so it looks
|
||||
like a problem in I64 VMS version(s).
|
||||
|
||||
- There is no clean build on VAX. In the environment I tested, I had to use GNU
|
||||
make's alloca which produced a couple of compile time warnings. It seems too
|
||||
much effort to work on a clean build on VAX.
|
||||
|
||||
A note on appending the redirected output. With this change, a simple mechanism
|
||||
is implemented to make ">>" work in action lines. In VMS there is no simple
|
||||
feature like ">>" to have DCL command or program output redirected and appended
|
||||
@@ -78,117 +64,24 @@ happens. Pressing Ctrl+Y to abort make is one case. In case of Ctrl+Y the
|
||||
associated command procedure is left in SYS$SCRATCH as well. Its name is
|
||||
CMDxxxxx.COM.
|
||||
|
||||
Change in the Ctrl+Y handling
|
||||
Change in the Ctrl+Y handling. The CtrlY handler now uses $delprc to delete all
|
||||
children. This way also actions with DCL commands will be stopped. As before
|
||||
the CtrlY handler then sends SIGQUIT to itself, which is handled in common
|
||||
code.
|
||||
|
||||
Ctrl+Y was: The CtrlY handler called $forcex for the current child.
|
||||
|
||||
Ctrl+Y changed: The CtrlY handler uses $delprc to delete all children. This way
|
||||
also actions with DCL commands will be stopped. As before Ctrl+Y then sends
|
||||
SIGQUIT to itself, which is handled in common code.
|
||||
|
||||
Change in deleteing temporary command files
|
||||
|
||||
Temporary command files were deleted in the main line, after returning from the
|
||||
vms child termination handler. If Ctrl+C was pressed, the handler is called but
|
||||
did not return to main line.
|
||||
|
||||
Now, temporary command files are deleted in the vms child termination
|
||||
handler. That deletes the them even if a Ctrl+C was pressed.
|
||||
Change in deleteing temporary command files. Temporary command files are now
|
||||
deleted in the vms child termination handler. That deletes them even if
|
||||
a Ctrl+C was pressed.
|
||||
|
||||
The behavior of pressing Ctrl+C is not changed. It still has only an effect,
|
||||
after the current action is terminated. If that doesn't happen or takes too
|
||||
long, Ctrl+Y should be used instead.
|
||||
|
||||
Changes (3.80)
|
||||
Changes for GNU make 3.80
|
||||
|
||||
. In default.c define variable ARCH as IA64 for VMS on Itanium systems.
|
||||
|
||||
. In makefile.vms avoid name collision for glob and globfree.
|
||||
|
||||
In newer version of the VMS CRTL there are glob and globfree implemented.
|
||||
Compiling and linking may result in
|
||||
|
||||
%ILINK-W-MULDEFLNKG, symbol DECC$GLOBFREE has subsequent linkage definition
|
||||
in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;1
|
||||
%ILINK-W-MULDEF, symbol DECC$GLOBFREE multiply defined
|
||||
in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;1
|
||||
|
||||
linker messages (and similar for DECC$GLOB). The messages just say, that
|
||||
globfree is a known CRTL whose name was mapped by the compiler to
|
||||
DECC$GLOBFREE. This is done in glob.c as well, so this name is defined
|
||||
twice. One possible solution is to use the VMS versions of glob and
|
||||
globfree. However, then the build environment needs to figure out if
|
||||
there is a new CRTL supporting these or not. This adds complexity. Even
|
||||
more, these functions return VMS file specifications, which is not
|
||||
expected by the other make sources. There is a switch at run time (a VMS
|
||||
logical DECC$GLOB_UNIX_STYLE), which can be set to get Unix style
|
||||
names. This may conflict with other software. The recommended solution
|
||||
for this is to set this switch just prior to calling main: in an
|
||||
initialization routine. This adds more complexity and more VMS specific
|
||||
code. It is easier to tell the compiler NOT to map the routine names
|
||||
with a simple change in makefile.vms.
|
||||
|
||||
Some notes on case sensitive names in rules and on the disk. In the VMS
|
||||
template for CONFIG.H case sensitive rules can be enabled with defining
|
||||
WANT_CASE_SENSITIVE_TARGETS. For recent version of VMS there is a case
|
||||
sensitive file system: ODS5. To make use of that, additionally un-defining
|
||||
the HAVE_CASE_INSENSITIVE_FS is required. As these are C macros, different
|
||||
versions of make need to be built to have any case sensitivity for VMS
|
||||
working. Unfortunately, for ODS5 disks that's not all.
|
||||
|
||||
- Usually DCL upcases command line tokens (except strings) and usually the
|
||||
file system is case blind (similar to how Windows systems work)
|
||||
$ set proc/parse=extended/case=sensitive
|
||||
preserves lower and UPPER on the command line and (for this process and all
|
||||
sub-processes) enables case sensitivity in the file system
|
||||
|
||||
- Usually the CRTL tries to reverse what DCL did with command line tokens, it
|
||||
lowercases all tokens (except strings)
|
||||
$ define DECC$ARGV_PARSE_STYLE enable
|
||||
passes (the now preserved) lower and UPPER from the command line to main()
|
||||
|
||||
- Usually the CRTL upcases the arguments to open() and friends
|
||||
$ define DECC$EFS_CASE_PRESERVE enable
|
||||
preserves the names as is.
|
||||
|
||||
It is important to know that not all VMS tools are ready for case sensitivity.
|
||||
With this setup some tools may not work as expected. The setup should not
|
||||
blindly be applied for all users in default login procedures.
|
||||
|
||||
Example? The poor coding gives a compiler message, showing that there are
|
||||
different files:
|
||||
|
||||
$ dir
|
||||
|
||||
Directory ODS5DISK[HB]
|
||||
|
||||
A.c;1 B.c;1 c.c;1 X.c;1
|
||||
x.c;1
|
||||
|
||||
Total of 5 files.
|
||||
$ ods5make x.obj
|
||||
cc /obj=x.obj x.c
|
||||
|
||||
foo(){lowercase_x();}
|
||||
......^
|
||||
%CC-I-IMPLICITFUNC, In this statement, the identifier "lowercase_x" is implicitly declared as a function.
|
||||
at line number 1 in file ODS5DISK[HB]x.c;1
|
||||
$ mc SYS$SYSDEVICE:[HARTMUT.MAKE_3_80P]ods5make X.obj
|
||||
cc /obj=X.obj X.c
|
||||
|
||||
foo() {UPPERCASE_X();}
|
||||
.......^
|
||||
%CC-I-IMPLICITFUNC, In this statement, the identifier "UPPERCASE_X" is implicitly declared as a function.
|
||||
at line number 1 in file ODS5DISK[HB]X.c;1
|
||||
$ dir
|
||||
|
||||
Directory ODS5DISK[HB]
|
||||
|
||||
A.c;1 B.c;1 c.c;1 X.c;1
|
||||
x.c;1 X.obj;1 x.obj;1
|
||||
|
||||
Total of 7 files.
|
||||
$
|
||||
|
||||
This is the VMS port of GNU Make done by Hartmut.Becker@compaq.com.
|
||||
|
||||
@@ -353,7 +246,7 @@ replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
|
||||
somewhere in the future. Be warned, the time resolution inside make is
|
||||
less than what vms provides. This might be a problem on the faster Alphas.
|
||||
|
||||
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||
You can use a : in a filename only if you precede it with a backslash ('\').
|
||||
E.g.- hobbes\:[bogas.files]
|
||||
|
||||
Make ignores success, informational, or warning errors (-S-, -I-, or
|
||||
@@ -375,7 +268,7 @@ Long command lines are now converted to command files.
|
||||
Comma (',') as a separator is now allowed. See makefile.vms for an example.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -55,7 +55,7 @@ Building with (MinGW-)GCC using build_w32.bat
|
||||
2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
|
||||
correct PATH and other environment variables for it, then execute ...
|
||||
|
||||
build_w32.bat gcc
|
||||
build_w32.bat gcc
|
||||
|
||||
This produces gnumake.exe in the current directory.
|
||||
|
||||
@@ -75,13 +75,13 @@ Building with (MSVC++-)cl using build_w32.bat or NMakefile
|
||||
e.g. "%VS71COMNTOOLS%vsvars32.bat"; or using a corresponding start
|
||||
menue entry from the cl-installation), then execute EITHER ...
|
||||
|
||||
build_w32.bat
|
||||
build_w32.bat
|
||||
|
||||
(this produces WinDebug/gnumake.exe and WinRel/gnumake.exe)
|
||||
|
||||
... OR ...
|
||||
|
||||
nmake /f NMakefile
|
||||
nmake /f NMakefile
|
||||
|
||||
(this produces WinDebug/make.exe and WinRel/make.exe).
|
||||
|
||||
@@ -97,203 +97,203 @@ Building with (MSVC++-)cl using build_w32.bat or NMakefile
|
||||
|
||||
GNU make on Windows 32-bit platforms:
|
||||
|
||||
This version of make is ported natively to Windows32 platforms
|
||||
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
|
||||
Windows 95, and Windows 98). It does not rely on any 3rd party
|
||||
software or add-on packages for building. The only thing
|
||||
needed is a Windows compiler. Two compilers supported
|
||||
officially are the MinGW port of GNU GCC, and the various
|
||||
versions of the Microsoft C compiler.
|
||||
This version of make is ported natively to Windows32 platforms
|
||||
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
|
||||
Windows 95, and Windows 98). It does not rely on any 3rd party
|
||||
software or add-on packages for building. The only thing
|
||||
needed is a Windows compiler. Two compilers supported
|
||||
officially are the MinGW port of GNU GCC, and the various
|
||||
versions of the Microsoft C compiler.
|
||||
|
||||
Do not confuse this port of GNU make with other Windows32 projects
|
||||
which provide a GNU make binary. These are separate projects
|
||||
and are not connected to this port effort.
|
||||
Do not confuse this port of GNU make with other Windows32 projects
|
||||
which provide a GNU make binary. These are separate projects
|
||||
and are not connected to this port effort.
|
||||
|
||||
GNU make and sh.exe:
|
||||
|
||||
This port prefers if you have a working sh.exe somewhere on
|
||||
your system. If you don't have sh.exe, the port falls back to
|
||||
MSDOS mode for launching programs (via a batch file). The
|
||||
MSDOS mode style execution has not been tested that carefully
|
||||
though (The author uses GNU bash as sh.exe).
|
||||
This port prefers if you have a working sh.exe somewhere on
|
||||
your system. If you don't have sh.exe, the port falls back to
|
||||
MSDOS mode for launching programs (via a batch file). The
|
||||
MSDOS mode style execution has not been tested that carefully
|
||||
though (The author uses GNU bash as sh.exe).
|
||||
|
||||
There are very few true ports of Bourne shell for NT right now.
|
||||
There is a version of GNU bash available from Cygnus "Cygwin"
|
||||
porting effort (http://www.cygwin.com/).
|
||||
Other possibilities are the MKS version of sh.exe, or building
|
||||
There are very few true ports of Bourne shell for NT right now.
|
||||
There is a version of GNU bash available from Cygnus "Cygwin"
|
||||
porting effort (http://www.cygwin.com/).
|
||||
Other possibilities are the MKS version of sh.exe, or building
|
||||
your own with a package like NutCracker (DataFocus) or Portage
|
||||
(Consensys). Also MinGW includes sh (http://mingw.org/).
|
||||
|
||||
GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
||||
|
||||
Some versions of Bourne shell do not behave well when invoked
|
||||
as 'sh -c' from CreateProcess(). The main problem is they seem
|
||||
to have a hard time handling quoted strings correctly. This can
|
||||
be circumvented by writing commands to be executed to a batch
|
||||
file and then executing the command by calling 'sh file'.
|
||||
Some versions of Bourne shell do not behave well when invoked
|
||||
as 'sh -c' from CreateProcess(). The main problem is they seem
|
||||
to have a hard time handling quoted strings correctly. This can
|
||||
be circumvented by writing commands to be executed to a batch
|
||||
file and then executing the command by calling 'sh file'.
|
||||
|
||||
To work around this difficulty, this version of make supports
|
||||
a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
|
||||
time, make forces all command lines to be executed via script
|
||||
files instead of by command line. In this mode you must have a
|
||||
working sh.exe in order to use parallel builds (-j).
|
||||
To work around this difficulty, this version of make supports
|
||||
a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
|
||||
time, make forces all command lines to be executed via script
|
||||
files instead of by command line. In this mode you must have a
|
||||
working sh.exe in order to use parallel builds (-j).
|
||||
|
||||
A native Windows32 system with no Bourne shell will also run
|
||||
in batch mode. All command lines will be put into batch files
|
||||
and executed via $(COMSPEC) (%COMSPEC%). However, parallel
|
||||
builds ARE supported with Windows shells (cmd.exe and
|
||||
command.com). See the next section about some peculiarities
|
||||
of parallel builds on Windows.
|
||||
A native Windows32 system with no Bourne shell will also run
|
||||
in batch mode. All command lines will be put into batch files
|
||||
and executed via $(COMSPEC) (%COMSPEC%). However, parallel
|
||||
builds ARE supported with Windows shells (cmd.exe and
|
||||
command.com). See the next section about some peculiarities
|
||||
of parallel builds on Windows.
|
||||
|
||||
Support for parallel builds
|
||||
|
||||
Parallel builds (-jN) are supported in this port, with 1
|
||||
limitation: The number of concurrent processes has a hard
|
||||
limit of 64, due to the way this port implements waiting for
|
||||
its subprocesses.
|
||||
Parallel builds (-jN) are supported in this port, with 1
|
||||
limitation: The number of concurrent processes has a hard
|
||||
limit of 64, due to the way this port implements waiting for
|
||||
its subprocesses.
|
||||
|
||||
GNU make and Cygnus GNU Windows32 tools:
|
||||
|
||||
Good news! Make now has native support for Cygwin sh. To enable,
|
||||
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
||||
from scratch. This version of make tested with B20.1 of Cygwin.
|
||||
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
||||
Good news! Make now has native support for Cygwin sh. To enable,
|
||||
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
||||
from scratch. This version of make tested with B20.1 of Cygwin.
|
||||
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
||||
|
||||
GNU make and the MKS shell:
|
||||
|
||||
There is now semi-official support for the MKS shell. To turn this
|
||||
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||
on HAVE_MKS_SHELL.
|
||||
There is now semi-official support for the MKS shell. To turn this
|
||||
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||
on HAVE_MKS_SHELL.
|
||||
|
||||
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
|
||||
There is a caveat that should be noted with respect to handling
|
||||
single character pathnames on Windows systems. When colon is
|
||||
used in PATH variables, make tries to be smart about knowing when
|
||||
you are using colon as a separator versus colon as a drive
|
||||
letter. Unfortunately, something as simple as the string 'x:/'
|
||||
could be interpreted 2 ways: (x and /) or (x:/).
|
||||
There is a caveat that should be noted with respect to handling
|
||||
single character pathnames on Windows systems. When colon is
|
||||
used in PATH variables, make tries to be smart about knowing when
|
||||
you are using colon as a separator versus colon as a drive
|
||||
letter. Unfortunately, something as simple as the string 'x:/'
|
||||
could be interpreted 2 ways: (x and /) or (x:/).
|
||||
|
||||
Make chooses to interpret a letter plus colon (e.g. x:/) as a
|
||||
drive letter pathname. If it is necessary to use single
|
||||
character directories in paths (VPATH, vpath, Path, PATH), the
|
||||
user must do one of two things:
|
||||
Make chooses to interpret a letter plus colon (e.g. x:/) as a
|
||||
drive letter pathname. If it is necessary to use single
|
||||
character directories in paths (VPATH, vpath, Path, PATH), the
|
||||
user must do one of two things:
|
||||
|
||||
a. Use semicolon as the separator to disambiguate colon. For
|
||||
example use 'x;/' if you want to say 'x' and '/' are
|
||||
separate components.
|
||||
a. Use semicolon as the separator to disambiguate colon. For
|
||||
example use 'x;/' if you want to say 'x' and '/' are
|
||||
separate components.
|
||||
|
||||
b. Qualify the directory name so that there is more than
|
||||
one character in the path(s) used. For example, none
|
||||
of these settings are ambiguous:
|
||||
b. Qualify the directory name so that there is more than
|
||||
one character in the path(s) used. For example, none
|
||||
of these settings are ambiguous:
|
||||
|
||||
./x:./y
|
||||
/some/path/x:/some/path/y
|
||||
x:/some/path/x:x:/some/path/y
|
||||
./x:./y
|
||||
/some/path/x:/some/path/y
|
||||
x:/some/path/x:x:/some/path/y
|
||||
|
||||
Please note that you are free to mix colon and semi-colon in the
|
||||
specification of paths. Make is able to figure out the intended
|
||||
result and convert the paths internally to the format needed
|
||||
when interacting with the operating system, providing the path
|
||||
is not within quotes, e.g. "x:/test/test.c".
|
||||
Please note that you are free to mix colon and semi-colon in the
|
||||
specification of paths. Make is able to figure out the intended
|
||||
result and convert the paths internally to the format needed
|
||||
when interacting with the operating system, providing the path
|
||||
is not within quotes, e.g. "x:/test/test.c".
|
||||
|
||||
You are encouraged to use colon as the separator character.
|
||||
This should ease the pain of deciding how to handle various path
|
||||
problems which exist between platforms. If colon is used on
|
||||
both Unix and Windows systems, then no ifdef'ing will be
|
||||
necessary in the makefile source.
|
||||
You are encouraged to use colon as the separator character.
|
||||
This should ease the pain of deciding how to handle various path
|
||||
problems which exist between platforms. If colon is used on
|
||||
both Unix and Windows systems, then no ifdef'ing will be
|
||||
necessary in the makefile source.
|
||||
|
||||
GNU make test suite:
|
||||
|
||||
I verified all functionality with a slightly modified version
|
||||
of make-test-%VERSION% (modifications to get test suite to run
|
||||
on Windows NT). All tests pass in an environment that includes
|
||||
sh.exe. Tests were performed on both Windows NT and Windows 95.
|
||||
I verified all functionality with a slightly modified version
|
||||
of make-test-%VERSION% (modifications to get test suite to run
|
||||
on Windows NT). All tests pass in an environment that includes
|
||||
sh.exe. Tests were performed on both Windows NT and Windows 95.
|
||||
|
||||
Pathnames and white space:
|
||||
|
||||
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
||||
contain white space (e.g. C:\Program Files\). These sorts of
|
||||
pathnames are valid on Unix too, but are never encouraged.
|
||||
There is at least one place in make (VPATH/vpath handling) where
|
||||
paths containing white space will simply not work. There may be
|
||||
others too. I chose to not try and port make in such a way so
|
||||
that these sorts of paths could be handled. I offer these
|
||||
suggestions as workarounds:
|
||||
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
||||
contain white space (e.g. C:\Program Files\). These sorts of
|
||||
pathnames are valid on Unix too, but are never encouraged.
|
||||
There is at least one place in make (VPATH/vpath handling) where
|
||||
paths containing white space will simply not work. There may be
|
||||
others too. I chose to not try and port make in such a way so
|
||||
that these sorts of paths could be handled. I offer these
|
||||
suggestions as workarounds:
|
||||
|
||||
1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
|
||||
"x:\longpathtest". Type "dir /x" to view these filenames
|
||||
within the cmd.exe shell.
|
||||
2. Rename the directory so it does not contain white space.
|
||||
1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
|
||||
"x:\longpathtest". Type "dir /x" to view these filenames
|
||||
within the cmd.exe shell.
|
||||
2. Rename the directory so it does not contain white space.
|
||||
|
||||
If you are unhappy with this choice, this is free software
|
||||
and you are free to take a crack at making this work. The code
|
||||
in w32/pathstuff.c and vpath.c would be the places to start.
|
||||
If you are unhappy with this choice, this is free software
|
||||
and you are free to take a crack at making this work. The code
|
||||
in w32/pathstuff.c and vpath.c would be the places to start.
|
||||
|
||||
Pathnames and Case insensitivity:
|
||||
|
||||
Unlike Unix, Windows 95/NT systems are case insensitive but case
|
||||
preserving. For example if you tell the file system to create a
|
||||
file named "Target", it will preserve the case. Subsequent access to
|
||||
the file with other case permutations will succeed (i.e. opening a
|
||||
file named "target" or "TARGET" will open the file "Target").
|
||||
Unlike Unix, Windows 95/NT systems are case insensitive but case
|
||||
preserving. For example if you tell the file system to create a
|
||||
file named "Target", it will preserve the case. Subsequent access to
|
||||
the file with other case permutations will succeed (i.e. opening a
|
||||
file named "target" or "TARGET" will open the file "Target").
|
||||
|
||||
By default, GNU make retains its case sensitivity when comparing
|
||||
target names and existing files or directories. It can be
|
||||
configured, however, into a case preserving and case insensitive
|
||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||
config.h.W32.
|
||||
By default, GNU make retains its case sensitivity when comparing
|
||||
target names and existing files or directories. It can be
|
||||
configured, however, into a case preserving and case insensitive
|
||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||
config.h.W32.
|
||||
|
||||
For example, the following makefile will create a file named
|
||||
Target in the directory subdir which will subsequently be used
|
||||
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
|
||||
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
|
||||
will not be made:
|
||||
For example, the following makefile will create a file named
|
||||
Target in the directory subdir which will subsequently be used
|
||||
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
|
||||
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
|
||||
will not be made:
|
||||
|
||||
subdir/Target:
|
||||
touch $@
|
||||
subdir/Target:
|
||||
touch $@
|
||||
|
||||
SUBDIR/DepTarget: SubDir/TARGET
|
||||
cp $^ $@
|
||||
SUBDIR/DepTarget: SubDir/TARGET
|
||||
cp $^ $@
|
||||
|
||||
Reliance on this behavior also eliminates the ability of GNU make
|
||||
to use case in comparison of matching rules. For example, it is
|
||||
not possible to set up a C++ rule using %.C that is different
|
||||
than a C rule using %.c. GNU make will consider these to be the
|
||||
same rule and will issue a warning.
|
||||
Reliance on this behavior also eliminates the ability of GNU make
|
||||
to use case in comparison of matching rules. For example, it is
|
||||
not possible to set up a C++ rule using %.C that is different
|
||||
than a C rule using %.c. GNU make will consider these to be the
|
||||
same rule and will issue a warning.
|
||||
|
||||
SAMBA/NTFS/VFAT:
|
||||
|
||||
I have not had any success building the debug version of this
|
||||
package using SAMBA as my file server. The reason seems to be
|
||||
related to the way VC++ 4.0 changes the case name of the pdb
|
||||
filename it is passed on the command line. It seems to change
|
||||
the name always to to lower case. I contend that the VC++
|
||||
compiler should not change the casename of files that are passed
|
||||
as arguments on the command line. I don't think this was a
|
||||
problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
|
||||
I have not had any success building the debug version of this
|
||||
package using SAMBA as my file server. The reason seems to be
|
||||
related to the way VC++ 4.0 changes the case name of the pdb
|
||||
filename it is passed on the command line. It seems to change
|
||||
the name always to to lower case. I contend that the VC++
|
||||
compiler should not change the casename of files that are passed
|
||||
as arguments on the command line. I don't think this was a
|
||||
problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
|
||||
|
||||
The package builds fine on VFAT and NTFS filesystems.
|
||||
The package builds fine on VFAT and NTFS filesystems.
|
||||
|
||||
Most all of the development I have done to date has been using
|
||||
NTFS and long file names. I have not done any considerable work
|
||||
under VFAT. VFAT users may wish to be aware that this port of
|
||||
make does respect case sensitivity.
|
||||
Most all of the development I have done to date has been using
|
||||
NTFS and long file names. I have not done any considerable work
|
||||
under VFAT. VFAT users may wish to be aware that this port of
|
||||
make does respect case sensitivity.
|
||||
|
||||
FAT:
|
||||
|
||||
Version 3.76 added support for FAT filesystems. Make works
|
||||
around some difficulties with stat'ing of files and caching of
|
||||
filenames and directories internally.
|
||||
Version 3.76 added support for FAT filesystems. Make works
|
||||
around some difficulties with stat'ing of files and caching of
|
||||
filenames and directories internally.
|
||||
|
||||
Bug reports:
|
||||
|
||||
Please submit bugs via the normal bug reporting mechanism which
|
||||
is described in the GNU make manual and the base README.
|
||||
Please submit bugs via the normal bug reporting mechanism which
|
||||
is described in the GNU make manual and the base README.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -96,7 +96,7 @@ SunOS 4.1.x:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1998-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-*-text-*-
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -17,35 +17,65 @@ You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Obtaining CVS Code
|
||||
Obtaining Git Code
|
||||
------------------
|
||||
|
||||
This seems redundant, since if you're reading this you most likely have
|
||||
already performed this step; however, for completeness, you can obtain
|
||||
the GNU make source code via anonymous CVS from the FSF's Savannah
|
||||
project <http://savannah.gnu.org/projects/make/>:
|
||||
already performed this step; however, for completeness, you can obtain the GNU
|
||||
make source code via Git from the FSF's Savannah project
|
||||
<http://savannah.gnu.org/projects/make/>:
|
||||
|
||||
$ cvs -d:pserver:anoncvs@cvs.savannah.gnu.org:/sources/make co make
|
||||
|
||||
You might want to use the "-z3" option to get compression, and you most
|
||||
certainly will want the -P option to avoid unneeded directories
|
||||
cluttering up your source. Personally I add these (as well as -dP for
|
||||
update) to my ~/.cvsrc file.
|
||||
$ git clone git://git.savannah.gnu.org/make.git
|
||||
|
||||
|
||||
If you have an older version of CVS, you might have to login first.
|
||||
There is no password; just hit the ENTER key if you are asked for one.
|
||||
|
||||
|
||||
Building From CVS
|
||||
Changes using Git
|
||||
-----------------
|
||||
|
||||
To build GNU make from CVS, you will need Autoconf, Automake, and
|
||||
For non-developers, please continue to provide patches as before, or if you
|
||||
make a public repository I can pull from that if you prefer.
|
||||
|
||||
For developers, I'm still new to Git myself, so I don't have a ton of advice.
|
||||
In this release we will continue to create ChangeLog files by hand so please
|
||||
don't forget to update the ChangeLog.
|
||||
|
||||
Rule #1: Don't rewrite pushed history (don't use "git push --force").
|
||||
|
||||
Typical simple workflow might be:
|
||||
|
||||
* Edit files
|
||||
* Use "git status" and "git diff" to verify your changes
|
||||
* Use "git add" to stage the changes you want to make
|
||||
* Use "git commit" to commit the staged changes to your local repository
|
||||
* Use "git pull" to accept & merge new changes from the Savannah repository
|
||||
* Use "git push" to push your commits back to the Savannah repository
|
||||
|
||||
For Emacs users, there are many options for Git integration but I strongly
|
||||
recommend the Magit package: http://www.emacswiki.org/emacs/Magit
|
||||
It makes the workflow much clearer, and has advanced features such as
|
||||
constructing multiple commits from various files and even from different
|
||||
diff chunks in the same file. There is a video available which helps a lot.
|
||||
|
||||
|
||||
Coding Standards
|
||||
----------------
|
||||
|
||||
GNU make code adheres to the GNU Coding Standards. Additionally, GNU make is
|
||||
a foundational bootstrap package for the GNU project; as such it is very
|
||||
conservative about language features it expects. It should build with any C
|
||||
compiler conforming to the ANSI C89 / ISO C90 standard.
|
||||
|
||||
Please use only spaces and no TAB characters in source code.
|
||||
|
||||
|
||||
Building From Git
|
||||
-----------------
|
||||
|
||||
To build GNU make from Git, you will need Autoconf, Automake, and
|
||||
Gettext, and any tools that those utilities require (GNU m4, Perl,
|
||||
etc.). See the configure.in file to find the minimum versions of each
|
||||
etc.). See the configure.ac file to find the minimum versions of each
|
||||
of these tools. You will also need a copy of wget.
|
||||
|
||||
When building from CVS you must build in the source directory: "VPATH
|
||||
When building from Git you must build in the source directory: "VPATH
|
||||
builds" from remote directories are not supported. Once you've created
|
||||
a distribution, of course, you can unpack it and do a VPATH build from
|
||||
there.
|
||||
@@ -77,7 +107,7 @@ to the point where you can run "make".
|
||||
a platform-local make you may get problems with missing files in doc/.
|
||||
|
||||
|
||||
At this point you have successfully brought your CVS copy of the GNU
|
||||
At this point you have successfully brought your Git copy of the GNU
|
||||
make source directory up to the point where it can be treated
|
||||
more-or-less like the official package you would get from ftp.gnu.org.
|
||||
That is, you can just run:
|
||||
@@ -87,7 +117,7 @@ That is, you can just run:
|
||||
to build and install GNU make.
|
||||
|
||||
|
||||
Windows builds from CVS
|
||||
Windows builds from Git
|
||||
-----------------------
|
||||
|
||||
If you have a UNIX emulation like CYGWIN you can opt to run the general
|
||||
@@ -130,18 +160,27 @@ Steps to Release
|
||||
Here are the things that need to be done (in more or less this order)
|
||||
before making an official release:
|
||||
|
||||
* Update the configure.in file with the new release number.
|
||||
* Update the configure.ac file with the new release number.
|
||||
* Update the NEWS file with the release number and date.
|
||||
* In Savannah modify the "Value", "Rank", and "Description" values for the
|
||||
current "SCM" entry in both "Component Version" and "Fix Release" fields
|
||||
to refer to the new release, for "Bugs" and "Patches".
|
||||
* Update the Savannah bug list URL in the NEWS file to use the correct
|
||||
"Fixed Release" ID number.
|
||||
* In Savannah create a new entry for the "Component Version" and "Fix
|
||||
Release" fields:
|
||||
- Value: SCM
|
||||
- Rank: 20
|
||||
- Descr: Fixed in Git; will be available in the next version of Make.
|
||||
* Run "make distcheck" to be sure it all works.
|
||||
* git tag -u <GPGID> <VER> where GPGID is my GPG key fingerprint,
|
||||
and VER is the release version.
|
||||
* Push everything:
|
||||
git push --tags origin master
|
||||
* Create the new release in the Savannah "Bugs" Administration for
|
||||
both the "Component Version" and "Fixed Release" fields.
|
||||
* Create the new release in the Savannah "Patches" Administration for
|
||||
the "Fixed Release" field.
|
||||
* Update the Savannah bug list URL in the NEWS file to use the correct
|
||||
"Fixed Release" ID number.
|
||||
* Run "make distcheck" to be sure it all works.
|
||||
* Commit everything.
|
||||
* cvs tag <RTAG> where RTAG is constructed by replacing each "." in
|
||||
the version with "-" and prefixing it with "make-".
|
||||
|
||||
|
||||
Publishing a Package
|
||||
@@ -151,12 +190,11 @@ In order to publish a package on the FSF FTP site, either the release
|
||||
site ftp://ftp.gnu.org, or the prerelease site ftp://alpha.gnu.org, you
|
||||
first need to have my GPG private key and my passphrase to unlock it.
|
||||
And, you can't have them! So there! But, just so I remember here's
|
||||
what you do:
|
||||
what to do:
|
||||
|
||||
Make sure the "Steps to Release" are complete and committed and tagged.
|
||||
|
||||
cvs -d :pserver:anonymous@cvs.savannah.gnu.org:/sources/make \
|
||||
export -r<RTAG> -d make-release make
|
||||
git clone git://git.savannah.gnu.org/make.git make-release
|
||||
|
||||
cd make-release
|
||||
|
||||
@@ -166,14 +204,17 @@ what you do:
|
||||
-OR-
|
||||
make upload-ftp # for ftp.gnu.org (official releases)
|
||||
|
||||
It will ask for the GPG passphrase _THREE_ times. Sigh.
|
||||
Depending on your distribution (whether GnuPG is integrated with your keyring
|
||||
etc.) it will either pop up a window asking for your GPG key passphrase one
|
||||
time, or else it will use the CLI to ask for the GPG passphrase _THREE_ times.
|
||||
Sigh.
|
||||
|
||||
|
||||
For both final releases and pre-releases, send an email with the URL of
|
||||
the package to the GNU translation robot to allow the translators to
|
||||
work on it:
|
||||
|
||||
<translation@iro.umontreal.ca>
|
||||
<coordinator@translationproject.org>
|
||||
|
||||
|
||||
Where to Announce
|
||||
@@ -185,8 +226,9 @@ Create the announcement in a text file, then sign it with GPG.
|
||||
|
||||
Upload to gnu.org, then login and send from my account there.
|
||||
|
||||
Email to: make-alpha@gnu.org, bug-make@gnu.org, help-make@gnu.org, make-w32@gnu.org.
|
||||
Email to: info-gnu@gnu.org
|
||||
To: bug-make@gnu.org, help-make@gnu.org, make-w32@gnu.org
|
||||
CC: info-gnu@gnu.org
|
||||
BCC: make-alpha@gnu.org
|
||||
|
||||
Add a news item to the Savannah project site.
|
||||
|
||||
@@ -198,7 +240,7 @@ Appendix A - For The Brave
|
||||
|
||||
For those of you who trust me implicitly, or are just brave (or
|
||||
foolhardy), here is a canned sequence of commands to build a GNU make
|
||||
distribution package from a virgin CVS source checkout (assuming all the
|
||||
distribution package from a virgin Git source checkout (assuming all the
|
||||
prerequisites are available of course).
|
||||
|
||||
This list is eminently suitable for a quick swipe o' the mouse and a
|
||||
@@ -82,19 +82,19 @@ If you need help using GNU make, try these forums:
|
||||
news:gnu.utils.bug
|
||||
|
||||
|
||||
CVS Access
|
||||
Git Access
|
||||
----------
|
||||
|
||||
The GNU make source repository is available via anonymous CVS from the
|
||||
GNU Subversions CVS server; look here for details:
|
||||
The GNU make source repository is available via Git from the
|
||||
GNU Savannah Git server; look here for details:
|
||||
|
||||
http://savannah.gnu.org/cvs/?group=make
|
||||
http://savannah.gnu.org/git/?group=make
|
||||
|
||||
Please note: you won't be able to build GNU make from CVS without
|
||||
Please note: you won't be able to build GNU make from Git without
|
||||
installing appropriate maintainer's tools, such as GNU m4, automake,
|
||||
autoconf, Perl, GNU make, and GCC. See the README.cvs file for hints on
|
||||
autoconf, Perl, GNU make, and GCC. See the README.git file for hints on
|
||||
how to build GNU make once these tools are available. We make no
|
||||
guarantees about the contents or quality of the latest code in the CVS
|
||||
guarantees about the contents or quality of the latest code in the Git
|
||||
repository: it is not unheard of for code that is known to be broken to
|
||||
be checked in. Use at your own risk.
|
||||
|
||||
@@ -142,7 +142,7 @@ Ports
|
||||
- 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.VMS for details about GNU Make on OpenVMS.
|
||||
|
||||
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||
|
||||
@@ -162,7 +162,7 @@ at the right README!
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# NOTE: If you have no 'make' program at all to process this makefile,
|
||||
# run 'build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -128,7 +128,8 @@ CTAGS = ctags -w
|
||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||
vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
|
||||
remote-$(REMOTE).o $(GLOB) $(GETOPT) $(ALLOCA) $(extras) $(guile)
|
||||
output.o remote-$(REMOTE).o $(GLOB) $(GETOPT) $(ALLOCA) \
|
||||
$(extras) $(guile)
|
||||
|
||||
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
||||
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
||||
@@ -140,7 +141,8 @@ srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
||||
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
|
||||
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
||||
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)file.h \
|
||||
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
|
||||
$(srcdir)job.h $(srcdir)makeint.h $(srcdir)rule.h \
|
||||
$(srcdir)output.c $(srcdir)output.h \
|
||||
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This list comes both from the authors and from users of GNU make.
|
||||
|
||||
They are listed in no particular order!
|
||||
|
||||
Also, I don't gaurantee that all of them will be ultimately deemed "good
|
||||
Also, I don't guarantee that all of them will be ultimately deemed "good
|
||||
ideas" and implemented. These are just the ones that, at first blush,
|
||||
seem to have some merit (and that I can remember).
|
||||
|
||||
@@ -125,7 +125,7 @@ The Rest of the List
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||
dnl
|
||||
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||
dnl Copyright (C) 1998-2012 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
dnl This file is part of GNU Make.
|
||||
dnl
|
||||
dnl GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
86
amiga.c
86
amiga.c
@@ -1,5 +1,5 @@
|
||||
/* Running commands on Amiga
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
#include "variable.h"
|
||||
#include "amiga.h"
|
||||
#include <assert.h>
|
||||
@@ -24,7 +24,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <proto/dos.h>
|
||||
|
||||
static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
|
||||
"Amiga Port by A. Digulla (digulla@home.lake.de)";
|
||||
"Amiga Port by A. Digulla (digulla@home.lake.de)";
|
||||
|
||||
int
|
||||
MyExecute (char **argv)
|
||||
@@ -36,7 +36,7 @@ MyExecute (char **argv)
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
len += strlen (*aptr) + 4;
|
||||
len += strlen (*aptr) + 4;
|
||||
}
|
||||
|
||||
buffer = AllocMem (len, MEMF_ANY);
|
||||
@@ -48,41 +48,41 @@ MyExecute (char **argv)
|
||||
|
||||
for (aptr=argv; *aptr; aptr++)
|
||||
{
|
||||
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||
{
|
||||
*ptr ++ = '"';
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
*ptr ++ = '"';
|
||||
}
|
||||
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||
{
|
||||
*ptr ++ = '\n';
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
}
|
||||
*ptr ++ = ' ';
|
||||
*ptr = 0;
|
||||
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||
{
|
||||
*ptr ++ = '"';
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
*ptr ++ = '"';
|
||||
}
|
||||
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||
{
|
||||
*ptr ++ = '\n';
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (ptr, *aptr);
|
||||
ptr += strlen (ptr);
|
||||
}
|
||||
*ptr ++ = ' ';
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
ptr[-1] = '\n';
|
||||
|
||||
status = SystemTags (buffer,
|
||||
SYS_UserShell, TRUE,
|
||||
TAG_END);
|
||||
SYS_UserShell, TRUE,
|
||||
TAG_END);
|
||||
|
||||
FreeMem (buffer, len);
|
||||
|
||||
if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
|
||||
status = 20;
|
||||
if (SetSignal (0L,0L) & SIGBREAKF_CTRL_C)
|
||||
status = 20;
|
||||
|
||||
/* Warnings don't count */
|
||||
if (status == 5)
|
||||
status = 0;
|
||||
status = 0;
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -90,27 +90,27 @@ MyExecute (char **argv)
|
||||
char *
|
||||
wildcard_expansion (char *wc, char *o)
|
||||
{
|
||||
# define PATH_SIZE 1024
|
||||
# define PATH_SIZE 1024
|
||||
struct AnchorPath * apath;
|
||||
|
||||
if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
|
||||
MEMF_CLEAR))
|
||||
)
|
||||
MEMF_CLEAR))
|
||||
)
|
||||
{
|
||||
apath->ap_Strlen = PATH_SIZE;
|
||||
apath->ap_Strlen = PATH_SIZE;
|
||||
|
||||
if (MatchFirst (wc, apath) == 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
o = variable_buffer_output (o, apath->ap_Buf,
|
||||
strlen (apath->ap_Buf));
|
||||
o = variable_buffer_output (o, " ",1);
|
||||
} while (MatchNext (apath) == 0);
|
||||
}
|
||||
if (MatchFirst (wc, apath) == 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
o = variable_buffer_output (o, apath->ap_Buf,
|
||||
strlen (apath->ap_Buf));
|
||||
o = variable_buffer_output (o, " ",1);
|
||||
} while (MatchNext (apath) == 0);
|
||||
}
|
||||
|
||||
MatchEnd (apath);
|
||||
FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
|
||||
MatchEnd (apath);
|
||||
FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
|
||||
}
|
||||
|
||||
return o;
|
||||
|
||||
2
amiga.h
2
amiga.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for amiga specific things
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
34
ar.c
34
ar.c
@@ -1,5 +1,5 @@
|
||||
/* Interface to 'ar' archives for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Make.
|
||||
|
||||
@@ -15,9 +15,9 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
#ifndef NO_ARCHIVES
|
||||
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
@@ -61,7 +61,7 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
|
||||
*arname_p = xstrdup (name);
|
||||
p = strchr (*arname_p, '(');
|
||||
*(p++) = '\0';
|
||||
p[strlen(p) - 1] = '\0';
|
||||
p[strlen (p) - 1] = '\0';
|
||||
*memname_p = p;
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
|
||||
/* ARGSUSED */
|
||||
static long int
|
||||
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
|
||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||
long int size UNUSED, long int date,
|
||||
int uid UNUSED, int gid UNUSED, int mode UNUSED,
|
||||
const void *name)
|
||||
const void *name)
|
||||
{
|
||||
return ar_name_equal (name, mem, truncated) ? date : 0;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ struct ar_glob_state
|
||||
|
||||
static long int
|
||||
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||
long int size UNUSED, long int date UNUSED, int uid UNUSED,
|
||||
int gid UNUSED, int mode UNUSED, const void *arg)
|
||||
{
|
||||
@@ -218,21 +218,21 @@ glob_pattern_p (const char *pattern, int quote)
|
||||
{
|
||||
case '?':
|
||||
case '*':
|
||||
return 1;
|
||||
return 1;
|
||||
|
||||
case '\\':
|
||||
if (quote)
|
||||
++p;
|
||||
break;
|
||||
if (quote)
|
||||
++p;
|
||||
break;
|
||||
|
||||
case '[':
|
||||
opened = 1;
|
||||
break;
|
||||
opened = 1;
|
||||
break;
|
||||
|
||||
case ']':
|
||||
if (opened)
|
||||
return 1;
|
||||
break;
|
||||
if (opened)
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -282,4 +282,4 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
|
||||
return state.chain;
|
||||
}
|
||||
|
||||
#endif /* Not NO_ARCHIVES. */
|
||||
#endif /* Not NO_ARCHIVES. */
|
||||
|
||||
537
arscan.c
537
arscan.c
@@ -1,5 +1,5 @@
|
||||
/* Library function for scanning an archive file.
|
||||
Copyright (C) 1987-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
@@ -22,7 +22,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
#ifndef NO_ARCHIVES
|
||||
|
||||
#ifdef VMS
|
||||
#include <lbrdef.h>
|
||||
@@ -61,11 +61,11 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
|
||||
bufdesc.dsc$w_length = sizeof (filename);
|
||||
|
||||
status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc,
|
||||
&bufdesc.dsc$w_length, 0);
|
||||
&bufdesc.dsc$w_length, 0);
|
||||
if (! (status & 1))
|
||||
{
|
||||
error (NILF, _("lbr$set_module() failed to extract module info, status = %d"),
|
||||
status);
|
||||
status);
|
||||
|
||||
lbr$close (&VMS_lib_idx);
|
||||
|
||||
@@ -112,7 +112,7 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
|
||||
|
||||
fnval =
|
||||
(*VMS_function) (-1, filename, 0, 0, 0, 0, val, 0, 0, 0,
|
||||
VMS_saved_memname);
|
||||
VMS_saved_memname);
|
||||
|
||||
if (fnval)
|
||||
{
|
||||
@@ -183,7 +183,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
if (! (status & 1))
|
||||
{
|
||||
error (NILF, _("unable to open library '%s' to lookup member '%s'"),
|
||||
archive, (char *)arg);
|
||||
archive, (char *)arg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -212,8 +212,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
#else /* !VMS */
|
||||
|
||||
/* SCO Unix's compiler defines both of these. */
|
||||
#ifdef M_UNIX
|
||||
#undef M_XENIX
|
||||
#ifdef M_UNIX
|
||||
#undef M_XENIX
|
||||
#endif
|
||||
|
||||
/* On the sun386i and in System V rel 3, ar.h defines two different archive
|
||||
@@ -222,7 +222,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
to have a nonzero value. */
|
||||
|
||||
#if (!defined (PORTAR) || PORTAR == 0) && (!defined (PORT5AR) || PORT5AR == 0)
|
||||
#undef PORTAR
|
||||
#undef PORTAR
|
||||
#ifdef M_XENIX
|
||||
/* According to Jim Sievert <jas1@rsvl.unisys.com>, for SCO XENIX defining
|
||||
PORTAR to 1 gets the wrong archive format, and defining it to 0 gets the
|
||||
@@ -257,17 +257,17 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
/* 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. */
|
||||
# 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. */
|
||||
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
|
||||
# define TOCHAR(_m) (_m)
|
||||
@@ -292,8 +292,8 @@ struct ar_hdr
|
||||
#endif
|
||||
|
||||
/* Cray's <ar.h> apparently defines this. */
|
||||
#ifndef AR_HDR_SIZE
|
||||
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||
#ifndef AR_HDR_SIZE
|
||||
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||
#endif
|
||||
|
||||
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||
@@ -328,12 +328,10 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
{
|
||||
#ifdef AIAMAG
|
||||
FL_HDR fl_header;
|
||||
#ifdef AIAMAGBIG
|
||||
# ifdef AIAMAGBIG
|
||||
int big_archive = 0;
|
||||
FL_HDR_BIG fl_header_big;
|
||||
#endif
|
||||
#else
|
||||
int long_name = 0;
|
||||
# endif
|
||||
#endif
|
||||
char *namemap = 0;
|
||||
int desc = open (archive, O_RDONLY, 0);
|
||||
@@ -345,8 +343,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
register int nread = read (desc, buf, SARMAG);
|
||||
if (nread != SARMAG || memcmp (buf, ARMAG, SARMAG))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -356,39 +354,39 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
|
||||
if (nread != FL_HSZ)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
#ifdef AIAMAGBIG
|
||||
/* If this is a "big" archive, then set the flag and
|
||||
re-read the header into the "big" structure. */
|
||||
if (!memcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
|
||||
{
|
||||
big_archive = 1;
|
||||
big_archive = 1;
|
||||
|
||||
/* seek back to beginning of archive */
|
||||
if (lseek (desc, 0, 0) < 0)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
/* seek back to beginning of archive */
|
||||
if (lseek (desc, 0, 0) < 0)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* re-read the header into the "big" structure */
|
||||
nread = read (desc, &fl_header_big, FL_HSZ_BIG);
|
||||
if (nread != FL_HSZ_BIG)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
/* re-read the header into the "big" structure */
|
||||
nread = read (desc, &fl_header_big, FL_HSZ_BIG);
|
||||
if (nread != FL_HSZ_BIG)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
/* Check to make sure this is a "normal" archive. */
|
||||
if (memcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
|
||||
{
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
@@ -397,11 +395,11 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
#else
|
||||
unsigned short int buf;
|
||||
#endif
|
||||
register int nread = read(desc, &buf, sizeof (buf));
|
||||
register int nread = read (desc, &buf, sizeof (buf));
|
||||
if (nread != sizeof (buf) || buf != ARMAG)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -419,143 +417,144 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
#ifdef AIAMAGBIG
|
||||
if ( big_archive )
|
||||
{
|
||||
sscanf (fl_header_big.fl_fstmoff, "%20ld", &member_offset);
|
||||
sscanf (fl_header_big.fl_lstmoff, "%20ld", &last_member_offset);
|
||||
sscanf (fl_header_big.fl_fstmoff, "%20ld", &member_offset);
|
||||
sscanf (fl_header_big.fl_lstmoff, "%20ld", &last_member_offset);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
||||
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
||||
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
||||
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
||||
}
|
||||
|
||||
if (member_offset == 0)
|
||||
{
|
||||
/* Empty archive. */
|
||||
close (desc);
|
||||
return 0;
|
||||
/* Empty archive. */
|
||||
close (desc);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#ifndef M_XENIX
|
||||
#ifndef M_XENIX
|
||||
register long int member_offset = sizeof (int);
|
||||
#else /* Xenix. */
|
||||
#else /* Xenix. */
|
||||
register long int member_offset = sizeof (unsigned short int);
|
||||
#endif /* Not Xenix. */
|
||||
#endif /* Not Xenix. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
register int nread;
|
||||
struct ar_hdr member_header;
|
||||
register int nread;
|
||||
struct ar_hdr member_header;
|
||||
#ifdef AIAMAGBIG
|
||||
struct ar_hdr_big member_header_big;
|
||||
struct ar_hdr_big member_header_big;
|
||||
#endif
|
||||
#ifdef AIAMAG
|
||||
char name[256];
|
||||
int name_len;
|
||||
long int dateval;
|
||||
int uidval, gidval;
|
||||
long int data_offset;
|
||||
char name[256];
|
||||
int name_len;
|
||||
long int dateval;
|
||||
int uidval, gidval;
|
||||
long int data_offset;
|
||||
#else
|
||||
char namebuf[sizeof member_header.ar_name + 1];
|
||||
char *name;
|
||||
int is_namemap; /* Nonzero if this entry maps long names. */
|
||||
char namebuf[sizeof member_header.ar_name + 1];
|
||||
char *name;
|
||||
int is_namemap; /* Nonzero if this entry maps long names. */
|
||||
int long_name = 0;
|
||||
#endif
|
||||
long int eltsize;
|
||||
int eltmode;
|
||||
long int fnval;
|
||||
long int eltsize;
|
||||
int eltmode;
|
||||
long int fnval;
|
||||
|
||||
if (lseek (desc, member_offset, 0) < 0)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
if (lseek (desc, member_offset, 0) < 0)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
#ifdef AIAMAG
|
||||
#define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
|
||||
|
||||
#ifdef AIAMAGBIG
|
||||
if (big_archive)
|
||||
{
|
||||
nread = read (desc, &member_header_big,
|
||||
AR_MEMHDR_SZ(member_header_big) );
|
||||
if (big_archive)
|
||||
{
|
||||
nread = read (desc, &member_header_big,
|
||||
AR_MEMHDR_SZ(member_header_big) );
|
||||
|
||||
if (nread != AR_MEMHDR_SZ(member_header_big))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
if (nread != AR_MEMHDR_SZ(member_header_big))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
|
||||
nread = read (desc, name, name_len);
|
||||
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
|
||||
nread = read (desc, name, name_len);
|
||||
|
||||
if (nread != name_len)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
if (nread != name_len)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
name[name_len] = 0;
|
||||
name[name_len] = 0;
|
||||
|
||||
sscanf (member_header_big.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
||||
sscanf (member_header_big.ar_size, "%20ld", &eltsize);
|
||||
sscanf (member_header_big.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
||||
sscanf (member_header_big.ar_size, "%20ld", &eltsize);
|
||||
|
||||
data_offset = (member_offset + AR_MEMHDR_SZ(member_header_big)
|
||||
+ name_len + 2);
|
||||
}
|
||||
else
|
||||
data_offset = (member_offset + AR_MEMHDR_SZ(member_header_big)
|
||||
+ name_len + 2);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nread = read (desc, &member_header,
|
||||
AR_MEMHDR_SZ(member_header) );
|
||||
{
|
||||
nread = read (desc, &member_header,
|
||||
AR_MEMHDR_SZ(member_header) );
|
||||
|
||||
if (nread != AR_MEMHDR_SZ(member_header))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
if (nread != AR_MEMHDR_SZ(member_header))
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
sscanf (member_header.ar_namlen, "%4d", &name_len);
|
||||
nread = read (desc, name, name_len);
|
||||
sscanf (member_header.ar_namlen, "%4d", &name_len);
|
||||
nread = read (desc, name, name_len);
|
||||
|
||||
if (nread != name_len)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
if (nread != name_len)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
name[name_len] = 0;
|
||||
name[name_len] = 0;
|
||||
|
||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
||||
sscanf (member_header.ar_size, "%12ld", &eltsize);
|
||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
||||
sscanf (member_header.ar_size, "%12ld", &eltsize);
|
||||
|
||||
data_offset = (member_offset + AR_MEMHDR_SZ(member_header)
|
||||
+ name_len + 2);
|
||||
}
|
||||
data_offset += data_offset % 2;
|
||||
data_offset = (member_offset + AR_MEMHDR_SZ(member_header)
|
||||
+ name_len + 2);
|
||||
}
|
||||
data_offset += data_offset % 2;
|
||||
|
||||
fnval =
|
||||
(*function) (desc, name, 0,
|
||||
member_offset, data_offset, eltsize,
|
||||
dateval, uidval, gidval,
|
||||
eltmode, arg);
|
||||
fnval =
|
||||
(*function) (desc, name, 0,
|
||||
member_offset, data_offset, eltsize,
|
||||
dateval, uidval, gidval,
|
||||
eltmode, arg);
|
||||
|
||||
#else /* Not AIAMAG. */
|
||||
nread = read (desc, &member_header, AR_HDR_SIZE);
|
||||
if (nread == 0)
|
||||
/* No data left means end of file; that is OK. */
|
||||
break;
|
||||
#else /* Not AIAMAG. */
|
||||
nread = read (desc, &member_header, AR_HDR_SIZE);
|
||||
if (nread == 0)
|
||||
/* No data left means end of file; that is OK. */
|
||||
break;
|
||||
|
||||
if (nread != AR_HDR_SIZE
|
||||
if (nread != AR_HDR_SIZE
|
||||
#if defined(ARFMAG) || defined(ARFZMAG)
|
||||
|| (
|
||||
|| (
|
||||
# ifdef ARFMAG
|
||||
memcmp (member_header.ar_fmag, ARFMAG, 2)
|
||||
# else
|
||||
@@ -569,152 +568,152 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
# endif
|
||||
)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
name = namebuf;
|
||||
memcpy (name, member_header.ar_name, sizeof member_header.ar_name);
|
||||
{
|
||||
register char *p = name + sizeof member_header.ar_name;
|
||||
do
|
||||
*p = '\0';
|
||||
while (p > name && *--p == ' ');
|
||||
name = namebuf;
|
||||
memcpy (name, member_header.ar_name, sizeof member_header.ar_name);
|
||||
{
|
||||
register char *p = name + sizeof member_header.ar_name;
|
||||
do
|
||||
*p = '\0';
|
||||
while (p > name && *--p == ' ');
|
||||
|
||||
#ifndef AIAMAG
|
||||
/* If the member name is "//" or "ARFILENAMES/" this may be
|
||||
a list of file name mappings. The maximum file name
|
||||
length supported by the standard archive format is 14
|
||||
characters. This member will actually always be the
|
||||
first or second entry in the archive, but we don't check
|
||||
that. */
|
||||
is_namemap = (!strcmp (name, "//")
|
||||
|| !strcmp (name, "ARFILENAMES/"));
|
||||
#endif /* Not AIAMAG. */
|
||||
/* On some systems, there is a slash after each member name. */
|
||||
if (*p == '/')
|
||||
*p = '\0';
|
||||
/* If the member name is "//" or "ARFILENAMES/" this may be
|
||||
a list of file name mappings. The maximum file name
|
||||
length supported by the standard archive format is 14
|
||||
characters. This member will actually always be the
|
||||
first or second entry in the archive, but we don't check
|
||||
that. */
|
||||
is_namemap = (!strcmp (name, "//")
|
||||
|| !strcmp (name, "ARFILENAMES/"));
|
||||
#endif /* Not AIAMAG. */
|
||||
/* On some systems, there is a slash after each member name. */
|
||||
if (*p == '/')
|
||||
*p = '\0';
|
||||
|
||||
#ifndef AIAMAG
|
||||
/* If the member name starts with a space or a slash, this
|
||||
is an index into the file name mappings (used by GNU ar).
|
||||
Otherwise if the member name looks like #1/NUMBER the
|
||||
real member name appears in the element data (used by
|
||||
4.4BSD). */
|
||||
if (! is_namemap
|
||||
&& (name[0] == ' ' || name[0] == '/')
|
||||
&& namemap != 0)
|
||||
{
|
||||
name = namemap + atoi (name + 1);
|
||||
long_name = 1;
|
||||
}
|
||||
else if (name[0] == '#'
|
||||
&& name[1] == '1'
|
||||
&& name[2] == '/')
|
||||
{
|
||||
int namesize = atoi (name + 3);
|
||||
/* If the member name starts with a space or a slash, this
|
||||
is an index into the file name mappings (used by GNU ar).
|
||||
Otherwise if the member name looks like #1/NUMBER the
|
||||
real member name appears in the element data (used by
|
||||
4.4BSD). */
|
||||
if (! is_namemap
|
||||
&& (name[0] == ' ' || name[0] == '/')
|
||||
&& namemap != 0)
|
||||
{
|
||||
name = namemap + atoi (name + 1);
|
||||
long_name = 1;
|
||||
}
|
||||
else if (name[0] == '#'
|
||||
&& name[1] == '1'
|
||||
&& name[2] == '/')
|
||||
{
|
||||
int namesize = atoi (name + 3);
|
||||
|
||||
name = alloca (namesize + 1);
|
||||
nread = read (desc, name, namesize);
|
||||
if (nread != namesize)
|
||||
{
|
||||
close (desc);
|
||||
return -2;
|
||||
}
|
||||
name[namesize] = '\0';
|
||||
name = alloca (namesize + 1);
|
||||
nread = read (desc, name, namesize);
|
||||
if (nread != namesize)
|
||||
{
|
||||
close (desc);
|
||||
return -2;
|
||||
}
|
||||
name[namesize] = '\0';
|
||||
|
||||
long_name = 1;
|
||||
}
|
||||
long_name = 1;
|
||||
}
|
||||
#endif /* Not AIAMAG. */
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef M_XENIX
|
||||
sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
|
||||
eltsize = atol (TOCHAR (member_header.ar_size));
|
||||
#else /* Xenix. */
|
||||
eltmode = (unsigned short int) member_header.ar_mode;
|
||||
eltsize = member_header.ar_size;
|
||||
#endif /* Not Xenix. */
|
||||
#ifndef M_XENIX
|
||||
sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
|
||||
eltsize = atol (TOCHAR (member_header.ar_size));
|
||||
#else /* Xenix. */
|
||||
eltmode = (unsigned short int) member_header.ar_mode;
|
||||
eltsize = member_header.ar_size;
|
||||
#endif /* Not Xenix. */
|
||||
|
||||
fnval =
|
||||
(*function) (desc, name, ! long_name, member_offset,
|
||||
member_offset + AR_HDR_SIZE, eltsize,
|
||||
#ifndef M_XENIX
|
||||
atol (TOCHAR (member_header.ar_date)),
|
||||
atoi (TOCHAR (member_header.ar_uid)),
|
||||
atoi (TOCHAR (member_header.ar_gid)),
|
||||
#else /* Xenix. */
|
||||
member_header.ar_date,
|
||||
member_header.ar_uid,
|
||||
member_header.ar_gid,
|
||||
#endif /* Not Xenix. */
|
||||
eltmode, arg);
|
||||
fnval =
|
||||
(*function) (desc, name, ! long_name, member_offset,
|
||||
member_offset + AR_HDR_SIZE, eltsize,
|
||||
#ifndef M_XENIX
|
||||
atol (TOCHAR (member_header.ar_date)),
|
||||
atoi (TOCHAR (member_header.ar_uid)),
|
||||
atoi (TOCHAR (member_header.ar_gid)),
|
||||
#else /* Xenix. */
|
||||
member_header.ar_date,
|
||||
member_header.ar_uid,
|
||||
member_header.ar_gid,
|
||||
#endif /* Not Xenix. */
|
||||
eltmode, arg);
|
||||
|
||||
#endif /* AIAMAG. */
|
||||
|
||||
if (fnval)
|
||||
{
|
||||
(void) close (desc);
|
||||
return fnval;
|
||||
}
|
||||
if (fnval)
|
||||
{
|
||||
(void) close (desc);
|
||||
return fnval;
|
||||
}
|
||||
|
||||
#ifdef AIAMAG
|
||||
if (member_offset == last_member_offset)
|
||||
/* End of the chain. */
|
||||
break;
|
||||
if (member_offset == last_member_offset)
|
||||
/* End of the chain. */
|
||||
break;
|
||||
|
||||
#ifdef AIAMAGBIG
|
||||
if (big_archive)
|
||||
if (big_archive)
|
||||
sscanf (member_header_big.ar_nxtmem, "%20ld", &member_offset);
|
||||
else
|
||||
else
|
||||
#endif
|
||||
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
|
||||
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
|
||||
|
||||
if (lseek (desc, member_offset, 0) != member_offset)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
if (lseek (desc, member_offset, 0) != member_offset)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
#else
|
||||
|
||||
/* If this member maps archive names, we must read it in. The
|
||||
name map will always precede any members whose names must
|
||||
be mapped. */
|
||||
if (is_namemap)
|
||||
{
|
||||
char *clear;
|
||||
char *limit;
|
||||
/* If this member maps archive names, we must read it in. The
|
||||
name map will always precede any members whose names must
|
||||
be mapped. */
|
||||
if (is_namemap)
|
||||
{
|
||||
char *clear;
|
||||
char *limit;
|
||||
|
||||
namemap = alloca (eltsize);
|
||||
nread = read (desc, namemap, eltsize);
|
||||
if (nread != eltsize)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
namemap = alloca (eltsize);
|
||||
nread = read (desc, namemap, eltsize);
|
||||
if (nread != eltsize)
|
||||
{
|
||||
(void) close (desc);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* The names are separated by newlines. Some formats have
|
||||
a trailing slash. Null terminate the strings for
|
||||
convenience. */
|
||||
limit = namemap + eltsize;
|
||||
for (clear = namemap; clear < limit; clear++)
|
||||
{
|
||||
if (*clear == '\n')
|
||||
{
|
||||
*clear = '\0';
|
||||
if (clear[-1] == '/')
|
||||
clear[-1] = '\0';
|
||||
}
|
||||
}
|
||||
/* The names are separated by newlines. Some formats have
|
||||
a trailing slash. Null terminate the strings for
|
||||
convenience. */
|
||||
limit = namemap + eltsize;
|
||||
for (clear = namemap; clear < limit; clear++)
|
||||
{
|
||||
if (*clear == '\n')
|
||||
{
|
||||
*clear = '\0';
|
||||
if (clear[-1] == '/')
|
||||
clear[-1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
is_namemap = 0;
|
||||
}
|
||||
is_namemap = 0;
|
||||
}
|
||||
|
||||
member_offset += AR_HDR_SIZE + eltsize;
|
||||
if (member_offset % 2 != 0)
|
||||
member_offset++;
|
||||
member_offset += AR_HDR_SIZE + eltsize;
|
||||
if (member_offset % 2 != 0)
|
||||
member_offset++;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -746,9 +745,9 @@ ar_name_equal (const char *name, const char *mem, int truncated)
|
||||
#else
|
||||
struct ar_hdr hdr;
|
||||
#if !defined (__hpux) && !defined (cray)
|
||||
return strneq (name, mem, sizeof(hdr.ar_name) - 1);
|
||||
return strneq (name, mem, sizeof (hdr.ar_name) - 1);
|
||||
#else
|
||||
return strneq (name, mem, sizeof(hdr.ar_name) - 2);
|
||||
return strneq (name, mem, sizeof (hdr.ar_name) - 2);
|
||||
#endif /* !__hpux && !cray */
|
||||
#endif /* !AIAMAG */
|
||||
}
|
||||
@@ -761,7 +760,7 @@ ar_name_equal (const char *name, const char *mem, int truncated)
|
||||
/* ARGSUSED */
|
||||
static long int
|
||||
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
||||
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
|
||||
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
|
||||
long int date UNUSED, int uid UNUSED, int gid UNUSED,
|
||||
int mode UNUSED, const void *name)
|
||||
{
|
||||
@@ -815,7 +814,7 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
ar_hdr.ar_date[ui] = ' ';
|
||||
sprintf (TOCHAR (ar_hdr.ar_date), "%ld", (long int) statbuf.st_mtime);
|
||||
#ifdef AIAMAG
|
||||
ar_hdr.ar_date[strlen(ar_hdr.ar_date)] = ' ';
|
||||
ar_hdr.ar_date[strlen (ar_hdr.ar_date)] = ' ';
|
||||
#endif
|
||||
#else
|
||||
ar_hdr.ar_date = statbuf.st_mtime;
|
||||
@@ -840,14 +839,14 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
|
||||
long int
|
||||
describe_member (int desc, const char *name, int truncated,
|
||||
long int hdrpos, long int datapos, long int size,
|
||||
long int hdrpos, long int datapos, long int size,
|
||||
long int date, int uid, int gid, int mode, const void *arg)
|
||||
{
|
||||
extern char *ctime ();
|
||||
|
||||
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
|
||||
name, truncated ? _(" (name might be truncated)") : "",
|
||||
size, hdrpos, datapos);
|
||||
name, truncated ? _(" (name might be truncated)") : "",
|
||||
size, hdrpos, datapos);
|
||||
printf (_(" Date %s"), ctime (&date));
|
||||
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
|
||||
|
||||
@@ -861,5 +860,5 @@ main (int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* TEST. */
|
||||
#endif /* NO_ARCHIVES. */
|
||||
#endif /* TEST. */
|
||||
#endif /* NO_ARCHIVES. */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Shell script to build GNU Make in the absence of any 'make' program.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1993-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
152
build_w32.bat
152
build_w32.bat
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -15,26 +15,53 @@ rem
|
||||
rem You should have received a copy of the GNU General Public License along
|
||||
rem with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if exist config.h.W32 GoTo NotCVS
|
||||
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.in > config.h.W32.sed
|
||||
if "%1" == "-h" GoTo Usage
|
||||
if "%1" == "--help" GoTo Usage
|
||||
if not exist config.h.W32.template GoTo NotSCM
|
||||
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > config.h.W32.sed
|
||||
echo s,%%PACKAGE%%,make,g >> config.h.W32.sed
|
||||
sed -f config.h.W32.sed config.h.W32.template > config.h.W32
|
||||
:NotCVS
|
||||
if not exist config.h copy config.h.W32 config.h
|
||||
echo static const char *const GUILE_module_defn = ^" \> gmk-default.h
|
||||
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\/" gmk-default.scm >> gmk-default.h
|
||||
echo ^";>> gmk-default.h
|
||||
:NotSCM
|
||||
copy config.h.W32 config.h
|
||||
|
||||
rem Guile configuration
|
||||
set GUILECFLAGS=
|
||||
set GUILELIBS=
|
||||
set GUILESRC=
|
||||
set NOGUILE=
|
||||
set OPT=-O2
|
||||
set COMPILER=
|
||||
set PKGMSC=
|
||||
:ParseSW
|
||||
if "%1" == "--debug" GoTo SetOpt
|
||||
if "%1" == "--without-guile" GoTo NoGuile
|
||||
if "%2" == "--without-guile" GoTo NoGuile
|
||||
if "%1" == "gcc" GoTo SetCC
|
||||
if "%1" == "" GoTo ChkGuile
|
||||
:SetOpt
|
||||
set OPT=-O0
|
||||
shift
|
||||
GoTo ParseSW
|
||||
:NoGuile
|
||||
set NOGUILE=Y
|
||||
echo "Building without Guile"
|
||||
shift
|
||||
GoTo ParseSW
|
||||
:SetCC
|
||||
set COMPILER=gcc
|
||||
echo "Building with GCC"
|
||||
shift
|
||||
GoTo ParseSW
|
||||
rem Build with Guile is supported only on NT and later versions
|
||||
:ChkGuile
|
||||
if "%NOGUILE%" == "Y" GoTo GuileDone
|
||||
if not "%OS%" == "Windows_NT" GoTo NoGuile
|
||||
pkg-config --help > guile.tmp 2> NUL
|
||||
if ERRORLEVEL 1 GoTo NoPkgCfg
|
||||
echo "Checking for Guile 2.0"
|
||||
if not "%1" == "gcc" set PKGMSC=--msvc-syntax
|
||||
if not "%COMPILER%" == "gcc" set PKGMSC=--msvc-syntax
|
||||
pkg-config --cflags --short-errors "guile-2.0" > guile.tmp
|
||||
if not ERRORLEVEL 1 set /P GUILECFLAGS= < guile.tmp
|
||||
pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > guile.tmp
|
||||
@@ -47,24 +74,25 @@ pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > guile.tmp
|
||||
if not ERRORLEVEL 1 set /P GUILELIBS= < guile.tmp
|
||||
if not "%GUILECFLAGS%" == "" GoTo GuileDone
|
||||
echo "No Guile found, building without Guile"
|
||||
GoTo NoGuile
|
||||
GoTo GuileDone
|
||||
:NoPkgCfg
|
||||
echo "pkg-config not found, building without Guile"
|
||||
:NoGuile
|
||||
:GuileDone
|
||||
if not "%GUILECFLAGS%" == "" echo "Guile found, building with Guile"
|
||||
if not "%GUILECFLAGS%" == "" set GUILESRC=guile.c
|
||||
if not "%GUILECFLAGS%" == "" set GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE
|
||||
if "%1" == "--without-guile" shift
|
||||
if "%COMPILER%" == "gcc" if "%OPT%" == "-O0" echo "Building without compiler optimizations"
|
||||
cd w32\subproc
|
||||
echo.
|
||||
echo "Creating the subproc library"
|
||||
%ComSpec% /c build.bat %1
|
||||
%ComSpec% /c build.bat
|
||||
cd ..\..
|
||||
|
||||
if exist link.dbg del link.dbg
|
||||
if exist link.rel del link.rel
|
||||
echo "Creating GNU Make for Windows 9X/NT/2K/XP"
|
||||
if "%1" == "gcc" GoTo GCCBuild
|
||||
echo.
|
||||
echo "Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8"
|
||||
if "%COMPILER%" == "gcc" GoTo GCCBuild
|
||||
set make=gnumake
|
||||
echo on
|
||||
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||
@@ -94,6 +122,8 @@ cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D
|
||||
echo WinDebug\getopt1.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
|
||||
echo WinDebug\job.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c output.c
|
||||
echo WinDebug\output.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
|
||||
echo WinDebug\read.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
|
||||
@@ -118,8 +148,14 @@ cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D
|
||||
echo WinDebug\vpath.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
|
||||
echo WinDebug\implicit.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c loadapi.c
|
||||
echo WinDebug\loadapi.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c load.c
|
||||
echo WinDebug\load.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
|
||||
echo WinDebug\dirent.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\posixfcn.c
|
||||
echo WinDebug\posixfcn.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
|
||||
echo WinDebug\glob.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
|
||||
@@ -132,7 +168,7 @@ echo WinDebug\guile.obj >>link.dbg
|
||||
:LinkDbg
|
||||
echo off
|
||||
echo "Linking WinDebug/%make%.exe"
|
||||
rem link.exe %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/hash.obj .\WinDebug/strcache.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
|
||||
rem link.exe %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/output.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/hash.obj .\WinDebug/strcache.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
|
||||
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
|
||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe @link.dbg
|
||||
if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
|
||||
@@ -165,6 +201,8 @@ cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIND
|
||||
echo WinRel\getopt1.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
|
||||
echo WinRel\job.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c output.c
|
||||
echo WinRel\output.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
|
||||
echo WinRel\read.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
|
||||
@@ -189,8 +227,14 @@ cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIND
|
||||
echo WinRel\vpath.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
|
||||
echo WinRel\implicit.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c loadapi.c
|
||||
echo WinRel\loadapi.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c load.c
|
||||
echo WinRel\load.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
|
||||
echo WinRel\dirent.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\posixfcn.c
|
||||
echo WinRel\posixfcn.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
|
||||
echo WinRel\glob.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
|
||||
@@ -203,7 +247,7 @@ echo WinRel\guile.obj >>link.rel
|
||||
:LinkRel
|
||||
echo off
|
||||
echo "Linking WinRel/%make%.exe"
|
||||
rem link.exe %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/hash.obj .\WinRel/strcache.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
|
||||
rem link.exe %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/output.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/hash.obj .\WinRel/strcache.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
|
||||
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
|
||||
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe @link.rel
|
||||
if not exist .\WinRel/%make%.exe echo "WinRel build failed"
|
||||
@@ -212,43 +256,58 @@ set make=
|
||||
GoTo BuildEnd
|
||||
:GCCBuild
|
||||
echo on
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c variable.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c rule.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remote-stub.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c commands.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c file.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getloadavg.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c default.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c signame.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c expand.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c dir.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %GUILECFLAGS% -c main.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt1.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c job.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c read.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c version.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c arscan.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remake.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c hash.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c strcache.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c misc.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ar.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c function.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c vpath.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c implicit.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/glob.c -o glob.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c variable.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c rule.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remote-stub.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c commands.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c file.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getloadavg.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c default.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c signame.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c expand.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c dir.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %GUILECFLAGS% -c main.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt1.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c job.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c output.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c read.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c version.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c arscan.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remake.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c hash.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c strcache.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c misc.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ar.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c function.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c vpath.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c implicit.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c loadapi.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c load.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/glob.c -o glob.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/compat/posixfcn.c -o posixfcn.o
|
||||
@echo off
|
||||
set GUILEOBJ=
|
||||
if "%GUILESRC%" == "" GoTo LinkGCC
|
||||
set GUILEOBJ=guile.o
|
||||
echo on
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 %GUILECFLAGS% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c guile.c
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% %GUILECFLAGS% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c guile.c
|
||||
:LinkGCC
|
||||
@echo off
|
||||
Rem The version NN of libgnumake-NN.dll.a should be bumped whenever
|
||||
Rem the API changes in binary-incompatible manner.
|
||||
@echo on
|
||||
gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o %GUILEOBJ% job.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o glob.o fnmatch.o pathstuff.o w32_misc.o sub_proc.o w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
|
||||
gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o %GUILEOBJ% job.o output.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o loadapi.o load.o glob.o fnmatch.o pathstuff.o posixfcn.o w32_misc.o sub_proc.o w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=libgnumake-1.dll.a
|
||||
@GoTo BuildEnd
|
||||
:Usage
|
||||
echo Usage: %0 [options] [gcc]
|
||||
echo Options:
|
||||
echo. --debug For GCC only, make a debug build
|
||||
echo. (MSVC build always makes both debug and release)
|
||||
echo. --without-guile Do not compile Guile support even if found
|
||||
echo. --help Display these instructions and exit
|
||||
:BuildEnd
|
||||
@echo off
|
||||
set GUILEOBJ=
|
||||
@@ -256,4 +315,7 @@ set GUILESRC=
|
||||
set GUILELIBS=
|
||||
set GUILECFLAGS=
|
||||
set PKGMSC=
|
||||
set OPT=
|
||||
set COMPILER=
|
||||
set NOGUILE=
|
||||
echo on
|
||||
|
||||
149
commands.c
149
commands.c
@@ -1,5 +1,5 @@
|
||||
/* Command processing for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,9 +14,11 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "dep.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include "variable.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
@@ -33,7 +35,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
int remote_kill (int id, int sig);
|
||||
|
||||
#ifndef HAVE_UNISTD_H
|
||||
#ifndef HAVE_UNISTD_H
|
||||
int getpid ();
|
||||
#endif
|
||||
|
||||
@@ -68,7 +70,7 @@ set_file_variables (struct file *file)
|
||||
struct dep *d;
|
||||
const char *at, *percent, *star, *less;
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
#ifndef NO_ARCHIVES
|
||||
/* If the target is an archive member 'lib(member)',
|
||||
then $@ is 'lib' and $% is 'member'. */
|
||||
|
||||
@@ -90,7 +92,7 @@ set_file_variables (struct file *file)
|
||||
percent = p;
|
||||
}
|
||||
else
|
||||
#endif /* NO_ARCHIVES. */
|
||||
#endif /* NO_ARCHIVES. */
|
||||
{
|
||||
at = file->name;
|
||||
percent = "";
|
||||
@@ -100,35 +102,35 @@ set_file_variables (struct file *file)
|
||||
if (file->stem == 0)
|
||||
{
|
||||
/* In Unix make, $* is set to the target name with
|
||||
any suffix in the .SUFFIXES list stripped off for
|
||||
explicit rules. We store this in the 'stem' member. */
|
||||
any suffix in the .SUFFIXES list stripped off for
|
||||
explicit rules. We store this in the 'stem' member. */
|
||||
const char *name;
|
||||
unsigned int len;
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (file->name))
|
||||
{
|
||||
name = strchr (file->name, '(') + 1;
|
||||
len = strlen (name) - 1;
|
||||
}
|
||||
{
|
||||
name = strchr (file->name, '(') + 1;
|
||||
len = strlen (name) - 1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
name = file->name;
|
||||
len = strlen (name);
|
||||
}
|
||||
{
|
||||
name = file->name;
|
||||
len = strlen (name);
|
||||
}
|
||||
|
||||
for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
|
||||
{
|
||||
unsigned int slen = strlen (dep_name (d));
|
||||
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
|
||||
{
|
||||
file->stem = strcache_add_len (name, len - slen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
unsigned int slen = strlen (dep_name (d));
|
||||
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
|
||||
{
|
||||
file->stem = strcache_add_len (name, len - slen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (d == 0)
|
||||
file->stem = "";
|
||||
file->stem = "";
|
||||
}
|
||||
star = file->stem;
|
||||
|
||||
@@ -147,7 +149,7 @@ set_file_variables (struct file *file)
|
||||
In this case $< is the same as $@. */
|
||||
less = at;
|
||||
|
||||
#define DEFINE_VARIABLE(name, len, value) \
|
||||
#define DEFINE_VARIABLE(name, len, value) \
|
||||
(void) define_variable_for_file (name,len,value,o_automatic,0,file)
|
||||
|
||||
/* Define the variables. */
|
||||
@@ -200,13 +202,13 @@ set_file_variables (struct file *file)
|
||||
|
||||
cp = plus_value;
|
||||
|
||||
qmark_len = plus_len + 1; /* Will be this or less. */
|
||||
qmark_len = plus_len + 1; /* Will be this or less. */
|
||||
for (d = file->deps; d != 0; d = d->next)
|
||||
if (! d->ignore_mtime && ! d->need_2nd_expansion)
|
||||
{
|
||||
const char *c = dep_name (d);
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (c))
|
||||
{
|
||||
c = strchr (c, '(') + 1;
|
||||
@@ -220,7 +222,7 @@ set_file_variables (struct file *file)
|
||||
cp += len;
|
||||
*cp++ = FILE_LIST_SEPARATOR;
|
||||
if (! (d->changed || always_make_flag))
|
||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||
}
|
||||
|
||||
/* Kill the last space and define the variable. */
|
||||
@@ -275,23 +277,23 @@ set_file_variables (struct file *file)
|
||||
continue;
|
||||
|
||||
c = dep_name (d);
|
||||
#ifndef NO_ARCHIVES
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (c))
|
||||
{
|
||||
c = strchr (c, '(') + 1;
|
||||
len = strlen (c) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = strchr (c, '(') + 1;
|
||||
len = strlen (c) - 1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
len = strlen (c);
|
||||
len = strlen (c);
|
||||
|
||||
if (d->ignore_mtime)
|
||||
{
|
||||
memcpy (bp, c, len);
|
||||
bp += len;
|
||||
*bp++ = FILE_LIST_SEPARATOR;
|
||||
}
|
||||
else
|
||||
bp += len;
|
||||
*bp++ = FILE_LIST_SEPARATOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy (cp, c, len);
|
||||
cp += len;
|
||||
@@ -319,7 +321,7 @@ set_file_variables (struct file *file)
|
||||
DEFINE_VARIABLE ("|", 1, bar_value);
|
||||
}
|
||||
|
||||
#undef DEFINE_VARIABLE
|
||||
#undef DEFINE_VARIABLE
|
||||
}
|
||||
|
||||
/* Chop CMDS up into individual command lines if necessary.
|
||||
@@ -457,7 +459,7 @@ execute_file_commands (struct file *file)
|
||||
{
|
||||
/* If there are no commands, assume everything worked. */
|
||||
set_command_state (file, cs_running);
|
||||
file->update_status = 0;
|
||||
file->update_status = us_success;
|
||||
notice_finished_file (file);
|
||||
return;
|
||||
}
|
||||
@@ -468,6 +470,11 @@ execute_file_commands (struct file *file)
|
||||
|
||||
set_file_variables (file);
|
||||
|
||||
/* If this is a loaded dynamic object, unload it before remaking.
|
||||
Some systems don't support overwriting a loaded object. */
|
||||
if (file->loaded)
|
||||
unload_file (file->name);
|
||||
|
||||
/* Start the commands running. */
|
||||
new_job (file);
|
||||
}
|
||||
@@ -512,14 +519,14 @@ fatal_error_signal (int sig)
|
||||
DWORD susp_count = SuspendThread (main_thread);
|
||||
|
||||
if (susp_count != 0)
|
||||
fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
|
||||
fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
|
||||
else if (susp_count == (DWORD)-1)
|
||||
{
|
||||
DWORD ierr = GetLastError ();
|
||||
{
|
||||
DWORD ierr = GetLastError ();
|
||||
|
||||
fprintf (stderr, "SuspendThread: error %ld: %s\n",
|
||||
ierr, map_windows32_error_to_string (ierr));
|
||||
}
|
||||
fprintf (stderr, "SuspendThread: error %ld: %s\n",
|
||||
ierr, map_windows32_error_to_string (ierr));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
handling_fatal_signal = 1;
|
||||
@@ -535,8 +542,8 @@ fatal_error_signal (int sig)
|
||||
{
|
||||
struct child *c;
|
||||
for (c = children; c != 0; c = c->next)
|
||||
if (!c->remote)
|
||||
(void) kill (c->pid, SIGTERM);
|
||||
if (!c->remote)
|
||||
(void) kill (c->pid, SIGTERM);
|
||||
}
|
||||
|
||||
/* If we got a signal that means the user
|
||||
@@ -554,18 +561,18 @@ fatal_error_signal (int sig)
|
||||
struct child *c;
|
||||
|
||||
/* Remote children won't automatically get signals sent
|
||||
to the process group, so we must send them. */
|
||||
to the process group, so we must send them. */
|
||||
for (c = children; c != 0; c = c->next)
|
||||
if (c->remote)
|
||||
(void) remote_kill (c->pid, sig);
|
||||
if (c->remote)
|
||||
(void) remote_kill (c->pid, sig);
|
||||
|
||||
for (c = children; c != 0; c = c->next)
|
||||
delete_child_targets (c);
|
||||
delete_child_targets (c);
|
||||
|
||||
/* Clean up the children. We don't just use the call below because
|
||||
we don't want to print the "Waiting for children" message. */
|
||||
we don't want to print the "Waiting for children" message. */
|
||||
while (job_slots_used > 0)
|
||||
reap_children (1, 0);
|
||||
reap_children (1, 0);
|
||||
}
|
||||
else
|
||||
/* Wait for our children to die. */
|
||||
@@ -615,17 +622,17 @@ delete_target (struct file *file, const char *on_behalf_of)
|
||||
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));
|
||||
? (time_t) -1
|
||||
: (time_t) FILE_TIMESTAMP_S (file->last_mtime));
|
||||
if (ar_member_date (file->name) != file_date)
|
||||
{
|
||||
if (on_behalf_of)
|
||||
error (NILF, _("*** [%s] Archive member '%s' may be bogus; not deleted"),
|
||||
on_behalf_of, file->name);
|
||||
else
|
||||
error (NILF, _("*** Archive member '%s' may be bogus; not deleted"),
|
||||
file->name);
|
||||
}
|
||||
{
|
||||
if (on_behalf_of)
|
||||
error (NILF, _("*** [%s] Archive member '%s' may be bogus; not deleted"),
|
||||
on_behalf_of, file->name);
|
||||
else
|
||||
error (NILF, _("*** Archive member '%s' may be bogus; not deleted"),
|
||||
file->name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -636,12 +643,12 @@ delete_target (struct file *file, const char *on_behalf_of)
|
||||
&& FILE_TIMESTAMP_STAT_MODTIME (file->name, st) != file->last_mtime)
|
||||
{
|
||||
if (on_behalf_of)
|
||||
error (NILF, _("*** [%s] Deleting file '%s'"), on_behalf_of, file->name);
|
||||
error (NILF, _("*** [%s] Deleting file '%s'"), on_behalf_of, file->name);
|
||||
else
|
||||
error (NILF, _("*** Deleting file '%s'"), file->name);
|
||||
error (NILF, _("*** Deleting file '%s'"), file->name);
|
||||
if (unlink (file->name) < 0
|
||||
&& errno != ENOENT) /* It disappeared; so what. */
|
||||
perror_with_name ("unlink: ", file->name);
|
||||
&& errno != ENOENT) /* It disappeared; so what. */
|
||||
perror_with_name ("unlink: ", file->name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
18
commands.h
18
commands.h
@@ -1,5 +1,5 @@
|
||||
/* Definition of data structures describing shell commands for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -19,20 +19,20 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
struct commands
|
||||
{
|
||||
struct floc fileinfo; /* Where commands were defined. */
|
||||
char *commands; /* Commands text. */
|
||||
char **command_lines; /* Commands chopped up into lines. */
|
||||
char *lines_flags; /* One set of flag bits for each line. */
|
||||
gmk_floc fileinfo; /* Where commands were defined. */
|
||||
char *commands; /* Commands text. */
|
||||
char **command_lines; /* Commands chopped up into lines. */
|
||||
char *lines_flags; /* One set of flag bits for each line. */
|
||||
unsigned short ncommand_lines;/* Number of command lines. */
|
||||
char recipe_prefix; /* Recipe prefix for this command set. */
|
||||
unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
|
||||
/* the COMMANDS_RECURSE bit set. */
|
||||
/* the COMMANDS_RECURSE bit set. */
|
||||
};
|
||||
|
||||
/* Bits in 'lines_flags'. */
|
||||
#define COMMANDS_RECURSE 1 /* Recurses: + or $(MAKE). */
|
||||
#define COMMANDS_SILENT 2 /* Silent: @. */
|
||||
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
||||
#define COMMANDS_RECURSE 1 /* Recurses: + or $(MAKE). */
|
||||
#define COMMANDS_SILENT 2 /* Silent: @. */
|
||||
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
||||
|
||||
void execute_file_commands (struct file *file);
|
||||
void print_commands (const struct commands *cmds);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* config.h -- hand-massaged for Amiga -*-C-*-
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -16,7 +16,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
@@ -53,9 +53,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if your system has a working fnmatch function. */
|
||||
/* #undef HAVE_FNMATCH */
|
||||
|
||||
@@ -71,7 +68,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if the 'long double' type works. */
|
||||
/* #undef HAVE_LONG_DOUBLE */
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#define HAVE_LONG_FILE_NAMES 1
|
||||
|
||||
/* Define if you have a working 'mmap' system call. */
|
||||
@@ -87,7 +84,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
/* #undef HAVE_ST_BLOCKS */
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
@@ -96,7 +93,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have the strftime function. */
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
@@ -112,16 +109,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
/* #undef HAVE_UTIME_NULL */
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define if on MINIX. */
|
||||
/* Define if on MINIX. */
|
||||
/* #undef _MINIX */
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
@@ -154,19 +145,16 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Define if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if your compiler conforms to the ANSI C standard. */
|
||||
#define HAVE_ANSI_COMPILER 1
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
@@ -185,9 +173,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
@@ -249,7 +234,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have the seteuid function. */
|
||||
/* #undef HAVE_SETEUID */
|
||||
|
||||
/* Define if you have the setlinebuf function. */
|
||||
/* Define if you have the setlinebuf function. */
|
||||
/* #undef HAVE_SETLINEBUF */
|
||||
|
||||
/* Define if you have the setregid function. */
|
||||
@@ -258,7 +243,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have the setreuid function. */
|
||||
/* #undef HAVE_SETREUID */
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
/* Define if you have the sigsetmask function. */
|
||||
/* #undef HAVE_SIGSETMASK */
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
@@ -303,9 +288,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
/* #undef HAVE_STDLIB_H */
|
||||
|
||||
@@ -339,6 +321,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* Output sync sypport */
|
||||
#define NO_OUTPUT_SYNC
|
||||
|
||||
/* Define for Case Insensitve behavior */
|
||||
#define HAVE_CASE_INSENSITIVE_FS
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
|
||||
|
||||
Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* config.h.in. Generated automatically from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
@@ -75,9 +75,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define to 1 if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define to 1 if you have the fdopen function. */
|
||||
#define HAVE_FDOPEN 1
|
||||
|
||||
@@ -141,12 +138,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if utime(file, NULL) sets file's timestamp to the present. */
|
||||
/* #undef HAVE_UTIME_NULL */
|
||||
|
||||
/* Define to 1 if you have <vfork.h>. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define to 1 if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the wait3 system call. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
@@ -186,9 +177,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
@@ -216,9 +207,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
@@ -336,12 +324,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define to 1 if your compiler conforms to the ANSI C standard. */
|
||||
#define HAVE_ANSI_COMPILER 1
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
@@ -424,10 +406,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
/* maybe this should be placed into make.h */
|
||||
#if defined(__VAX) && defined(__DECC)
|
||||
#define alloca(n) __ALLOCA(n)
|
||||
/* maybe this should be placed into makeint.h */
|
||||
#if defined(__VAX) && defined(__DECC)
|
||||
#define alloca(n) __ALLOCA(n)
|
||||
#endif
|
||||
|
||||
/* Output sync sypport */
|
||||
#define NO_OUTPUT_SYNC
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "VMS"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
|
||||
|
||||
Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -62,9 +62,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
*/
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define to 1 if your compiler conforms to the ANSI C standard. */
|
||||
#define HAVE_ANSI_COMPILER 1
|
||||
|
||||
/* Define to 1 if you have the 'atexit' function. */
|
||||
#define HAVE_ATEXIT 1
|
||||
|
||||
@@ -109,9 +106,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
# define HAVE_DIRECT_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you don't have 'vprintf' but do have '_doprnt.' */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Use platform specific coding */
|
||||
#define HAVE_DOS_PATHS 1
|
||||
|
||||
@@ -129,9 +123,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the 'fileno' function. */
|
||||
#define HAVE_FILENO 1
|
||||
|
||||
/* Define to 1 if you have the 'fork' function. */
|
||||
/* #undef HAVE_FORK */
|
||||
|
||||
/* Define to 1 if you have the 'getcwd' function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
@@ -247,9 +238,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the 'socket' function. */
|
||||
/* #undef HAVE_SOCKET */
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#ifdef __MINGW32__
|
||||
#define HAVE_STDINT_H 1
|
||||
@@ -348,37 +336,21 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <varargs.h> header file. */
|
||||
/* #undef HAVE_VARARGS_H */
|
||||
|
||||
/* Define to 1 if you have the 'vfork' function. */
|
||||
/* #undef HAVE_VFORK */
|
||||
|
||||
/* Define to 1 if you have the <vfork.h> header file. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define to 1 if you have the 'vprintf' function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
|
||||
/* Define to 1 if you have the 'wait3' function. */
|
||||
/* #undef HAVE_WAIT3 */
|
||||
|
||||
/* Define to 1 if you have the 'waitpid' function. */
|
||||
/* #undef HAVE_WAITPID */
|
||||
|
||||
/* Define to 1 if 'fork' works. */
|
||||
/* #undef HAVE_WORKING_FORK */
|
||||
|
||||
/* Define to 1 if 'vfork' works. */
|
||||
/* #undef HAVE_WORKING_VFORK */
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "Windows32"
|
||||
|
||||
/* Define to 1 to enable job server support in GNU make. */
|
||||
#define MAKE_JOBSERVER 1
|
||||
|
||||
/* Define to 1 to enable 'load' support in GNU make. */
|
||||
#define MAKE_LOAD 1
|
||||
|
||||
/* Define to 1 to enable symbolic link timestamp checking. */
|
||||
/* #undef MAKE_SYMLINKS */
|
||||
|
||||
@@ -427,9 +399,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
@@ -511,9 +483,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define uintmax_t unsigned long
|
||||
#endif
|
||||
|
||||
/* Define as 'fork' if 'vfork' does not work. */
|
||||
/*#define vfork fork*/
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* #undef HAVE_SYS_WAIT_H */
|
||||
|
||||
|
||||
14
config/.cvsignore → config/.gitignore
vendored
14
config/.cvsignore → config/.gitignore
vendored
@@ -1,11 +1,11 @@
|
||||
*.m4
|
||||
config.*
|
||||
mkinstalldirs
|
||||
texinfo.tex
|
||||
mdate-sh
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
mdate-sh
|
||||
missing
|
||||
|
||||
Makefile Makefile.in
|
||||
texinfo.tex
|
||||
*.m4
|
||||
!dospaths.m4
|
||||
@@ -33,7 +33,7 @@
|
||||
* Makefile.am: New file.
|
||||
|
||||
|
||||
Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*-Makefile-*-, or close enough
|
||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -15,34 +15,4 @@
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
EXTRA_DIST = \
|
||||
codeset.m4 \
|
||||
dospaths.m4 \
|
||||
gettext.m4 \
|
||||
glibc21.m4 \
|
||||
iconv.m4 \
|
||||
intdiv0.m4 \
|
||||
intmax.m4 \
|
||||
inttypes-pri.m4 \
|
||||
inttypes.m4 \
|
||||
inttypes_h.m4 \
|
||||
isc-posix.m4 \
|
||||
isc-posix.m4 \
|
||||
lcmessage.m4 \
|
||||
lib-ld.m4 \
|
||||
lib-link.m4 \
|
||||
lib-prefix.m4 \
|
||||
longdouble.m4 \
|
||||
longlong.m4 \
|
||||
nls.m4 \
|
||||
po.m4 \
|
||||
printf-posix.m4 \
|
||||
progtest.m4 \
|
||||
signed.m4 \
|
||||
size_max.m4 \
|
||||
stdint_h.m4 \
|
||||
uintmax_t.m4 \
|
||||
ulonglong.m4 \
|
||||
wchar_t.m4 \
|
||||
wint_t.m4 \
|
||||
xsize.m4
|
||||
# Autoconf / automake know how to handle this directory.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
|
||||
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
|
||||
#
|
||||
# Copyright (C) 1993-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
|
||||
|
||||
Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -76,16 +76,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if your compiler conforms to the ANSI C standard. */
|
||||
#define HAVE_ANSI_COMPILER 1
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define to 1 if you have the vprintf library function. */
|
||||
#undef HAVE_VPRINTF
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the stricmp function. */
|
||||
#define HAVE_STRICMP 1
|
||||
|
||||
@@ -110,8 +100,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "%VERSION%"
|
||||
|
||||
/* Define to 1 if the C compiler supports function prototypes. */
|
||||
#define PROTOTYPES 1
|
||||
/* Output sync sypport */
|
||||
#define NO_OUTPUT_SYNC
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#
|
||||
# Copyright (C) 1993-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -16,10 +16,9 @@
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
AC_INIT([GNU make],[3.82.90],[bug-make@gnu.org])
|
||||
AC_INIT([GNU make],[3.99.92],[bug-make@gnu.org])
|
||||
|
||||
AC_PREREQ([2.59])
|
||||
AC_REVISION([$Id$])
|
||||
AC_PREREQ([2.62])
|
||||
|
||||
# Autoconf setup
|
||||
AC_CONFIG_AUX_DIR([config])
|
||||
@@ -27,7 +26,7 @@ AC_CONFIG_SRCDIR([vpath.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
# Automake setup
|
||||
AM_INIT_AUTOMAKE([1.9])
|
||||
AM_INIT_AUTOMAKE([1.11.1 silent-rules])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
@@ -63,17 +62,7 @@ AC_HEADER_DIRENT
|
||||
AC_HEADER_STAT
|
||||
AC_HEADER_TIME
|
||||
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
|
||||
memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h])
|
||||
|
||||
# Set a flag if we have an ANSI C compiler
|
||||
AS_IF([test "$ac_cv_prog_cc_stdc" != no],
|
||||
[ AC_DEFINE([HAVE_ANSI_COMPILER], [1],
|
||||
[Define to 1 if your compiler conforms to the ANSI C standard.])
|
||||
])
|
||||
|
||||
|
||||
# Determine what kind of variadic function calls we support
|
||||
AC_CHECK_HEADERS([stdarg.h varargs.h], [break])
|
||||
memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h])
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_C_CONST
|
||||
@@ -101,12 +90,12 @@ AC_CACHE_CHECK([whether to use high resolution file timestamps],
|
||||
#if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif]],
|
||||
[[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
|
||||
[[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
|
||||
[make_cv_file_timestamp_hi_res=yes])
|
||||
])])
|
||||
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes], [val=1], [val=0])
|
||||
AC_DEFINE_UNQUOTED([FILE_TIMESTAMP_HI_RES], [$val],
|
||||
[Use high resolution file timestamps if nonzero.])
|
||||
[Use high resolution file timestamps if nonzero.])
|
||||
|
||||
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
|
||||
[ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
|
||||
@@ -114,7 +103,7 @@ AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
|
||||
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
|
||||
AS_IF([test "$ac_cv_search_clock_gettime" != no],
|
||||
[ AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
|
||||
[Define to 1 if you have the clock_gettime function.])
|
||||
[Define to 1 if you have the clock_gettime function.])
|
||||
])
|
||||
])
|
||||
|
||||
@@ -128,24 +117,24 @@ AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
|
||||
[ac_cv_func_gettimeofday=no
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[#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)"])])
|
||||
{
|
||||
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)"])])
|
||||
AS_IF([test "$ac_cv_func_gettimeofday" = yes],
|
||||
[ AC_DEFINE([HAVE_GETTIMEOFDAY], [1],
|
||||
[Define to 1 if you have a standard gettimeofday function])
|
||||
[Define to 1 if you have a standard gettimeofday function])
|
||||
])
|
||||
|
||||
AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
|
||||
dup2 getcwd realpath sigsetmask sigaction \
|
||||
dup dup2 getcwd realpath sigsetmask sigaction \
|
||||
getgroups seteuid setegid setlinebuf setreuid setregid \
|
||||
getrlimit setrlimit setvbuf pipe strerror strsignal \
|
||||
lstat readlink atexit])
|
||||
lstat readlink atexit])
|
||||
|
||||
# We need to check declarations, not just existence, because on Tru64 this
|
||||
# function is not declared without special flags, which themselves cause
|
||||
@@ -164,8 +153,6 @@ AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp])
|
||||
AC_FUNC_STRCOLL
|
||||
|
||||
AC_FUNC_ALLOCA
|
||||
AC_FUNC_FORK([])
|
||||
AC_FUNC_VPRINTF
|
||||
AC_FUNC_CLOSEDIR_VOID
|
||||
|
||||
# See if the user wants to add (or not) GNU Guile support
|
||||
@@ -194,11 +181,11 @@ AC_FUNC_GETLOADAVG
|
||||
|
||||
AS_IF([test "$ac_cv_header_nlist_h" = yes],
|
||||
[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
|
||||
[[struct nlist nl;
|
||||
[[struct nlist nl;
|
||||
nl.n_name = "string";
|
||||
return 0;]])],
|
||||
[make_cv_nlist_struct=yes],
|
||||
[make_cv_nlist_struct=no])
|
||||
[make_cv_nlist_struct=yes],
|
||||
[make_cv_nlist_struct=no])
|
||||
AS_IF([test "$make_cv_nlist_struct" = yes],
|
||||
[ AC_DEFINE([NLIST_STRUCT], [1],
|
||||
[Define to 1 if struct nlist.n_name is a pointer rather than an array.])
|
||||
@@ -257,7 +244,7 @@ AC_SUBST([REMOTE]) REMOTE=stub
|
||||
use_customs=false
|
||||
AC_ARG_WITH([customs],
|
||||
[ AC_HELP_STRING([--with-customs=DIR],
|
||||
[enable remote jobs via Customs--see README.customs])],
|
||||
[enable remote jobs via Customs--see README.customs])],
|
||||
[ AS_CASE([$withval], [n|no], [:],
|
||||
[make_cppflags="$CPPFLAGS"
|
||||
AS_CASE([$withval],
|
||||
@@ -267,7 +254,7 @@ AC_ARG_WITH([customs],
|
||||
CF_NETLIBS
|
||||
AC_CHECK_HEADER([customs.h],
|
||||
[use_customs=true
|
||||
REMOTE=cstms
|
||||
REMOTE=cstms
|
||||
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
|
||||
[with_customs=no
|
||||
CPPFLAGS="$make_cppflags" make_badcust=yes])
|
||||
@@ -281,7 +268,7 @@ AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
|
||||
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
|
||||
AC_ARG_ENABLE([case-insensitive-file-system],
|
||||
AC_HELP_STRING([--enable-case-insensitive-file-system],
|
||||
[assume file systems are case insensitive]),
|
||||
[assume file systems are case insensitive]),
|
||||
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
|
||||
|
||||
# See if we can handle the job server feature, and if the user wants it.
|
||||
@@ -352,13 +339,13 @@ AS_IF([test "$make_cv_load" = yes], [
|
||||
AC_MSG_CHECKING([If the linker accepts -Wl,--export-dynamic])
|
||||
old_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
|
||||
AC_LINK_IFELSE([int main(){}],
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_SUBST([AM_LDFLAGS], [-Wl,--export-dynamic])],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_CHECKING([If the linker accepts -rdynamic])
|
||||
LDFLAGS="$old_LDFLAGS -rdynamic"
|
||||
AC_LINK_IFELSE([int main(){}],
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_SUBST([AM_LDFLAGS], [-rdynamic])],
|
||||
[AC_MSG_RESULT([no])])
|
||||
@@ -381,7 +368,7 @@ AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
|
||||
[make_cv_path_sccs_get=get])
|
||||
])
|
||||
AC_DEFINE_UNQUOTED([SCCS_GET], ["$make_cv_path_sccs_get"],
|
||||
[Define to the name of the SCCS 'get' command.])
|
||||
[Define to the name of the SCCS 'get' command.])
|
||||
|
||||
ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
|
||||
AS_IF([(/usr/sccs/admin -n s.conftest || admin -n s.conftest) >/dev/null 2>&1 &&
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1994-2012 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
2
debug.h
2
debug.h
@@ -1,5 +1,5 @@
|
||||
/* Debugging macros and interface.
|
||||
Copyright (C) 1999-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
45
default.c
45
default.c
@@ -1,5 +1,5 @@
|
||||
/* Data base of default implicit rules for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,10 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
#include "rule.h"
|
||||
@@ -525,6 +528,8 @@ static const char *default_variables[] =
|
||||
#endif
|
||||
|
||||
#endif /* !VMS */
|
||||
/* Make this assignment to avoid undefined variable warnings. */
|
||||
"GNUMAKEFLAGS", "",
|
||||
0, 0
|
||||
};
|
||||
|
||||
@@ -534,15 +539,19 @@ void
|
||||
set_default_suffixes (void)
|
||||
{
|
||||
suffix_file = enter_file (strcache_add (".SUFFIXES"));
|
||||
suffix_file->builtin = 1;
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
define_variable_cname ("SUFFIXES", "", o_default, 0);
|
||||
else
|
||||
{
|
||||
struct dep *d;
|
||||
char *p = default_suffixes;
|
||||
suffix_file->deps = enter_prereqs(PARSE_FILE_SEQ (&p, struct dep, '\0',
|
||||
NULL, 0),
|
||||
NULL);
|
||||
suffix_file->deps = enter_prereqs (PARSE_SIMPLE_SEQ (&p, struct dep),
|
||||
NULL);
|
||||
for (d = suffix_file->deps; d; d = d->next)
|
||||
d->file->builtin = 1;
|
||||
|
||||
define_variable_cname ("SUFFIXES", default_suffixes, o_default, 0);
|
||||
}
|
||||
}
|
||||
@@ -563,15 +572,14 @@ install_default_suffix_rules (void)
|
||||
for (s = default_suffix_rules; *s != 0; s += 2)
|
||||
{
|
||||
struct file *f = enter_file (strcache_add (s[0]));
|
||||
/* Don't clobber cmds given in a makefile if there were any. */
|
||||
if (f->cmds == 0)
|
||||
{
|
||||
f->cmds = xmalloc (sizeof (struct commands));
|
||||
f->cmds->fileinfo.filenm = 0;
|
||||
f->cmds->commands = s[1];
|
||||
f->cmds->command_lines = 0;
|
||||
f->cmds->recipe_prefix = RECIPEPREFIX_DEFAULT;
|
||||
}
|
||||
/* This function should run before any makefile is parsed. */
|
||||
assert (f->cmds == 0);
|
||||
f->cmds = xmalloc (sizeof (struct commands));
|
||||
f->cmds->fileinfo.filenm = 0;
|
||||
f->cmds->commands = s[1];
|
||||
f->cmds->command_lines = 0;
|
||||
f->cmds->recipe_prefix = RECIPEPREFIX_DEFAULT;
|
||||
f->builtin = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,3 +612,12 @@ define_default_variables (void)
|
||||
for (s = default_variables; *s != 0; s += 2)
|
||||
define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
|
||||
}
|
||||
|
||||
void
|
||||
undefine_default_variables (void)
|
||||
{
|
||||
const char **s;
|
||||
|
||||
for (s = default_variables; *s != 0; s += 2)
|
||||
undefine_variable_global (s[0], strlen (s[0]), o_default);
|
||||
}
|
||||
|
||||
33
dep.h
33
dep.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions of dependency data structures for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -18,11 +18,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
These flags are saved in the 'changed' field of each
|
||||
'struct dep' in the chain returned by 'read_all_makefiles'. */
|
||||
|
||||
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
|
||||
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
|
||||
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
|
||||
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
|
||||
#define RM_NOFLAG 0
|
||||
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
|
||||
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
|
||||
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
|
||||
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
|
||||
#define RM_NOFLAG 0
|
||||
|
||||
/* Structure representing one dependency of a file.
|
||||
Each struct file's 'deps' points to a chain of these,
|
||||
@@ -53,22 +53,23 @@ struct nameseq
|
||||
const char *name;
|
||||
};
|
||||
|
||||
|
||||
#define PARSEFS_NONE (0x0000)
|
||||
#define PARSEFS_NOSTRIP (0x0001)
|
||||
#define PARSEFS_NOAR (0x0002)
|
||||
#define PARSEFS_NOGLOB (0x0004)
|
||||
#define PARSEFS_EXISTS (0x0008)
|
||||
#define PARSEFS_NOCACHE (0x0010)
|
||||
#define PARSEFS_NONE 0x0000
|
||||
#define PARSEFS_NOSTRIP 0x0001
|
||||
#define PARSEFS_NOAR 0x0002
|
||||
#define PARSEFS_NOGLOB 0x0004
|
||||
#define PARSEFS_EXISTS 0x0008
|
||||
#define PARSEFS_NOCACHE 0x0010
|
||||
|
||||
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
|
||||
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
|
||||
#define PARSE_SIMPLE_SEQ(_s,_t) \
|
||||
(_t *)parse_file_seq ((_s),sizeof (_t),MAP_NUL,NULL,PARSEFS_NONE)
|
||||
|
||||
#ifdef VMS
|
||||
void *parse_file_seq ();
|
||||
#else
|
||||
void *parse_file_seq (char **stringp, unsigned int size,
|
||||
int stopchar, const char *prefix, int flags);
|
||||
int stopmap, const char *prefix, int flags);
|
||||
#endif
|
||||
|
||||
char *tilde_expand (const char *name);
|
||||
@@ -87,5 +88,5 @@ struct dep *copy_dep_chain (const struct dep *d);
|
||||
void free_dep_chain (struct dep *d);
|
||||
void free_ns_chain (struct nameseq *n);
|
||||
struct dep *read_all_makefiles (const char **makefiles);
|
||||
void eval_buffer (char *buffer);
|
||||
int update_goal_chain (struct dep *goals);
|
||||
void eval_buffer (char *buffer, const gmk_floc *floc);
|
||||
enum update_status update_goal_chain (struct dep *goals);
|
||||
|
||||
525
dir.c
525
dir.c
@@ -1,5 +1,5 @@
|
||||
/* Directory hashing for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,10 +14,12 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
#include "hash.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
|
||||
#ifdef HAVE_DIRENT_H
|
||||
#ifdef HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||
# ifdef VMS
|
||||
@@ -84,21 +86,21 @@ dosify (const char *filename)
|
||||
df = dos_filename;
|
||||
|
||||
/* First, transform the name part. */
|
||||
for (i = 0; *filename != '\0' && i < 8 && *filename != '.'; ++i)
|
||||
for (i = 0; i < 8 && ! STOP_SET (*filename, MAP_DOT|MAP_NUL); ++i)
|
||||
*df++ = tolower ((unsigned char)*filename++);
|
||||
|
||||
/* Now skip to the next dot. */
|
||||
while (*filename != '\0' && *filename != '.')
|
||||
while (! STOP_SET (*filename, MAP_DOT|MAP_NUL))
|
||||
++filename;
|
||||
if (*filename != '\0')
|
||||
{
|
||||
*df++ = *filename++;
|
||||
for (i = 0; *filename != '\0' && i < 3 && *filename != '.'; ++i)
|
||||
*df++ = tolower ((unsigned char)*filename++);
|
||||
for (i = 0; i < 3 && ! STOP_SET (*filename, MAP_DOT|MAP_NUL); ++i)
|
||||
*df++ = tolower ((unsigned char)*filename++);
|
||||
}
|
||||
|
||||
/* Look for more dots. */
|
||||
while (*filename != '\0' && *filename != '.')
|
||||
while (! STOP_SET (*filename, MAP_DOT|MAP_NUL))
|
||||
++filename;
|
||||
if (*filename == '.')
|
||||
return filename;
|
||||
@@ -144,11 +146,11 @@ static int
|
||||
vms_hash (const char *name)
|
||||
{
|
||||
int h = 0;
|
||||
int g;
|
||||
|
||||
while (*name)
|
||||
{
|
||||
unsigned char uc = *name;
|
||||
int g;
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||
h = (h << 4) + (isupper (uc) ? tolower (uc) : uc);
|
||||
#else
|
||||
@@ -157,10 +159,10 @@ vms_hash (const char *name)
|
||||
name++;
|
||||
g = h & 0xf0000000;
|
||||
if (g)
|
||||
{
|
||||
h = h ^ (g >> 24);
|
||||
h = h ^ g;
|
||||
}
|
||||
{
|
||||
h = h ^ (g >> 24);
|
||||
h = h ^ g;
|
||||
}
|
||||
}
|
||||
return h;
|
||||
}
|
||||
@@ -177,7 +179,7 @@ vmsstat_dir (const char *name, struct stat *st)
|
||||
if (dir == 0)
|
||||
return -1;
|
||||
closedir (dir);
|
||||
s = strchr (name, ':'); /* find device */
|
||||
s = strchr (name, ':'); /* find device */
|
||||
if (s)
|
||||
{
|
||||
/* to keep the compiler happy we said "const char *name", now we cheat */
|
||||
@@ -202,13 +204,13 @@ vmsstat_dir (const char *name, struct stat *st)
|
||||
|
||||
/* Hash table of directories. */
|
||||
|
||||
#ifndef DIRECTORY_BUCKETS
|
||||
#ifndef DIRECTORY_BUCKETS
|
||||
#define DIRECTORY_BUCKETS 199
|
||||
#endif
|
||||
|
||||
struct directory_contents
|
||||
{
|
||||
dev_t dev; /* Device and inode numbers of this dir. */
|
||||
dev_t dev; /* Device and inode numbers of this dir. */
|
||||
#ifdef WINDOWS32
|
||||
/* Inode means nothing on WINDOWS32. Even file key information is
|
||||
* unreliable because it is random per file open and undefined for remote
|
||||
@@ -229,8 +231,8 @@ struct directory_contents
|
||||
ino_t ino;
|
||||
# endif
|
||||
#endif /* WINDOWS32 */
|
||||
struct hash_table dirfiles; /* Files in this directory. */
|
||||
DIR *dirstream; /* Stream reading this directory. */
|
||||
struct hash_table dirfiles; /* Files in this directory. */
|
||||
DIR *dirstream; /* Stream reading this directory. */
|
||||
};
|
||||
|
||||
static unsigned long
|
||||
@@ -246,9 +248,9 @@ directory_contents_hash_1 (const void *key_0)
|
||||
#else
|
||||
# ifdef VMS
|
||||
hash = (((unsigned int) key->dev << 4)
|
||||
^ ((unsigned int) key->ino[0]
|
||||
+ (unsigned int) key->ino[1]
|
||||
+ (unsigned int) key->ino[2]));
|
||||
^ ((unsigned int) key->ino[0]
|
||||
+ (unsigned int) key->ino[1]
|
||||
+ (unsigned int) key->ino[2]));
|
||||
# else
|
||||
hash = ((unsigned int) key->dev << 4) ^ (unsigned int) key->ino;
|
||||
# endif
|
||||
@@ -269,9 +271,9 @@ directory_contents_hash_2 (const void *key_0)
|
||||
#else
|
||||
# ifdef VMS
|
||||
hash = (((unsigned int) key->dev << 4)
|
||||
^ ~((unsigned int) key->ino[0]
|
||||
+ (unsigned int) key->ino[1]
|
||||
+ (unsigned int) key->ino[2]));
|
||||
^ ~((unsigned int) key->ino[0]
|
||||
+ (unsigned int) key->ino[1]
|
||||
+ (unsigned int) key->ino[2]));
|
||||
# else
|
||||
hash = ((unsigned int) key->dev << 4) ^ (unsigned int) ~key->ino;
|
||||
# endif
|
||||
@@ -331,7 +333,7 @@ static struct hash_table directory_contents;
|
||||
|
||||
struct directory
|
||||
{
|
||||
const char *name; /* Name of the directory. */
|
||||
const char *name; /* Name of the directory. */
|
||||
|
||||
/* The directory's contents. This data may be shared by several
|
||||
entries in the hash table, which refer to the same directory
|
||||
@@ -355,7 +357,7 @@ static int
|
||||
directory_hash_cmp (const void *x, const void *y)
|
||||
{
|
||||
return_ISTRING_COMPARE (((const struct directory *) x)->name,
|
||||
((const struct directory *) y)->name);
|
||||
((const struct directory *) y)->name);
|
||||
}
|
||||
|
||||
/* Table of directories hashed by name. */
|
||||
@@ -372,9 +374,9 @@ static unsigned int open_directories = 0;
|
||||
|
||||
struct dirfile
|
||||
{
|
||||
const char *name; /* Name of the file. */
|
||||
const char *name; /* Name of the file. */
|
||||
short length;
|
||||
short impossible; /* This file is impossible. */
|
||||
short impossible; /* This file is impossible. */
|
||||
};
|
||||
|
||||
static unsigned long
|
||||
@@ -400,7 +402,7 @@ dirfile_hash_cmp (const void *xv, const void *yv)
|
||||
return_ISTRING_COMPARE (x->name, y->name);
|
||||
}
|
||||
|
||||
#ifndef DIRFILE_BUCKETS
|
||||
#ifndef DIRFILE_BUCKETS
|
||||
#define DIRFILE_BUCKETS 107
|
||||
#endif
|
||||
|
||||
@@ -413,19 +415,10 @@ static struct directory *find_directory (const char *name);
|
||||
static struct directory *
|
||||
find_directory (const char *name)
|
||||
{
|
||||
const char *p;
|
||||
struct directory *dir;
|
||||
struct directory **dir_slot;
|
||||
struct directory dir_key;
|
||||
int r;
|
||||
#ifdef WINDOWS32
|
||||
char* w32_path;
|
||||
char fs_label[BUFSIZ];
|
||||
char fs_type[BUFSIZ];
|
||||
unsigned long fs_serno;
|
||||
unsigned long fs_flags;
|
||||
unsigned long fs_len;
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
if ((*name == '.') && (*(name+1) == 0))
|
||||
name = "[]";
|
||||
@@ -439,20 +432,20 @@ find_directory (const char *name)
|
||||
|
||||
if (HASH_VACANT (dir))
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
/* The directory was not found. Create a new entry for it. */
|
||||
const char *p = name + strlen (name);
|
||||
struct stat st;
|
||||
int r;
|
||||
|
||||
p = name + strlen (name);
|
||||
dir = xmalloc (sizeof (struct directory));
|
||||
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
|
||||
dir->name = strcache_add_len (downcase(name), p - name);
|
||||
dir->name = strcache_add_len (downcase (name), p - name);
|
||||
#else
|
||||
dir->name = strcache_add_len (name, p - name);
|
||||
#endif
|
||||
hash_insert_at (&directories, dir, dir_slot);
|
||||
/* The directory is not in the name hash table.
|
||||
Find its device and inode numbers, and look it up by them. */
|
||||
Find its device and inode numbers, and look it up by them. */
|
||||
|
||||
#ifdef VMS
|
||||
r = vmsstat_dir (name, &st);
|
||||
@@ -479,96 +472,101 @@ find_directory (const char *name)
|
||||
|
||||
if (r < 0)
|
||||
{
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the 'contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
}
|
||||
/* Couldn't stat the directory. Mark this by
|
||||
setting the 'contents' member to a nil pointer. */
|
||||
dir->contents = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Search the contents hash table; device and inode are the key. */
|
||||
{
|
||||
/* Search the contents hash table; device and inode are the key. */
|
||||
|
||||
struct directory_contents *dc;
|
||||
struct directory_contents **dc_slot;
|
||||
struct directory_contents dc_key;
|
||||
|
||||
dc_key.dev = st.st_dev;
|
||||
#ifdef WINDOWS32
|
||||
dc_key.path_key = w32_path = w32ify (name, 1);
|
||||
dc_key.ctime = st.st_ctime;
|
||||
char *w32_path;
|
||||
#endif
|
||||
struct directory_contents *dc;
|
||||
struct directory_contents **dc_slot;
|
||||
struct directory_contents dc_key;
|
||||
|
||||
dc_key.dev = st.st_dev;
|
||||
#ifdef WINDOWS32
|
||||
dc_key.path_key = w32_path = w32ify (name, 1);
|
||||
dc_key.ctime = st.st_ctime;
|
||||
#else
|
||||
# ifdef VMS
|
||||
dc_key.ino[0] = st.st_ino[0];
|
||||
dc_key.ino[1] = st.st_ino[1];
|
||||
dc_key.ino[2] = st.st_ino[2];
|
||||
dc_key.ino[0] = st.st_ino[0];
|
||||
dc_key.ino[1] = st.st_ino[1];
|
||||
dc_key.ino[2] = st.st_ino[2];
|
||||
# else
|
||||
dc_key.ino = st.st_ino;
|
||||
dc_key.ino = st.st_ino;
|
||||
# endif
|
||||
#endif
|
||||
dc_slot = (struct directory_contents **) hash_find_slot (&directory_contents, &dc_key);
|
||||
dc = *dc_slot;
|
||||
dc_slot = (struct directory_contents **) hash_find_slot (&directory_contents, &dc_key);
|
||||
dc = *dc_slot;
|
||||
|
||||
if (HASH_VACANT (dc))
|
||||
{
|
||||
/* Nope; this really is a directory we haven't seen before. */
|
||||
if (HASH_VACANT (dc))
|
||||
{
|
||||
/* Nope; this really is a directory we haven't seen before. */
|
||||
#ifdef WINDOWS32
|
||||
char fs_label[BUFSIZ];
|
||||
char fs_type[BUFSIZ];
|
||||
unsigned long fs_serno;
|
||||
unsigned long fs_flags;
|
||||
unsigned long fs_len;
|
||||
#endif
|
||||
dc = (struct directory_contents *)
|
||||
xmalloc (sizeof (struct directory_contents));
|
||||
|
||||
dc = (struct directory_contents *)
|
||||
xmalloc (sizeof (struct directory_contents));
|
||||
|
||||
/* Enter it in the contents hash table. */
|
||||
dc->dev = st.st_dev;
|
||||
/* Enter it in the contents hash table. */
|
||||
dc->dev = st.st_dev;
|
||||
#ifdef WINDOWS32
|
||||
dc->path_key = xstrdup (w32_path);
|
||||
dc->ctime = st.st_ctime;
|
||||
dc->ctime = st.st_ctime;
|
||||
dc->mtime = st.st_mtime;
|
||||
|
||||
/*
|
||||
* NTFS is the only WINDOWS32 filesystem that bumps mtime
|
||||
* on a directory when files are added/deleted from
|
||||
* a directory.
|
||||
*/
|
||||
/* NTFS is the only WINDOWS32 filesystem that bumps mtime on a
|
||||
directory when files are added/deleted from a directory. */
|
||||
w32_path[3] = '\0';
|
||||
if (GetVolumeInformation(w32_path,
|
||||
fs_label, sizeof (fs_label),
|
||||
&fs_serno, &fs_len,
|
||||
&fs_flags, fs_type, sizeof (fs_type)) == FALSE)
|
||||
if (GetVolumeInformation (w32_path, fs_label, sizeof (fs_label),
|
||||
&fs_serno, &fs_len, &fs_flags, fs_type,
|
||||
sizeof (fs_type)) == FALSE)
|
||||
dc->fs_flags = FS_UNKNOWN;
|
||||
else if (!strcmp(fs_type, "FAT"))
|
||||
else if (!strcmp (fs_type, "FAT"))
|
||||
dc->fs_flags = FS_FAT;
|
||||
else if (!strcmp(fs_type, "NTFS"))
|
||||
else if (!strcmp (fs_type, "NTFS"))
|
||||
dc->fs_flags = FS_NTFS;
|
||||
else
|
||||
dc->fs_flags = FS_UNKNOWN;
|
||||
#else
|
||||
# ifdef VMS
|
||||
dc->ino[0] = st.st_ino[0];
|
||||
dc->ino[1] = st.st_ino[1];
|
||||
dc->ino[2] = st.st_ino[2];
|
||||
dc->ino[0] = st.st_ino[0];
|
||||
dc->ino[1] = st.st_ino[1];
|
||||
dc->ino[2] = st.st_ino[2];
|
||||
# else
|
||||
dc->ino = st.st_ino;
|
||||
dc->ino = st.st_ino;
|
||||
# endif
|
||||
#endif /* WINDOWS32 */
|
||||
hash_insert_at (&directory_contents, dc, dc_slot);
|
||||
ENULLLOOP (dc->dirstream, opendir (name));
|
||||
if (dc->dirstream == 0)
|
||||
hash_insert_at (&directory_contents, dc, dc_slot);
|
||||
ENULLLOOP (dc->dirstream, opendir (name));
|
||||
if (dc->dirstream == 0)
|
||||
/* Couldn't open the directory. Mark this by setting the
|
||||
'files' member to a nil pointer. */
|
||||
dc->dirfiles.ht_vec = 0;
|
||||
else
|
||||
{
|
||||
hash_init (&dc->dirfiles, DIRFILE_BUCKETS,
|
||||
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
||||
/* Keep track of how many directories are open. */
|
||||
++open_directories;
|
||||
if (open_directories == MAX_OPEN_DIRECTORIES)
|
||||
/* We have too many directories open already.
|
||||
Read the entire directory and then close it. */
|
||||
dir_contents_file_exists_p (dc, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hash_init (&dc->dirfiles, DIRFILE_BUCKETS,
|
||||
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
||||
/* Keep track of how many directories are open. */
|
||||
++open_directories;
|
||||
if (open_directories == MAX_OPEN_DIRECTORIES)
|
||||
/* We have too many directories open already.
|
||||
Read the entire directory and then close it. */
|
||||
dir_contents_file_exists_p (dc, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Point the name-hashed entry for DIR at its contents data. */
|
||||
dir->contents = dc;
|
||||
}
|
||||
/* Point the name-hashed entry for DIR at its contents data. */
|
||||
dir->contents = dc;
|
||||
}
|
||||
}
|
||||
|
||||
return dir;
|
||||
@@ -581,7 +579,6 @@ static int
|
||||
dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
const char *filename)
|
||||
{
|
||||
unsigned int hash;
|
||||
struct dirfile *df;
|
||||
struct dirent *d;
|
||||
#ifdef WINDOWS32
|
||||
@@ -610,16 +607,15 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
filename = vmsify (filename,0);
|
||||
#endif
|
||||
|
||||
hash = 0;
|
||||
if (filename != 0)
|
||||
{
|
||||
struct dirfile dirfile_key;
|
||||
|
||||
if (*filename == '\0')
|
||||
{
|
||||
/* Checking if the directory exists. */
|
||||
return 1;
|
||||
}
|
||||
{
|
||||
/* Checking if the directory exists. */
|
||||
return 1;
|
||||
}
|
||||
dirfile_key.name = filename;
|
||||
dirfile_key.length = strlen (filename);
|
||||
df = hash_find_item (&dir->dirfiles, &dirfile_key);
|
||||
@@ -639,32 +635,32 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
* on directories (ugh!).
|
||||
*/
|
||||
if (dir->path_key)
|
||||
{
|
||||
{
|
||||
if ((dir->fs_flags & FS_FAT) != 0)
|
||||
{
|
||||
dir->mtime = time ((time_t *) 0);
|
||||
rehash = 1;
|
||||
}
|
||||
else if (stat (dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
|
||||
{
|
||||
/* reset date stamp to show most recent re-process. */
|
||||
dir->mtime = st.st_mtime;
|
||||
rehash = 1;
|
||||
}
|
||||
{
|
||||
dir->mtime = time ((time_t *) 0);
|
||||
rehash = 1;
|
||||
}
|
||||
else if (stat (dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
|
||||
{
|
||||
/* reset date stamp to show most recent re-process. */
|
||||
dir->mtime = st.st_mtime;
|
||||
rehash = 1;
|
||||
}
|
||||
|
||||
/* If it has been already read in, all done. */
|
||||
if (!rehash)
|
||||
return 0;
|
||||
if (!rehash)
|
||||
return 0;
|
||||
|
||||
/* make sure directory can still be opened; if not return. */
|
||||
dir->dirstream = opendir (dir->path_key);
|
||||
if (!dir->dirstream)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
/* The directory has been all read in. */
|
||||
return 0;
|
||||
/* The directory has been all read in. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (1)
|
||||
@@ -691,7 +687,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
}
|
||||
#endif
|
||||
if (!REAL_DIR_ENTRY (d))
|
||||
continue;
|
||||
continue;
|
||||
|
||||
len = NAMLEN (d);
|
||||
dirfile_key.name = d->d_name;
|
||||
@@ -704,17 +700,17 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
*/
|
||||
if (! rehash || HASH_VACANT (*dirfile_slot))
|
||||
#endif
|
||||
{
|
||||
df = xmalloc (sizeof (struct dirfile));
|
||||
{
|
||||
df = xmalloc (sizeof (struct dirfile));
|
||||
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
|
||||
df->name = strcache_add_len (downcase(d->d_name), len);
|
||||
df->name = strcache_add_len (downcase (d->d_name), len);
|
||||
#else
|
||||
df->name = strcache_add_len (d->d_name, len);
|
||||
df->name = strcache_add_len (d->d_name, len);
|
||||
#endif
|
||||
df->length = len;
|
||||
df->impossible = 0;
|
||||
hash_insert_at (&dir->dirfiles, df, dirfile_slot);
|
||||
}
|
||||
df->length = len;
|
||||
df->impossible = 0;
|
||||
hash_insert_at (&dir->dirfiles, df, dirfile_slot);
|
||||
}
|
||||
/* Check if the name matches the one we're searching for. */
|
||||
if (filename != 0 && patheq (d->d_name, filename))
|
||||
return 1;
|
||||
@@ -739,7 +735,7 @@ int
|
||||
dir_file_exists_p (const char *dirname, const char *filename)
|
||||
{
|
||||
return dir_contents_file_exists_p (find_directory (dirname)->contents,
|
||||
filename);
|
||||
filename);
|
||||
}
|
||||
|
||||
/* Return 1 if the file named NAME exists. */
|
||||
@@ -751,7 +747,7 @@ file_exists_p (const char *name)
|
||||
const char *dirname;
|
||||
const char *slash;
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
#ifndef NO_ARCHIVES
|
||||
if (ar_name (name))
|
||||
return ar_member_date (name) != (time_t) -1;
|
||||
#endif
|
||||
@@ -767,7 +763,7 @@ file_exists_p (const char *name)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
const char *bslash = strrchr(name, '\\');
|
||||
const char *bslash = strrchr (name, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
@@ -792,8 +788,8 @@ file_exists_p (const char *name)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < name + 3 && name[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
p = alloca (dirend - name + 1);
|
||||
memcpy (p, name, dirend - name);
|
||||
@@ -827,7 +823,7 @@ file_impossible (const char *filename)
|
||||
# ifdef HAVE_DOS_PATHS
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
const char *bslash = strrchr(p, '\\');
|
||||
const char *bslash = strrchr (p, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
@@ -847,21 +843,21 @@ file_impossible (const char *filename)
|
||||
const char *dirname;
|
||||
const char *slash = dirend;
|
||||
if (dirend == p)
|
||||
dirname = "/";
|
||||
dirname = "/";
|
||||
else
|
||||
{
|
||||
{
|
||||
char *cp;
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < p + 3 && p[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < p + 3 && p[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
cp = alloca (dirend - p + 1);
|
||||
memcpy (cp, p, dirend - p);
|
||||
cp[dirend - p] = '\0';
|
||||
cp = alloca (dirend - p + 1);
|
||||
memcpy (cp, p, dirend - p);
|
||||
cp[dirend - p] = '\0';
|
||||
dirname = cp;
|
||||
}
|
||||
}
|
||||
dir = find_directory (dirname);
|
||||
filename = p = slash + 1;
|
||||
}
|
||||
@@ -874,7 +870,7 @@ file_impossible (const char *filename)
|
||||
if (dir->contents->dirfiles.ht_vec == 0)
|
||||
{
|
||||
hash_init (&dir->contents->dirfiles, DIRFILE_BUCKETS,
|
||||
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
||||
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
|
||||
}
|
||||
|
||||
/* Make a new entry and put it in the table. */
|
||||
@@ -882,7 +878,7 @@ file_impossible (const char *filename)
|
||||
new = xmalloc (sizeof (struct dirfile));
|
||||
new->length = strlen (filename);
|
||||
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
|
||||
new->name = strcache_add_len (downcase(filename), new->length);
|
||||
new->name = strcache_add_len (downcase (filename), new->length);
|
||||
#else
|
||||
new->name = strcache_add_len (filename, new->length);
|
||||
#endif
|
||||
@@ -896,7 +892,6 @@ int
|
||||
file_impossible_p (const char *filename)
|
||||
{
|
||||
const char *dirend;
|
||||
const char *p = filename;
|
||||
struct directory_contents *dir;
|
||||
struct dirfile *dirfile;
|
||||
struct dirfile dirfile_key;
|
||||
@@ -910,7 +905,7 @@ file_impossible_p (const char *filename)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||
{
|
||||
const char *bslash = strrchr(filename, '\\');
|
||||
const char *bslash = strrchr (filename, '\\');
|
||||
if (!dirend || bslash > dirend)
|
||||
dirend = bslash;
|
||||
/* The case of "d:file". */
|
||||
@@ -930,23 +925,23 @@ file_impossible_p (const char *filename)
|
||||
const char *dirname;
|
||||
const char *slash = dirend;
|
||||
if (dirend == filename)
|
||||
dirname = "/";
|
||||
dirname = "/";
|
||||
else
|
||||
{
|
||||
{
|
||||
char *cp;
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
cp = alloca (dirend - filename + 1);
|
||||
memcpy (cp, p, dirend - p);
|
||||
cp[dirend - p] = '\0';
|
||||
cp = alloca (dirend - filename + 1);
|
||||
memcpy (cp, filename, dirend - filename);
|
||||
cp[dirend - filename] = '\0';
|
||||
dirname = cp;
|
||||
}
|
||||
}
|
||||
dir = find_directory (dirname)->contents;
|
||||
p = filename = slash + 1;
|
||||
filename = slash + 1;
|
||||
}
|
||||
|
||||
if (dir == 0 || dir->dirfiles.ht_vec == 0)
|
||||
@@ -954,13 +949,13 @@ file_impossible_p (const char *filename)
|
||||
return 0;
|
||||
|
||||
#ifdef __MSDOS__
|
||||
filename = dosify (p);
|
||||
filename = dosify (filename);
|
||||
#endif
|
||||
#ifdef HAVE_CASE_INSENSITIVE_FS
|
||||
filename = downcase (p);
|
||||
filename = downcase (filename);
|
||||
#endif
|
||||
#ifdef VMS
|
||||
filename = vmsify (p, 1);
|
||||
filename = vmsify (filename, 1);
|
||||
#endif
|
||||
|
||||
dirfile_key.name = filename;
|
||||
@@ -1001,80 +996,80 @@ print_dir_data_base (void)
|
||||
{
|
||||
struct directory *dir = *dir_slot;
|
||||
if (! HASH_VACANT (dir))
|
||||
{
|
||||
if (dir->contents == 0)
|
||||
printf (_("# %s: could not be stat'd.\n"), dir->name);
|
||||
else if (dir->contents->dirfiles.ht_vec == 0)
|
||||
{
|
||||
{
|
||||
if (dir->contents == 0)
|
||||
printf (_("# %s: could not be stat'd.\n"), dir->name);
|
||||
else if (dir->contents->dirfiles.ht_vec == 0)
|
||||
{
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
|
||||
dir->name, dir->contents->path_key,dir->contents->mtime);
|
||||
printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
|
||||
dir->name, dir->contents->path_key,dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||
dir->name, (long int) dir->contents->dev,
|
||||
(long int) dir->contents->ino);
|
||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||
dir->name, (long int) dir->contents->dev,
|
||||
(long int) dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int f = 0;
|
||||
unsigned int im = 0;
|
||||
struct dirfile **files_slot;
|
||||
struct dirfile **files_end;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int f = 0;
|
||||
unsigned int im = 0;
|
||||
struct dirfile **files_slot;
|
||||
struct dirfile **files_end;
|
||||
|
||||
files_slot = (struct dirfile **) dir->contents->dirfiles.ht_vec;
|
||||
files_end = files_slot + dir->contents->dirfiles.ht_size;
|
||||
for ( ; files_slot < files_end; files_slot++)
|
||||
{
|
||||
struct dirfile *df = *files_slot;
|
||||
if (! HASH_VACANT (df))
|
||||
{
|
||||
if (df->impossible)
|
||||
++im;
|
||||
else
|
||||
++f;
|
||||
}
|
||||
}
|
||||
files_slot = (struct dirfile **) dir->contents->dirfiles.ht_vec;
|
||||
files_end = files_slot + dir->contents->dirfiles.ht_size;
|
||||
for ( ; files_slot < files_end; files_slot++)
|
||||
{
|
||||
struct dirfile *df = *files_slot;
|
||||
if (! HASH_VACANT (df))
|
||||
{
|
||||
if (df->impossible)
|
||||
++im;
|
||||
else
|
||||
++f;
|
||||
}
|
||||
}
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %d): "),
|
||||
dir->name, dir->contents->path_key, dir->contents->mtime);
|
||||
printf (_("# %s (key %s, mtime %d): "),
|
||||
dir->name, dir->contents->path_key, dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): "),
|
||||
dir->name,
|
||||
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||
printf (_("# %s (device %ld, inode %ld): "),
|
||||
dir->name,
|
||||
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
if (f == 0)
|
||||
fputs (_("No"), stdout);
|
||||
else
|
||||
printf ("%u", f);
|
||||
fputs (_(" files, "), stdout);
|
||||
if (im == 0)
|
||||
fputs (_("no"), stdout);
|
||||
else
|
||||
printf ("%u", im);
|
||||
fputs (_(" impossibilities"), stdout);
|
||||
if (dir->contents->dirstream == 0)
|
||||
puts (".");
|
||||
else
|
||||
puts (_(" so far."));
|
||||
files += f;
|
||||
impossible += im;
|
||||
}
|
||||
}
|
||||
if (f == 0)
|
||||
fputs (_("No"), stdout);
|
||||
else
|
||||
printf ("%u", f);
|
||||
fputs (_(" files, "), stdout);
|
||||
if (im == 0)
|
||||
fputs (_("no"), stdout);
|
||||
else
|
||||
printf ("%u", im);
|
||||
fputs (_(" impossibilities"), stdout);
|
||||
if (dir->contents->dirstream == 0)
|
||||
puts (".");
|
||||
else
|
||||
puts (_(" so far."));
|
||||
files += f;
|
||||
impossible += im;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fputs ("\n# ", stdout);
|
||||
@@ -1143,35 +1138,35 @@ read_dirstream (__ptr_t stream)
|
||||
{
|
||||
struct dirfile *df = *ds->dirfile_slot++;
|
||||
if (! HASH_VACANT (df) && !df->impossible)
|
||||
{
|
||||
/* The glob interface wants a 'struct dirent', so mock one up. */
|
||||
struct dirent *d;
|
||||
unsigned int len = df->length + 1;
|
||||
{
|
||||
/* The glob interface wants a 'struct dirent', so mock one up. */
|
||||
struct dirent *d;
|
||||
unsigned int len = df->length + 1;
|
||||
unsigned int sz = sizeof (*d) - sizeof (d->d_name) + len;
|
||||
if (sz > bufsz)
|
||||
{
|
||||
bufsz *= 2;
|
||||
if (sz > bufsz)
|
||||
bufsz = sz;
|
||||
buf = xrealloc (buf, bufsz);
|
||||
}
|
||||
d = (struct dirent *) buf;
|
||||
if (sz > bufsz)
|
||||
{
|
||||
bufsz *= 2;
|
||||
if (sz > bufsz)
|
||||
bufsz = sz;
|
||||
buf = xrealloc (buf, bufsz);
|
||||
}
|
||||
d = (struct dirent *) buf;
|
||||
#ifdef __MINGW32__
|
||||
# if __MINGW32_MAJOR_VERSION < 3 || (__MINGW32_MAJOR_VERSION == 3 && \
|
||||
__MINGW32_MINOR_VERSION == 0)
|
||||
d->d_name = xmalloc(len);
|
||||
__MINGW32_MINOR_VERSION == 0)
|
||||
d->d_name = xmalloc (len);
|
||||
# endif
|
||||
#endif
|
||||
FAKE_DIR_ENTRY (d);
|
||||
FAKE_DIR_ENTRY (d);
|
||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||
d->d_namlen = len - 1;
|
||||
d->d_namlen = len - 1;
|
||||
#endif
|
||||
#ifdef _DIRENT_HAVE_D_TYPE
|
||||
d->d_type = DT_UNKNOWN;
|
||||
d->d_type = DT_UNKNOWN;
|
||||
#endif
|
||||
memcpy (d->d_name, df->name, len);
|
||||
return d;
|
||||
}
|
||||
memcpy (d->d_name, df->name, len);
|
||||
return d;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1181,14 +1176,17 @@ static void
|
||||
ansi_free (void *p)
|
||||
{
|
||||
if (p)
|
||||
free(p);
|
||||
free (p);
|
||||
}
|
||||
|
||||
/* On 64 bit ReliantUNIX (5.44 and above) in LFS mode, stat() is actually a
|
||||
* macro for stat64(). If stat is a macro, make a local wrapper function to
|
||||
* invoke it.
|
||||
*
|
||||
* On MS-Windows, stat() "succeeds" for foo/bar/. where foo/bar is a
|
||||
* regular file; fix that here.
|
||||
*/
|
||||
#ifndef stat
|
||||
#if !defined(stat) && !defined(WINDOWS32)
|
||||
# ifndef VMS
|
||||
int stat (const char *path, struct stat *sbuf);
|
||||
# endif
|
||||
@@ -1198,6 +1196,23 @@ static int
|
||||
local_stat (const char *path, struct stat *buf)
|
||||
{
|
||||
int e;
|
||||
#ifdef WINDOWS32
|
||||
size_t plen = strlen (path);
|
||||
|
||||
/* Make sure the parent of "." exists and is a directory, not a
|
||||
file. This is because 'stat' on Windows normalizes the argument
|
||||
foo/. => foo without checking first that foo is a directory. */
|
||||
if (plen > 1 && path[plen - 1] == '.'
|
||||
&& (path[plen - 2] == '/' || path[plen - 2] == '\\'))
|
||||
{
|
||||
char parent[MAXPATHLEN];
|
||||
|
||||
strncpy (parent, path, plen - 2);
|
||||
parent[plen - 2] = '\0';
|
||||
if (stat (parent, buf) < 0 || !_S_ISDIR (buf->st_mode))
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
EINTRLOOP (e, stat (path, buf));
|
||||
return e;
|
||||
@@ -1219,8 +1234,8 @@ void
|
||||
hash_init_directories (void)
|
||||
{
|
||||
hash_init (&directories, DIRECTORY_BUCKETS,
|
||||
directory_hash_1, directory_hash_2, directory_hash_cmp);
|
||||
directory_hash_1, directory_hash_2, directory_hash_cmp);
|
||||
hash_init (&directory_contents, DIRECTORY_BUCKETS,
|
||||
directory_contents_hash_1, directory_contents_hash_2,
|
||||
directory_contents_hash_1, directory_contents_hash_2,
|
||||
directory_contents_hash_cmp);
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
Makefile Makefile.in
|
||||
version.texi fdl.texi make-stds.texi texinfo.tex
|
||||
make.info*
|
||||
make*.html
|
||||
make.aux make.cp make.cps make.fn make.fns make.ky
|
||||
make.pg make.toc make.tp make.vr make.log
|
||||
make.dvi make.ps make.pdf
|
||||
stamp-vti
|
||||
20
doc/.gitignore
vendored
Normal file
20
doc/.gitignore
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
fdl.texi
|
||||
make-stds.texi
|
||||
stamp-vti
|
||||
version.texi
|
||||
make.info*
|
||||
make*.html
|
||||
make.aux
|
||||
make.cp
|
||||
make.cps
|
||||
make.dvi
|
||||
make.fn
|
||||
make.fns
|
||||
make.ky
|
||||
make.log
|
||||
make.pdf
|
||||
make.pg
|
||||
make.ps
|
||||
make.toc
|
||||
make.tp
|
||||
make.vr
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*-Makefile-*-, or close enough
|
||||
# Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
641
doc/make.texi
641
doc/make.texi
@@ -4,7 +4,6 @@
|
||||
|
||||
@include version.texi
|
||||
@set EDITION 0.72
|
||||
@set RCSID $Id$
|
||||
|
||||
@settitle GNU @code{make}
|
||||
@setchapternewpage odd
|
||||
@@ -27,7 +26,7 @@ of @cite{The GNU Make Manual}, for GNU @code{make} version @value{VERSION}.
|
||||
|
||||
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
|
||||
2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
||||
2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
@@ -220,6 +219,11 @@ Recipe Execution
|
||||
* Choosing the Shell:: How @code{make} chooses the shell used
|
||||
to run recipes.
|
||||
|
||||
Parallel Execution
|
||||
|
||||
* Parallel Output:: Handling output during parallel execution
|
||||
* Parallel Input:: Handling input during parallel execution
|
||||
|
||||
Recursive Use of @code{make}
|
||||
|
||||
* MAKE Variable:: The special effects of using @samp{$(MAKE)}.
|
||||
@@ -348,6 +352,9 @@ GNU Guile Integration
|
||||
Loading Dynamic Objects
|
||||
|
||||
* load Directive:: Loading dynamic objects as extensions.
|
||||
* Remaking Loaded Objects:: How loaded objects get remade.
|
||||
* Loaded Object API:: Programmatic interface for loaded objects.
|
||||
* Loaded Object Example:: Example of a loaded object
|
||||
|
||||
@end detailmenu
|
||||
@end menu
|
||||
@@ -1287,7 +1294,6 @@ in the makefiles. @xref{Include, , Including Other Makefiles}.
|
||||
|
||||
@node Remaking Makefiles, Overriding Makefiles, MAKEFILES Variable, Makefiles
|
||||
@section How Makefiles Are Remade
|
||||
|
||||
@cindex updating makefiles
|
||||
@cindex remaking makefiles
|
||||
@cindex makefile, remaking of
|
||||
@@ -4057,44 +4063,16 @@ If there is nothing looking like an integer after the @samp{-j} option,
|
||||
there is no limit on the number of job slots. The default number of job
|
||||
slots is one, which means serial execution (one thing at a time).
|
||||
|
||||
One unpleasant consequence of running several recipes simultaneously is
|
||||
that output generated by the recipes appears whenever each recipe
|
||||
sends it, so messages from different recipes may be interspersed.
|
||||
|
||||
Another problem is that two processes cannot both take input from the
|
||||
same device; so to make sure that only one recipe tries to take input
|
||||
from the terminal at once, @code{make} will invalidate the standard
|
||||
input streams of all but one running recipe. This means that
|
||||
attempting to read from standard input will usually be a fatal error (a
|
||||
@samp{Broken pipe} signal) for most child processes if there are
|
||||
several.
|
||||
@cindex broken pipe
|
||||
@cindex standard input
|
||||
|
||||
It is unpredictable which recipe will have a valid standard input stream
|
||||
(which will come from the terminal, or wherever you redirect the standard
|
||||
input of @code{make}). The first recipe run will always get it first, and
|
||||
the first recipe started after that one finishes will get it next, and so
|
||||
on.
|
||||
|
||||
We will change how this aspect of @code{make} works if we find a better
|
||||
alternative. In the mean time, you should not rely on any recipe using
|
||||
standard input at all if you are using the parallel execution feature; but
|
||||
if you are not using this feature, then standard input works normally in
|
||||
all recipes.
|
||||
|
||||
Finally, handling recursive @code{make} invocations raises issues. For
|
||||
more information on this, see
|
||||
@ref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
||||
Handling recursive @code{make} invocations raises issues for parallel
|
||||
execution. For more information on this, see @ref{Options/Recursion,
|
||||
,Communicating Options to a Sub-@code{make}}.
|
||||
|
||||
If a recipe fails (is killed by a signal or exits with a nonzero
|
||||
status), and errors are not ignored for that recipe
|
||||
(@pxref{Errors, ,Errors in Recipes}),
|
||||
the remaining recipe lines to remake the same target will not be run.
|
||||
If a recipe fails and the @samp{-k} or @samp{--keep-going}
|
||||
option was not given
|
||||
(@pxref{Options Summary, ,Summary of Options}),
|
||||
@code{make} aborts execution. If make
|
||||
status), and errors are not ignored for that recipe (@pxref{Errors,
|
||||
,Errors in Recipes}), the remaining recipe lines to remake the same
|
||||
target will not be run. If a recipe fails and the @samp{-k} or
|
||||
@samp{--keep-going} option was not given (@pxref{Options Summary,
|
||||
,Summary of Options}), @code{make} aborts execution. If make
|
||||
terminates for any reason (including a signal) with child processes
|
||||
running, it waits for them to finish before actually exiting.@refill
|
||||
|
||||
@@ -4127,6 +4105,135 @@ average goes below that limit, or until all the other jobs finish.
|
||||
|
||||
By default, there is no load limit.
|
||||
|
||||
@menu
|
||||
* Parallel Output:: Handling output during parallel execution
|
||||
* Parallel Input:: Handling input during parallel execution
|
||||
@end menu
|
||||
|
||||
@node Parallel Output, Parallel Input, Parallel, Parallel
|
||||
@subsection Output During Parallel Execution
|
||||
@cindex output during parallel execution
|
||||
@cindex parallel execution, output during
|
||||
|
||||
When running several recipes in parallel the output from each
|
||||
recipe appears as soon as it is generated, with the result that
|
||||
messages from different recipes may be interspersed, sometimes even
|
||||
appearing on the same line. This can make reading the output very
|
||||
difficult.
|
||||
|
||||
@cindex @code{--output-sync}
|
||||
@cindex @code{-O}
|
||||
To avoid this you can use the @samp{--output-sync} (@samp{-O}) option.
|
||||
This option instructs @code{make} to save the output from the commands
|
||||
it invokes and print it all once the commands are completed.
|
||||
Additionally, if there are multiple recursive @code{make} invocations
|
||||
running in parallel, they will communicate so that only one of them is
|
||||
generating output at a time.
|
||||
|
||||
If working directory printing is enabled (@pxref{-w Option, ,The
|
||||
@samp{--print-directory} Option}), the enter/leave messages are
|
||||
printed around each output grouping. If you prefer not to see these
|
||||
messages add the @samp{--no-print-directory} option to @code{MAKEFLAGS}.
|
||||
|
||||
There are four levels of granularity when synchronizing output,
|
||||
specified by giving an argument to the option (e.g., @samp{-Oline} or
|
||||
@samp{--output-sync=recurse}).
|
||||
|
||||
@table @code
|
||||
@item none
|
||||
This is the default: all output is sent directly as it is generated and
|
||||
no synchronization is performed.
|
||||
|
||||
@item line
|
||||
Output from each individual line of the recipe is grouped and printed
|
||||
as soon as that line is complete. If a recipe consists of multiple
|
||||
lines, they may be interspersed with lines from other recipes.
|
||||
|
||||
@item target
|
||||
Output from the entire recipe for each target is grouped and printed
|
||||
once the target is complete. This is the default if the
|
||||
@code{--output-sync} or @code{-O} option is given with no argument.
|
||||
|
||||
@item recurse
|
||||
Output from each recursive invocation of @code{make} is grouped and
|
||||
printed once the recursive invocation is complete.
|
||||
|
||||
@end table
|
||||
|
||||
Regardless of the mode chosen, the total build time will be the same.
|
||||
The only difference is in how the output appears.
|
||||
|
||||
The @samp{target} and @samp{recurse} modes both collect the output of
|
||||
the entire recipe of a target and display it uninterrupted when the
|
||||
recipe completes. The difference between them is in how recipes that
|
||||
contain recursive invocations of @code{make} are treated
|
||||
(@pxref{Recursion, ,Recursive Use of @code{make}}). For all recipes
|
||||
which have no recursive lines, the @samp{target} and @samp{recurse}
|
||||
modes behave identically.
|
||||
|
||||
If the @samp{recurse} mode is chosen, recipes that contain recursive
|
||||
@code{make} invocations are treated the same as other targets: the
|
||||
output from the recipe, including the output from the recursive
|
||||
@code{make}, is saved and printed after the entire recipe is complete.
|
||||
This ensures output from all the targets built by a given recursive
|
||||
@code{make} instance are grouped together, which may make the output
|
||||
easier to understand. However it also leads to long periods of time
|
||||
during the build where no output is seen, followed by large bursts of
|
||||
output. If you are not watching the build as it proceeds, but instead
|
||||
viewing a log of the build after the fact, this may be the best option
|
||||
for you.
|
||||
|
||||
If you are watching the output, the long gaps of quiet during the
|
||||
build can be frustrating. The @samp{target} output synchronization
|
||||
mode detects when @code{make} is going to be invoked recursively,
|
||||
using the standard methods, and it will not synchronize the output of
|
||||
those lines. The recursive @code{make} will perform the
|
||||
synchronization for its targets and the output from each will be
|
||||
displayed immediately when it completes. Be aware that output from
|
||||
recursive lines of the recipe are not synchronized (for example if
|
||||
the recursive line prints a message before running @code{make}, that
|
||||
message will not be synchronized).
|
||||
|
||||
The @samp{line} mode can be useful for front-ends that are watching
|
||||
the output of @code{make} to track when recipes are started and
|
||||
completed.
|
||||
|
||||
Some programs invoked by @code{make} may behave differently if they
|
||||
determine they're writing output to a terminal versus a file (often
|
||||
described as ``interactive'' vs. ``non-interactive'' modes). For
|
||||
example, many programs that can display colorized output will not do
|
||||
so if they determine they are not writing to a terminal. If your
|
||||
makefile invokes a program like this then using the output
|
||||
synchronization options will cause the program to believe it's running
|
||||
in ``non-interactive'' mode even though the output will ultimately go
|
||||
to the terminal.
|
||||
|
||||
@node Parallel Input, , Parallel Output, Parallel
|
||||
@subsection Input During Parallel Execution
|
||||
@cindex input during parallel execution
|
||||
@cindex parallel execution, input during
|
||||
@cindex standard input
|
||||
|
||||
Two processes cannot both take input from the same device at the same
|
||||
time. To make sure that only one recipe tries to take input from the
|
||||
terminal at once, @code{make} will invalidate the standard input
|
||||
streams of all but one running recipe. If another recipe attempts to
|
||||
read from standard input it will usually incur a fatal error (a
|
||||
@samp{Broken pipe} signal).
|
||||
@cindex broken pipe
|
||||
|
||||
It is unpredictable which recipe will have a valid standard input stream
|
||||
(which will come from the terminal, or wherever you redirect the standard
|
||||
input of @code{make}). The first recipe run will always get it first, and
|
||||
the first recipe started after that one finishes will get it next, and so
|
||||
on.
|
||||
|
||||
We will change how this aspect of @code{make} works if we find a better
|
||||
alternative. In the mean time, you should not rely on any recipe using
|
||||
standard input at all if you are using the parallel execution feature; but
|
||||
if you are not using this feature, then standard input works normally in
|
||||
all recipes.
|
||||
|
||||
@node Errors, Interrupts, Parallel, Recipes
|
||||
@section Errors in Recipes
|
||||
@cindex errors (in recipes)
|
||||
@@ -4696,6 +4803,16 @@ itself. For instance, the @samp{-t}, @samp{-n}, and @samp{-q} options, if
|
||||
put in one of these variables, could have disastrous consequences and would
|
||||
certainly have at least surprising and probably annoying effects.@refill
|
||||
|
||||
If you'd like to run other implementations of @code{make} in addition
|
||||
to GNU @code{make}, and hence do not want to add GNU
|
||||
@code{make}-specific flags to the @code{MAKEFLAGS} variable, you can
|
||||
add them to the @code{GNUMAKEFLAGS} variable instead. This variable
|
||||
is parsed just before @code{MAKEFLAGS}, in the same way as
|
||||
@code{MAKEFLAGS}. Note, however, that when @code{make} constructs
|
||||
@code{MAKEFLAGS} to pass to a recursive @code{make} it will include
|
||||
all flags. GNU @code{make} never sets the @code{GNUMAKEFLAGS}
|
||||
variable itself.
|
||||
|
||||
@node -w Option, , Options/Recursion, Recursion
|
||||
@subsection The @samp{--print-directory} Option
|
||||
@cindex directories, printing them
|
||||
@@ -6295,7 +6412,6 @@ Has GNU Guile available as an embedded extension language.
|
||||
@item load
|
||||
Supports dynamically loadable objects for creating custom extensions.
|
||||
@xref{Loading Objects, ,Loading Dynamic Objects}.
|
||||
|
||||
@end table
|
||||
|
||||
@vindex .INCLUDE_DIRS @r{(list of include directories)}
|
||||
@@ -8479,6 +8595,10 @@ 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.
|
||||
|
||||
@item n (@i{none})
|
||||
Disable all debugging currently enabled. If additional debugging
|
||||
flags are encountered after this they will still take effect.
|
||||
@end table
|
||||
|
||||
@item -e
|
||||
@@ -8597,6 +8717,25 @@ prerequisites, and do not remake anything on account of changes in
|
||||
are ignored. @xref{Avoiding Compilation, ,Avoiding Recompilation of
|
||||
Some Files}.@refill
|
||||
|
||||
@item -O[@var{type}]
|
||||
@cindex @code{-O}
|
||||
@itemx --output-sync[=@var{type}]
|
||||
@cindex @code{--output-sync}
|
||||
@cindex output during parallel execution
|
||||
@cindex parallel execution, output during
|
||||
Ensure that the complete output from each recipe is printed in one
|
||||
uninterrupted sequence. This option is only useful when using the
|
||||
@code{--jobs} option to run multiple recipes simultaneously
|
||||
(@pxref{Parallel, ,Parallel Execution}) Without this option output
|
||||
will be displayed as it is generated by the recipes.@refill
|
||||
|
||||
With no type or the type @samp{target}, output from the entire recipe
|
||||
of each target is grouped together. With the type @samp{line}, output
|
||||
from each line in the recipe is grouped together. With the type
|
||||
@samp{recurse}, the output from an entire recursive make is grouped
|
||||
together. With the type @samp{none}, no output synchronization is
|
||||
performed. @xref{Parallel Output, ,Output During Parallel Execution}.
|
||||
|
||||
@item -p
|
||||
@cindex @code{-p}
|
||||
@itemx --print-data-base
|
||||
@@ -8686,11 +8825,11 @@ recipes were done, in order to fool future invocations of
|
||||
|
||||
@item --trace
|
||||
@cindex @code{--trace}
|
||||
@c Extra blank line here makes the table look better.
|
||||
|
||||
Print the entire recipe to be executed, even for recipes that are
|
||||
normally silent (due to @code{.SILENT} or @samp{@@}). Also print the
|
||||
makefile name and line number where the recipe was defined.
|
||||
Show tracing information for @code{make} execution. Prints the entire
|
||||
recipe to be executed, even for recipes that are normally silent (due
|
||||
to @code{.SILENT} or @samp{@@}). Also prints the makefile name and
|
||||
line number where the recipe was defined, and information on why the
|
||||
target is being rebuilt.
|
||||
|
||||
@item -v
|
||||
@cindex @code{-v}
|
||||
@@ -8710,7 +8849,7 @@ from complicated nests of recursive @code{make} commands.
|
||||
rarely need to specify this option since @samp{make} does it for you;
|
||||
see @ref{-w Option, ,The @samp{--print-directory} Option}.)
|
||||
|
||||
@itemx --no-print-directory
|
||||
@item --no-print-directory
|
||||
@cindex @code{--no-print-directory}
|
||||
Disable printing of the working directory under @code{-w}.
|
||||
This option is useful when @code{-w} is turned on automatically,
|
||||
@@ -9378,14 +9517,16 @@ Extra flags to give to the SCCS @code{get} program.
|
||||
@item LDFLAGS
|
||||
@vindex LDFLAGS
|
||||
Extra flags to give to compilers when they are supposed to invoke the linker,
|
||||
@samp{ld}.
|
||||
@samp{ld}, such as @code{-L}. Libraries (@code{-lfoo}) should be
|
||||
added to the @code{LDLIBS} variable instead.
|
||||
|
||||
@item LDLIBS
|
||||
@vindex LDLIBS
|
||||
@vindex LOADLIBES
|
||||
Library flags or names given to compilers when they are supposed to
|
||||
invoke the linker, @samp{ld}. @code{LOADLIBES} is a deprecated (but
|
||||
still supported) alternative to @code{LDLIBS}.
|
||||
still supported) alternative to @code{LDLIBS}. Non-library linker
|
||||
flags, such as @code{-L}, should go in the @code{LDFLAGS} variable.
|
||||
|
||||
@item LFLAGS
|
||||
@vindex LFLAGS
|
||||
@@ -10539,11 +10680,11 @@ program, although this can be inefficient.
|
||||
In cases where the built-in capabilities of GNU @code{make} are
|
||||
insufficient to your requirements there are two options for extending
|
||||
@code{make}. On systems where it's provided, you can utilize GNU
|
||||
Guile as an embedded scripting language (@pxref{Guile Integration,
|
||||
,GNU Guile Integration}). On systems which support dynamically
|
||||
loadable objects, you can write your own extension in any language
|
||||
(which can be compiled into such an object) and load it to provide
|
||||
extended capabilities (@pxref{load Directive, ,The @code{load} Directive}).
|
||||
Guile as an embedded scripting language (@pxref{Guile Integration,,GNU
|
||||
Guile Integration}). On systems which support dynamically loadable
|
||||
objects, you can write your own extension in any language (which can
|
||||
be compiled into such an object) and load it to provide extended
|
||||
capabilities (@pxref{load Directive, ,The @code{load} Directive}).
|
||||
|
||||
@menu
|
||||
* Guile Integration:: Using Guile as an embedded scripting language.
|
||||
@@ -10660,23 +10801,24 @@ exports these procedures as public interfaces from that module:
|
||||
|
||||
@table @code
|
||||
@item gmk-expand
|
||||
@findex gmk-expand
|
||||
This procedure takes a single argument which is converted into a
|
||||
string. The string is expanded by @code{make} using normal
|
||||
@code{make} expansion rules. The result of the expansion is converted
|
||||
into a Guile string and provided as the result of the procedure.
|
||||
|
||||
@item gmk-eval
|
||||
@findex gmk-eval
|
||||
This procedure takes a single argument which is converted into a
|
||||
string. The string is evaluated by @code{make} as if it were a
|
||||
makefile. This is the same capability available via the @code{eval}
|
||||
function (@pxref{Eval Function}). The result of the @code{gmk-eval}
|
||||
procedure is always the empty string.
|
||||
|
||||
@item gmk-var
|
||||
This procedure takes a single argument which is converted into a
|
||||
string. The string is assumed to be the name of a @code{make}
|
||||
variable, which is then expanded. The expansion is converted into a
|
||||
string and provided as the result of the procedure.
|
||||
Note that @code{gmk-eval} is not quite the same as using
|
||||
@code{gmk-expand} with the @code{eval} function: in the latter case
|
||||
the evaluated string will be expanded @emph{twice}; first by
|
||||
@code{gmk-expand}, then again by the @code{eval} function.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -10758,8 +10900,8 @@ symbol to be stored in a @code{make} variable.
|
||||
|
||||
@node Loading Objects, , Guile Integration, Extending make
|
||||
@section Loading Dynamic Objects
|
||||
@cindex loading objects
|
||||
@cindex objects, loading
|
||||
@cindex loaded objects
|
||||
@cindex objects, loaded
|
||||
@cindex extensions, loading
|
||||
|
||||
@cartouche
|
||||
@@ -10768,13 +10910,8 @@ The @code{load} directive and extension capability is considered a
|
||||
``technology preview'' in this release of GNU make. We encourage you
|
||||
to experiment with this feature and we appreciate any feedback on it.
|
||||
However we cannot guarantee to maintain backward-compatibility in the
|
||||
next release.
|
||||
|
||||
In particular, for this feature to be useful your extensions will need
|
||||
to invoke various functions internal to GNU @code{make}. In this
|
||||
release there is no stable programming interface defined for
|
||||
@code{make}: any internal function may change or even disappear in
|
||||
future releases.
|
||||
next release. Consider using GNU Guile instead for extending GNU make
|
||||
(@pxref{Guile Function, ,The @code{guile} Function}).
|
||||
@end quotation
|
||||
@end cartouche
|
||||
|
||||
@@ -10786,15 +10923,18 @@ providing new capabilities which may then be invoked by your makefile.
|
||||
The @code{load} directive is used to load a dynamic object. Once the
|
||||
object is loaded, a ``setup'' function will be invoked to allow the
|
||||
object to initialize itself and register new facilities with GNU
|
||||
@code{make}. Typically a dynamic object would create new functions,
|
||||
@code{make}. A dynamic object might include new @code{make} functions,
|
||||
for example, and the ``setup'' function would register them with GNU
|
||||
@code{make}'s function handling system.
|
||||
|
||||
@menu
|
||||
* load Directive:: Loading dynamic objects as extensions.
|
||||
* Remaking Loaded Objects:: How loaded objects get remade.
|
||||
* Loaded Object API:: Programmatic interface for loaded objects.
|
||||
* Loaded Object Example:: Example of a loaded object
|
||||
@end menu
|
||||
|
||||
@node load Directive, , Loading Objects, Loading Objects
|
||||
@node load Directive, Remaking Loaded Objects, Loading Objects, Loading Objects
|
||||
@subsection The @code{load} Directive
|
||||
@cindex load directive
|
||||
@cindex extensions, load directive
|
||||
@@ -10814,21 +10954,35 @@ or:
|
||||
load @var{object-file}(@var{symbol-name}) @dots{}
|
||||
@end example
|
||||
|
||||
In the first form, the file @var{object-file} is dynamically loaded by
|
||||
GNU @code{make}. On failure, @code{make} will print a message and
|
||||
exit. If the load succeeds @code{make} will invoke an initializing
|
||||
function whose name is created by taking the base file name of
|
||||
@var{object-file}, up to the first character which is not a valid
|
||||
symbol name character (alphanumerics and underscores are valid symbol
|
||||
name characters). To this prefix will be appended the suffix
|
||||
@code{_gmake_setup}, then this symbol will be invoked.
|
||||
The file @var{object-file} is dynamically loaded by GNU @code{make}.
|
||||
If @var{object-file} does not include a directory path then it is
|
||||
first looked for in the current directory. If it is not found there,
|
||||
or a directory path is included, then system-specific paths will be
|
||||
searched. If the load fails for any reason, @code{make} will print a
|
||||
message and exit.
|
||||
|
||||
In the second form, the function @var{symbol-name} will be invoked.
|
||||
If the load succeeds @code{make} will invoke an initializing function.
|
||||
|
||||
If @var{symbol-name} is provided, it will be used as the name of the
|
||||
initializing function.
|
||||
|
||||
If no @var{symbol-name} is provided, the initializing function name is
|
||||
created by taking the base file name of @var{object-file}, up to the
|
||||
first character which is not a valid symbol name character
|
||||
(alphanumerics and underscores are valid symbol name characters). To
|
||||
this prefix will be appended the suffix @code{_gmk_setup}.
|
||||
|
||||
More than one object file may be loaded with a single @code{load}
|
||||
directive, and both forms of @code{load} arguments may be used in the
|
||||
same directive.
|
||||
|
||||
The initializing function will be provided the file name and line
|
||||
number of the invocation of the @code{load} operation. It should
|
||||
return a value of type @code{int}, which must be @code{0} on failure
|
||||
and non-@code{0} on success. If the return value is @code{-1}, then
|
||||
GNU make will @emph{not} attempt to rebuild the object file
|
||||
(@pxref{Remaking Loaded Objects, ,How Loaded Objects Are Remade}).
|
||||
|
||||
For example:
|
||||
|
||||
@example
|
||||
@@ -10837,7 +10991,7 @@ load ../mk_funcs.so
|
||||
|
||||
will load the dynamic object @file{../mk_funcs.so}. After the object
|
||||
is loaded, @code{make} will invoke the function (assumed to be defined
|
||||
by the shared object) @code{mk_funcs_gmake_setup}.
|
||||
by the shared object) @code{mk_funcs_gmk_setup}.
|
||||
|
||||
On the other hand:
|
||||
|
||||
@@ -10849,7 +11003,7 @@ will load the dynamic object @file{../mk_funcs.so}. After the object
|
||||
is loaded, @code{make} will invoke the function @code{init_mk_func}.
|
||||
|
||||
Regardless of how many times an object file appears in a @code{load}
|
||||
directive, it will only be loaded (and it's setup function will only
|
||||
directive, it will only be loaded (and its setup function will only
|
||||
be invoked) once.
|
||||
|
||||
@vindex .LOADED
|
||||
@@ -10864,6 +11018,274 @@ generated if an object fails to load. The failed object is not added
|
||||
to the @code{.LOADED} variable, which can then be consulted to
|
||||
determine if the load was successful.
|
||||
|
||||
@node Remaking Loaded Objects, Loaded Object API, load Directive, Loading Objects
|
||||
@subsection How Loaded Objects Are Remade
|
||||
@cindex updating loaded objects
|
||||
@cindex remaking loaded objects
|
||||
@cindex loaded objects, remaking of
|
||||
|
||||
Loaded objects undergo the same re-make procedure as makefiles
|
||||
(@pxref{Remaking Makefiles, ,How Makefiles Are Remade}). If any
|
||||
loaded object is recreated, then @code{make} will start from scratch
|
||||
and re-read all the makefiles, and reload the object files again. It
|
||||
is not necessary for the loaded object to do anything special to
|
||||
support this.@refill
|
||||
|
||||
It's up to the makefile author to provide the rules needed for
|
||||
rebuilding the loaded object.
|
||||
|
||||
@node Loaded Object API, Loaded Object Example, Remaking Loaded Objects, Loading Objects
|
||||
@subsection Loaded Object Interface
|
||||
@cindex loaded object API
|
||||
@cindex interface for loaded objects
|
||||
|
||||
@cartouche
|
||||
@quotation Warning
|
||||
For this feature to be useful your extensions will need to invoke
|
||||
various functions internal to GNU @code{make}. The programming
|
||||
interfaces provided in this release should not be considered stable:
|
||||
functions may be added, removed, or change calling signatures or
|
||||
implementations in future versions of GNU @code{make}.
|
||||
@end quotation
|
||||
@end cartouche
|
||||
|
||||
To be useful, loaded objects must be able to interact with GNU
|
||||
@code{make}. This interaction includes both interfaces the loaded
|
||||
object provides to makefiles and also interfaces @code{make} provides
|
||||
to the loaded object to manipulate @code{make}'s operation.
|
||||
|
||||
The interface between loaded objects and @code{make} is defined by the
|
||||
@file{gnumake.h} C header file. All loaded objects written in C
|
||||
should include this header file. Any loaded object not written in C
|
||||
will need to implement the interface defined in this header file.
|
||||
|
||||
Typically, a loaded object will register one or more new GNU
|
||||
@code{make} functions using the @code{gmk_add_function} routine from
|
||||
within its setup function. The implementations of these @code{make}
|
||||
functions may make use of the @code{gmk_expand} and @code{gmk_eval}
|
||||
routines to perform their tasks, then optionally return a string as
|
||||
the result of the function expansion.
|
||||
|
||||
@subsubheading Loaded Object Licensing
|
||||
@cindex loaded object licensing
|
||||
@cindex plugin_is_GPL_compatible
|
||||
|
||||
Every dynamic extension should define the global symbol
|
||||
@code{plugin_is_GPL_compatible} to assert that it has been licensed
|
||||
under a GPL-compatible license. If this symbol does not exist,
|
||||
@code{make} emits a fatal error and exits when it tries to load your
|
||||
extension.
|
||||
|
||||
The declared type of the symbol should be @code{int}. It does not need
|
||||
to be in any allocated section, though. The code merely asserts that
|
||||
the symbol exists in the global scope. Something like this is enough:
|
||||
|
||||
@example
|
||||
int plugin_is_GPL_compatible;
|
||||
@end example
|
||||
|
||||
@subsubheading Data Structures
|
||||
|
||||
@table @code
|
||||
@item gmk_floc
|
||||
This structure represents a filename/location pair. It is provided
|
||||
when defining items, so GNU @code{make} can inform the user later
|
||||
where the definition occurred if necessary.
|
||||
@end table
|
||||
|
||||
@subsubheading Registering Functions
|
||||
@findex gmk_add_function
|
||||
|
||||
There is currently one way for makefiles to invoke operations provided
|
||||
by the loaded object: through the @code{make} function call
|
||||
interface. A loaded object can register one or more new functions
|
||||
which may then be invoked from within the makefile in the same way as
|
||||
any other function.
|
||||
|
||||
Use @code{gmk_add_function} to create a new @code{make} function. Its
|
||||
arguments are as follows:
|
||||
|
||||
@table @code
|
||||
@item name
|
||||
The function name. This is what the makefile should use to invoke the
|
||||
function. The name must be between 1 and 255 characters long.
|
||||
|
||||
@item func_ptr
|
||||
A pointer to a function that @code{make} will invoke when it expands
|
||||
the function in a makefile. This function must be defined by the
|
||||
loaded object. GNU @code{make} will call it with three arguments:
|
||||
@code{name} (the same name as above), @code{argc} (the number of
|
||||
arguments to the function), and @code{argv} (the list of arguments to
|
||||
the function). The last argument (that is, @code{argv[argc]} will be
|
||||
null (@code{0}).
|
||||
|
||||
@item min_args
|
||||
The minimum number of arguments the function will accept. Must be
|
||||
between 0 and 255. GNU @code{make} will check this and fail before
|
||||
invoking @code{func_ptr} if the function was invoked with too few
|
||||
arguments.
|
||||
|
||||
@item max_args
|
||||
The maximum number of arguments the function will accept. Must be
|
||||
between 0 and 255. GNU @code{make} will check this and fail before
|
||||
invoking @code{func_ptr} if the function was invoked with too few
|
||||
arguments. If the value is 0, then any number of arguments is
|
||||
accepted. If the value is greater than 0, then it must be greater
|
||||
than or equal to @code{min_args}.
|
||||
|
||||
@item expand_args
|
||||
If this value is 0, then @code{make} will not expand the arguments to
|
||||
the function before passing them to @code{func_ptr}. If the value is
|
||||
non-0, then the arguments will be expanded first.
|
||||
@end table
|
||||
|
||||
@subsubheading GNU @code{make} Facilities
|
||||
|
||||
There are some facilities exported by GNU @code{make} for use by
|
||||
loaded objects. Typically these would be run from within the
|
||||
setup function and/or the functions registered via
|
||||
@code{gmk_add_function}, to retrieve or modify the data @code{make}
|
||||
works with.
|
||||
|
||||
@table @code
|
||||
@item gmk_expand
|
||||
@findex gmk_expand
|
||||
This function takes a string and expands it using @code{make}
|
||||
expansion rules. The result of the expansion is returned in a
|
||||
nil-terminated string buffer. The caller is responsible for calling
|
||||
@code{gmk_free} with a pointer to the returned buffer when done.
|
||||
|
||||
@item gmk_eval
|
||||
@findex gmk_eval
|
||||
This function takes a buffer and evaluates it as a segment of makefile
|
||||
syntax. This function can be used to define new variables, new rules,
|
||||
etc. It is equivalent to using the @code{eval} @code{make} function.
|
||||
@end table
|
||||
|
||||
Note that there is a difference between @code{gmk_eval} and calling
|
||||
@code{gmk_expand} with a string using the @code{eval} function: in
|
||||
the latter case the string will be expanded @emph{twice}; once by
|
||||
@code{gmk_expand} and then again by the @code{eval} function. Using
|
||||
@code{gmk_eval} the buffer is only expanded once, at most (as it's
|
||||
read by the @code{make} parser).
|
||||
|
||||
@subsubheading Memory Management
|
||||
|
||||
Some systems allow for different memory management schemes. Thus you
|
||||
should never pass memory that you've allocated directly to any
|
||||
@code{make} function, nor should you attempt to directly free any
|
||||
memory returned to you by any @code{make} function. Instead, use the
|
||||
@code{gmk_alloc} and @code{gmk_free} functions.
|
||||
|
||||
@table @code
|
||||
@item gmk_alloc
|
||||
@findex gmk_alloc
|
||||
Return a pointer to a newly-allocated buffer. This function will
|
||||
always return a valid pointer; if not enough memory is available
|
||||
@code{make} will exit.
|
||||
|
||||
@item gmk_free
|
||||
@findex gmk_free
|
||||
Free a buffer returned to you by @code{make}. Once the
|
||||
@code{gmk_free} function returns the string will no longer be valid.
|
||||
@end table
|
||||
|
||||
@node Loaded Object Example, , Loaded Object API, Loading Objects
|
||||
@subsection Example Loaded Object
|
||||
@cindex loaded object example
|
||||
@cindex example of loaded objects
|
||||
|
||||
Let's suppose we wanted to write a new GNU @code{make} function that
|
||||
would create a temporary file and return its name. We would like our
|
||||
function to take a prefix as an argument. First we can write the
|
||||
function in a file @file{mk_temp.c}:
|
||||
|
||||
@example
|
||||
@group
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <gnumake.h>
|
||||
|
||||
int plugin_is_GPL_compatible;
|
||||
|
||||
char *
|
||||
gen_tmpfile(const char *nm, int argc, char **argv)
|
||||
@{
|
||||
int fd;
|
||||
|
||||
/* Compute the size of the filename and allocate space for it. */
|
||||
int len = strlen (argv[0]) + 6 + 1;
|
||||
char *buf = gmk_alloc (len);
|
||||
|
||||
strcpy (buf, argv[0]);
|
||||
strcat (buf, "XXXXXX");
|
||||
|
||||
fd = mkstemp(buf);
|
||||
if (fd >= 0)
|
||||
@{
|
||||
/* Don't leak the file descriptor. */
|
||||
close (fd);
|
||||
return buf;
|
||||
@}
|
||||
|
||||
/* Failure. */
|
||||
fprintf (stderr, "mkstemp(%s) failed: %s\n", buf, strerror (errno));
|
||||
gmk_free (buf);
|
||||
return NULL;
|
||||
@}
|
||||
|
||||
int
|
||||
mk_temp_gmk_setup ()
|
||||
@{
|
||||
/* Register the function with make name "mk-temp". */
|
||||
gmk_add_function ("mk-temp", gen_tmpfile, 1, 1, 1);
|
||||
return 1;
|
||||
@}
|
||||
@end group
|
||||
@end example
|
||||
|
||||
Next, we will write a makefile that can build this shared object, load
|
||||
it, and use it:
|
||||
|
||||
@example
|
||||
@group
|
||||
all:
|
||||
@@echo Temporary file: $(mk-temp tmpfile.)
|
||||
|
||||
load mk_temp.so
|
||||
|
||||
mk_temp.so: mk_temp.c
|
||||
$(CC) -shared -fPIC -o $@ $<
|
||||
@end group
|
||||
@end example
|
||||
|
||||
On MS-Windows, due to peculiarities of how shared objects are
|
||||
produced, the compiler needs to scan the @dfn{import library} produced
|
||||
when building @code{make}, typically called
|
||||
@file{libgnumake-@var{version}.dll.a}, where @var{version} is the
|
||||
version of the load object API. So the recipe to produce a shared
|
||||
object will look on Windows like this (assuming the API version is 1):
|
||||
|
||||
@example
|
||||
@group
|
||||
mk_temp.dll: mk_temp.c
|
||||
$(CC) -shared -o $@ $< -lgnumake-1
|
||||
@end group
|
||||
@end example
|
||||
|
||||
Now when you run @code{make} you'll see something like:
|
||||
|
||||
@example
|
||||
$ make
|
||||
cc -shared -fPIC -o mk_temp.so mk_temp.c
|
||||
Temporary filename: tmpfile.A7JEwd
|
||||
@end example
|
||||
|
||||
@node Features, Missing, Extending make, Top
|
||||
@chapter Features of GNU @code{make}
|
||||
@cindex features of GNU @code{make}
|
||||
@@ -10973,6 +11395,11 @@ The concept of doing several things at once (parallelism) exists in
|
||||
many incarnations of @code{make} and similar programs, though not in the
|
||||
System V or BSD implementations. @xref{Execution, ,Recipe Execution}.
|
||||
|
||||
@item
|
||||
A number of different build tools that support parallelism also
|
||||
support collecting output and displaying as a single block.
|
||||
@xref{Parallel Output, ,Output During Parallel Execution}.
|
||||
|
||||
@item
|
||||
Modified variable references using pattern substitution come from
|
||||
SunOS 4. @xref{Reference, ,Basics of Variable References}.
|
||||
@@ -11007,6 +11434,12 @@ nonexistent file comes from SunOS 4 @code{make}. (But note that SunOS 4
|
||||
The @code{!=} shell assignment operator exists in many BSD of
|
||||
@code{make} and is purposefully implemented here to behave identically
|
||||
to those implementations.
|
||||
|
||||
@item
|
||||
Various build management tools are implemented using scripting
|
||||
languages such as Perl or Python and thus provide a natural embedded
|
||||
scripting language, similar to GNU @code{make}'s integration of GNU
|
||||
Guile.
|
||||
@end itemize
|
||||
|
||||
The remaining features are inventions new in GNU @code{make}:
|
||||
@@ -11113,9 +11546,8 @@ Various new built-in implicit rules.
|
||||
@xref{Catalogue of Rules, ,Catalogue of Implicit Rules}.
|
||||
|
||||
@item
|
||||
The built-in variable @samp{MAKE_VERSION} gives the version number of
|
||||
@code{make}.
|
||||
@vindex MAKE_VERSION
|
||||
Load dynamic objects which can modify the behavior of @code{make}.
|
||||
@xref{Loading Objects, ,Loading Dynamic Objects}.
|
||||
@end itemize
|
||||
|
||||
@node Missing, Makefile Conventions, Features, Top
|
||||
@@ -11459,6 +11891,11 @@ Evaluate @var{text} then read the results as makefile commands.
|
||||
Expands to the empty string.@*
|
||||
@xref{Eval Function, ,The @code{eval} Function}.
|
||||
|
||||
@item $(file @var{op} @var{filename},@var{text})
|
||||
Expand the arguments, then open the file @var{filename} using mode
|
||||
@var{op} and write @var{text} to that file.@*
|
||||
@xref{File Function, ,The @code{file} Function}.
|
||||
|
||||
@item $(value @var{var})
|
||||
Evaluates to the contents of the variable @var{var}, with no expansion
|
||||
performed on it.@*
|
||||
@@ -11558,6 +11995,18 @@ The name with which @code{make} was invoked. Using this variable in
|
||||
recipes has special meaning. @xref{MAKE Variable, ,How the
|
||||
@code{MAKE} Variable Works}.
|
||||
|
||||
@item MAKE_VERSION
|
||||
|
||||
The built-in variable @samp{MAKE_VERSION} expands to the version
|
||||
number of the GNU @code{make} program.
|
||||
@vindex MAKE_VERSION
|
||||
|
||||
@item MAKE_HOST
|
||||
|
||||
The built-in variable @samp{MAKE_HOST} expands to a string
|
||||
representing the host that GNU @code{make} was built to run on.
|
||||
@vindex MAKE_HOST
|
||||
|
||||
@item MAKELEVEL
|
||||
|
||||
The number of levels of recursion (sub-@code{make}s).@*
|
||||
@@ -11574,6 +12023,17 @@ recipe 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 GNUMAKEFLAGS
|
||||
|
||||
Other flags parsed by @code{make}. You can set this in the environment or
|
||||
a makefile to set @code{make} command-line flags. GNU @code{make}
|
||||
never sets this variable itself. This variable is only needed if
|
||||
you'd like to set GNU @code{make}-specific flags in a POSIX-compliant
|
||||
makefile. This variable will be seen by GNU @code{make} and ignored
|
||||
by other @code{make} implementations. It's not needed if you only use
|
||||
GNU @code{make}; just use @code{MAKEFLAGS} directly.
|
||||
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
||||
|
||||
@item MAKECMDGOALS
|
||||
|
||||
The targets given to @code{make} on the command line. Setting this
|
||||
@@ -11717,12 +12177,15 @@ of its arguments. @xref{Functions, ,Functions for Transforming Text}.
|
||||
@itemx multiple target patterns. Stop.
|
||||
@itemx target pattern contains no `%'. Stop.
|
||||
@itemx mixed implicit and static pattern rules. Stop.
|
||||
These are generated for malformed static pattern rules. The first means
|
||||
there's no pattern in the target section of the rule; the second means
|
||||
there are multiple patterns in the target section; the third means
|
||||
the target doesn't contain a pattern character (@code{%}); and the
|
||||
fourth means that all three parts of the static pattern rule contain
|
||||
pattern characters (@code{%})--only the first two parts should.
|
||||
These are generated for malformed static pattern rules. The first
|
||||
means there's no pattern in the target section of the rule; the second
|
||||
means there are multiple patterns in the target section; the third
|
||||
means the target doesn't contain a pattern character (@code{%}); and
|
||||
the fourth means that all three parts of the static pattern rule
|
||||
contain pattern characters (@code{%})--only the first two parts
|
||||
should. If you see these errors and you aren't trying to create a
|
||||
static pattern rule, check the value of any variables in your target
|
||||
and prerequisite lists to be sure they do not contain colons.
|
||||
@xref{Static Usage, ,Syntax of Static Pattern Rules}.
|
||||
|
||||
@item warning: -jN forced in submake: disabling jobserver mode.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1998-2012 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -20,6 +20,7 @@ echo Building Make for MSDOS
|
||||
rem Echo ON so they will see what is going on.
|
||||
@echo on
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g output.c -o output.o
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
||||
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
||||
@@ -51,7 +52,7 @@ ar rv libglob.a glob.o fnmatch.o
|
||||
@echo off
|
||||
cd ..
|
||||
echo commands.o > respf.$$$
|
||||
for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
|
||||
for %%f in (job output dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
|
||||
for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
|
||||
echo glob/libglob.a >> respf.$$$
|
||||
rem gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g guile.c -o guile.o
|
||||
|
||||
240
expand.c
240
expand.c
@@ -1,5 +1,5 @@
|
||||
/* Variable expansion functions for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -26,7 +26,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Initially, any errors reported when expanding strings will be reported
|
||||
against the file where the error appears. */
|
||||
const struct floc **expanding_var = &reading_file;
|
||||
const gmk_floc **expanding_var = &reading_file;
|
||||
|
||||
/* The next two describe the variable output buffer.
|
||||
This buffer is used to hold the variable-expansion of a line of the
|
||||
@@ -61,8 +61,8 @@ variable_buffer_output (char *ptr, const char *string, unsigned int length)
|
||||
{
|
||||
unsigned int offset = ptr - variable_buffer;
|
||||
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
|
||||
? newlen + 100
|
||||
: 2 * variable_buffer_length);
|
||||
? newlen + 100
|
||||
: 2 * variable_buffer_length);
|
||||
variable_buffer = xrealloc (variable_buffer, variable_buffer_length);
|
||||
ptr = variable_buffer + offset;
|
||||
}
|
||||
@@ -96,8 +96,8 @@ char *
|
||||
recursively_expand_for_file (struct variable *v, struct file *file)
|
||||
{
|
||||
char *value;
|
||||
const struct floc *this_var;
|
||||
const struct floc **saved_varp;
|
||||
const gmk_floc *this_var;
|
||||
const gmk_floc **saved_varp;
|
||||
struct variable_set_list *save = 0;
|
||||
int set_reading = 0;
|
||||
|
||||
@@ -200,7 +200,7 @@ variable_expand_string (char *line, const char *string, long length)
|
||||
unsigned int line_offset;
|
||||
|
||||
if (!line)
|
||||
line = initialize_variable_output();
|
||||
line = initialize_variable_output ();
|
||||
o = line;
|
||||
line_offset = line - variable_buffer;
|
||||
|
||||
@@ -220,118 +220,116 @@ variable_expand_string (char *line, const char *string, long length)
|
||||
{
|
||||
/* Copy all following uninteresting chars all at once to the
|
||||
variable output buffer, and skip them. Uninteresting chars end
|
||||
at the next $ or the end of the input. */
|
||||
at the next $ or the end of the input. */
|
||||
|
||||
p1 = strchr (p, '$');
|
||||
|
||||
o = variable_buffer_output (o, p, p1 != 0 ? (unsigned int)(p1 - p) : strlen (p) + 1);
|
||||
|
||||
if (p1 == 0)
|
||||
break;
|
||||
break;
|
||||
p = p1 + 1;
|
||||
|
||||
/* Dispatch on the char that follows the $. */
|
||||
|
||||
switch (*p)
|
||||
{
|
||||
case '$':
|
||||
/* $$ seen means output one $ to the variable output buffer. */
|
||||
o = variable_buffer_output (o, p, 1);
|
||||
break;
|
||||
{
|
||||
case '$':
|
||||
/* $$ seen means output one $ to the variable output buffer. */
|
||||
o = variable_buffer_output (o, p, 1);
|
||||
break;
|
||||
|
||||
case '(':
|
||||
case '{':
|
||||
/* $(...) or ${...} is the general case of substitution. */
|
||||
{
|
||||
char openparen = *p;
|
||||
char closeparen = (openparen == '(') ? ')' : '}';
|
||||
case '(':
|
||||
case '{':
|
||||
/* $(...) or ${...} is the general case of substitution. */
|
||||
{
|
||||
char openparen = *p;
|
||||
char closeparen = (openparen == '(') ? ')' : '}';
|
||||
const char *begp;
|
||||
const char *beg = p + 1;
|
||||
char *op;
|
||||
const char *beg = p + 1;
|
||||
char *op;
|
||||
char *abeg = NULL;
|
||||
const char *end, *colon;
|
||||
const char *end, *colon;
|
||||
|
||||
op = o;
|
||||
begp = p;
|
||||
if (handle_function (&op, &begp))
|
||||
{
|
||||
o = op;
|
||||
p = begp;
|
||||
break;
|
||||
}
|
||||
op = o;
|
||||
begp = p;
|
||||
if (handle_function (&op, &begp))
|
||||
{
|
||||
o = op;
|
||||
p = begp;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Is there a variable reference inside the parens or braces?
|
||||
If so, expand it before expanding the entire reference. */
|
||||
/* Is there a variable reference inside the parens or braces?
|
||||
If so, expand it before expanding the entire reference. */
|
||||
|
||||
end = strchr (beg, closeparen);
|
||||
if (end == 0)
|
||||
end = strchr (beg, closeparen);
|
||||
if (end == 0)
|
||||
/* Unterminated variable reference. */
|
||||
fatal (*expanding_var, _("unterminated variable reference"));
|
||||
p1 = lindex (beg, end, '$');
|
||||
if (p1 != 0)
|
||||
{
|
||||
/* BEG now points past the opening paren or brace.
|
||||
Count parens or braces until it is matched. */
|
||||
int count = 0;
|
||||
for (p = beg; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == openparen)
|
||||
++count;
|
||||
else if (*p == closeparen && --count < 0)
|
||||
break;
|
||||
}
|
||||
/* If COUNT is >= 0, there were unmatched opening parens
|
||||
or braces, so we go to the simple case of a variable name
|
||||
such as '$($(a)'. */
|
||||
if (count < 0)
|
||||
{
|
||||
abeg = expand_argument (beg, p); /* Expand the name. */
|
||||
beg = abeg;
|
||||
end = strchr (beg, '\0');
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Advance P to the end of this reference. After we are
|
||||
p1 = lindex (beg, end, '$');
|
||||
if (p1 != 0)
|
||||
{
|
||||
/* BEG now points past the opening paren or brace.
|
||||
Count parens or braces until it is matched. */
|
||||
int count = 0;
|
||||
for (p = beg; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == openparen)
|
||||
++count;
|
||||
else if (*p == closeparen && --count < 0)
|
||||
break;
|
||||
}
|
||||
/* If COUNT is >= 0, there were unmatched opening parens
|
||||
or braces, so we go to the simple case of a variable name
|
||||
such as '$($(a)'. */
|
||||
if (count < 0)
|
||||
{
|
||||
abeg = expand_argument (beg, p); /* Expand the name. */
|
||||
beg = abeg;
|
||||
end = strchr (beg, '\0');
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Advance P to the end of this reference. After we are
|
||||
finished expanding this one, P will be incremented to
|
||||
continue the scan. */
|
||||
p = end;
|
||||
p = end;
|
||||
|
||||
/* This is not a reference to a built-in function and
|
||||
any variable references inside are now expanded.
|
||||
Is the resultant text a substitution reference? */
|
||||
/* This is not a reference to a built-in function and
|
||||
any variable references inside are now expanded.
|
||||
Is the resultant text a substitution reference? */
|
||||
|
||||
colon = lindex (beg, end, ':');
|
||||
if (colon)
|
||||
{
|
||||
/* This looks like a substitution reference: $(FOO:A=B). */
|
||||
const char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
||||
colon = lindex (beg, end, ':');
|
||||
if (colon)
|
||||
{
|
||||
/* This looks like a substitution reference: $(FOO:A=B). */
|
||||
const char *subst_beg = colon + 1;
|
||||
const char *subst_end = lindex (subst_beg, end, '=');
|
||||
if (subst_end == 0)
|
||||
/* There is no = in sight. Punt on the substitution
|
||||
reference and treat this as a variable name containing
|
||||
a colon, in the code below. */
|
||||
colon = 0;
|
||||
else
|
||||
{
|
||||
const char *replace_beg = subst_end + 1;
|
||||
const char *replace_end = end;
|
||||
|
||||
subst_beg = colon + 1;
|
||||
subst_end = lindex (subst_beg, end, '=');
|
||||
if (subst_end == 0)
|
||||
/* There is no = in sight. Punt on the substitution
|
||||
reference and treat this as a variable name containing
|
||||
a colon, in the code below. */
|
||||
colon = 0;
|
||||
else
|
||||
{
|
||||
replace_beg = subst_end + 1;
|
||||
replace_end = end;
|
||||
|
||||
/* Extract the variable name before the colon
|
||||
and look up that variable. */
|
||||
v = lookup_variable (beg, colon - beg);
|
||||
if (v == 0)
|
||||
warn_undefined (beg, colon - beg);
|
||||
/* Extract the variable name before the colon
|
||||
and look up that variable. */
|
||||
v = lookup_variable (beg, colon - beg);
|
||||
if (v == 0)
|
||||
warn_undefined (beg, colon - beg);
|
||||
|
||||
/* If the variable is not empty, perform the
|
||||
substitution. */
|
||||
if (v != 0 && *v->value != '\0')
|
||||
{
|
||||
char *pattern, *replace, *ppercent, *rpercent;
|
||||
char *value = (v->recursive
|
||||
if (v != 0 && *v->value != '\0')
|
||||
{
|
||||
char *pattern, *replace, *ppercent, *rpercent;
|
||||
char *value = (v->recursive
|
||||
? recursively_expand (v)
|
||||
: v->value);
|
||||
: v->value);
|
||||
|
||||
/* Copy the pattern and the replacement. Add in an
|
||||
extra % at the beginning to use in case there
|
||||
@@ -349,15 +347,15 @@ variable_expand_string (char *line, const char *string, long length)
|
||||
|
||||
/* Look for %. Set the percent pointers properly
|
||||
based on whether we find one or not. */
|
||||
ppercent = find_percent (pattern);
|
||||
if (ppercent)
|
||||
ppercent = find_percent (pattern);
|
||||
if (ppercent)
|
||||
{
|
||||
++ppercent;
|
||||
rpercent = find_percent (replace);
|
||||
if (rpercent)
|
||||
++rpercent;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
ppercent = pattern;
|
||||
rpercent = replace;
|
||||
@@ -368,38 +366,38 @@ variable_expand_string (char *line, const char *string, long length)
|
||||
o = patsubst_expand_pat (o, value, pattern, replace,
|
||||
ppercent, rpercent);
|
||||
|
||||
if (v->recursive)
|
||||
free (value);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (v->recursive)
|
||||
free (value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (colon == 0)
|
||||
/* This is an ordinary variable reference.
|
||||
Look up the value of the variable. */
|
||||
o = reference_variable (o, beg, end - beg);
|
||||
if (colon == 0)
|
||||
/* This is an ordinary variable reference.
|
||||
Look up the value of the variable. */
|
||||
o = reference_variable (o, beg, end - beg);
|
||||
|
||||
if (abeg)
|
||||
free (abeg);
|
||||
}
|
||||
break;
|
||||
if (abeg)
|
||||
free (abeg);
|
||||
}
|
||||
break;
|
||||
|
||||
case '\0':
|
||||
break;
|
||||
case '\0':
|
||||
break;
|
||||
|
||||
default:
|
||||
if (isblank ((unsigned char)p[-1]))
|
||||
break;
|
||||
default:
|
||||
if (isblank ((unsigned char)p[-1]))
|
||||
break;
|
||||
|
||||
/* A $ followed by a random char is a variable reference:
|
||||
$a is equivalent to $(a). */
|
||||
/* A $ followed by a random char is a variable reference:
|
||||
$a is equivalent to $(a). */
|
||||
o = reference_variable (o, p, 1);
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (*p == '\0')
|
||||
break;
|
||||
break;
|
||||
|
||||
++p;
|
||||
}
|
||||
@@ -418,7 +416,7 @@ variable_expand_string (char *line, const char *string, long length)
|
||||
char *
|
||||
variable_expand (const char *line)
|
||||
{
|
||||
return variable_expand_string(NULL, line, (long)-1);
|
||||
return variable_expand_string (NULL, line, (long)-1);
|
||||
}
|
||||
|
||||
/* Expand an argument for an expansion function.
|
||||
@@ -434,7 +432,7 @@ expand_argument (const char *str, const char *end)
|
||||
char *r;
|
||||
|
||||
if (str == end)
|
||||
return xstrdup("");
|
||||
return xstrdup ("");
|
||||
|
||||
if (!end || *end == '\0')
|
||||
return allocated_variable_expand (str);
|
||||
@@ -463,7 +461,7 @@ variable_expand_for_file (const char *line, struct file *file)
|
||||
{
|
||||
char *result;
|
||||
struct variable_set_list *savev;
|
||||
const struct floc *savef;
|
||||
const gmk_floc *savef;
|
||||
|
||||
if (file == 0)
|
||||
return variable_expand (line);
|
||||
|
||||
229
file.c
229
file.c
@@ -1,5 +1,5 @@
|
||||
/* Target file management for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,12 +14,12 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "dep.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
@@ -54,11 +54,11 @@ static int
|
||||
file_hash_cmp (const void *x, const void *y)
|
||||
{
|
||||
return_ISTRING_COMPARE (((struct file const *) x)->hname,
|
||||
((struct file const *) y)->hname);
|
||||
((struct file const *) y)->hname);
|
||||
}
|
||||
|
||||
#ifndef FILE_BUCKETS
|
||||
#define FILE_BUCKETS 1007
|
||||
#ifndef FILE_BUCKETS
|
||||
#define FILE_BUCKETS 1007
|
||||
#endif
|
||||
static struct hash_table files;
|
||||
|
||||
@@ -103,20 +103,20 @@ lookup_file (const char *name)
|
||||
#endif
|
||||
while (name[0] == '.'
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
&& (name[1] == '/' || name[1] == '\\')
|
||||
&& (name[1] == '/' || name[1] == '\\')
|
||||
#else
|
||||
&& name[1] == '/'
|
||||
&& name[1] == '/'
|
||||
#endif
|
||||
&& name[2] != '\0')
|
||||
&& name[2] != '\0')
|
||||
{
|
||||
name += 2;
|
||||
while (*name == '/'
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
|| *name == '\\'
|
||||
|| *name == '\\'
|
||||
#endif
|
||||
)
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
)
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
}
|
||||
|
||||
if (*name == '\0')
|
||||
@@ -153,7 +153,7 @@ enter_file (const char *name)
|
||||
struct file file_key;
|
||||
|
||||
assert (*name != '\0');
|
||||
assert (strcache_iscached (name));
|
||||
assert (! verify_flag || strcache_iscached (name));
|
||||
|
||||
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
|
||||
if (*name != '.')
|
||||
@@ -177,11 +177,14 @@ enter_file (const char *name)
|
||||
file_slot = (struct file **) hash_find_slot (&files, &file_key);
|
||||
f = *file_slot;
|
||||
if (! HASH_VACANT (f) && !f->double_colon)
|
||||
return f;
|
||||
{
|
||||
f->builtin = 0;
|
||||
return f;
|
||||
}
|
||||
|
||||
new = xcalloc (sizeof (struct file));
|
||||
new->name = new->hname = name;
|
||||
new->update_status = -1;
|
||||
new->update_status = us_none;
|
||||
|
||||
if (HASH_VACANT (f))
|
||||
{
|
||||
@@ -213,6 +216,7 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
struct file *f;
|
||||
|
||||
/* If it's already that name, we're done. */
|
||||
from_file->builtin = 0;
|
||||
file_key.hname = to_hname;
|
||||
if (! file_hash_cmp (from_file, &file_key))
|
||||
return;
|
||||
@@ -318,9 +322,11 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
MERGE (is_target);
|
||||
MERGE (cmd_target);
|
||||
MERGE (phony);
|
||||
MERGE (loaded);
|
||||
MERGE (ignore_vpath);
|
||||
#undef MERGE
|
||||
|
||||
to_file->builtin = 0;
|
||||
from_file->renamed = to_file;
|
||||
}
|
||||
|
||||
@@ -363,52 +369,52 @@ remove_intermediates (int sig)
|
||||
for ( ; file_slot < file_end; file_slot++)
|
||||
if (! HASH_VACANT (*file_slot))
|
||||
{
|
||||
struct file *f = *file_slot;
|
||||
struct file *f = *file_slot;
|
||||
/* Is this file eligible for automatic deletion?
|
||||
Yes, IFF: it's marked intermediate, it's not secondary, it wasn't
|
||||
given on the command line, and it's either a -include makefile or
|
||||
it's not precious. */
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary && !f->cmd_target)
|
||||
{
|
||||
int status;
|
||||
if (f->update_status == -1)
|
||||
/* If nothing would have created this file yet,
|
||||
don't print an "rm" command for it. */
|
||||
continue;
|
||||
if (just_print_flag)
|
||||
status = 0;
|
||||
else
|
||||
{
|
||||
status = unlink (f->name);
|
||||
if (status < 0 && errno == ENOENT)
|
||||
continue;
|
||||
}
|
||||
if (!f->dontcare)
|
||||
{
|
||||
if (sig)
|
||||
error (NILF, _("*** Deleting intermediate file '%s'"), f->name);
|
||||
else
|
||||
{
|
||||
if (! doneany)
|
||||
DB (DB_BASIC, (_("Removing intermediate files...\n")));
|
||||
if (!silent_flag)
|
||||
{
|
||||
if (! doneany)
|
||||
{
|
||||
fputs ("rm ", stdout);
|
||||
doneany = 1;
|
||||
}
|
||||
else
|
||||
putchar (' ');
|
||||
fputs (f->name, stdout);
|
||||
fflush (stdout);
|
||||
}
|
||||
}
|
||||
if (status < 0)
|
||||
perror_with_name ("unlink: ", f->name);
|
||||
}
|
||||
}
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary && !f->cmd_target)
|
||||
{
|
||||
int status;
|
||||
if (f->update_status == us_none)
|
||||
/* If nothing would have created this file yet,
|
||||
don't print an "rm" command for it. */
|
||||
continue;
|
||||
if (just_print_flag)
|
||||
status = 0;
|
||||
else
|
||||
{
|
||||
status = unlink (f->name);
|
||||
if (status < 0 && errno == ENOENT)
|
||||
continue;
|
||||
}
|
||||
if (!f->dontcare)
|
||||
{
|
||||
if (sig)
|
||||
error (NILF, _("*** Deleting intermediate file '%s'"), f->name);
|
||||
else
|
||||
{
|
||||
if (! doneany)
|
||||
DB (DB_BASIC, (_("Removing intermediate files...\n")));
|
||||
if (!silent_flag)
|
||||
{
|
||||
if (! doneany)
|
||||
{
|
||||
fputs ("rm ", stdout);
|
||||
doneany = 1;
|
||||
}
|
||||
else
|
||||
putchar (' ');
|
||||
fputs (f->name, stdout);
|
||||
fflush (stdout);
|
||||
}
|
||||
}
|
||||
if (status < 0)
|
||||
perror_with_name ("unlink: ", f->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (doneany && !sig)
|
||||
@@ -424,7 +430,8 @@ remove_intermediates (int sig)
|
||||
struct dep *
|
||||
split_prereqs (char *p)
|
||||
{
|
||||
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, '|', NULL, 0);
|
||||
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, MAP_PIPE, NULL,
|
||||
PARSEFS_NONE);
|
||||
|
||||
if (*p)
|
||||
{
|
||||
@@ -433,7 +440,7 @@ split_prereqs (char *p)
|
||||
struct dep *ood;
|
||||
|
||||
++p;
|
||||
ood = PARSE_FILE_SEQ (&p, struct dep, '\0', NULL, 0);
|
||||
ood = PARSE_SIMPLE_SEQ (&p, struct dep);
|
||||
|
||||
if (! new)
|
||||
new = ood;
|
||||
@@ -690,23 +697,23 @@ snap_deps (void)
|
||||
for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev)
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->precious = 1;
|
||||
f2->precious = 1;
|
||||
|
||||
for (f = lookup_file (".LOW_RESOLUTION_TIME"); f != 0; f = f->prev)
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->low_resolution_time = 1;
|
||||
f2->low_resolution_time = 1;
|
||||
|
||||
for (f = lookup_file (".PHONY"); f != 0; f = f->prev)
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
{
|
||||
/* Mark this file as phony nonexistent target. */
|
||||
f2->phony = 1;
|
||||
{
|
||||
/* Mark this file as phony nonexistent target. */
|
||||
f2->phony = 1;
|
||||
f2->is_target = 1;
|
||||
f2->last_mtime = NONEXISTENT_MTIME;
|
||||
f2->mtime_before_update = NONEXISTENT_MTIME;
|
||||
}
|
||||
f2->last_mtime = NONEXISTENT_MTIME;
|
||||
f2->mtime_before_update = NONEXISTENT_MTIME;
|
||||
}
|
||||
|
||||
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
|
||||
/* Mark .INTERMEDIATE deps as intermediate files. */
|
||||
@@ -738,22 +745,22 @@ snap_deps (void)
|
||||
if (f != 0 && f->is_target)
|
||||
{
|
||||
if (f->deps == 0)
|
||||
ignore_errors_flag = 1;
|
||||
ignore_errors_flag = 1;
|
||||
else
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->command_flags |= COMMANDS_NOERROR;
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->command_flags |= COMMANDS_NOERROR;
|
||||
}
|
||||
|
||||
f = lookup_file (".SILENT");
|
||||
if (f != 0 && f->is_target)
|
||||
{
|
||||
if (f->deps == 0)
|
||||
silent_flag = 1;
|
||||
silent_flag = 1;
|
||||
else
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->command_flags |= COMMANDS_SILENT;
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||
f2->command_flags |= COMMANDS_SILENT;
|
||||
}
|
||||
|
||||
f = lookup_file (".NOTPARALLEL");
|
||||
@@ -793,13 +800,13 @@ file_timestamp_cons (const char *fname, time_t stamp, long int ns)
|
||||
FILE_TIMESTAMP ts = product + offset;
|
||||
|
||||
if (! (s <= FILE_TIMESTAMP_S (ORDINARY_MTIME_MAX)
|
||||
&& product <= ts && ts <= 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);
|
||||
fname ? fname : _("Current time"), buf);
|
||||
}
|
||||
|
||||
return ts;
|
||||
@@ -823,10 +830,10 @@ file_timestamp_now (int *resolution)
|
||||
struct timespec timespec;
|
||||
if (clock_gettime (CLOCK_REALTIME, ×pec) == 0)
|
||||
{
|
||||
r = 1;
|
||||
s = timespec.tv_sec;
|
||||
ns = timespec.tv_nsec;
|
||||
goto got_time;
|
||||
r = 1;
|
||||
s = timespec.tv_sec;
|
||||
ns = timespec.tv_nsec;
|
||||
goto got_time;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
@@ -835,10 +842,10 @@ file_timestamp_now (int *resolution)
|
||||
struct timeval timeval;
|
||||
if (gettimeofday (&timeval, 0) == 0)
|
||||
{
|
||||
r = 1000;
|
||||
s = timeval.tv_sec;
|
||||
ns = timeval.tv_usec * 1000;
|
||||
goto got_time;
|
||||
r = 1000;
|
||||
s = timeval.tv_sec;
|
||||
ns = timeval.tv_usec * 1000;
|
||||
goto got_time;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
@@ -865,8 +872,8 @@ file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts)
|
||||
|
||||
if (tm)
|
||||
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
else if (t < 0)
|
||||
sprintf (p, "%ld", (long) t);
|
||||
else
|
||||
@@ -917,6 +924,13 @@ print_file (const void *item)
|
||||
{
|
||||
const struct file *f = item;
|
||||
|
||||
/* If we're not using builtin targets, don't show them.
|
||||
|
||||
Ideally we'd be able to delete them altogether but currently there's no
|
||||
facility to ever delete a file once it's been added. */
|
||||
if (no_builtin_rules_flag && f->builtin)
|
||||
return;
|
||||
|
||||
putchar ('\n');
|
||||
|
||||
if (f->cmds && f->cmds->recipe_prefix != cmd_prefix)
|
||||
@@ -944,6 +958,8 @@ print_file (const void *item)
|
||||
puts (_("# Command line target."));
|
||||
if (f->dontcare)
|
||||
puts (_("# A default, MAKEFILES, or -include/sinclude makefile."));
|
||||
if (f->builtin)
|
||||
puts (_("# Builtin rule"));
|
||||
puts (f->tried_implicit
|
||||
? _("# Implicit rule search has been done.")
|
||||
: _("# Implicit rule search has not been done."));
|
||||
@@ -956,7 +972,7 @@ print_file (const void *item)
|
||||
const struct dep *d;
|
||||
fputs (_("# Also makes:"), stdout);
|
||||
for (d = f->also_make; d != 0; d = d->next)
|
||||
printf (" %s", dep_name (d));
|
||||
printf (" %s", dep_name (d));
|
||||
putchar ('\n');
|
||||
}
|
||||
if (f->last_mtime == UNKNOWN_MTIME)
|
||||
@@ -984,25 +1000,20 @@ print_file (const void *item)
|
||||
case cs_not_started:
|
||||
case cs_finished:
|
||||
switch (f->update_status)
|
||||
{
|
||||
case -1:
|
||||
break;
|
||||
case 0:
|
||||
puts (_("# Successfully updated."));
|
||||
break;
|
||||
case 1:
|
||||
assert (question_flag);
|
||||
puts (_("# Needs to be updated (-q is set)."));
|
||||
break;
|
||||
case 2:
|
||||
puts (_("# Failed to be updated."));
|
||||
break;
|
||||
default:
|
||||
puts (_("# Invalid value in 'update_status' member!"));
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
abort ();
|
||||
}
|
||||
{
|
||||
case us_none:
|
||||
break;
|
||||
case us_success:
|
||||
puts (_("# Successfully updated."));
|
||||
break;
|
||||
case us_question:
|
||||
assert (question_flag);
|
||||
puts (_("# Needs to be updated (-q is set)."));
|
||||
break;
|
||||
case us_failed:
|
||||
puts (_("# Failed to be updated."));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
puts (_("# Invalid value in 'command_state' member!"));
|
||||
@@ -1037,7 +1048,7 @@ print_file_data_base (void)
|
||||
#define VERIFY_CACHED(_p,_n) \
|
||||
do{\
|
||||
if (_p->_n && _p->_n[0] && !strcache_iscached (_p->_n)) \
|
||||
error (NULL, "%s: Field '%s' not cached: %s\n", _p->name, # _n, _p->_n); \
|
||||
error (NULL, _("%s: Field '%s' not cached: %s"), _p->name, # _n, _p->_n); \
|
||||
}while(0)
|
||||
|
||||
static void
|
||||
|
||||
81
filedef.h
81
filedef.h
@@ -1,5 +1,5 @@
|
||||
/* Definition of target file data structures for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -26,18 +26,14 @@ struct file
|
||||
const char *name;
|
||||
const char *hname; /* Hashed filename */
|
||||
const char *vpath; /* VPATH/vpath pathname */
|
||||
struct dep *deps; /* all dependencies, including duplicates */
|
||||
struct commands *cmds; /* Commands to execute for this target. */
|
||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||
const char *stem; /* Implicit stem, if an implicit
|
||||
struct dep *deps; /* all dependencies, including duplicates */
|
||||
struct commands *cmds; /* Commands to execute for this target. */
|
||||
const char *stem; /* Implicit stem, if an implicit
|
||||
rule has been used */
|
||||
struct dep *also_make; /* Targets that are made by making this. */
|
||||
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
|
||||
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
|
||||
has been performed. */
|
||||
struct file *prev; /* Previous entry for same file name;
|
||||
used when there are multiple double-colon
|
||||
entries for the same file. */
|
||||
struct dep *also_make; /* Targets that are made by making this. */
|
||||
struct file *prev; /* Previous entry for same file name;
|
||||
used when there are multiple double-colon
|
||||
entries for the same file. */
|
||||
struct file *last; /* Last entry for the same file name. */
|
||||
|
||||
/* File that this file was renamed to. After any time that a
|
||||
@@ -59,33 +55,44 @@ 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 cmd_state /* State of the commands. */
|
||||
{ /* Note: It is important that cs_not_started be zero. */
|
||||
cs_not_started, /* Not yet started. */
|
||||
cs_deps_running, /* Dep commands running. */
|
||||
cs_running, /* Commands running. */
|
||||
cs_finished /* Commands finished. */
|
||||
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
|
||||
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
|
||||
has been performed. */
|
||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||
enum update_status /* Status of the last attempt to update. */
|
||||
{
|
||||
us_success = 0, /* Successfully updated. Must be 0! */
|
||||
us_none, /* No attempt to update has been made. */
|
||||
us_question, /* Needs to be updated (-q is is set). */
|
||||
us_failed /* Update failed. */
|
||||
} update_status ENUM_BITFIELD (2);
|
||||
enum cmd_state /* State of the commands. */
|
||||
{
|
||||
cs_not_started = 0, /* Not yet started. Must be 0! */
|
||||
cs_deps_running, /* Dep commands running. */
|
||||
cs_running, /* Commands running. */
|
||||
cs_finished /* Commands finished. */
|
||||
} command_state ENUM_BITFIELD (2);
|
||||
|
||||
unsigned int precious:1; /* Non-0 means don't delete file on quit */
|
||||
unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
|
||||
has only one-second resolution. */
|
||||
unsigned int builtin:1; /* True if the file is a builtin rule. */
|
||||
unsigned int precious:1; /* Non-0 means don't delete file on quit */
|
||||
unsigned int loaded:1; /* True if the file is a loaded object. */
|
||||
unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
|
||||
has only one-second resolution. */
|
||||
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
|
||||
i.e., a prerequisite of .PHONY. */
|
||||
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
|
||||
i.e., a prerequisite of .PHONY. */
|
||||
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
||||
unsigned int secondary:1; /* Nonzero means remove_intermediates should
|
||||
not delete it. */
|
||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||
this target cannot be remade. */
|
||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||
this target cannot be remade. */
|
||||
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
|
||||
unsigned int pat_searched:1;/* Nonzero if we already searched for
|
||||
pattern-specific variables. */
|
||||
@@ -131,9 +138,9 @@ void print_file_data_base (void);
|
||||
#define FILE_TIMESTAMP_LO_BITS (FILE_TIMESTAMP_HI_RES ? 30 : 0)
|
||||
|
||||
#define FILE_TIMESTAMP_S(ts) (((ts) - ORDINARY_MTIME_MIN) \
|
||||
>> FILE_TIMESTAMP_LO_BITS)
|
||||
>> FILE_TIMESTAMP_LO_BITS)
|
||||
#define FILE_TIMESTAMP_NS(ts) ((int) (((ts) - ORDINARY_MTIME_MIN) \
|
||||
& ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
|
||||
& ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
|
||||
|
||||
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
|
||||
representing a file timestamp. The upper bound is not necessarily 19,
|
||||
@@ -184,8 +191,8 @@ FILE_TIMESTAMP f_mtime (struct file *file, int search);
|
||||
/* 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)
|
||||
<< FILE_TIMESTAMP_LO_BITS) \
|
||||
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
|
||||
|
||||
/* 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
|
||||
|
||||
897
function.c
897
function.c
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/* Get the system load averages.
|
||||
Copyright (C) 1985-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985-2013 Free Software Foundation, Inc.
|
||||
|
||||
GNU Make 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
|
||||
@@ -985,7 +985,7 @@ getloadavg (double loadavg[], int nelem)
|
||||
#endif /* ! HAVE_GETLOADAVG */
|
||||
|
||||
#ifdef TEST
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
|
||||
2
getopt.c
2
getopt.c
@@ -3,7 +3,7 @@ NOTE: getopt is now part of the C library, so if you don't know what
|
||||
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
||||
before changing it!
|
||||
|
||||
Copyright (C) 1987-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
2
getopt.h
2
getopt.h
@@ -1,5 +1,5 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2013 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987-1994, 1996-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-1994, 1996-2013 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
Makefile Makefile.in
|
||||
.deps
|
||||
@@ -56,7 +56,7 @@ typedef __SIZE_TYPE__ __size_t;
|
||||
# else
|
||||
/* This is a guess. */
|
||||
/*hb
|
||||
* Conflicts with DECCs aready defined type __size_t.
|
||||
* Conflicts with DECCs already defined type __size_t.
|
||||
* Defining an own type with a name beginning with '__' is no good.
|
||||
* Anyway if DECC is used and __SIZE_T is defined then __size_t is
|
||||
* already defined (and I hope it's exactly the one we need here).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;; Contents of the (gnu make) Guile module
|
||||
;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
||||
;; This file is part of GNU Make.
|
||||
;;
|
||||
;; GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -45,10 +45,6 @@
|
||||
(walk x)
|
||||
(string-join (reverse! acc))))
|
||||
|
||||
;; eval (GNU make eval) the input string S
|
||||
(define (gmk-eval s)
|
||||
(gmk-expand (format #f "$(eval ~a)" (obj-to-str s))))
|
||||
|
||||
;; Return the value of the GNU make variable V
|
||||
(define (gmk-var v)
|
||||
(gmk-expand (format #f "$(~a)" (obj-to-str v))))
|
||||
|
||||
73
gnumake.h
Normal file
73
gnumake.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/* External interfaces usable by dynamic objects loaded into GNU Make.
|
||||
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--
|
||||
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GNUMAKE_H_
|
||||
#define _GNUMAKE_H_
|
||||
|
||||
/* Specify the location of elements read from makefiles. */
|
||||
typedef struct
|
||||
{
|
||||
const char *filenm;
|
||||
unsigned long lineno;
|
||||
} gmk_floc;
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef GMK_BUILDING_MAKE
|
||||
# define GMK_EXPORT __declspec(dllexport)
|
||||
# else
|
||||
# define GMK_EXPORT __declspec(dllimport)
|
||||
# endif
|
||||
#else
|
||||
# define GMK_EXPORT
|
||||
#endif
|
||||
|
||||
/* Free memory returned by the gmk_expand() function. */
|
||||
void GMK_EXPORT gmk_free (char *str);
|
||||
|
||||
/* Allocate memory in GNU make's context. */
|
||||
char * GMK_EXPORT gmk_alloc (unsigned int len);
|
||||
|
||||
/* Run $(eval ...) on the provided string BUFFER. */
|
||||
void GMK_EXPORT gmk_eval (const char *buffer, const gmk_floc *floc);
|
||||
|
||||
/* Run GNU make expansion on the provided string STR.
|
||||
Returns an allocated buffer that the caller must free with gmk_free(). */
|
||||
char * GMK_EXPORT gmk_expand (const char *str);
|
||||
|
||||
/* Register a new GNU make function NAME (maximum of 255 chars long).
|
||||
When the function is expanded in the makefile, FUNC will be invoked with
|
||||
the appropriate arguments.
|
||||
|
||||
The return value of FUNC must be either NULL, in which case it expands to
|
||||
the empty string, or a pointer to the result of the expansion in a string
|
||||
created by gmk_alloc(). GNU make will free the memory when it's done.
|
||||
|
||||
MIN_ARGS is the minimum number of arguments the function requires.
|
||||
MAX_ARGS is the maximum number of arguments (or 0 if there's no maximum).
|
||||
MIN_ARGS and MAX_ARGS must be >= 0 and <= 255.
|
||||
|
||||
If EXPAND_ARGS is 0, the arguments to the function will not be expanded
|
||||
before FUNC is called. If EXPAND_ARGS is non-0, they will be expanded.
|
||||
*/
|
||||
void GMK_EXPORT gmk_add_function (const char *name,
|
||||
char *(*func)(const char *nm,
|
||||
int argc, char **argv),
|
||||
int min_args, int max_args, int expand_args);
|
||||
|
||||
#endif /* _GNUMAKE_H_ */
|
||||
53
guile.c
53
guile.c
@@ -1,5 +1,5 @@
|
||||
/* GNU Guile interface for GNU Make.
|
||||
Copyright (C) 2011-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,8 +14,11 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
#include "gnumake.h"
|
||||
|
||||
#include "debug.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include "variable.h"
|
||||
|
||||
@@ -40,7 +43,7 @@ guile_expand_wrapper (SCM obj)
|
||||
char *res;
|
||||
|
||||
DB (DB_BASIC, (_("guile: Expanding '%s'\n"), str));
|
||||
res = allocated_variable_expand (str);
|
||||
res = gmk_expand (str);
|
||||
ret = scm_from_locale_string (res);
|
||||
|
||||
free (str);
|
||||
@@ -49,6 +52,18 @@ guile_expand_wrapper (SCM obj)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Perform the GNU make eval function. */
|
||||
static SCM
|
||||
guile_eval_wrapper (SCM obj)
|
||||
{
|
||||
char *str = cvt_scm_to_str (obj);
|
||||
|
||||
DB (DB_BASIC, (_("guile: Evaluating '%s'\n"), str));
|
||||
gmk_eval (str, 0);
|
||||
|
||||
return SCM_BOOL_F;
|
||||
}
|
||||
|
||||
/* Invoked by scm_c_define_module(), in the context of the GNU make module. */
|
||||
static void
|
||||
guile_define_module (void *data UNUSED)
|
||||
@@ -57,7 +72,10 @@ guile_define_module (void *data UNUSED)
|
||||
#include "gmk-default.h"
|
||||
|
||||
/* Register a subr for GNU make's eval capability. */
|
||||
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, guile_expand_wrapper);
|
||||
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (scm_t_subr) guile_expand_wrapper);
|
||||
|
||||
/* Register a subr for GNU make's eval capability. */
|
||||
scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (scm_t_subr) guile_eval_wrapper);
|
||||
|
||||
/* Define the rest of the module. */
|
||||
scm_c_eval_string (GUILE_module_defn);
|
||||
@@ -87,19 +105,21 @@ internal_guile_eval (void *arg)
|
||||
|
||||
/* This is the function registered with make */
|
||||
static char *
|
||||
func_guile (char *o, char **argv, const char *funcname UNUSED)
|
||||
func_guile (const char *funcname UNUSED, int argc UNUSED, char **argv)
|
||||
{
|
||||
if (argv[0] && argv[0][0] != '\0')
|
||||
static int init = 0;
|
||||
|
||||
if (! init)
|
||||
{
|
||||
char *str = scm_with_guile (internal_guile_eval, argv[0]);
|
||||
if (str)
|
||||
{
|
||||
o = variable_buffer_output (o, str, strlen (str));
|
||||
free (str);
|
||||
}
|
||||
/* Initialize the Guile interpreter. */
|
||||
scm_with_guile (guile_init, NULL);
|
||||
init = 1;
|
||||
}
|
||||
|
||||
return o;
|
||||
if (argv[0] && argv[0][0] != '\0')
|
||||
return scm_with_guile (internal_guile_eval, argv[0]);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* ----- Public interface ----- */
|
||||
@@ -107,13 +127,10 @@ func_guile (char *o, char **argv, const char *funcname UNUSED)
|
||||
/* We could send the flocp to define_new_function(), but since guile is
|
||||
"kind of" built-in, that didn't seem so useful. */
|
||||
int
|
||||
guile_gmake_setup (const struct floc *flocp UNUSED)
|
||||
guile_gmake_setup (const gmk_floc *flocp UNUSED)
|
||||
{
|
||||
/* Initialize the Guile interpreter. */
|
||||
scm_with_guile (guile_init, NULL);
|
||||
|
||||
/* Create a make function "guile". */
|
||||
define_new_function (NILF, "guile", 0, 1, 1, func_guile);
|
||||
gmk_add_function ("guile", func_guile, 0, 1, 1);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
4
hash.c
4
hash.c
@@ -14,10 +14,10 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
#include "hash.h"
|
||||
|
||||
#define CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))
|
||||
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
|
||||
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
|
||||
#define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n)))
|
||||
#define CLONE(o, t, n) ((t *) memcpy (MALLOC (t, (n)), (o), sizeof (t) * (n)))
|
||||
|
||||
90
implicit.c
90
implicit.c
@@ -1,5 +1,5 @@
|
||||
/* Implicit rule searching for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
#include "rule.h"
|
||||
#include "dep.h"
|
||||
@@ -217,13 +217,10 @@ pattern_search (struct file *file, int archive,
|
||||
struct file *int_file = 0;
|
||||
|
||||
/* List of dependencies found recursively. */
|
||||
struct patdeps *deplist
|
||||
= xmalloc (max_pattern_deps * sizeof (struct patdeps));
|
||||
unsigned int max_deps = max_pattern_deps;
|
||||
struct patdeps *deplist = xmalloc (max_deps * sizeof (struct patdeps));
|
||||
struct patdeps *pat = deplist;
|
||||
|
||||
/* All the prerequisites actually found for a rule, after expansion. */
|
||||
struct dep *deps;
|
||||
|
||||
/* Names of possible dependencies are constructed in this buffer. */
|
||||
char *depname = alloca (namelen + max_pattern_dep_length);
|
||||
|
||||
@@ -252,8 +249,6 @@ pattern_search (struct file *file, int archive,
|
||||
that is not just '%'. */
|
||||
int specific_rule_matched = 0;
|
||||
|
||||
struct dep dep_simple;
|
||||
|
||||
unsigned int ri; /* uninit checks OK */
|
||||
struct rule *rule;
|
||||
|
||||
@@ -400,10 +395,10 @@ pattern_search (struct file *file, int archive,
|
||||
target in MATCHES. If several targets of the same rule match,
|
||||
that rule will be in TRYRULES more than once. */
|
||||
tryrules[nrules].rule = rule;
|
||||
tryrules[nrules].matches = ti;
|
||||
tryrules[nrules].matches = ti;
|
||||
tryrules[nrules].stemlen = stemlen + (check_lastslash ? pathlen : 0);
|
||||
tryrules[nrules].order = nrules;
|
||||
tryrules[nrules].checked_lastslash = check_lastslash;
|
||||
tryrules[nrules].checked_lastslash = check_lastslash;
|
||||
++nrules;
|
||||
}
|
||||
}
|
||||
@@ -535,11 +530,9 @@ pattern_search (struct file *file, int archive,
|
||||
/* If we don't need a second expansion, just replace the %. */
|
||||
if (! dep->need_2nd_expansion)
|
||||
{
|
||||
dep_simple = *dep;
|
||||
dep_simple.next = 0;
|
||||
p = strchr (nptr, '%');
|
||||
if (p == 0)
|
||||
dep_simple.name = nptr;
|
||||
strcpy (depname, nptr);
|
||||
else
|
||||
{
|
||||
char *o = depname;
|
||||
@@ -553,13 +546,19 @@ pattern_search (struct file *file, int archive,
|
||||
memcpy (o, stem_str, stemlen);
|
||||
o += stemlen;
|
||||
strcpy (o, p + 1);
|
||||
dep_simple.name = strcache_add (depname);
|
||||
}
|
||||
dl = &dep_simple;
|
||||
|
||||
/* Parse the expanded string. It might have wildcards. */
|
||||
p = depname;
|
||||
dl = PARSE_SIMPLE_SEQ (&p, struct dep);
|
||||
for (d = dl; d != NULL; d = d->next)
|
||||
{
|
||||
++deps_found;
|
||||
d->ignore_mtime = dep->ignore_mtime;
|
||||
}
|
||||
|
||||
/* We've used up this dep, so next time get a new one. */
|
||||
nptr = 0;
|
||||
++deps_found;
|
||||
}
|
||||
|
||||
/* We have to perform second expansion on this prereq. In an
|
||||
@@ -575,6 +574,7 @@ pattern_search (struct file *file, int archive,
|
||||
{
|
||||
int add_dir = 0;
|
||||
unsigned int len;
|
||||
struct dep **dptr;
|
||||
|
||||
nptr = get_next_word (nptr, &len);
|
||||
if (nptr == 0)
|
||||
@@ -617,6 +617,9 @@ pattern_search (struct file *file, int archive,
|
||||
add_dir = 1;
|
||||
}
|
||||
|
||||
/* Set up for the next word. */
|
||||
nptr += len;
|
||||
|
||||
/* Initialize and set file variables if we haven't already
|
||||
done so. */
|
||||
if (!file_vars_initialized)
|
||||
@@ -635,32 +638,47 @@ pattern_search (struct file *file, int archive,
|
||||
|
||||
/* Perform the 2nd expansion. */
|
||||
p = variable_expand_for_file (depname, file);
|
||||
dptr = &dl;
|
||||
|
||||
/* Parse the expanded string. */
|
||||
dl = PARSE_FILE_SEQ (&p, struct dep, order_only ? '\0' : '|',
|
||||
add_dir ? dir : NULL, 0);
|
||||
|
||||
for (d = dl; d != NULL; d = d->next)
|
||||
/* Parse the results into a deps list. */
|
||||
do
|
||||
{
|
||||
++deps_found;
|
||||
if (order_only)
|
||||
d->ignore_mtime = 1;
|
||||
}
|
||||
/* Parse the expanded string. */
|
||||
struct dep *dp = PARSE_FILE_SEQ (&p, struct dep,
|
||||
order_only ? MAP_NUL : MAP_PIPE,
|
||||
add_dir ? dir : NULL, PARSEFS_NONE);
|
||||
*dptr = dp;
|
||||
|
||||
/* Set up for the next word. */
|
||||
nptr += len;
|
||||
for (d = dp; d != NULL; d = d->next)
|
||||
{
|
||||
++deps_found;
|
||||
if (order_only)
|
||||
d->ignore_mtime = 1;
|
||||
dptr = &d->next;
|
||||
}
|
||||
|
||||
/* If we stopped due to an order-only token, note it. */
|
||||
if (*p == '|')
|
||||
{
|
||||
order_only = 1;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
while (*p != '\0');
|
||||
}
|
||||
|
||||
/* If there are more than max_pattern_deps prerequisites (due to
|
||||
2nd expansion), reset it and realloc the arrays. */
|
||||
|
||||
if (deps_found > max_pattern_deps)
|
||||
if (deps_found > max_deps)
|
||||
{
|
||||
unsigned int l = pat - deplist;
|
||||
/* This might have changed due to recursion. */
|
||||
max_pattern_deps = MAX(max_pattern_deps, deps_found);
|
||||
max_deps = max_pattern_deps;
|
||||
deplist = xrealloc (deplist,
|
||||
deps_found * sizeof (struct patdeps));
|
||||
max_deps * sizeof (struct patdeps));
|
||||
pat = deplist + l;
|
||||
max_pattern_deps = deps_found;
|
||||
}
|
||||
|
||||
/* Go through the nameseq and handle each as a prereq name. */
|
||||
@@ -760,8 +778,8 @@ pattern_search (struct file *file, int archive,
|
||||
pat->pattern = int_file->name;
|
||||
int_file->name = d->name;
|
||||
pat->file = int_file;
|
||||
(pat++)->name = d->name;
|
||||
int_file = 0;
|
||||
(pat++)->name = d->name;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -782,8 +800,7 @@ pattern_search (struct file *file, int archive,
|
||||
}
|
||||
|
||||
/* Free the ns chain. */
|
||||
if (dl != &dep_simple)
|
||||
free_dep_chain (dl);
|
||||
free_dep_chain (dl);
|
||||
|
||||
if (failed)
|
||||
break;
|
||||
@@ -800,10 +817,7 @@ pattern_search (struct file *file, int archive,
|
||||
/* This pattern rule does apply. Stop looking for one. */
|
||||
break;
|
||||
|
||||
/* This pattern rule does not apply. If some of its dependencies
|
||||
succeeded, free the data structure describing them. */
|
||||
/* free_idep_chain (deps); */
|
||||
deps = 0;
|
||||
/* This pattern rule does not apply. Keep looking. */
|
||||
}
|
||||
|
||||
/* If we found an applicable rule without intermediate files, don't try
|
||||
|
||||
110
job.h
110
job.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for managing subprocesses in GNU Make.
|
||||
Copyright (C) 1992-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,8 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef SEEN_JOB_H
|
||||
#define SEEN_JOB_H
|
||||
#include "output.h"
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
@@ -26,7 +25,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* How to set close-on-exec for a file descriptor. */
|
||||
|
||||
#if !defined F_SETFD
|
||||
# define CLOSE_ON_EXEC(_d)
|
||||
# ifdef WINDOWS32
|
||||
# define CLOSE_ON_EXEC(_d) process_noinherit(_d)
|
||||
# else
|
||||
# define CLOSE_ON_EXEC(_d)
|
||||
# endif
|
||||
#else
|
||||
# ifndef FD_CLOEXEC
|
||||
# define FD_CLOEXEC 1
|
||||
@@ -34,32 +37,78 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
# define CLOSE_ON_EXEC(_d) (void) fcntl ((_d), F_SETFD, FD_CLOEXEC)
|
||||
#endif
|
||||
|
||||
#ifdef NO_OUTPUT_SYNC
|
||||
# define RECORD_SYNC_MUTEX(m) \
|
||||
error (NILF, \
|
||||
_("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
|
||||
#else
|
||||
# ifdef WINDOWS32
|
||||
/* For emulations in w32/compat/posixfcn.c. */
|
||||
# define F_GETFD 1
|
||||
# define F_SETLKW 2
|
||||
/* Implementation note: None of the values of l_type below can be zero
|
||||
-- they are compared with a static instance of the struct, so zero
|
||||
means unknown/invalid, see w32/compat/posixfcn.c. */
|
||||
# define F_WRLCK 1
|
||||
# define F_UNLCK 2
|
||||
|
||||
struct flock
|
||||
{
|
||||
short l_type;
|
||||
short l_whence;
|
||||
off_t l_start;
|
||||
off_t l_len;
|
||||
pid_t l_pid;
|
||||
};
|
||||
|
||||
/* This type is actually a HANDLE, but we want to avoid including
|
||||
windows.h as much as possible. */
|
||||
typedef intptr_t sync_handle_t;
|
||||
|
||||
/* Public functions emulated/provided in posixfcn.c. */
|
||||
int fcntl (intptr_t fd, int cmd, ...);
|
||||
intptr_t create_mutex (void);
|
||||
int same_stream (FILE *f1, FILE *f2);
|
||||
|
||||
# define RECORD_SYNC_MUTEX(m) record_sync_mutex(m)
|
||||
void record_sync_mutex (const char *str);
|
||||
void prepare_mutex_handle_string (intptr_t hdl);
|
||||
# else /* !WINDOWS32 */
|
||||
|
||||
typedef int sync_handle_t; /* file descriptor */
|
||||
|
||||
# define RECORD_SYNC_MUTEX(m) (void)(m)
|
||||
|
||||
# endif
|
||||
#endif /* !OUTPUT_SYNC */
|
||||
|
||||
/* Structure describing a running or dead child process. */
|
||||
|
||||
struct child
|
||||
{
|
||||
struct child *next; /* Link in the chain. */
|
||||
struct child *next; /* Link in the chain. */
|
||||
|
||||
struct file *file; /* File being remade. */
|
||||
struct file *file; /* File being remade. */
|
||||
|
||||
char **environment; /* Environment for commands. */
|
||||
char **environment; /* Environment for commands. */
|
||||
char *sh_batch_file; /* Script file for shell commands */
|
||||
char **command_lines; /* Array of variable-expanded cmd lines. */
|
||||
char *command_ptr; /* Ptr into command_lines[command_line]. */
|
||||
char **command_lines; /* Array of variable-expanded cmd lines. */
|
||||
char *command_ptr; /* Ptr into command_lines[command_line]. */
|
||||
|
||||
#ifdef VMS
|
||||
char *comname; /* Temporary command file name */
|
||||
int efn; /* Completion event flag number */
|
||||
int cstatus; /* Completion status */
|
||||
int efn; /* Completion event flag number */
|
||||
int cstatus; /* Completion status */
|
||||
#endif
|
||||
|
||||
unsigned int command_line; /* Index into command_lines. */
|
||||
pid_t pid; /* Child process's ID number. */
|
||||
unsigned int remote:1; /* Nonzero if executing remotely. */
|
||||
unsigned int noerror:1; /* Nonzero if commands contained a '-'. */
|
||||
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
||||
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
||||
unsigned int dontcare:1; /* Saved dontcare flag. */
|
||||
unsigned int command_line; /* Index into command_lines. */
|
||||
struct output output; /* Output for this child. */
|
||||
pid_t pid; /* Child process's ID number. */
|
||||
unsigned int remote:1; /* Nonzero if executing remotely. */
|
||||
unsigned int noerror:1; /* Nonzero if commands contained a '-'. */
|
||||
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
|
||||
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
|
||||
unsigned int dontcare:1; /* Saved dontcare flag. */
|
||||
};
|
||||
|
||||
extern struct child *children;
|
||||
@@ -73,17 +122,24 @@ char **construct_command_argv (char *line, char **restp, struct file *file,
|
||||
int cmd_flags, char** batch_file);
|
||||
#ifdef VMS
|
||||
int child_execute_job (char *argv, struct child *child);
|
||||
#elif defined(__EMX__)
|
||||
int child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
|
||||
#else
|
||||
void child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
|
||||
# define FD_STDIN (fileno (stdin))
|
||||
# define FD_STDOUT (fileno (stdout))
|
||||
# define FD_STDERR (fileno (stderr))
|
||||
# if defined(__EMX__)
|
||||
int child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
char **argv, char **envp)
|
||||
# else
|
||||
void child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
char **argv, char **envp) __attribute__ ((noreturn));
|
||||
# endif
|
||||
#endif
|
||||
#ifdef _AMIGA
|
||||
void exec_command (char **argv);
|
||||
void exec_command (char **argv) __attribute__ ((noreturn));
|
||||
#elif defined(__EMX__)
|
||||
int exec_command (char **argv, char **envp);
|
||||
#else
|
||||
void exec_command (char **argv, char **envp);
|
||||
void exec_command (char **argv, char **envp) __attribute__ ((noreturn));
|
||||
#endif
|
||||
|
||||
extern unsigned int job_slots_used;
|
||||
@@ -92,14 +148,12 @@ void block_sigs (void);
|
||||
#ifdef POSIX
|
||||
void unblock_sigs (void);
|
||||
#else
|
||||
#ifdef HAVE_SIGSETMASK
|
||||
#ifdef HAVE_SIGSETMASK
|
||||
extern int fatal_signal_mask;
|
||||
#define unblock_sigs() sigsetmask (0)
|
||||
#define unblock_sigs() sigsetmask (0)
|
||||
#else
|
||||
#define unblock_sigs()
|
||||
#define unblock_sigs()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern unsigned int jobserver_tokens;
|
||||
|
||||
#endif /* SEEN_JOB_H */
|
||||
|
||||
215
load.c
215
load.c
@@ -1,5 +1,5 @@
|
||||
/* Loading dynamic objects for GNU Make.
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#if MAKE_LOAD
|
||||
|
||||
@@ -24,76 +24,121 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define SYMBOL_EXTENSION "_gmake_setup"
|
||||
|
||||
static void *global_dl = NULL;
|
||||
#define SYMBOL_EXTENSION "_gmk_setup"
|
||||
|
||||
#include "debug.h"
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
|
||||
static int
|
||||
init_symbol (const struct floc *flocp, const char *ldname, load_func_t symp)
|
||||
{
|
||||
int r;
|
||||
const char *p;
|
||||
int nmlen = strlen (ldname);
|
||||
char *loaded = allocated_variable_expand("$(.LOADED)");
|
||||
|
||||
/* If it's already been loaded don't do it again. */
|
||||
p = strstr (loaded, ldname);
|
||||
r = p && (p==loaded || p[-1]==' ') && (p[nmlen]=='\0' || p[nmlen]==' ');
|
||||
free (loaded);
|
||||
if (r)
|
||||
return 1;
|
||||
|
||||
/* Now invoke the symbol. */
|
||||
r = (*symp) (flocp);
|
||||
|
||||
/* If it succeeded, add the symbol to the loaded variable. */
|
||||
if (r > 0)
|
||||
do_variable_definition (flocp, ".LOADED", ldname, o_default, f_append, 0);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
load_file (const struct floc *flocp, const char *ldname, int noerror)
|
||||
struct load_list
|
||||
{
|
||||
struct load_list *next;
|
||||
const char *name;
|
||||
void *dlp;
|
||||
};
|
||||
|
||||
static struct load_list *loaded_syms = NULL;
|
||||
|
||||
static load_func_t
|
||||
load_object (const gmk_floc *flocp, int noerror,
|
||||
const char *ldname, const char *symname)
|
||||
{
|
||||
static void *global_dl = NULL;
|
||||
load_func_t symp;
|
||||
const char *fp;
|
||||
char *symname = NULL;
|
||||
char *new = alloca (strlen (ldname) + CSTRLEN (SYMBOL_EXTENSION) + 1);
|
||||
|
||||
if (! global_dl)
|
||||
{
|
||||
global_dl = dlopen (NULL, RTLD_NOW|RTLD_GLOBAL);
|
||||
if (! global_dl)
|
||||
fatal (flocp, _("Failed to open global symbol table: %s"), dlerror());
|
||||
fatal (flocp, _("Failed to open global symbol table: %s"), dlerror ());
|
||||
}
|
||||
|
||||
/* If a symbol name was provided, use it. */
|
||||
fp = strchr (ldname, '(');
|
||||
symp = (load_func_t) dlsym (global_dl, symname);
|
||||
if (! symp)
|
||||
{
|
||||
struct load_list *new;
|
||||
void *dlp = NULL;
|
||||
|
||||
/* If the path has no "/", try the current directory first. */
|
||||
if (! strchr (ldname, '/')
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
&& ! strchr (ldname, '\\')
|
||||
#endif
|
||||
)
|
||||
dlp = dlopen (concat (2, "./", ldname), RTLD_LAZY|RTLD_GLOBAL);
|
||||
|
||||
/* If we haven't opened it yet, try the default search path. */
|
||||
if (! dlp)
|
||||
dlp = dlopen (ldname, RTLD_LAZY|RTLD_GLOBAL);
|
||||
|
||||
/* Still no? Then fail. */
|
||||
if (! dlp)
|
||||
{
|
||||
if (noerror)
|
||||
DB (DB_BASIC, ("%s", dlerror ()));
|
||||
else
|
||||
error (flocp, "%s", dlerror ());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Assert that the GPL license symbol is defined. */
|
||||
symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
|
||||
if (! symp)
|
||||
fatal (flocp, _("Loaded object %s is not declared to be GPL compatible"),
|
||||
ldname);
|
||||
|
||||
symp = (load_func_t) dlsym (dlp, symname);
|
||||
if (! symp)
|
||||
fatal (flocp, _("Failed to load symbol %s from %s: %s"),
|
||||
symname, ldname, dlerror ());
|
||||
|
||||
/* Add this symbol to a trivial lookup table. This is not efficient but
|
||||
it's highly unlikely we'll be loading lots of objects, and we only
|
||||
need it to look them up on unload, if we rebuild them. */
|
||||
new = xmalloc (sizeof (struct load_list));
|
||||
new->name = xstrdup (ldname);
|
||||
new->dlp = dlp;
|
||||
new->next = loaded_syms;
|
||||
loaded_syms = new;
|
||||
}
|
||||
|
||||
return symp;
|
||||
}
|
||||
|
||||
int
|
||||
load_file (const gmk_floc *flocp, const char **ldname, int noerror)
|
||||
{
|
||||
int nmlen = strlen (*ldname);
|
||||
char *new = alloca (nmlen + CSTRLEN (SYMBOL_EXTENSION) + 1);
|
||||
char *symname = NULL;
|
||||
char *loaded;
|
||||
const char *fp;
|
||||
int r;
|
||||
load_func_t symp;
|
||||
|
||||
/* Break the input into an object file name and a symbol name. If no symbol
|
||||
name was provided, compute one from the object file name. */
|
||||
fp = strchr (*ldname, '(');
|
||||
if (fp)
|
||||
{
|
||||
const char *ep;
|
||||
|
||||
/* If there's an open paren, see if there's a close paren: if so use
|
||||
/* There's an open paren, so see if there's a close paren: if so use
|
||||
that as the symbol name. We can't have whitespace: it would have
|
||||
been chopped up before this function is called. */
|
||||
ep = strchr (fp+1, ')');
|
||||
if (ep && ep[1] == '\0')
|
||||
{
|
||||
int l = fp - ldname;;
|
||||
int l = fp - *ldname;;
|
||||
|
||||
++fp;
|
||||
if (fp == ep)
|
||||
fatal (flocp, _("Empty symbol name for load: %s"), ldname);
|
||||
fatal (flocp, _("Empty symbol name for load: %s"), *ldname);
|
||||
|
||||
/* Make a copy of the ldname part. */
|
||||
memcpy (new, ldname, l);
|
||||
memcpy (new, *ldname, l);
|
||||
new[l] = '\0';
|
||||
ldname = new;
|
||||
*ldname = new;
|
||||
|
||||
/* Make a copy of the symbol name part. */
|
||||
symname = new + l + 1;
|
||||
@@ -102,14 +147,39 @@ load_file (const struct floc *flocp, const char *ldname, int noerror)
|
||||
}
|
||||
}
|
||||
|
||||
/* Add this name to the string cache so it can be reused later. */
|
||||
*ldname = strcache_add (*ldname);
|
||||
|
||||
/* If this object has been loaded, we're done. */
|
||||
loaded = allocated_variable_expand ("$(.LOADED)");
|
||||
fp = strstr (loaded, *ldname);
|
||||
r = fp && (fp==loaded || fp[-1]==' ') && (fp[nmlen]=='\0' || fp[nmlen]==' ');
|
||||
free (loaded);
|
||||
if (r)
|
||||
return 1;
|
||||
|
||||
/* If we didn't find a symbol name yet, construct it from the ldname. */
|
||||
if (! symname)
|
||||
{
|
||||
char *p = new;
|
||||
|
||||
fp = strrchr (ldname, '/');
|
||||
fp = strrchr (*ldname, '/');
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
if (fp)
|
||||
{
|
||||
const char *fp2 = strchr (fp, '\\');
|
||||
|
||||
if (fp2 > fp)
|
||||
fp = fp2;
|
||||
}
|
||||
else
|
||||
fp = strrchr (*ldname, '\\');
|
||||
/* The (improbable) case of d:foo. */
|
||||
if (fp && *fp && fp[1] == ':')
|
||||
fp++;
|
||||
#endif
|
||||
if (!fp)
|
||||
fp = ldname;
|
||||
fp = *ldname;
|
||||
else
|
||||
++fp;
|
||||
while (isalnum (*fp) || *fp == '_')
|
||||
@@ -118,35 +188,42 @@ load_file (const struct floc *flocp, const char *ldname, int noerror)
|
||||
symname = new;
|
||||
}
|
||||
|
||||
DB (DB_VERBOSE, (_("Loading symbol %s from %s\n"), symname, ldname));
|
||||
DB (DB_VERBOSE, (_("Loading symbol %s from %s\n"), symname, *ldname));
|
||||
|
||||
/* See if it's already defined. */
|
||||
symp = (load_func_t) dlsym (global_dl, symname);
|
||||
if (! symp) {
|
||||
void *dlp = dlopen (ldname, RTLD_LAZY|RTLD_GLOBAL);
|
||||
if (! dlp)
|
||||
/* Load it! */
|
||||
symp = load_object (flocp, noerror, *ldname, symname);
|
||||
if (! symp)
|
||||
return 0;
|
||||
|
||||
/* Invoke the symbol. */
|
||||
r = (*symp) (flocp);
|
||||
|
||||
/* If it succeeded, add the load file to the loaded variable. */
|
||||
if (r > 0)
|
||||
do_variable_definition (flocp, ".LOADED", *ldname, o_default, f_append, 0);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
unload_file (const char *name)
|
||||
{
|
||||
struct load_list *d;
|
||||
|
||||
for (d = loaded_syms; d != NULL; d = d->next)
|
||||
if (streq (d->name, name) && d->dlp)
|
||||
{
|
||||
if (noerror)
|
||||
DB (DB_BASIC, ("%s", dlerror()));
|
||||
else
|
||||
error (flocp, "%s", dlerror());
|
||||
return 0;
|
||||
if (dlclose (d->dlp))
|
||||
perror_with_name ("dlclose", d->name);
|
||||
d->dlp = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
symp = dlsym (dlp, symname);
|
||||
if (! symp)
|
||||
fatal (flocp, _("Failed to load symbol %s from %s: %s"),
|
||||
symname, ldname, dlerror());
|
||||
}
|
||||
|
||||
/* Invoke the symbol to initialize the loaded object. */
|
||||
return init_symbol(flocp, ldname, symp);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
load_file (const struct floc *flocp, const char *ldname, int noerror)
|
||||
load_file (const gmk_floc *flocp, const char **ldname, int noerror)
|
||||
{
|
||||
if (! noerror)
|
||||
fatal (flocp, _("The 'load' operation is not supported on this platform."));
|
||||
@@ -154,4 +231,10 @@ load_file (const struct floc *flocp, const char *ldname, int noerror)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
unload_file (const char *name)
|
||||
{
|
||||
fatal (NILF, "INTERNAL: Cannot unload when load is not supported!");
|
||||
}
|
||||
|
||||
#endif /* MAKE_LOAD */
|
||||
|
||||
62
loadapi.c
Normal file
62
loadapi.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/* API for GNU Make dynamic objects.
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
#include "dep.h"
|
||||
|
||||
/* Allocate a buffer in our context, so we can free it. */
|
||||
char *
|
||||
gmk_alloc (unsigned int len)
|
||||
{
|
||||
return xmalloc (len);
|
||||
}
|
||||
|
||||
/* Free a buffer returned by gmk_expand(). */
|
||||
void
|
||||
gmk_free (char *s)
|
||||
{
|
||||
free (s);
|
||||
}
|
||||
|
||||
/* Evaluate a buffer as make syntax.
|
||||
Ideally eval_buffer() will take const char *, but not yet. */
|
||||
void
|
||||
gmk_eval (const char *buffer, const gmk_floc *floc)
|
||||
{
|
||||
char *s = xstrdup (buffer);
|
||||
eval_buffer (s, floc);
|
||||
free (s);
|
||||
}
|
||||
|
||||
/* Expand a string and return an allocated buffer.
|
||||
Caller must call gmk_free() with this buffer. */
|
||||
char *
|
||||
gmk_expand (const char *ref)
|
||||
{
|
||||
return allocated_variable_expand (ref);
|
||||
}
|
||||
|
||||
/* Register a function to be called from makefiles. */
|
||||
void
|
||||
gmk_add_function (const char *name,
|
||||
char *(*func)(const char *nm, int argc, char **argv),
|
||||
int min, int max, int expand)
|
||||
{
|
||||
define_new_function (reading_file, name, min, max, expand, func);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
# Maintainer-only makefile segment. This contains things that are relevant
|
||||
# only if you have the full copy of the GNU make sources from the CVS
|
||||
# only if you have the full copy of the GNU make sources from the Git
|
||||
# tree, not a dist copy.
|
||||
|
||||
# We like mondo-warnings!
|
||||
@@ -83,31 +83,18 @@ DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
|
||||
< $$f; \
|
||||
done) > $@
|
||||
|
||||
# Get rid of everything "else".
|
||||
#
|
||||
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
|
||||
# Cleaning
|
||||
|
||||
CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
|
||||
build.sh.in .deps .dep_segment ABOUT-NLS \
|
||||
ansi2knr.*
|
||||
GIT := git
|
||||
|
||||
# This rule tries to clean the tree right down to how it looks when you do a
|
||||
# virgin CVS checkout.
|
||||
# git-clean: Clean all "ignored" files. Leave untracked files.
|
||||
# git-very-clean: Clean all files that aren't stored in source control.
|
||||
|
||||
# This target is potentially dangerous since it removes _ANY FILE_ that
|
||||
# is not in CVS. Including files you might mean to add to CVS but
|
||||
# haven't yet... I only use this in subdirectories where it's unlikely
|
||||
# we have any new files. Still... be careful!!
|
||||
|
||||
cvsclean = $(PERL) -e '$$k{CVS} = 1; open(E,"< CVS/Entries") || die "CVS/Entries: $$!\n"; while (defined ($$_ = <E>)) { m%^/([^/]*)% or next; $$k{$$1} = 1; } close(E) || die "CVS/Entries: $$!\n"; opendir(D, ".") || die ".: $$!\n"; while (defined ($$_ = readdir(D))) { -f $$_ && ! exists $$k{$$_} && unlink($$_); } closedir(D) || die ".: $$!\n";'
|
||||
|
||||
.PHONY: cvs-clean
|
||||
cvs-clean: maintainer-clean
|
||||
-rm -rf *~ $(CVS-CLEAN-FILES)
|
||||
-cd config && $(cvsclean)
|
||||
-cd po && $(cvsclean)
|
||||
-cd doc && $(cvsclean)
|
||||
-cd glob && $(cvsclean)
|
||||
.PHONY: git-clean git-very-clean
|
||||
git-clean:
|
||||
-$(GIT) clean -fdX
|
||||
git-very-clean: git-clean
|
||||
-$(GIT) clean -fd
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -197,11 +184,42 @@ scm-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub
|
||||
update: po-update scm-update
|
||||
|
||||
|
||||
# ---------------------------------- #
|
||||
# Alternative configuration checks. #
|
||||
# ---------------------------------- #
|
||||
|
||||
.PHONY: check-alt-config
|
||||
check-alt-config: \
|
||||
checkcfg.--disable-job-server \
|
||||
checkcfg.--disable-load \
|
||||
checkcfg.--without-guile \
|
||||
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
|
||||
checkcfg.CPPFLAGS^-DNO_ARCHIVES
|
||||
|
||||
checkcfg.%: distdir
|
||||
@ rm -rf $(distdir)/_build \
|
||||
&& mkdir $(distdir)/_build \
|
||||
&& cd $(distdir)/_build \
|
||||
&& echo "Testing configure with $(subst ^,=,$*)" \
|
||||
&& ../configure --srcdir=.. $(subst ^,=,$*) \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
CFLAGS='$(AM_CFLAGS)' \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check
|
||||
|
||||
|
||||
.PHONY: update
|
||||
update: po-update scm-update
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Sanity checks. ##
|
||||
## --------------- ##
|
||||
|
||||
# Checks that don't require cvs. Run 'changelog-check' last as
|
||||
# Before we build a distribution be sure we run our local checks
|
||||
#distdir: local-check
|
||||
|
||||
# Checks that don't require Git. Run 'changelog-check' last as
|
||||
# previous test may reveal problems requiring new ChangeLog entries.
|
||||
local-check: po-check changelog-check
|
||||
|
||||
@@ -216,11 +234,11 @@ changelog-check:
|
||||
fi
|
||||
|
||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||
# Ignore make.h; it defines _().
|
||||
# Ignore makeint.h; it defines _().
|
||||
po-check:
|
||||
if test -f po/POTFILES.in; then \
|
||||
grep '^[^#]' po/POTFILES.in | sort > $@-1; \
|
||||
$(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "make.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \
|
||||
$(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "makeint.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \
|
||||
diff -u $@-1 $@-2 || exit 1; \
|
||||
rm -f $@-1 $@-2; \
|
||||
fi
|
||||
@@ -271,7 +289,7 @@ $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
||||
$(FTPPUT) "$(gnu-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
|
||||
|
||||
|
||||
# Copyright (C) 1997-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
32
make.1
32
make.1
@@ -143,7 +143,9 @@ for showing implicit rules,
|
||||
.I j
|
||||
for details on invocation of commands, and
|
||||
.I m
|
||||
for debugging while remaking makefiles.
|
||||
for debugging while remaking makefiles. Use
|
||||
.I n
|
||||
to disable all previous debugging flags.
|
||||
.TP 0.5i
|
||||
\fB\-e\fR, \fB\-\-environment\-overrides\fR
|
||||
Give variables taken from the environment precedence
|
||||
@@ -220,6 +222,28 @@ on account of changes in
|
||||
.IR file .
|
||||
Essentially the file is treated as very old and its rules are ignored.
|
||||
.TP 0.5i
|
||||
\fB\-O\fR[\fItype\fR], \fB\-\-output\-sync\fR[=\fItype\fR]
|
||||
When running multiple jobs in parallel with \fB-j\fR, ensure the output of
|
||||
each job is collected together rather than interspersed with output from
|
||||
other jobs. If
|
||||
.I type
|
||||
is not specified or is
|
||||
.B target
|
||||
the output from the entire recipe for each target is grouped together. If
|
||||
.I type
|
||||
is
|
||||
.B line
|
||||
the output from each command line within a recipe is grouped together.
|
||||
If
|
||||
.I type
|
||||
is
|
||||
.B recurse
|
||||
output from an entire recursive make is grouped together. If
|
||||
.I type
|
||||
is
|
||||
.B none
|
||||
output synchronization is disabled.
|
||||
.TP 0.5i
|
||||
\fB\-p\fR, \fB\-\-print\-data\-base\fR
|
||||
Print the data base (rules and variable values) that results from
|
||||
reading the makefiles; then execute as usual or as otherwise
|
||||
@@ -268,8 +292,8 @@ future invocations of
|
||||
.BR make .
|
||||
.TP 0.5i
|
||||
.B \-\-trace
|
||||
Print information about the commands invoked by
|
||||
.BR make.
|
||||
Information about the disposition of each target is printed (why the target is
|
||||
being rebuilt and what commands are run to rebuild it).
|
||||
.TP 0.5i
|
||||
\fB\-v\fR, \fB\-\-version\fR
|
||||
Print the version of the
|
||||
@@ -339,7 +363,7 @@ This manual page contributed by Dennis Morse of Stanford University.
|
||||
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
||||
McGrath. Maintained by Paul Smith.
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 1992-1993, 1996-2012 Free Software Foundation, Inc.
|
||||
Copyright \(co 1992-1993, 1996-2013 Free Software Foundation, Inc.
|
||||
This file is part of
|
||||
.IR "GNU make" .
|
||||
.LP
|
||||
|
||||
2
make.lnk
2
make.lnk
@@ -1,4 +1,4 @@
|
||||
FROM LIB:cres.o "commands.o"+"job.o"+"dir.o"+"file.o"+"misc.o"+"main.o"+"read.o"+"remake.o"+"rule.o"+"implicit.o"+"default.o"+"variable.o"+"expand.o"+"function.o"+"vpath.o"+"version.o"+"ar.o"+"arscan.o"+"signame.o"+"remote-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"+"hash.o"+"strcache.o"
|
||||
FROM LIB:cres.o "commands.o"+"job.o"+"dir.o"+"file.o"+"misc.o"+"main.o"+"read.o"+"remake.o"+"rule.o"+"implicit.o"+"default.o"+"variable.o"+"expand.o"+"function.o"+"vpath.o"+"version.o"+"ar.o"+"arscan.o"+"signame.o"+"remote-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"+"hash.o"+"strcache.o"+"output.o"
|
||||
TO "make.new"
|
||||
LIB glob/glob.lib LIB:sc.lib LIB:amiga.lib
|
||||
QUIET
|
||||
|
||||
@@ -171,6 +171,9 @@
|
||||
<File
|
||||
RelativePath=".\job.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\output.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\main.c">
|
||||
</File>
|
||||
@@ -278,7 +281,10 @@
|
||||
RelativePath=".\job.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\make.h">
|
||||
RelativePath=".\output.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\makeint.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\rule.h">
|
||||
|
||||
@@ -67,8 +67,8 @@ $ then
|
||||
$ gosub check_cc_qual
|
||||
$ endif
|
||||
$ filelist = "alloca ar arscan commands default dir expand file function " + -
|
||||
"hash implicit job main misc read remake remote-stub rule " + -
|
||||
"signame variable version vmsfunctions vmsify vpath " + -
|
||||
"hash implicit job load main misc read remake remote-stub rule " + -
|
||||
"output signame variable version vmsfunctions vmsify vpath " + -
|
||||
"[.glob]glob [.glob]fnmatch getopt1 getopt strcache"
|
||||
$ copy config.h-vms config.h
|
||||
$ n=0
|
||||
@@ -138,7 +138,7 @@ $ exit
|
||||
$ endsubroutine : compileit
|
||||
$!
|
||||
$!-----------------------------------------------------------------------------
|
||||
$!Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
$!Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
$!This file is part of GNU Make.
|
||||
$!
|
||||
$!GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
76
makefile.vms
76
makefile.vms
@@ -1,6 +1,6 @@
|
||||
# -*-Makefile-*- to build GNU make on VMS
|
||||
#
|
||||
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -20,7 +20,7 @@
|
||||
# Klaus Kämpf (kkaempf@rmi.de)
|
||||
# Modified for version 3.78.1 by Hartmut.Becker@compaq.com.
|
||||
# Modified for version 3.80 by zinser@decus.de
|
||||
# Modified for version 3.81 by Hartmut Becker
|
||||
# Modified for versions 3.81, 3.99.90 by Hartmut Becker
|
||||
|
||||
CC = cc
|
||||
CP = copy
|
||||
@@ -90,17 +90,17 @@ manext = 1
|
||||
|
||||
#guile = ,guile.obj
|
||||
|
||||
objs = commands.obj,job.obj,dir.obj,file.obj,misc.obj,hash.obj,\
|
||||
main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
|
||||
objs = commands.obj,job.obj,output.obj,dir.obj,file.obj,misc.obj,hash.obj,\
|
||||
load.obj,main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
|
||||
default.obj,variable.obj,expand.obj,function.obj,strcache.obj,\
|
||||
vpath.obj,version.obj\
|
||||
$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)$(guile)
|
||||
|
||||
srcs = commands.c job.c dir.c file.c misc.c guile.c hash.c \
|
||||
main.c read.c remake.c rule.c implicit.c \
|
||||
srcs = commands.c job.c output.c dir.c file.c misc.c guile.c hash.c \
|
||||
load.c main.c read.c remake.c rule.c implicit.c \
|
||||
default.c variable.c expand.c function.c strcache.c \
|
||||
vpath.c version.c vmsfunctions.c vmsify.c $(ARCHIVES_SRC) $(ALLOCASRC) \
|
||||
commands.h dep.h filedef.h job.h make.h rule.h variable.h
|
||||
commands.h dep.h filedef.h job.h output.h makeint.h rule.h variable.h
|
||||
|
||||
|
||||
.PHONY: all doc
|
||||
@@ -114,40 +114,44 @@ make.exe: $(objs)
|
||||
|
||||
.PHONY: clean realclean
|
||||
clean:
|
||||
$$ purge [...]
|
||||
-purge [...]
|
||||
-$(RM) make.exe;,*.obj;
|
||||
-$(RM) [.glob]*.obj;
|
||||
|
||||
# Automatically generated dependencies.
|
||||
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
|
||||
job.obj: job.c vmsjobs.c make.h commands.h job.h filedef.h variable.h
|
||||
dir.obj: dir.c make.h
|
||||
file.obj: file.c make.h commands.h dep.h filedef.h variable.h
|
||||
misc.obj: misc.c make.h dep.h
|
||||
hash.obj: hash.c make.h hash.h
|
||||
strcache.obj: strcache.c make.h hash.h
|
||||
main.obj: main.c make.h commands.h dep.h filedef.h variable.h job.h
|
||||
guile.obj: guile.c make.h debug.h dep.h gmk-default.h
|
||||
read.obj: read.c make.h commands.h dep.h filedef.h variable.h
|
||||
remake.obj: remake.c make.h commands.h job.h dep.h filedef.h
|
||||
rule.obj: rule.c make.h commands.h dep.h filedef.h variable.h rule.h
|
||||
implicit.obj: implicit.c make.h rule.h dep.h filedef.h
|
||||
default.obj: default.c make.h rule.h dep.h filedef.h commands.h variable.h
|
||||
variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
|
||||
expand.obj: expand.c make.h commands.h filedef.h variable.h
|
||||
function.obj: function.c make.h variable.h dep.h commands.h job.h
|
||||
vpath.obj: vpath.c make.h filedef.h variable.h
|
||||
# makeint.h: config.h gnumake.h gettext.h
|
||||
# filedef.h: hash.h
|
||||
ar.obj: ar.c makeint.h filedef.h dep.h [.glob]fnmatch.h
|
||||
arscan.obj: arscan.c makeint.h
|
||||
commands.obj: commands.c makeint.h dep.h commands.h filedef.h variable.h job.h
|
||||
default.obj: default.c makeint.h rule.h dep.h job.h filedef.h commands.h variable.h
|
||||
dir.obj: dir.c makeint.h hash.h [.glob]glob.h
|
||||
expand.obj: expand.c makeint.h commands.h filedef.h job.h rule.h variable.h
|
||||
file.obj: file.c makeint.h commands.h dep.h filedef.h variable.h job.h debug.h
|
||||
function.obj: function.c makeint.h variable.h dep.h commands.h filedef.h debug.h job.h
|
||||
getopt.obj: getopt.c getopt.h config.h gettext.h
|
||||
getopt1.obj: getopt1.c getopt.h config.h
|
||||
guile.obj: guile.c makeint.h debug.h dep.h gmk-default.h
|
||||
hash.obj: hash.c makeint.h hash.h
|
||||
implicit.obj: implicit.c makeint.h rule.h dep.h filedef.h debug.h variable.h job.h commands.h
|
||||
job.obj: job.c vmsjobs.c makeint.h commands.h job.h filedef.h variable.h debug.h
|
||||
output.obj: output.c vmsjobs.c makeint.h output.h filedef.h debug.h
|
||||
load.obj: load.c makeint.h debug.h filedef.h variable.h
|
||||
main.obj: main.c makeint.h commands.h dep.h filedef.h variable.h job.h rule.h debug.h getopt.h
|
||||
misc.obj: misc.c makeint.h dep.h debug.h
|
||||
read.obj: read.c makeint.h commands.h dep.h filedef.h variable.h [.glob]glob.h debug.h rule.h job.h
|
||||
remake.obj: remake.c makeint.h commands.h job.h dep.h filedef.h variable.h debug.h
|
||||
remote-stub.obj: remote-stub.c makeint.h filedef.h job.h commands.h
|
||||
rule.obj: rule.c makeint.h commands.h dep.h filedef.h variable.h rule.h job.h
|
||||
signame.obj: signame.c makeint.h
|
||||
strcache.obj: strcache.c makeint.h hash.h
|
||||
variable.obj: variable.c makeint.h commands.h variable.h dep.h filedef.h job.h rule.h
|
||||
version.obj: version.c config.h
|
||||
arscan.obj: arscan.c
|
||||
ar.obj: ar.c make.h filedef.h
|
||||
signame.obj: signame.c
|
||||
remote-stub.obj: remote-stub.c
|
||||
[.glob]glob.obj: [.glob]glob.c
|
||||
[.glob]fnmatch.obj: [.glob]fnmatch.c
|
||||
getopt.obj: getopt.c
|
||||
getopt1.obj: getopt1.c
|
||||
vmsfunctions.obj: vmsfunctions.c make.h vmsdir.h
|
||||
vmsify.obj: vmsify.c make.h
|
||||
vmsfunctions.obj: vmsfunctions.c makeint.h vmsdir.h debug.h job.h
|
||||
vmsify.obj: vmsify.c
|
||||
vpath.obj: vpath.c makeint.h filedef.h variable.h
|
||||
[.glob]fnmatch.obj: [.glob]fnmatch.c [.glob]fnmatch.h config.h
|
||||
[.glob]glob.obj: [.glob]glob.c [.glob]glob.h [.glob]fnmatch.h config.h
|
||||
|
||||
config.h: config.h-vms
|
||||
$(CP) $< $@
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -16,7 +16,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* We use <config.h> instead of "config.h" so that a compilation
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
(which it would do because make.h was found in $srcdir). */
|
||||
(which it would do because makeint.h was found in $srcdir). */
|
||||
#include <config.h>
|
||||
#undef HAVE_CONFIG_H
|
||||
#define HAVE_CONFIG_H 1
|
||||
@@ -47,6 +47,14 @@ char *alloca ();
|
||||
# define NDEBUG 1
|
||||
#endif
|
||||
|
||||
/* Include the externally-visible content.
|
||||
Be sure to use the local one, and not one installed on the system.
|
||||
Define GMK_BUILDING_MAKE for proper selection of dllexport/dllimport
|
||||
declarations for MS-Windows. */
|
||||
#ifdef WINDOWS32
|
||||
# define GMK_BUILDING_MAKE
|
||||
#endif
|
||||
#include "gnumake.h"
|
||||
|
||||
#ifdef CRAY
|
||||
/* This must happen before #include <signal.h> so
|
||||
@@ -165,6 +173,9 @@ unsigned int get_path_max (void);
|
||||
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
|
||||
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
|
||||
|
||||
/* The maximum number of digits needed to represent the largest integer. */
|
||||
#define INTEGER_LENGTH sizeof("18446744073709551616")
|
||||
|
||||
#ifndef CHAR_MAX
|
||||
# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char)
|
||||
#endif
|
||||
@@ -186,6 +197,7 @@ unsigned int get_path_max (void);
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
# include <fcntl.h>
|
||||
# include <types.h>
|
||||
# include <unixlib.h>
|
||||
# include <unixio.h>
|
||||
@@ -341,10 +353,17 @@ char *strsignal (int signum);
|
||||
# include <malloc.h>
|
||||
# define pipe(_p) _pipe((_p), 512, O_BINARY)
|
||||
# define kill(_pid,_sig) w32_kill((_pid),(_sig))
|
||||
/* MSVC doesn't have ftruncate. */
|
||||
# ifdef _MSC_VER
|
||||
# define ftruncate(_fd,_len) _chsize(_fd,_len)
|
||||
# endif
|
||||
/* MinGW64 doesn't have _S_ISDIR. */
|
||||
# ifndef _S_ISDIR
|
||||
# define _S_ISDIR(m) S_ISDIR(m)
|
||||
# endif
|
||||
|
||||
void sync_Path_environment (void);
|
||||
int w32_kill (pid_t pid, int sig);
|
||||
char *end_of_token_w32 (const char *s, char stopchar);
|
||||
int find_and_set_default_shell (const char *token);
|
||||
|
||||
/* indicates whether or not we have Bourne shell */
|
||||
@@ -352,8 +371,44 @@ extern int no_default_sh_exe;
|
||||
|
||||
/* is default_shell unixy? */
|
||||
extern int unixy_shell;
|
||||
|
||||
/* We don't have a preferred fixed value for LOCALEDIR. */
|
||||
# ifndef LOCALEDIR
|
||||
# define LOCALEDIR NULL
|
||||
# endif
|
||||
|
||||
/* Include only the minimal stuff from windows.h. */
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif /* WINDOWS32 */
|
||||
|
||||
#define ANY_SET(_v,_m) (((_v)&(_m)) != 0)
|
||||
#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
|
||||
|
||||
#define MAP_NUL 0x0001
|
||||
#define MAP_BLANK 0x0002
|
||||
#define MAP_SPACE 0x0004
|
||||
#define MAP_COMMENT 0x0008
|
||||
#define MAP_SEMI 0x0010
|
||||
#define MAP_EQUALS 0x0020
|
||||
#define MAP_COLON 0x0040
|
||||
#define MAP_PERCENT 0x0080
|
||||
#define MAP_PIPE 0x0100
|
||||
#define MAP_DOT 0x0200
|
||||
#define MAP_COMMA 0x0400
|
||||
|
||||
/* This means not only a '$', but skip the variable reference. */
|
||||
#define MAP_VARIABLE 0x4000
|
||||
/* The set of characters which are path separators is OS-specific. */
|
||||
#define MAP_PATHSEP 0x8000
|
||||
|
||||
#ifdef VMS
|
||||
# define MAP_VMSCOMMA MAP_COMMA
|
||||
#else
|
||||
# define MAP_VMSCOMMA 0x0000
|
||||
#endif
|
||||
|
||||
#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(int)(_v)],(_m))
|
||||
|
||||
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
|
||||
# define SET_STACK_SIZE
|
||||
#endif
|
||||
@@ -362,45 +417,24 @@ extern int unixy_shell;
|
||||
extern struct rlimit stack_limit;
|
||||
#endif
|
||||
|
||||
struct floc
|
||||
{
|
||||
const char *filenm;
|
||||
unsigned long lineno;
|
||||
};
|
||||
#define NILF ((struct floc *)0)
|
||||
#define NILF ((gmk_floc *)0)
|
||||
|
||||
#define CSTRLEN(_s) (sizeof (_s)-1)
|
||||
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
|
||||
|
||||
|
||||
/* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use
|
||||
variadic versions of these functions. */
|
||||
|
||||
#if HAVE_STDARG_H || HAVE_VARARGS_H
|
||||
# if HAVE_VPRINTF || HAVE_DOPRNT
|
||||
# define USE_VARIADIC 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
|
||||
const char *concat (unsigned int, ...);
|
||||
void message (int prefix, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
void error (const struct floc *flocp, const char *fmt, ...)
|
||||
void error (const gmk_floc *flocp, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
void fatal (const struct floc *flocp, const char *fmt, ...)
|
||||
void fatal (const gmk_floc *flocp, const char *fmt, ...)
|
||||
__attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
|
||||
#else
|
||||
const char *concat ();
|
||||
void message ();
|
||||
void error ();
|
||||
void fatal ();
|
||||
#endif
|
||||
|
||||
void die (int) __attribute__ ((noreturn));
|
||||
void log_working_directory (int);
|
||||
void pfatal_with_name (const char *) __attribute__ ((noreturn));
|
||||
void perror_with_name (const char *, const char *);
|
||||
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
|
||||
void *xmalloc (unsigned int);
|
||||
void *xcalloc (unsigned int);
|
||||
void *xrealloc (void *, unsigned int);
|
||||
@@ -415,7 +449,6 @@ int alpha_compare (const void *, const void *);
|
||||
void print_spaces (unsigned int);
|
||||
char *find_percent (char *);
|
||||
const char *find_percent_cached (const char **);
|
||||
FILE *open_tmpfile (char **, const char *);
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
int ar_name (const char *);
|
||||
@@ -424,9 +457,9 @@ int ar_touch (const char *);
|
||||
time_t ar_member_date (const char *);
|
||||
|
||||
typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
|
||||
long int hdrpos, long int datapos,
|
||||
long int size, long int date, int uid,
|
||||
int gid, int mode, const void *arg);
|
||||
long int hdrpos, long int datapos,
|
||||
long int size, long int date, int uid,
|
||||
int gid, int mode, const void *arg);
|
||||
|
||||
long int ar_scan (const char *archive, ar_member_func_t function, const void *arg);
|
||||
int ar_name_equal (const char *name, const char *mem, int truncated);
|
||||
@@ -443,6 +476,7 @@ const char *dir_name (const char *);
|
||||
void hash_init_directories (void);
|
||||
|
||||
void define_default_variables (void);
|
||||
void undefine_default_variables (void);
|
||||
void set_default_suffixes (void);
|
||||
void install_default_suffix_rules (void);
|
||||
void install_default_implicit_rules (void);
|
||||
@@ -459,8 +493,6 @@ void user_access (void);
|
||||
void make_access (void);
|
||||
void child_access (void);
|
||||
|
||||
void close_stdout (void);
|
||||
|
||||
char *strip_whitespace (const char **begpp, const char **endpp);
|
||||
|
||||
/* String caching */
|
||||
@@ -473,16 +505,13 @@ int strcache_setbufsize (unsigned int size);
|
||||
|
||||
/* Guile support */
|
||||
#ifdef HAVE_GUILE
|
||||
int guile_gmake_setup (const struct floc *flocp);
|
||||
int guile_gmake_setup (const gmk_floc *flocp);
|
||||
#endif
|
||||
|
||||
/* Loadable object support */
|
||||
typedef int (*load_func_t)(const struct floc *flocp);
|
||||
int load_file (const struct floc *flocp, const char *filename, int noerror);
|
||||
|
||||
#ifdef HAVE_VFORK_H
|
||||
# include <vfork.h>
|
||||
#endif
|
||||
/* Loadable object support. Sets to the strcached name of the loaded file. */
|
||||
typedef int (*load_func_t)(const gmk_floc *flocp);
|
||||
int load_file (const gmk_floc *flocp, const char **filename, int noerror);
|
||||
void unload_file (const char *name);
|
||||
|
||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||
because such systems often declare them in header files anyway. */
|
||||
@@ -527,18 +556,25 @@ int strncasecmp (const char *s1, const char *s2, int n);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
extern const struct floc *reading_file;
|
||||
extern const struct floc **expanding_var;
|
||||
#define OUTPUT_SYNC_NONE 0
|
||||
#define OUTPUT_SYNC_LINE 1
|
||||
#define OUTPUT_SYNC_TARGET 2
|
||||
#define OUTPUT_SYNC_RECURSE 3
|
||||
|
||||
extern const gmk_floc *reading_file;
|
||||
extern const gmk_floc **expanding_var;
|
||||
|
||||
extern char **environ;
|
||||
|
||||
extern unsigned short stopchar_map[];
|
||||
|
||||
extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
|
||||
extern int print_data_base_flag, question_flag, touch_flag, always_make_flag;
|
||||
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
|
||||
extern int print_version_flag, print_directory_flag, check_symlink_flag;
|
||||
extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
|
||||
extern int not_parallel, second_expansion, clock_skew_detected;
|
||||
extern int rebuilding_makefiles, one_shell;
|
||||
extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
|
||||
|
||||
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
||||
extern int batch_mode_shell;
|
||||
411
misc.c
411
misc.c
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous generic support functions for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,42 +14,21 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include "debug.h"
|
||||
|
||||
/* Variadic functions. We go through contortions to allow proper function
|
||||
prototypes for both ANSI and pre-ANSI C compilers, and also for those
|
||||
which support stdarg.h vs. varargs.h, and finally those which have
|
||||
vfprintf(), etc. and those who have _doprnt... or nothing.
|
||||
/* GNU make no longer supports pre-ANSI89 environments. */
|
||||
|
||||
This fancy stuff all came from GNU fileutils, except for the VA_PRINTF and
|
||||
VA_END macros used here since we have multiple print functions. */
|
||||
#include <stdarg.h>
|
||||
|
||||
#if USE_VARIADIC
|
||||
# if HAVE_STDARG_H
|
||||
# include <stdarg.h>
|
||||
# define VA_START(args, lastarg) va_start(args, lastarg)
|
||||
# else
|
||||
# include <varargs.h>
|
||||
# define VA_START(args, lastarg) va_start(args)
|
||||
# endif
|
||||
# if HAVE_VPRINTF
|
||||
# define VA_PRINTF(fp, lastarg, args) vfprintf((fp), (lastarg), (args))
|
||||
# else
|
||||
# define VA_PRINTF(fp, lastarg, args) _doprnt((lastarg), (args), (fp))
|
||||
# endif
|
||||
# define VA_END(args) va_end(args)
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#else
|
||||
/* We can't use any variadic interface! */
|
||||
# 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)
|
||||
# include <sys/file.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Compare strings *S1 and *S2.
|
||||
Return negative if the first is less, positive if it is greater,
|
||||
zero if they are equal. */
|
||||
@@ -72,9 +51,7 @@ alpha_compare (const void *v1, const void *v2)
|
||||
void
|
||||
collapse_continuations (char *line)
|
||||
{
|
||||
register char *in, *out, *p;
|
||||
register int backslash;
|
||||
register unsigned int bs_write;
|
||||
char *in, *out, *p;
|
||||
|
||||
in = strchr (line, '\n');
|
||||
if (in == 0)
|
||||
@@ -87,64 +64,64 @@ collapse_continuations (char *line)
|
||||
while (*in != '\0')
|
||||
{
|
||||
/* BS_WRITE gets the number of quoted backslashes at
|
||||
the end just before IN, and BACKSLASH gets nonzero
|
||||
if the next character is quoted. */
|
||||
backslash = 0;
|
||||
bs_write = 0;
|
||||
the end just before IN, and BACKSLASH gets nonzero
|
||||
if the next character is quoted. */
|
||||
unsigned int backslash = 0;
|
||||
unsigned int bs_write = 0;
|
||||
for (p = in - 1; p >= line && *p == '\\'; --p)
|
||||
{
|
||||
if (backslash)
|
||||
++bs_write;
|
||||
backslash = !backslash;
|
||||
{
|
||||
if (backslash)
|
||||
++bs_write;
|
||||
backslash = !backslash;
|
||||
|
||||
/* It should be impossible to go back this far without exiting,
|
||||
but if we do, we can't get the right answer. */
|
||||
if (in == out - 1)
|
||||
abort ();
|
||||
}
|
||||
/* It should be impossible to go back this far without exiting,
|
||||
but if we do, we can't get the right answer. */
|
||||
if (in == out - 1)
|
||||
abort ();
|
||||
}
|
||||
|
||||
/* Output the appropriate number of backslashes. */
|
||||
while (bs_write-- > 0)
|
||||
*out++ = '\\';
|
||||
*out++ = '\\';
|
||||
|
||||
/* Skip the newline. */
|
||||
++in;
|
||||
|
||||
if (backslash)
|
||||
{
|
||||
{
|
||||
/* Backslash/newline handling:
|
||||
In traditional GNU make all trailing whitespace, consecutive
|
||||
backslash/newlines, and any leading whitespace on the next line
|
||||
is reduced to a single space.
|
||||
In POSIX, each backslash/newline and is replaced by a space. */
|
||||
in = next_token (in);
|
||||
in = next_token (in);
|
||||
if (! posix_pedantic)
|
||||
while (out > line && isblank ((unsigned char)out[-1]))
|
||||
--out;
|
||||
*out++ = ' ';
|
||||
}
|
||||
*out++ = ' ';
|
||||
}
|
||||
else
|
||||
/* If the newline isn't quoted, put it in the output. */
|
||||
*out++ = '\n';
|
||||
/* If the newline isn't quoted, put it in the output. */
|
||||
*out++ = '\n';
|
||||
|
||||
/* Now copy the following line to the output.
|
||||
Stop when we find backslashes followed by a newline. */
|
||||
Stop when we find backslashes followed by a newline. */
|
||||
while (*in != '\0')
|
||||
if (*in == '\\')
|
||||
{
|
||||
p = in + 1;
|
||||
while (*p == '\\')
|
||||
++p;
|
||||
if (*p == '\n')
|
||||
{
|
||||
in = p;
|
||||
break;
|
||||
}
|
||||
while (in < p)
|
||||
*out++ = *in++;
|
||||
}
|
||||
else
|
||||
*out++ = *in++;
|
||||
if (*in == '\\')
|
||||
{
|
||||
p = in + 1;
|
||||
while (*p == '\\')
|
||||
++p;
|
||||
if (*p == '\n')
|
||||
{
|
||||
in = p;
|
||||
break;
|
||||
}
|
||||
while (in < p)
|
||||
*out++ = *in++;
|
||||
}
|
||||
else
|
||||
*out++ = *in++;
|
||||
}
|
||||
|
||||
*out = '\0';
|
||||
@@ -164,28 +141,19 @@ print_spaces (unsigned int n)
|
||||
This string lives in static, re-used memory. */
|
||||
|
||||
const char *
|
||||
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
|
||||
concat (unsigned int num, ...)
|
||||
#else
|
||||
concat (num, va_alist)
|
||||
unsigned int num;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
static unsigned int rlen = 0;
|
||||
static char *result = NULL;
|
||||
unsigned int ri = 0;
|
||||
|
||||
#if USE_VARIADIC
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
VA_START (args, num);
|
||||
va_start (args, num);
|
||||
|
||||
while (num-- > 0)
|
||||
{
|
||||
const char *s = va_arg (args, const char *);
|
||||
unsigned int l = s ? strlen (s) : 0;
|
||||
unsigned int l = xstrlen (s);
|
||||
|
||||
if (l == 0)
|
||||
continue;
|
||||
@@ -200,7 +168,7 @@ concat (num, va_alist)
|
||||
ri += l;
|
||||
}
|
||||
|
||||
VA_END (args);
|
||||
va_end (args);
|
||||
|
||||
/* Get some more memory if we don't have enough space for the
|
||||
terminating '\0'. */
|
||||
@@ -215,113 +183,9 @@ concat (num, va_alist)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Print a message on stdout. */
|
||||
|
||||
void
|
||||
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
|
||||
message (int prefix, const char *fmt, ...)
|
||||
#else
|
||||
message (prefix, fmt, va_alist)
|
||||
int prefix;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#if USE_VARIADIC
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
log_working_directory (1);
|
||||
|
||||
if (fmt != 0)
|
||||
{
|
||||
if (prefix)
|
||||
{
|
||||
if (makelevel == 0)
|
||||
printf ("%s: ", program);
|
||||
else
|
||||
printf ("%s[%u]: ", program, makelevel);
|
||||
}
|
||||
VA_START (args, fmt);
|
||||
VA_PRINTF (stdout, fmt, args);
|
||||
VA_END (args);
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
/* Print an error message. */
|
||||
|
||||
void
|
||||
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
|
||||
error (const struct floc *flocp, const char *fmt, ...)
|
||||
#else
|
||||
error (flocp, fmt, va_alist)
|
||||
const struct floc *flocp;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#if USE_VARIADIC
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
log_working_directory (1);
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
fprintf (stderr, "%s:%lu: ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fprintf (stderr, "%s: ", program);
|
||||
else
|
||||
fprintf (stderr, "%s[%u]: ", program, makelevel);
|
||||
|
||||
VA_START(args, fmt);
|
||||
VA_PRINTF (stderr, fmt, args);
|
||||
VA_END (args);
|
||||
|
||||
putc ('\n', stderr);
|
||||
fflush (stderr);
|
||||
}
|
||||
|
||||
/* Print an error message and exit. */
|
||||
|
||||
void
|
||||
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
|
||||
fatal (const struct floc *flocp, const char *fmt, ...)
|
||||
#else
|
||||
fatal (flocp, fmt, va_alist)
|
||||
const struct floc *flocp;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#if USE_VARIADIC
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
log_working_directory (1);
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
fprintf (stderr, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fprintf (stderr, "%s: *** ", program);
|
||||
else
|
||||
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
|
||||
|
||||
VA_START(args, fmt);
|
||||
VA_PRINTF (stderr, fmt, args);
|
||||
VA_END (args);
|
||||
|
||||
fputs (_(". Stop.\n"), stderr);
|
||||
|
||||
die (2);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRERROR
|
||||
|
||||
#undef strerror
|
||||
|
||||
#undef strerror
|
||||
char *
|
||||
strerror (int errnum)
|
||||
{
|
||||
@@ -338,24 +202,6 @@ strerror (int errnum)
|
||||
return buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Print an error message from errno. */
|
||||
|
||||
void
|
||||
perror_with_name (const char *str, const char *name)
|
||||
{
|
||||
error (NILF, _("%s%s: %s"), str, name, strerror (errno));
|
||||
}
|
||||
|
||||
/* Print an error message from errno and exit. */
|
||||
|
||||
void
|
||||
pfatal_with_name (const char *name)
|
||||
{
|
||||
fatal (NILF, _("%s: %s"), name, strerror (errno));
|
||||
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/* Like malloc but get fatal error if memory is exhausted. */
|
||||
/* Don't bother if we're using dmalloc; it provides these for us. */
|
||||
@@ -468,41 +314,11 @@ lindex (const char *s, const char *limit, int c)
|
||||
char *
|
||||
end_of_token (const char *s)
|
||||
{
|
||||
while (*s != '\0' && !isblank ((unsigned char)*s))
|
||||
while (! STOP_SET (*s, MAP_BLANK|MAP_NUL))
|
||||
++s;
|
||||
return (char *)s;
|
||||
}
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/*
|
||||
* Same as end_of_token, but take into account a stop character
|
||||
*/
|
||||
char *
|
||||
end_of_token_w32 (const char *s, char stopchar)
|
||||
{
|
||||
const char *p = s;
|
||||
int backslash = 0;
|
||||
|
||||
while (*p != '\0' && *p != stopchar
|
||||
&& (backslash || !isblank ((unsigned char)*p)))
|
||||
{
|
||||
if (*p++ == '\\')
|
||||
{
|
||||
backslash = !backslash;
|
||||
while (*p == '\\')
|
||||
{
|
||||
backslash = !backslash;
|
||||
++p;
|
||||
}
|
||||
}
|
||||
else
|
||||
backslash = 0;
|
||||
}
|
||||
|
||||
return (char *)p;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Return the address of the first nonwhitespace or null in the string S. */
|
||||
|
||||
char *
|
||||
@@ -551,9 +367,9 @@ copy_dep_chain (const struct dep *d)
|
||||
|
||||
c->next = 0;
|
||||
if (firstnew == 0)
|
||||
firstnew = lastnew = c;
|
||||
firstnew = lastnew = c;
|
||||
else
|
||||
lastnew = lastnew->next = c;
|
||||
lastnew = lastnew->next = c;
|
||||
|
||||
d = d->next;
|
||||
}
|
||||
@@ -590,7 +406,6 @@ free_ns_chain (struct nameseq *ns)
|
||||
|
||||
|
||||
#if !HAVE_STRCASECMP && !HAVE_STRICMP && !HAVE_STRCMPI
|
||||
|
||||
/* If we don't have strcasecmp() (from POSIX), or anything that can substitute
|
||||
for it, define our own version. */
|
||||
|
||||
@@ -616,7 +431,6 @@ strcasecmp (const char *s1, const char *s2)
|
||||
#endif
|
||||
|
||||
#if !HAVE_STRNCASECMP && !HAVE_STRNICMP && !HAVE_STRNCMPI
|
||||
|
||||
/* If we don't have strncasecmp() (from POSIX), or anything that can
|
||||
substitute for it, define our own version. */
|
||||
|
||||
@@ -643,7 +457,7 @@ strncasecmp (const char *s1, const char *s2, int n)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
|
||||
#ifdef POSIX
|
||||
|
||||
@@ -656,7 +470,7 @@ strncasecmp (const char *s1, const char *s2, int n)
|
||||
#undef HAVE_SETREUID
|
||||
#undef HAVE_SETREGID
|
||||
|
||||
#else /* Not POSIX. */
|
||||
#else /* Not POSIX. */
|
||||
|
||||
/* Some POSIX.1 systems have the seteuid and setegid functions. In a
|
||||
POSIX-like system, they are the best thing to use. However, some
|
||||
@@ -666,30 +480,30 @@ strncasecmp (const char *s1, const char *s2, int n)
|
||||
#undef HAVE_SETEUID
|
||||
#undef HAVE_SETEGID
|
||||
|
||||
#endif /* POSIX. */
|
||||
#endif /* POSIX. */
|
||||
|
||||
#ifndef HAVE_UNISTD_H
|
||||
#ifndef HAVE_UNISTD_H
|
||||
extern int getuid (), getgid (), geteuid (), getegid ();
|
||||
extern int setuid (), setgid ();
|
||||
#ifdef HAVE_SETEUID
|
||||
extern int seteuid ();
|
||||
#else
|
||||
#ifdef HAVE_SETREUID
|
||||
#ifdef HAVE_SETREUID
|
||||
extern int setreuid ();
|
||||
#endif /* Have setreuid. */
|
||||
#endif /* Have seteuid. */
|
||||
#endif /* Have setreuid. */
|
||||
#endif /* Have seteuid. */
|
||||
#ifdef HAVE_SETEGID
|
||||
extern int setegid ();
|
||||
#else
|
||||
#ifdef HAVE_SETREGID
|
||||
#ifdef HAVE_SETREGID
|
||||
extern int setregid ();
|
||||
#endif /* Have setregid. */
|
||||
#endif /* Have setegid. */
|
||||
#endif /* No <unistd.h>. */
|
||||
#endif /* Have setregid. */
|
||||
#endif /* Have setegid. */
|
||||
#endif /* No <unistd.h>. */
|
||||
|
||||
/* Keep track of the user and group IDs for user- and make- access. */
|
||||
static int user_uid = -1, user_gid = -1, make_uid = -1, make_gid = -1;
|
||||
#define access_inited (user_uid != -1)
|
||||
#define access_inited (user_uid != -1)
|
||||
static enum { make, user } current_access;
|
||||
|
||||
|
||||
@@ -706,7 +520,7 @@ log_access (const char *flavor)
|
||||
run in a child fork whose stdout is piped. */
|
||||
|
||||
fprintf (stderr, _("%s: user %lu (real %lu), group %lu (real %lu)\n"),
|
||||
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
|
||||
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
|
||||
(unsigned long) getegid (), (unsigned long) getgid ());
|
||||
fflush (stderr);
|
||||
}
|
||||
@@ -732,14 +546,14 @@ init_access (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
|
||||
/* Give the process appropriate permissions for access to
|
||||
user data (i.e., to stat files, or to spawn a child process). */
|
||||
void
|
||||
user_access (void)
|
||||
{
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
|
||||
if (!access_inited)
|
||||
init_access ();
|
||||
@@ -752,7 +566,7 @@ user_access (void)
|
||||
We now want to set the effective user and group IDs to the real IDs,
|
||||
which are the IDs of the process that exec'd make. */
|
||||
|
||||
#ifdef HAVE_SETEUID
|
||||
#ifdef HAVE_SETEUID
|
||||
|
||||
/* Modern systems have the seteuid/setegid calls which set only the
|
||||
effective IDs, which is ideal. */
|
||||
@@ -760,9 +574,9 @@ user_access (void)
|
||||
if (seteuid (user_uid) < 0)
|
||||
pfatal_with_name ("user_access: seteuid");
|
||||
|
||||
#else /* Not HAVE_SETEUID. */
|
||||
#else /* Not HAVE_SETEUID. */
|
||||
|
||||
#ifndef HAVE_SETREUID
|
||||
#ifndef HAVE_SETREUID
|
||||
|
||||
/* System V has only the setuid/setgid calls to set user/group IDs.
|
||||
There is an effective ID, which can be set by setuid/setgid.
|
||||
@@ -775,7 +589,7 @@ user_access (void)
|
||||
if (setuid (user_uid) < 0)
|
||||
pfatal_with_name ("user_access: setuid");
|
||||
|
||||
#else /* HAVE_SETREUID. */
|
||||
#else /* HAVE_SETREUID. */
|
||||
|
||||
/* In 4BSD, the setreuid/setregid calls set both the real and effective IDs.
|
||||
They may be set to themselves or each other. So you have two alternatives
|
||||
@@ -787,14 +601,14 @@ user_access (void)
|
||||
if (setreuid (make_uid, user_uid) < 0)
|
||||
pfatal_with_name ("user_access: setreuid");
|
||||
|
||||
#endif /* Not HAVE_SETREUID. */
|
||||
#endif /* HAVE_SETEUID. */
|
||||
#endif /* Not HAVE_SETREUID. */
|
||||
#endif /* HAVE_SETEUID. */
|
||||
|
||||
#ifdef HAVE_SETEGID
|
||||
#ifdef HAVE_SETEGID
|
||||
if (setegid (user_gid) < 0)
|
||||
pfatal_with_name ("user_access: setegid");
|
||||
#else
|
||||
#ifndef HAVE_SETREGID
|
||||
#ifndef HAVE_SETREGID
|
||||
if (setgid (user_gid) < 0)
|
||||
pfatal_with_name ("user_access: setgid");
|
||||
#else
|
||||
@@ -807,7 +621,7 @@ user_access (void)
|
||||
|
||||
log_access (_("User access"));
|
||||
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
}
|
||||
|
||||
/* Give the process appropriate permissions for access to
|
||||
@@ -815,7 +629,7 @@ user_access (void)
|
||||
void
|
||||
make_access (void)
|
||||
{
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
|
||||
if (!access_inited)
|
||||
init_access ();
|
||||
@@ -825,11 +639,11 @@ make_access (void)
|
||||
|
||||
/* See comments in user_access, above. */
|
||||
|
||||
#ifdef HAVE_SETEUID
|
||||
#ifdef HAVE_SETEUID
|
||||
if (seteuid (make_uid) < 0)
|
||||
pfatal_with_name ("make_access: seteuid");
|
||||
#else
|
||||
#ifndef HAVE_SETREUID
|
||||
#ifndef HAVE_SETREUID
|
||||
if (setuid (make_uid) < 0)
|
||||
pfatal_with_name ("make_access: setuid");
|
||||
#else
|
||||
@@ -838,11 +652,11 @@ make_access (void)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SETEGID
|
||||
#ifdef HAVE_SETEGID
|
||||
if (setegid (make_gid) < 0)
|
||||
pfatal_with_name ("make_access: setegid");
|
||||
#else
|
||||
#ifndef HAVE_SETREGID
|
||||
#ifndef HAVE_SETREGID
|
||||
if (setgid (make_gid) < 0)
|
||||
pfatal_with_name ("make_access: setgid");
|
||||
#else
|
||||
@@ -855,7 +669,7 @@ make_access (void)
|
||||
|
||||
log_access (_("Make access"));
|
||||
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
}
|
||||
|
||||
/* Give the process appropriate permissions for a child process.
|
||||
@@ -863,7 +677,7 @@ make_access (void)
|
||||
void
|
||||
child_access (void)
|
||||
{
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
#ifdef GETLOADAVG_PRIVILEGED
|
||||
|
||||
if (!access_inited)
|
||||
abort ();
|
||||
@@ -871,7 +685,7 @@ child_access (void)
|
||||
/* Set both the real and effective UID and GID to the user's.
|
||||
They cannot be changed back to make's. */
|
||||
|
||||
#ifndef HAVE_SETREUID
|
||||
#ifndef HAVE_SETREUID
|
||||
if (setuid (user_uid) < 0)
|
||||
pfatal_with_name ("child_access: setuid");
|
||||
#else
|
||||
@@ -879,7 +693,7 @@ child_access (void)
|
||||
pfatal_with_name ("child_access: setreuid");
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SETREGID
|
||||
#ifndef HAVE_SETREGID
|
||||
if (setgid (user_gid) < 0)
|
||||
pfatal_with_name ("child_access: setgid");
|
||||
#else
|
||||
@@ -889,9 +703,9 @@ child_access (void)
|
||||
|
||||
log_access (_("Child access"));
|
||||
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
#endif /* GETLOADAVG_PRIVILEGED */
|
||||
}
|
||||
|
||||
|
||||
#ifdef NEED_GET_PATH_MAX
|
||||
unsigned int
|
||||
get_path_max (void)
|
||||
@@ -902,58 +716,11 @@ get_path_max (void)
|
||||
{
|
||||
long int x = pathconf ("/", _PC_PATH_MAX);
|
||||
if (x > 0)
|
||||
value = x;
|
||||
value = x;
|
||||
else
|
||||
return MAXPATHLEN;
|
||||
return MAXPATHLEN;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* This code is stolen from gnulib.
|
||||
If/when we abandon the requirement to work with K&R compilers, we can
|
||||
remove this (and perhaps other parts of GNU make!) and migrate to using
|
||||
gnulib directly.
|
||||
|
||||
This is called only through atexit(), which means die() has already been
|
||||
invoked. So, call exit() here directly. Apparently that works...?
|
||||
*/
|
||||
|
||||
/* Close standard output, exiting with status 'exit_failure' on failure.
|
||||
If a program writes *anything* to stdout, that program should close
|
||||
stdout and make sure that it succeeds before exiting. Otherwise,
|
||||
suppose that you go to the extreme of checking the return status
|
||||
of every function that does an explicit write to stdout. The last
|
||||
printf can succeed in writing to the internal stream buffer, and yet
|
||||
the fclose(stdout) could still fail (due e.g., to a disk full error)
|
||||
when it tries to write out that buffered data. Thus, you would be
|
||||
left with an incomplete output file and the offending program would
|
||||
exit successfully. Even calling fflush is not always sufficient,
|
||||
since some file systems (NFS and CODA) buffer written/flushed data
|
||||
until an actual close call.
|
||||
|
||||
Besides, it's wasteful to check the return value from every call
|
||||
that writes to stdout -- just let the internal stream state record
|
||||
the failure. That's what the ferror test is checking below.
|
||||
|
||||
It's important to detect such failures and exit nonzero because many
|
||||
tools (most notably 'make' and other build-management systems) depend
|
||||
on being able to detect failure in other tools via their exit status. */
|
||||
|
||||
void
|
||||
close_stdout (void)
|
||||
{
|
||||
int prev_fail = ferror (stdout);
|
||||
int fclose_fail = fclose (stdout);
|
||||
|
||||
if (prev_fail || fclose_fail)
|
||||
{
|
||||
if (fclose_fail)
|
||||
error (NILF, _("write error: %s"), strerror (errno));
|
||||
else
|
||||
error (NILF, _("write error"));
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
758
output.c
Normal file
758
output.c
Normal file
@@ -0,0 +1,758 @@
|
||||
/* Output to stdout / stderr for GNU make
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "job.h"
|
||||
|
||||
/* GNU make no longer supports pre-ANSI89 environments. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#else
|
||||
# include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS32
|
||||
# include <windows.h>
|
||||
# include "sub_proc.h"
|
||||
#endif /* WINDOWS32 */
|
||||
|
||||
struct output *output_context = NULL;
|
||||
unsigned int stdio_traced = 0;
|
||||
|
||||
#define OUTPUT_NONE (-1)
|
||||
|
||||
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
|
||||
|
||||
#ifdef HAVE_FCNTL
|
||||
# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
|
||||
#else
|
||||
# define STREAM_OK(_s) 1
|
||||
#endif
|
||||
|
||||
/* I really want to move to gnulib. However, this is a big undertaking
|
||||
especially for non-UNIX platforms: how to get bootstrapping to work, etc.
|
||||
I don't want to take the time to do it right now. Use a hack to get a
|
||||
useful version of vsnprintf() for Windows. */
|
||||
#ifdef __VMS
|
||||
# define va_copy(_d, _s) ((_d) = (_s))
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
# define va_copy(_d, _s) ((_d) = (_s))
|
||||
# define snprintf msc_vsnprintf
|
||||
static int
|
||||
msc_vsnprintf (char *str, size_t size, const char *format, va_list ap)
|
||||
{
|
||||
int len = -1;
|
||||
|
||||
if (size > 0)
|
||||
len = _vsnprintf_s (str, size, _TRUNCATE, format, ap);
|
||||
if (len == -1)
|
||||
len = _vscprintf (format, ap);
|
||||
|
||||
return len;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Write a string to the current STDOUT or STDERR. */
|
||||
static void
|
||||
_outputs (struct output *out, int is_err, const char *msg)
|
||||
{
|
||||
if (! out || ! out->syncout)
|
||||
{
|
||||
FILE *f = is_err ? stderr : stdout;
|
||||
fputs (msg, f);
|
||||
fflush (f);
|
||||
}
|
||||
else
|
||||
{
|
||||
int fd = is_err ? out->err : out->out;
|
||||
int len = strlen (msg);
|
||||
int r;
|
||||
|
||||
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
|
||||
while (1)
|
||||
{
|
||||
EINTRLOOP (r, write (fd, msg, len));
|
||||
if (r == len)
|
||||
break;
|
||||
if (r <= 0)
|
||||
return;
|
||||
len -= r;
|
||||
msg += r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Write a message indicating that we've just entered or
|
||||
left (according to ENTERING) the current directory. */
|
||||
|
||||
static int
|
||||
log_working_directory (struct output *out, int entering)
|
||||
{
|
||||
static char *buf = NULL;
|
||||
static unsigned int len = 0;
|
||||
unsigned int need;
|
||||
const char *fmt;
|
||||
char *p;
|
||||
|
||||
/* Get enough space for the longest possible output. */
|
||||
need = strlen (program) + INTEGER_LENGTH + 2 + 1;
|
||||
if (starting_directory)
|
||||
need += strlen (starting_directory);
|
||||
|
||||
/* Use entire sentences to give the translators a fighting chance. */
|
||||
if (makelevel == 0)
|
||||
if (starting_directory == 0)
|
||||
if (entering)
|
||||
fmt = _("%s: Entering an unknown directory\n");
|
||||
else
|
||||
fmt = _("%s: Leaving an unknown directory\n");
|
||||
else
|
||||
if (entering)
|
||||
fmt = _("%s: Entering directory '%s'\n");
|
||||
else
|
||||
fmt = _("%s: Leaving directory '%s'\n");
|
||||
else
|
||||
if (starting_directory == 0)
|
||||
if (entering)
|
||||
fmt = _("%s[%u]: Entering an unknown directory\n");
|
||||
else
|
||||
fmt = _("%s[%u]: Leaving an unknown directory\n");
|
||||
else
|
||||
if (entering)
|
||||
fmt = _("%s[%u]: Entering directory '%s'\n");
|
||||
else
|
||||
fmt = _("%s[%u]: Leaving directory '%s'\n");
|
||||
|
||||
need += strlen (fmt);
|
||||
|
||||
if (need > len)
|
||||
{
|
||||
buf = xrealloc (buf, need);
|
||||
len = need;
|
||||
}
|
||||
|
||||
p = buf;
|
||||
if (print_data_base_flag)
|
||||
{
|
||||
*(p++) = '#';
|
||||
*(p++) = ' ';
|
||||
}
|
||||
|
||||
if (makelevel == 0)
|
||||
if (starting_directory == 0)
|
||||
sprintf (p, fmt , program);
|
||||
else
|
||||
sprintf (p, fmt, program, starting_directory);
|
||||
else if (starting_directory == 0)
|
||||
sprintf (p, fmt, program, makelevel);
|
||||
else
|
||||
sprintf (p, fmt, program, makelevel, starting_directory);
|
||||
|
||||
_outputs (out, 0, buf);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Set a file descriptor to be in O_APPEND mode.
|
||||
If it fails, just ignore it. */
|
||||
|
||||
static void
|
||||
set_append_mode (int fd)
|
||||
{
|
||||
#if defined(F_GETFL) && defined(F_SETFL) && defined(O_APPEND)
|
||||
int flags = fcntl (fd, F_GETFL, 0);
|
||||
if (flags >= 0)
|
||||
fcntl (fd, F_SETFL, flags | O_APPEND);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
|
||||
/* Semaphore for use in -j mode with output_sync. */
|
||||
static sync_handle_t sync_handle = -1;
|
||||
|
||||
#define FD_NOT_EMPTY(_f) ((_f) != OUTPUT_NONE && lseek ((_f), 0, SEEK_END) > 0)
|
||||
|
||||
/* Set up the sync handle. Disables output_sync on error. */
|
||||
static int
|
||||
sync_init ()
|
||||
{
|
||||
int combined_output = 0;
|
||||
|
||||
#ifdef WINDOWS32
|
||||
if ((!STREAM_OK (stdout) && !STREAM_OK (stderr))
|
||||
|| (sync_handle = create_mutex ()) == -1)
|
||||
{
|
||||
perror_with_name ("output-sync suppressed: ", "stderr");
|
||||
output_sync = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
combined_output = same_stream (stdout, stderr);
|
||||
prepare_mutex_handle_string (sync_handle);
|
||||
}
|
||||
|
||||
#else
|
||||
if (STREAM_OK (stdout))
|
||||
{
|
||||
struct stat stbuf_o, stbuf_e;
|
||||
|
||||
sync_handle = fileno (stdout);
|
||||
combined_output = (fstat (fileno (stdout), &stbuf_o) == 0
|
||||
&& fstat (fileno (stderr), &stbuf_e) == 0
|
||||
&& stbuf_o.st_dev == stbuf_e.st_dev
|
||||
&& stbuf_o.st_ino == stbuf_e.st_ino);
|
||||
}
|
||||
else if (STREAM_OK (stderr))
|
||||
sync_handle = fileno (stderr);
|
||||
else
|
||||
{
|
||||
perror_with_name ("output-sync suppressed: ", "stderr");
|
||||
output_sync = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return combined_output;
|
||||
}
|
||||
|
||||
/* Support routine for output_sync() */
|
||||
static void
|
||||
pump_from_tmp (int from, FILE *to)
|
||||
{
|
||||
static char buffer[8192];
|
||||
|
||||
#ifdef WINDOWS32
|
||||
int prev_mode;
|
||||
|
||||
/* "from" is opened by open_tmpfd, which does it in binary mode, so
|
||||
we need the mode of "to" to match that. */
|
||||
prev_mode = _setmode (fileno (to), _O_BINARY);
|
||||
#endif
|
||||
|
||||
if (lseek (from, 0, SEEK_SET) == -1)
|
||||
perror ("lseek()");
|
||||
|
||||
while (1)
|
||||
{
|
||||
int len;
|
||||
EINTRLOOP (len, read (from, buffer, sizeof (buffer)));
|
||||
if (len < 0)
|
||||
perror ("read()");
|
||||
if (len <= 0)
|
||||
break;
|
||||
if (fwrite (buffer, len, 1, to) < 1)
|
||||
perror ("fwrite()");
|
||||
}
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/* Switch "to" back to its original mode, so that log messages by
|
||||
Make have the same EOL format as without --output-sync. */
|
||||
_setmode (fileno (to), prev_mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Obtain the lock for writing output. */
|
||||
static void *
|
||||
acquire_semaphore (void)
|
||||
{
|
||||
static struct flock fl;
|
||||
|
||||
fl.l_type = F_WRLCK;
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 1;
|
||||
if (fcntl (sync_handle, F_SETLKW, &fl) != -1)
|
||||
return &fl;
|
||||
perror ("fcntl()");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Release the lock for writing output. */
|
||||
static void
|
||||
release_semaphore (void *sem)
|
||||
{
|
||||
struct flock *flp = (struct flock *)sem;
|
||||
flp->l_type = F_UNLCK;
|
||||
if (fcntl (sync_handle, F_SETLKW, flp) == -1)
|
||||
perror ("fcntl()");
|
||||
}
|
||||
|
||||
/* Returns a file descriptor to a temporary file. The file is automatically
|
||||
closed/deleted on exit. Don't use a FILE* stream. */
|
||||
int
|
||||
output_tmpfd ()
|
||||
{
|
||||
int fd = -1;
|
||||
FILE *tfile = tmpfile ();
|
||||
|
||||
if (! tfile)
|
||||
pfatal_with_name ("tmpfile");
|
||||
|
||||
/* Create a duplicate so we can close the stream. */
|
||||
fd = dup (fileno (tfile));
|
||||
if (fd < 0)
|
||||
pfatal_with_name ("dup");
|
||||
|
||||
fclose (tfile);
|
||||
|
||||
set_append_mode (fd);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
/* Adds file descriptors to the child structure to support output_sync; one
|
||||
for stdout and one for stderr as long as they are open. If stdout and
|
||||
stderr share a device they can share a temp file too.
|
||||
Will reset output_sync on error. */
|
||||
static void
|
||||
setup_tmpfile (struct output *out)
|
||||
{
|
||||
/* Is make's stdout going to the same place as stderr? */
|
||||
static int combined_output = -1;
|
||||
|
||||
if (combined_output < 0)
|
||||
combined_output = sync_init ();
|
||||
|
||||
if (STREAM_OK (stdout))
|
||||
{
|
||||
int fd = output_tmpfd ();
|
||||
if (fd < 0)
|
||||
goto error;
|
||||
CLOSE_ON_EXEC (fd);
|
||||
out->out = fd;
|
||||
}
|
||||
|
||||
if (STREAM_OK (stderr))
|
||||
{
|
||||
if (out->out != OUTPUT_NONE && combined_output)
|
||||
out->err = out->out;
|
||||
else
|
||||
{
|
||||
int fd = output_tmpfd ();
|
||||
if (fd < 0)
|
||||
goto error;
|
||||
CLOSE_ON_EXEC (fd);
|
||||
out->err = fd;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
/* If we failed to create a temp file, disable output sync going forward. */
|
||||
error:
|
||||
output_close (out);
|
||||
output_sync = 0;
|
||||
}
|
||||
|
||||
/* Synchronize the output of jobs in -j mode to keep the results of
|
||||
each job together. This is done by holding the results in temp files,
|
||||
one for stdout and potentially another for stderr, and only releasing
|
||||
them to "real" stdout/stderr when a semaphore can be obtained. */
|
||||
|
||||
void
|
||||
output_dump (struct output *out)
|
||||
{
|
||||
int outfd_not_empty = FD_NOT_EMPTY (out->out);
|
||||
int errfd_not_empty = FD_NOT_EMPTY (out->err);
|
||||
|
||||
if (outfd_not_empty || errfd_not_empty)
|
||||
{
|
||||
int traced = 0;
|
||||
|
||||
/* Try to acquire the semaphore. If it fails, dump the output
|
||||
unsynchronized; still better than silently discarding it.
|
||||
We want to keep this lock for as little time as possible. */
|
||||
void *sem = acquire_semaphore ();
|
||||
|
||||
/* Log the working directory for this dump. */
|
||||
if (print_directory_flag && output_sync != OUTPUT_SYNC_RECURSE)
|
||||
traced = log_working_directory (output_context, 1);
|
||||
|
||||
if (outfd_not_empty)
|
||||
pump_from_tmp (out->out, stdout);
|
||||
if (errfd_not_empty && out->err != out->out)
|
||||
pump_from_tmp (out->err, stderr);
|
||||
|
||||
if (traced)
|
||||
log_working_directory (output_context, 0);
|
||||
|
||||
/* Exit the critical section. */
|
||||
if (sem)
|
||||
release_semaphore (sem);
|
||||
|
||||
/* Truncate and reset the output, in case we use it again. */
|
||||
if (out->out != OUTPUT_NONE)
|
||||
{
|
||||
int e;
|
||||
lseek (out->out, 0, SEEK_SET);
|
||||
EINTRLOOP (e, ftruncate (out->out, 0));
|
||||
}
|
||||
if (out->err != OUTPUT_NONE && out->err != out->out)
|
||||
{
|
||||
int e;
|
||||
lseek (out->err, 0, SEEK_SET);
|
||||
EINTRLOOP (e, ftruncate (out->err, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* NO_OUTPUT_SYNC */
|
||||
|
||||
|
||||
/* Provide support for temporary files. */
|
||||
|
||||
#ifndef HAVE_STDLIB_H
|
||||
# ifdef HAVE_MKSTEMP
|
||||
int mkstemp (char *template);
|
||||
# else
|
||||
char *mktemp (char *template);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
FILE *
|
||||
output_tmpfile (char **name, const char *template)
|
||||
{
|
||||
#ifdef HAVE_FDOPEN
|
||||
int fd;
|
||||
#endif
|
||||
|
||||
#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
|
||||
}
|
||||
|
||||
|
||||
/* This code is stolen from gnulib.
|
||||
If/when we abandon the requirement to work with K&R compilers, we can
|
||||
remove this (and perhaps other parts of GNU make!) and migrate to using
|
||||
gnulib directly.
|
||||
|
||||
This is called only through atexit(), which means die() has already been
|
||||
invoked. So, call exit() here directly. Apparently that works...?
|
||||
*/
|
||||
|
||||
/* Close standard output, exiting with status 'exit_failure' on failure.
|
||||
If a program writes *anything* to stdout, that program should close
|
||||
stdout and make sure that it succeeds before exiting. Otherwise,
|
||||
suppose that you go to the extreme of checking the return status
|
||||
of every function that does an explicit write to stdout. The last
|
||||
printf can succeed in writing to the internal stream buffer, and yet
|
||||
the fclose(stdout) could still fail (due e.g., to a disk full error)
|
||||
when it tries to write out that buffered data. Thus, you would be
|
||||
left with an incomplete output file and the offending program would
|
||||
exit successfully. Even calling fflush is not always sufficient,
|
||||
since some file systems (NFS and CODA) buffer written/flushed data
|
||||
until an actual close call.
|
||||
|
||||
Besides, it's wasteful to check the return value from every call
|
||||
that writes to stdout -- just let the internal stream state record
|
||||
the failure. That's what the ferror test is checking below.
|
||||
|
||||
It's important to detect such failures and exit nonzero because many
|
||||
tools (most notably 'make' and other build-management systems) depend
|
||||
on being able to detect failure in other tools via their exit status. */
|
||||
|
||||
static void
|
||||
close_stdout (void)
|
||||
{
|
||||
int prev_fail = ferror (stdout);
|
||||
int fclose_fail = fclose (stdout);
|
||||
|
||||
if (prev_fail || fclose_fail)
|
||||
{
|
||||
if (fclose_fail)
|
||||
error (NILF, _("write error: %s"), strerror (errno));
|
||||
else
|
||||
error (NILF, _("write error"));
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
output_init (struct output *out)
|
||||
{
|
||||
if (out)
|
||||
{
|
||||
out->out = out->err = OUTPUT_NONE;
|
||||
out->syncout = !!output_sync;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Configure this instance of make. Be sure stdout is line-buffered. */
|
||||
|
||||
#ifdef HAVE_SETVBUF
|
||||
# ifdef SETVBUF_REVERSED
|
||||
setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
|
||||
# else /* setvbuf not reversed. */
|
||||
/* Some buggy systems lose if we pass 0 instead of allocating ourselves. */
|
||||
setvbuf (stdout, 0, _IOLBF, BUFSIZ);
|
||||
# endif /* setvbuf reversed. */
|
||||
#elif HAVE_SETLINEBUF
|
||||
setlinebuf (stdout);
|
||||
#endif /* setlinebuf missing. */
|
||||
|
||||
/* Force stdout/stderr into append mode. This ensures parallel jobs won't
|
||||
lose output due to overlapping writes. */
|
||||
set_append_mode (fileno (stdout));
|
||||
set_append_mode (fileno (stderr));
|
||||
|
||||
#ifdef HAVE_ATEXIT
|
||||
if (STREAM_OK (stdout))
|
||||
atexit (close_stdout);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
output_close (struct output *out)
|
||||
{
|
||||
if (! out)
|
||||
{
|
||||
if (stdio_traced)
|
||||
log_working_directory (NULL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
output_dump (out);
|
||||
#endif
|
||||
|
||||
if (out->out >= 0)
|
||||
close (out->out);
|
||||
if (out->err >= 0 && out->err != out->out)
|
||||
close (out->err);
|
||||
|
||||
output_init (out);
|
||||
}
|
||||
|
||||
/* We're about to generate output: be sure it's set up. */
|
||||
void
|
||||
output_start ()
|
||||
{
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
if (output_context && output_context->syncout && ! OUTPUT_ISSET(output_context))
|
||||
setup_tmpfile (output_context);
|
||||
#endif
|
||||
|
||||
if (! output_context || output_sync == OUTPUT_SYNC_RECURSE)
|
||||
{
|
||||
if (! stdio_traced && print_directory_flag)
|
||||
stdio_traced = log_working_directory (NULL, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
outputs (int is_err, const char *msg)
|
||||
{
|
||||
if (! msg || *msg == '\0')
|
||||
return;
|
||||
|
||||
output_start ();
|
||||
|
||||
_outputs (output_context, is_err, msg);
|
||||
}
|
||||
|
||||
|
||||
/* Return formatted string buffers.
|
||||
If we move to gnulib we can use vasnprintf() etc. to make this simpler.
|
||||
Note these functions use a static buffer, so each call overwrites the
|
||||
results of the previous call. */
|
||||
|
||||
static struct fmtstring
|
||||
{
|
||||
char *buffer;
|
||||
unsigned int size;
|
||||
unsigned int len;
|
||||
} fmtbuf = { NULL, 0, 0 };
|
||||
|
||||
/* Concatenate a formatted string onto the format buffer. */
|
||||
static const char *
|
||||
vfmtconcat (const char *fmt, va_list args)
|
||||
{
|
||||
va_list vcopy;
|
||||
int tot;
|
||||
int unused = fmtbuf.size - fmtbuf.len;
|
||||
|
||||
va_copy (vcopy, args);
|
||||
|
||||
tot = vsnprintf (&fmtbuf.buffer[fmtbuf.len], unused, fmt, args);
|
||||
assert (tot >= 0);
|
||||
|
||||
if (tot >= unused)
|
||||
{
|
||||
fmtbuf.size += tot * 2;
|
||||
fmtbuf.buffer = xrealloc (fmtbuf.buffer, fmtbuf.size);
|
||||
|
||||
unused = fmtbuf.size - fmtbuf.len;
|
||||
tot = vsnprintf (&fmtbuf.buffer[fmtbuf.len], unused, fmt, vcopy);
|
||||
}
|
||||
|
||||
va_end (vcopy);
|
||||
|
||||
fmtbuf.len += tot;
|
||||
|
||||
return fmtbuf.buffer;
|
||||
}
|
||||
|
||||
static const char *
|
||||
fmtconcat (const char *fmt, ...)
|
||||
{
|
||||
const char *p;
|
||||
va_list args;
|
||||
|
||||
va_start (args, fmt);
|
||||
p = vfmtconcat (fmt, args);
|
||||
va_end (args);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Print a message on stdout. */
|
||||
|
||||
void
|
||||
message (int prefix, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
assert (fmt != NULL);
|
||||
|
||||
fmtbuf.len = 0;
|
||||
|
||||
if (prefix)
|
||||
{
|
||||
if (makelevel == 0)
|
||||
fmtconcat ("%s: ", program);
|
||||
else
|
||||
fmtconcat ("%s[%u]: ", program, makelevel);
|
||||
}
|
||||
|
||||
va_start (args, fmt);
|
||||
vfmtconcat (fmt, args);
|
||||
va_end (args);
|
||||
|
||||
fmtconcat ("\n");
|
||||
|
||||
outputs (0, fmtbuf.buffer);
|
||||
}
|
||||
|
||||
/* Print an error message. */
|
||||
|
||||
void
|
||||
error (const gmk_floc *flocp, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
assert (fmt != NULL);
|
||||
|
||||
fmtbuf.len = 0;
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
fmtconcat ("%s:%lu: ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fmtconcat ("%s: ", program);
|
||||
else
|
||||
fmtconcat ("%s[%u]: ", program, makelevel);
|
||||
|
||||
va_start (args, fmt);
|
||||
vfmtconcat (fmt, args);
|
||||
va_end (args);
|
||||
|
||||
fmtconcat ("\n");
|
||||
|
||||
outputs (1, fmtbuf.buffer);
|
||||
}
|
||||
|
||||
/* Print an error message and exit. */
|
||||
|
||||
void
|
||||
fatal (const gmk_floc *flocp, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
assert (fmt != NULL);
|
||||
|
||||
fmtbuf.len = 0;
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
fmtconcat ("%s:%lu: *** ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fmtconcat ("%s: *** ", program);
|
||||
else
|
||||
fmtconcat ("%s[%u]: *** ", program, makelevel);
|
||||
|
||||
va_start (args, fmt);
|
||||
vfmtconcat (fmt, args);
|
||||
va_end (args);
|
||||
|
||||
fmtconcat (_(". Stop.\n"));
|
||||
outputs (1, fmtbuf.buffer);
|
||||
|
||||
die (2);
|
||||
}
|
||||
|
||||
/* Print an error message from errno. */
|
||||
|
||||
void
|
||||
perror_with_name (const char *str, const char *name)
|
||||
{
|
||||
error (NILF, _("%s%s: %s"), str, name, strerror (errno));
|
||||
}
|
||||
|
||||
/* Print an error message from errno and exit. */
|
||||
|
||||
void
|
||||
pfatal_with_name (const char *name)
|
||||
{
|
||||
fatal (NILF, _("%s: %s"), name, strerror (errno));
|
||||
|
||||
/* NOTREACHED */
|
||||
}
|
||||
51
output.h
Normal file
51
output.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* Output to stdout / stderr for GNU make
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
struct output
|
||||
{
|
||||
int out;
|
||||
int err;
|
||||
unsigned int syncout:1; /* True if we want to synchronize output. */
|
||||
};
|
||||
|
||||
extern struct output *output_context;
|
||||
extern unsigned int stdio_traced;
|
||||
|
||||
#define OUTPUT_SET(_new) do{ output_context = (_new)->syncout ? (_new) : NULL; }while(0)
|
||||
#define OUTPUT_UNSET() do{ output_context = NULL; }while(0)
|
||||
|
||||
#define OUTPUT_TRACED() do{ stdio_traced = 1; }while(0)
|
||||
#define OUTPUT_IS_TRACED() (!!stdio_traced)
|
||||
|
||||
FILE *output_tmpfile (char **, const char *);
|
||||
|
||||
/* Initialize and close a child output structure: if NULL do this program's
|
||||
output (this should only be done once). */
|
||||
void output_init (struct output *out);
|
||||
void output_close (struct output *out);
|
||||
|
||||
/* In situations where output may be about to be displayed but we're not
|
||||
sure if we've set it up yet, call this. */
|
||||
void output_start (void);
|
||||
|
||||
/* Show a message on stdout or stderr. Will start the output if needed. */
|
||||
void outputs (int is_err, const char *msg);
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
int output_tmpfd (void);
|
||||
/* Dump any child output content to stdout, and reset it. */
|
||||
void output_dump (struct output *out);
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
*.gmo *.mo *.pot *.po
|
||||
|
||||
Makefile Makefile.in Makefile.in.in Makevars.template
|
||||
Rules-quot stamp-po
|
||||
*.sed *.sin *.header
|
||||
POTFILES
|
||||
15
po/.gitignore
vendored
Normal file
15
po/.gitignore
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
Makefile.in.in
|
||||
Makevars.template
|
||||
POTFILES
|
||||
Rules-quot
|
||||
boldquot.sed
|
||||
en@boldquot.header
|
||||
en@quot.header
|
||||
insert-header.sin
|
||||
make.pot
|
||||
quot.sed
|
||||
remove-potcdate.sin
|
||||
remove-potcdate.sed
|
||||
stamp-po
|
||||
*.gmo
|
||||
*.po
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
* POTFILES.in, LINGUAS, Makevars: Created.
|
||||
|
||||
Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# This is a -*-Makefile-*-
|
||||
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# List of source files containing translatable strings.
|
||||
# Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -27,9 +27,11 @@ guile.c
|
||||
hash.c
|
||||
implicit.c
|
||||
job.c
|
||||
job.h
|
||||
load.c
|
||||
main.c
|
||||
misc.c
|
||||
output.c
|
||||
read.c
|
||||
remake.c
|
||||
remote-cstms.c
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
@echo Windows32 CVS build preparation of config.h.W32 and NMakefile.
|
||||
@echo Windows32 SCM build preparation of config.h.W32 and NMakefile.
|
||||
if not exist config.h.W32 copy config.h.W32.template config.h.W32
|
||||
if not exist config.h copy config.h.W32 config.h
|
||||
if not exist NMakefile copy NMakefile.template NMakefile
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Please do not send bug reports or questions about it to
|
||||
the Make maintainers.
|
||||
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -18,8 +18,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "job.h"
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
#include "commands.h"
|
||||
#include "job.h"
|
||||
@@ -34,7 +33,7 @@ char *remote_description = "Customs";
|
||||
|
||||
/* File name of the Customs 'export' client command.
|
||||
A full path name can be used to avoid some path-searching overhead. */
|
||||
#define EXPORT_COMMAND "/usr/local/bin/export"
|
||||
#define EXPORT_COMMAND "/usr/local/bin/export"
|
||||
|
||||
/* ExportPermit gotten by start_remote_job_p, and used by start_remote_job. */
|
||||
static ExportPermit permit;
|
||||
@@ -76,11 +75,11 @@ start_remote_job_p (int first_p)
|
||||
}
|
||||
|
||||
/* For secure Customs, make is installed setuid root and
|
||||
Customs requires a privileged source port be used. */
|
||||
Customs requires a privileged source port be used. */
|
||||
make_access ();
|
||||
|
||||
if (ISDB (DB_JOBS))
|
||||
Rpc_Debug(1);
|
||||
Rpc_Debug (1);
|
||||
|
||||
/* Ping the daemon once to see if it is there. */
|
||||
inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1;
|
||||
@@ -89,20 +88,20 @@ start_remote_job_p (int first_p)
|
||||
user_access ();
|
||||
|
||||
if (starting_directory == 0)
|
||||
/* main couldn't figure it out. */
|
||||
inited = -1;
|
||||
/* main couldn't figure it out. */
|
||||
inited = -1;
|
||||
else
|
||||
{
|
||||
/* Normalize the current directory path name to something
|
||||
that should work on all machines exported to. */
|
||||
{
|
||||
/* Normalize the current directory path name to something
|
||||
that should work on all machines exported to. */
|
||||
|
||||
normalized_cwd = xmalloc (GET_PATH_MAX);
|
||||
strcpy (normalized_cwd, starting_directory);
|
||||
if (Customs_NormPath (normalized_cwd, GET_PATH_MAX) < 0)
|
||||
/* Path normalization failure means using Customs
|
||||
won't work, but it's not really an error. */
|
||||
inited = -1;
|
||||
}
|
||||
normalized_cwd = xmalloc (GET_PATH_MAX);
|
||||
strcpy (normalized_cwd, starting_directory);
|
||||
if (Customs_NormPath (normalized_cwd, GET_PATH_MAX) < 0)
|
||||
/* Path normalization failure means using Customs
|
||||
won't work, but it's not really an error. */
|
||||
inited = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (inited < 0)
|
||||
@@ -110,7 +109,7 @@ start_remote_job_p (int first_p)
|
||||
|
||||
njobs = job_slots_used;
|
||||
if (!first_p)
|
||||
njobs -= 1; /* correction for being called from reap_children() */
|
||||
njobs -= 1; /* correction for being called from reap_children() */
|
||||
|
||||
/* the first job should run locally, or, if the -l flag is given, we use
|
||||
that as clue as to how many local jobs should be scheduled locally */
|
||||
@@ -171,7 +170,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
|
||||
|
||||
/* Create a WayBill to give to the server. */
|
||||
len = Customs_MakeWayBill (&permit, normalized_cwd, argv[0], argv,
|
||||
envp, retport, waybill);
|
||||
envp, retport, waybill);
|
||||
|
||||
/* Modify the waybill as if the remote child had done 'child_access ()'. */
|
||||
{
|
||||
@@ -187,11 +186,11 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
|
||||
sin.sin_port = htons (Customs_Port ());
|
||||
sin.sin_addr = permit.addr;
|
||||
status = Rpc_Call (sock, &sin, (Rpc_Proc) CUSTOMS_IMPORT,
|
||||
len, (Rpc_Opaque) waybill,
|
||||
sizeof(msg), (Rpc_Opaque) msg,
|
||||
1, &timeout);
|
||||
len, (Rpc_Opaque) waybill,
|
||||
sizeof (msg), (Rpc_Opaque) msg,
|
||||
1, &timeout);
|
||||
|
||||
host = gethostbyaddr((char *)&permit.addr, sizeof(permit.addr), AF_INET);
|
||||
host = gethostbyaddr ((char *)&permit.addr, sizeof(permit.addr), AF_INET);
|
||||
|
||||
if (status != RPC_SUCCESS)
|
||||
{
|
||||
@@ -214,18 +213,18 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
|
||||
else
|
||||
{
|
||||
error (NILF, "*** exported to %s (id %u)",
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
permit.id);
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
permit.id);
|
||||
}
|
||||
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
|
||||
pid = vfork ();
|
||||
pid = fork ();
|
||||
if (pid < 0)
|
||||
{
|
||||
/* The fork failed! */
|
||||
perror_with_name ("vfork", "");
|
||||
perror_with_name ("fork", "");
|
||||
return 1;
|
||||
}
|
||||
else if (pid == 0)
|
||||
@@ -233,7 +232,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
|
||||
/* Child side. Run 'export' to handle the connection. */
|
||||
static char sock_buf[20], retsock_buf[20], id_buf[20];
|
||||
static char *new_argv[6] =
|
||||
{ EXPORT_COMMAND, "-id", sock_buf, retsock_buf, id_buf, 0 };
|
||||
{ EXPORT_COMMAND, "-id", sock_buf, retsock_buf, id_buf, 0 };
|
||||
|
||||
/* Set up the arguments. */
|
||||
(void) sprintf (sock_buf, "%d", sock);
|
||||
@@ -242,7 +241,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
|
||||
|
||||
/* Get the right stdin. */
|
||||
if (stdin_fd != 0)
|
||||
(void) dup2 (stdin_fd, 0);
|
||||
(void) dup2 (stdin_fd, 0);
|
||||
|
||||
/* Unblock signals in the child. */
|
||||
unblock_sigs ();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Template for the remote job exportation interface to GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
|
||||
194
rule.c
194
rule.c
@@ -1,5 +1,5 @@
|
||||
/* Pattern and suffix rule internals for GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,12 +14,12 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "dep.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include "job.h"
|
||||
#include "commands.h"
|
||||
#include "variable.h"
|
||||
@@ -70,7 +70,7 @@ count_implicit_rule_limits (void)
|
||||
{
|
||||
char *name;
|
||||
int namelen;
|
||||
struct rule *rule, *lastrule;
|
||||
struct rule *rule;
|
||||
|
||||
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
|
||||
max_pattern_dep_length = 0;
|
||||
@@ -78,7 +78,6 @@ count_implicit_rule_limits (void)
|
||||
name = 0;
|
||||
namelen = 0;
|
||||
rule = pattern_rules;
|
||||
lastrule = 0;
|
||||
while (rule != 0)
|
||||
{
|
||||
unsigned int ndeps = 0;
|
||||
@@ -88,10 +87,10 @@ count_implicit_rule_limits (void)
|
||||
++num_pattern_rules;
|
||||
|
||||
if (rule->num > max_pattern_targets)
|
||||
max_pattern_targets = rule->num;
|
||||
max_pattern_targets = rule->num;
|
||||
|
||||
for (dep = rule->deps; dep != 0; dep = dep->next)
|
||||
{
|
||||
{
|
||||
const char *dname = dep_name (dep);
|
||||
unsigned int len = strlen (dname);
|
||||
|
||||
@@ -107,38 +106,37 @@ count_implicit_rule_limits (void)
|
||||
#endif
|
||||
ndeps++;
|
||||
|
||||
if (len > max_pattern_dep_length)
|
||||
max_pattern_dep_length = len;
|
||||
if (len > max_pattern_dep_length)
|
||||
max_pattern_dep_length = len;
|
||||
|
||||
if (p != 0 && p2 > p)
|
||||
{
|
||||
/* There is a slash before the % in the dep name.
|
||||
Extract the directory name. */
|
||||
if (p == dname)
|
||||
++p;
|
||||
if (p - dname > namelen)
|
||||
{
|
||||
namelen = p - dname;
|
||||
name = xrealloc (name, namelen + 1);
|
||||
}
|
||||
memcpy (name, dname, p - dname);
|
||||
name[p - dname] = '\0';
|
||||
if (p != 0 && p2 > p)
|
||||
{
|
||||
/* There is a slash before the % in the dep name.
|
||||
Extract the directory name. */
|
||||
if (p == dname)
|
||||
++p;
|
||||
if (p - dname > namelen)
|
||||
{
|
||||
namelen = p - dname;
|
||||
name = xrealloc (name, namelen + 1);
|
||||
}
|
||||
memcpy (name, dname, p - dname);
|
||||
name[p - dname] = '\0';
|
||||
|
||||
/* In the deps of an implicit rule the 'changed' flag
|
||||
actually indicates that the dependency is in a
|
||||
nonexistent subdirectory. */
|
||||
/* In the deps of an implicit rule the 'changed' flag
|
||||
actually indicates that the dependency is in a
|
||||
nonexistent subdirectory. */
|
||||
|
||||
dep->changed = !dir_file_exists_p (name, "");
|
||||
}
|
||||
else
|
||||
/* This dependency does not reside in a subdirectory. */
|
||||
dep->changed = 0;
|
||||
}
|
||||
dep->changed = !dir_file_exists_p (name, "");
|
||||
}
|
||||
else
|
||||
/* This dependency does not reside in a subdirectory. */
|
||||
dep->changed = 0;
|
||||
}
|
||||
|
||||
if (ndeps > max_pattern_deps)
|
||||
max_pattern_deps = ndeps;
|
||||
max_pattern_deps = ndeps;
|
||||
|
||||
lastrule = rule;
|
||||
rule = next;
|
||||
}
|
||||
|
||||
@@ -219,7 +217,7 @@ convert_to_pattern (void)
|
||||
{
|
||||
unsigned int l = strlen (dep_name (d));
|
||||
if (l > maxsuffix)
|
||||
maxsuffix = l;
|
||||
maxsuffix = l;
|
||||
}
|
||||
|
||||
/* Space to construct the suffix rule target name. */
|
||||
@@ -230,12 +228,12 @@ convert_to_pattern (void)
|
||||
unsigned int slen;
|
||||
|
||||
/* Make a rule that is just the suffix, with no deps or commands.
|
||||
This rule exists solely to disqualify match-anything rules. */
|
||||
This rule exists solely to disqualify match-anything rules. */
|
||||
convert_suffix_rule (dep_name (d), 0, 0);
|
||||
|
||||
if (d->file->cmds != 0)
|
||||
/* Record a pattern for this suffix's null-suffix rule. */
|
||||
convert_suffix_rule ("", dep_name (d), d->file->cmds);
|
||||
/* Record a pattern for this suffix's null-suffix rule. */
|
||||
convert_suffix_rule ("", dep_name (d), d->file->cmds);
|
||||
|
||||
/* Add every other suffix to this one and see if it exists as a
|
||||
two-suffix rule. */
|
||||
@@ -243,32 +241,32 @@ convert_to_pattern (void)
|
||||
memcpy (rulename, dep_name (d), slen);
|
||||
|
||||
for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next)
|
||||
{
|
||||
{
|
||||
struct file *f;
|
||||
unsigned int s2len;
|
||||
|
||||
s2len = strlen (dep_name (d2));
|
||||
s2len = strlen (dep_name (d2));
|
||||
|
||||
/* Can't build something from itself. */
|
||||
if (slen == s2len && streq (dep_name (d), dep_name (d2)))
|
||||
continue;
|
||||
if (slen == s2len && streq (dep_name (d), dep_name (d2)))
|
||||
continue;
|
||||
|
||||
memcpy (rulename + slen, dep_name (d2), s2len + 1);
|
||||
f = lookup_file (rulename);
|
||||
if (f == 0 || f->cmds == 0)
|
||||
continue;
|
||||
memcpy (rulename + slen, dep_name (d2), s2len + 1);
|
||||
f = lookup_file (rulename);
|
||||
if (f == 0 || f->cmds == 0)
|
||||
continue;
|
||||
|
||||
if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a')
|
||||
/* A suffix rule '.X.a:' generates the pattern rule '(%.o): %.X'.
|
||||
It also generates a normal '%.a: %.X' rule below. */
|
||||
convert_suffix_rule (NULL, /* Indicates '(%.o)'. */
|
||||
dep_name (d),
|
||||
f->cmds);
|
||||
if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a')
|
||||
/* A suffix rule '.X.a:' generates the pattern rule '(%.o): %.X'.
|
||||
It also generates a normal '%.a: %.X' rule below. */
|
||||
convert_suffix_rule (NULL, /* Indicates '(%.o)'. */
|
||||
dep_name (d),
|
||||
f->cmds);
|
||||
|
||||
/* The suffix rule '.X.Y:' is converted
|
||||
to the pattern rule '%.Y: %.X'. */
|
||||
convert_suffix_rule (dep_name (d2), dep_name (d), f->cmds);
|
||||
}
|
||||
/* The suffix rule '.X.Y:' is converted
|
||||
to the pattern rule '%.Y: %.X'. */
|
||||
convert_suffix_rule (dep_name (d2), dep_name (d), f->cmds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,42 +294,42 @@ new_pattern_rule (struct rule *rule, int override)
|
||||
for (r = pattern_rules; r != 0; lastrule = r, r = r->next)
|
||||
for (i = 0; i < rule->num; ++i)
|
||||
{
|
||||
for (j = 0; j < r->num; ++j)
|
||||
if (!streq (rule->targets[i], r->targets[j]))
|
||||
break;
|
||||
for (j = 0; j < r->num; ++j)
|
||||
if (!streq (rule->targets[i], r->targets[j]))
|
||||
break;
|
||||
/* If all the targets matched... */
|
||||
if (j == r->num)
|
||||
{
|
||||
struct dep *d, *d2;
|
||||
for (d = rule->deps, d2 = r->deps;
|
||||
d != 0 && d2 != 0; d = d->next, d2 = d2->next)
|
||||
if (!streq (dep_name (d), dep_name (d2)))
|
||||
break;
|
||||
if (d == 0 && d2 == 0)
|
||||
{
|
||||
/* All the dependencies matched. */
|
||||
if (override)
|
||||
{
|
||||
/* Remove the old rule. */
|
||||
freerule (r, lastrule);
|
||||
/* Install the new one. */
|
||||
if (pattern_rules == 0)
|
||||
pattern_rules = rule;
|
||||
else
|
||||
last_pattern_rule->next = rule;
|
||||
last_pattern_rule = rule;
|
||||
if (j == r->num)
|
||||
{
|
||||
struct dep *d, *d2;
|
||||
for (d = rule->deps, d2 = r->deps;
|
||||
d != 0 && d2 != 0; d = d->next, d2 = d2->next)
|
||||
if (!streq (dep_name (d), dep_name (d2)))
|
||||
break;
|
||||
if (d == 0 && d2 == 0)
|
||||
{
|
||||
/* All the dependencies matched. */
|
||||
if (override)
|
||||
{
|
||||
/* Remove the old rule. */
|
||||
freerule (r, lastrule);
|
||||
/* Install the new one. */
|
||||
if (pattern_rules == 0)
|
||||
pattern_rules = rule;
|
||||
else
|
||||
last_pattern_rule->next = rule;
|
||||
last_pattern_rule = rule;
|
||||
|
||||
/* We got one. Stop looking. */
|
||||
goto matched;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The old rule stays intact. Destroy the new one. */
|
||||
freerule (rule, (struct rule *) 0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* We got one. Stop looking. */
|
||||
goto matched;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The old rule stays intact. Destroy the new one. */
|
||||
freerule (rule, (struct rule *) 0);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matched:;
|
||||
@@ -340,9 +338,9 @@ new_pattern_rule (struct rule *rule, int override)
|
||||
{
|
||||
/* There was no rule to replace. */
|
||||
if (pattern_rules == 0)
|
||||
pattern_rules = rule;
|
||||
pattern_rules = rule;
|
||||
else
|
||||
last_pattern_rule->next = rule;
|
||||
last_pattern_rule->next = rule;
|
||||
last_pattern_rule = rule;
|
||||
}
|
||||
|
||||
@@ -375,7 +373,7 @@ install_pattern_rule (struct pspec *p, int terminal)
|
||||
++r->suffixes[0];
|
||||
|
||||
ptr = p->dep;
|
||||
r->deps = PARSE_FILE_SEQ (&ptr, struct dep, '\0', NULL, 0);
|
||||
r->deps = PARSE_SIMPLE_SEQ (&ptr, struct dep);
|
||||
|
||||
if (new_pattern_rule (r, 0))
|
||||
{
|
||||
@@ -384,7 +382,7 @@ install_pattern_rule (struct pspec *p, int terminal)
|
||||
r->cmds->fileinfo.filenm = 0;
|
||||
r->cmds->fileinfo.lineno = 0;
|
||||
/* These will all be string literals, but we malloc space for them
|
||||
anyway because somebody might want to free them later. */
|
||||
anyway because somebody might want to free them later. */
|
||||
r->cmds->commands = xstrdup (p->commands);
|
||||
r->cmds->command_lines = 0;
|
||||
r->cmds->recipe_prefix = RECIPEPREFIX_DEFAULT;
|
||||
@@ -470,7 +468,7 @@ create_pattern_rule (const char **targets, const char **target_percents,
|
||||
|
||||
/* Print the data base of rules. */
|
||||
|
||||
static void /* Useful to call from gdb. */
|
||||
static void /* Useful to call from gdb. */
|
||||
print_rule (struct rule *r)
|
||||
{
|
||||
unsigned int i;
|
||||
@@ -506,7 +504,7 @@ print_rule_data_base (void)
|
||||
print_rule (r);
|
||||
|
||||
if (r->terminal)
|
||||
++terminal;
|
||||
++terminal;
|
||||
}
|
||||
|
||||
if (rules == 0)
|
||||
@@ -514,12 +512,12 @@ print_rule_data_base (void)
|
||||
else
|
||||
{
|
||||
printf (_("\n# %u implicit rules, %u"), rules, terminal);
|
||||
#ifndef NO_FLOAT
|
||||
#ifndef NO_FLOAT
|
||||
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
|
||||
#else
|
||||
{
|
||||
int f = (terminal * 1000 + 5) / rules;
|
||||
printf (" (%d.%d%%)", f/10, f%10);
|
||||
int f = (terminal * 1000 + 5) / rules;
|
||||
printf (" (%d.%d%%)", f/10, f%10);
|
||||
}
|
||||
#endif
|
||||
puts (_(" terminal."));
|
||||
|
||||
16
rule.h
16
rule.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for using pattern rules in GNU Make.
|
||||
Copyright (C) 1988-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -20,14 +20,14 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
struct rule
|
||||
{
|
||||
struct rule *next;
|
||||
const char **targets; /* Targets of the rule. */
|
||||
unsigned int *lens; /* Lengths of each target. */
|
||||
const char **suffixes; /* Suffixes (after '%') of each target. */
|
||||
struct dep *deps; /* Dependencies of the rule. */
|
||||
struct commands *cmds; /* Commands to execute. */
|
||||
const char **targets; /* Targets of the rule. */
|
||||
unsigned int *lens; /* Lengths of each target. */
|
||||
const char **suffixes; /* Suffixes (after '%') of each target. */
|
||||
struct dep *deps; /* Dependencies of the rule. */
|
||||
struct commands *cmds; /* Commands to execute. */
|
||||
unsigned short num; /* Number of targets. */
|
||||
char terminal; /* If terminal (double-colon). */
|
||||
char in_use; /* If in use by a parent pattern_search. */
|
||||
char terminal; /* If terminal (double-colon). */
|
||||
char in_use; /* If in use by a parent pattern_search. */
|
||||
};
|
||||
|
||||
/* For calling install_pattern_rule. */
|
||||
|
||||
22
signame.c
22
signame.c
@@ -1,5 +1,5 @@
|
||||
/* Convert between signal names and numbers.
|
||||
Copyright (C) 1990-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
/* If the system provides strsignal, we don't need it. */
|
||||
|
||||
@@ -27,11 +27,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#if !HAVE_DECL_SYS_SIGLIST
|
||||
|
||||
/* Some systems do not define NSIG in <signal.h>. */
|
||||
#ifndef NSIG
|
||||
#ifdef _NSIG
|
||||
#define NSIG _NSIG
|
||||
#ifndef NSIG
|
||||
#ifdef _NSIG
|
||||
#define NSIG _NSIG
|
||||
#else
|
||||
#define NSIG 32
|
||||
#define NSIG 32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -192,10 +192,10 @@ signame_init (void)
|
||||
init_sig (SIGURG, "URG", _("Urgent I/O condition"));
|
||||
#endif
|
||||
#if defined (SIGIO)
|
||||
/* "I/O pending" has also been suggested. A disadvantage is
|
||||
that signal only happens when the process has
|
||||
asked for it, not everytime I/O is pending. Another disadvantage
|
||||
is the confusion from giving it a different name than under Unix. */
|
||||
/* "I/O pending" has also been suggested. A disadvantage is that signal
|
||||
only happens when the process has asked for it, not every time I/O is
|
||||
pending. Another disadvantage is the confusion from giving it a
|
||||
different name than under Unix. */
|
||||
init_sig (SIGIO, "IO", _("I/O possible"));
|
||||
#endif
|
||||
#if defined (SIGWIND)
|
||||
@@ -244,7 +244,7 @@ strsignal (int sig)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (sig > 0 || sig < NSIG)
|
||||
if (sig > 0 && sig < NSIG)
|
||||
return (char *) sys_siglist[sig];
|
||||
|
||||
sprintf (buf, "Signal %d", sig);
|
||||
|
||||
10
strcache.c
10
strcache.c
@@ -1,5 +1,5 @@
|
||||
/* Constant string caching for GNU Make.
|
||||
Copyright (C) 2006-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "make.h"
|
||||
#include "makeint.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <assert.h>
|
||||
@@ -57,7 +57,7 @@ static unsigned long total_size = 0;
|
||||
that this doesn't seem to be much of an issue in practice.
|
||||
*/
|
||||
static struct strcache *
|
||||
new_cache()
|
||||
new_cache ()
|
||||
{
|
||||
struct strcache *new;
|
||||
new = xmalloc (bufsize + CACHE_BUFFER_OFFSET);
|
||||
@@ -208,7 +208,7 @@ strcache_add_len (const char *str, unsigned int len)
|
||||
}
|
||||
|
||||
int
|
||||
strcache_setbufsize(unsigned int size)
|
||||
strcache_setbufsize (unsigned int size)
|
||||
{
|
||||
if (size > bufsize)
|
||||
bufsize = size;
|
||||
@@ -233,7 +233,7 @@ strcache_print_stats (const char *prefix)
|
||||
|
||||
if (! strcache)
|
||||
{
|
||||
printf(_("\n%s No strcache buffers\n"), prefix);
|
||||
printf (_("\n%s No strcache buffers\n"), prefix);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1996-2012 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
work
|
||||
.*gdbinit
|
||||
.gdb_history
|
||||
1
tests/.gitignore
vendored
Normal file
1
tests/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
work
|
||||
189
tests/ChangeLog
189
tests/ChangeLog
@@ -1,3 +1,180 @@
|
||||
2013-09-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/se_implicit: Verify that order-only tokens
|
||||
inside second expansion are parsed correctly.
|
||||
Test for Savannah bug #31155.
|
||||
|
||||
* run_make_tests.pl (set_more_defaults): If we can't find
|
||||
gnumake.h based on the make program we might be running from a
|
||||
remote build directory. Parse the Makefile for the right path.
|
||||
|
||||
Fix some test issues on Solaris.
|
||||
|
||||
* scripts/features/archives: Determine what output ar gives when
|
||||
adding and replacing objects and compare with that.
|
||||
* scripts/features/escape: Solaris /bin/sh doesn't properly handle
|
||||
backslashes inside single quotes, so don't rely on it.
|
||||
* scripts/features/output-sync: false(1) gives different exit
|
||||
codes on different systems; use "exit 1" instead.
|
||||
* scripts/features/parallelism: Increase the timeout for slower systems.
|
||||
|
||||
2013-09-21 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/archives: Some versions of ar (MacOSX) generate
|
||||
different output when creating archives. Run it and verify the
|
||||
real output.
|
||||
* scripts/features/default_names: MacOSX is, like Windows,
|
||||
case-preserving / case-insensitive. Redo the test to avoid
|
||||
checking for "UNIX".
|
||||
* test_driver.pl (attach_default_output): Don't dup stdout into
|
||||
stderr. Reported by Denis Excoffier <bug-tar@Denis-Excoffier.org>
|
||||
|
||||
* scripts/features/se_explicit: Fix a test that behaves
|
||||
differently with/without archive capability enabled.
|
||||
* scripts/features/output-sync: Don't test output-sync if it's not
|
||||
enabled. We also skip it if parallelism is not enabled, although
|
||||
strictly speaking some of the output-sync tests are valid even
|
||||
without parallelism.
|
||||
* scripts/features/jobserver: Move some tests that require the
|
||||
jobserver from features/parallelism to a separate suite. Only run
|
||||
this if jobserver mode is enabled.
|
||||
|
||||
* scripts/features/output-sync: Test shell functions writing to
|
||||
stderr in recipes: ensure it's captured via output-sync. Test
|
||||
output generated while reading makefiles and make sure it's
|
||||
captured via output-sync. Make sure that fatal errors dump the
|
||||
output so it's not lost.
|
||||
|
||||
* scripts/options/dash-w: Add a test for -w flag.
|
||||
|
||||
2013-09-15 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/misc/fopen-fail: Check for failure on infinite recursion.
|
||||
* run_make_tests.pl (run_make_test): Allow the answer string to be
|
||||
undef, which means that we shouldn't compare it at all. Only the
|
||||
exit code matters in this case.
|
||||
* test_driver.pl (compare_output): Ditto.
|
||||
Test for Savannah bug #27374.
|
||||
|
||||
* scripts/features/parallelism: Test broken jobserver on recursion.
|
||||
Test for Savannah bug #39934.
|
||||
|
||||
* scripts/options/eval: Verify --eval during restart.
|
||||
Test for Savannah bug #39203.
|
||||
|
||||
2013-09-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/output-sync: Verify -Orecurse properly.
|
||||
|
||||
2013-09-12 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/output-sync: Modify for output sync behavior.
|
||||
* scripts/variables/MAKE_RESTARTS: Ditto.
|
||||
* scripts/variables/MAKEFLAGS: Remove mode for --trace.
|
||||
* scripts/variables/GNUMAKEFLAGS: Ditto.
|
||||
|
||||
2013-07-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/rule_glob: Add tests for wildcards in rules.
|
||||
Test for Savannah bug #39310.
|
||||
|
||||
2013-07-09 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/se_implicit: Add a test for SE rules depending
|
||||
on other SE rules to be built.
|
||||
|
||||
2013-05-26 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/archives: Test for Savannah bug #38442.
|
||||
|
||||
* scripts/misc/bs-nl: Test for Savannah bug #39035.
|
||||
Add a test for Savannah bug #38945.
|
||||
|
||||
2013-05-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/options/dash-n: Fix results after MAKEFLAGS fixes.
|
||||
* scripts/variables/MAKEFLAGS: Ditto.
|
||||
* scripts/variables/GNUMAKEFLAGS: Ditto.
|
||||
|
||||
2013-05-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/loadapi: Add plugin_is_GPL_compatible symbol.
|
||||
* scripts/features/load: Ditto.
|
||||
|
||||
2013-05-13 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/output-sync (output_sync_set): Update for new
|
||||
--trace behavior.
|
||||
|
||||
2013-05-05 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/output-sync (output_sync_set): Remove
|
||||
extraneous enter/leave lines, which are no longer printed.
|
||||
Add tests for syncing command line printing.
|
||||
(output_sync_set): Rename options: "job"->"line"; "make"->"recurse"
|
||||
|
||||
2013-05-04 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/loadapi: Use the new alloc functions.
|
||||
|
||||
* scripts/features/output-sync (output_sync_set): New test for
|
||||
ordered recursive output for -Ojob / -Otarget.
|
||||
|
||||
2013-05-03 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* scripts/features/load: Fix signatures of testload_gmk_setup and
|
||||
explicit_setup, to bring them in line with the documentation.
|
||||
|
||||
2013-04-28 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/output-sync (output_sync_set): Add tests for
|
||||
the per-job syntax mode.
|
||||
(output_sync_set): Test improved error message location.
|
||||
|
||||
2013-04-15 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/output-sync (output_sync_set): New arg syntax.
|
||||
|
||||
2013-04-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/output-sync: Rewrite to be more reliable.
|
||||
|
||||
* test_driver.pl (_run_command): Don't set SIGALRM until after we
|
||||
start the child. Print errors to the top-level output, which will
|
||||
be stderr.
|
||||
(attach_default_output): Use a list of file handles as the stack.
|
||||
(detach_default_output): Ditto.
|
||||
|
||||
* scripts/features/output-sync: Add a test for output-sync.
|
||||
|
||||
2013-02-25 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* run_make_tests.pl (valid_option): Support the -srcdir flag.
|
||||
(set_more_defaults): Set up $srcdir if it's not set yet.
|
||||
|
||||
* scripts/functions/guile: Verify gmk-eval doesn't expand twice.
|
||||
* scripts/features/load: Rework to test just the load capability.
|
||||
* scripts/features/loadapi: New set of tests for the load API.
|
||||
|
||||
2013-01-19 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/load: Test loaded files with and without "./"
|
||||
prefix. Add tests for automatically rebuilding loaded files if
|
||||
they are out of date or non-existent.
|
||||
|
||||
2013-01-13 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/archives: Add a check targets that have parens,
|
||||
but are not archives. See Savannah bug #37878.
|
||||
|
||||
* scripts/options/dash-n: Verify -n is preserved after recursive /
|
||||
re-exec. See Savannah bug #38051.
|
||||
|
||||
2013-01-12 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/parallelism: Change rule so it doesn't depend
|
||||
on invocation order, etc.
|
||||
|
||||
2012-10-29 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/load: New test suite for the "load" directive.
|
||||
@@ -443,7 +620,7 @@
|
||||
* test_driver.pl (toplevel): Skip all hidden files/directories (ones
|
||||
beginning with ".").
|
||||
|
||||
* scripts/functions/andor: Tests for $(and ..) and $(or ...)
|
||||
* scripts/functions/andor: Tests for $(and ...) and $(or ...)
|
||||
functions.
|
||||
|
||||
2006-02-08 Boris Kolpackov <boris@kolpackov.net>
|
||||
@@ -530,9 +707,9 @@
|
||||
|
||||
2005-08-13 Boris Kolpackov <boris@kolpackov.net>
|
||||
|
||||
* scripts/functions/wildcard: Wrap calls to $(wildcard ) with
|
||||
* scripts/functions/wildcard: Wrap calls to $(wildcard) with
|
||||
$(sort) so that the resulting order is no longer filesystem-
|
||||
dependant.
|
||||
dependent.
|
||||
|
||||
2005-08-10 Boris Kolpackov <boris@kolpackov.net>
|
||||
|
||||
@@ -603,7 +780,7 @@
|
||||
|
||||
2005-06-09 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/functions/foreach: Add a test for Savannah bug #11913.
|
||||
* scripts/functions/foreach: Add a test for Savannah bug #11913.
|
||||
|
||||
2005-05-31 Boris Kolpackov <boris@kolpackov.net>
|
||||
|
||||
@@ -623,7 +800,7 @@
|
||||
2005-05-02 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/parallelism: Add a test for exporting recursive
|
||||
variables containing $(shell ) calls. Rewrite this script to use
|
||||
variables containing $(shell) calls. Rewrite this script to use
|
||||
run_make_test() everywhere.
|
||||
|
||||
2005-04-07 Paul D. Smith <psmith@gnu.org>
|
||||
@@ -1206,7 +1383,7 @@
|
||||
ChangeLog file for the test suite created.
|
||||
|
||||
|
||||
Copyright (C) 1992-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -72,7 +72,7 @@ Changes from 0.4.4 to 0.4.5 (April 29, 1995):
|
||||
|
||||
Also, some tests and stuff still haven't made it in because I
|
||||
haven't had time to write the test scripts for them. But they,
|
||||
too, will get in eventually. Contributions of scripts (ie, tests
|
||||
too, will get in eventually. Contributions of scripts (i.e., tests
|
||||
that I can just drop in) are particularly welcome and will be
|
||||
incorporated immediately.
|
||||
|
||||
@@ -162,7 +162,7 @@ Changes from 0.1 to 0.2 (5-4-92):
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1992-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
|
||||
@@ -7,7 +7,7 @@ This entire test suite, including all test files, are copyright and
|
||||
distributed under the following terms:
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Copyright (C) 1992-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
@@ -38,7 +38,7 @@ To run the test suite on Windows NT or DOS systems, use
|
||||
"perl.exe ./run_make-tests.pl".
|
||||
|
||||
By default, the test engine picks up the first executable called "make"
|
||||
that it finds in your path. You may use the -make_path option (ie,
|
||||
that it finds in your path. You may use the -make_path option (i.e.,
|
||||
"perl run_make_tests -make_path /usr/local/src/make-3.78/make") if
|
||||
you want to run a particular copy. This now works correctly with
|
||||
relative paths and when make is called something other than "make" (like
|
||||
@@ -58,7 +58,7 @@ The options/dash-l test will not really test anything if the copy of
|
||||
make you are using can't obtain the system load. Some systems require
|
||||
make to be setgid sys or kmem for this; if you don't want to install
|
||||
make just to test it, make it setgid to kmem or whatever group /dev/kmem
|
||||
is (ie, "chgrp kmem make;chmod g+s make" as root). In any case, the
|
||||
is (i.e., "chgrp kmem make;chmod g+s make" as root). In any case, the
|
||||
options/dash-l test should no longer *fail* because make can't read
|
||||
/dev/kmem.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Simple script to make a "shadow" test directory, using symbolic links.
|
||||
# Typically you'd put the shadow in /tmp or another local disk
|
||||
#
|
||||
# Copyright (C) 1992-2012 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
# This file is part of GNU Make.
|
||||
#
|
||||
# GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user