Compare commits

...

17 Commits

Author SHA1 Message Date
Paul Smith
9ab8af7cd8 GNU Make release 4.2.1. 2016-06-10 19:02:10 -04:00
Paul Smith
f522852f07 * maintMakefile: TP recommends rsync for retrieving PO files. 2016-06-06 08:32:00 -04:00
Jeremy Devenport
a3d8c086d5 * main.c (main): [SV 48009] Reset stack limit for make re-exec.
Copyright-paperwork-exempt: yes
2016-05-31 03:17:26 -04:00
Paul Smith
4762480ae9 [SV 47995] Ensure forced double-colon rules work with -j.
The fix for SV 44742 had a side-effect that some double-colon targets
were skipped.  This happens because the "considered" facility assumed
that all targets would be visited on each walk through the dependency
graph: we used a bit for considered and toggled it on each pass; if
we didn't walk the entire graph on every pass the bit would get out
of sync.  The new behavior after SV 44742 might return early without
walking the entire graph.  To fix this I changed the considered value
to an integer which is monotonically increasing: it is then never
possible to incorrectly determine that a previous pass through the
graph already considered the current target.

* filedef.h (struct file): make CONSIDERED an unsigned int.
* main.c (main): No longer need to reset CONSIDERED.
* remake.c (update_goal_chain): increment CONSIDERED rather than
inverting it between 0<->1.
(update_file_1): Reset CONSIDERED to 0 so it's re-considered.
(check_dep): Ditto.
* tests/scripts/features/double_colon: Add a regression test.
2016-05-31 03:17:26 -04:00
Paul Smith
ef6c059e1e * DELETE_ON_ERROR: [SV 48061] Use "exit 1" for portability.
Reported by Joel Fredrikson <Joel.Fredrikson@it.uu.se>
2016-05-31 03:17:26 -04:00
Paul Smith
cf4ed2ebe8 * w32/pathstuff.c: [SV 47996] Use ISBLANK() not isblank(). 2016-05-31 03:17:26 -04:00
Eli Zaretskii
5a4f9a67a3 Fix printing time stamps on MS-Windows
* dir.c (print_dir_data_base) [WINDOWS32]: Use %I64u format for
printing unsigned 64-bit data types, as %ull is not universally
supported.
2016-05-28 12:53:02 +03:00
Luke Allardyce
2987163ac4 [SV 48037] Fix MinGW build with Posix configury tools
* w32/Makefile.am (libw32_a_CPPFLAGS): Add -I$(srcdir)/glob.

Copyright-paperwork-exempt: yes
2016-05-27 22:39:55 +03:00
Paul Smith
ec61980122 GNU Make release 4.2. 2016-05-22 09:25:55 -04:00
Joe Crayne
9bb994e831 [SV 44742] Fix double-colon rules plus parallel builds.
* remake.c (update_file): Don't update double-colon target status
if we're still building targets.
(ftime_t): Don't propagate timestamps for double-colon targets that
we've not examined yet.
* tests/scripts/features/double_colon: Add parallel build tests.

Copyright-paperwork-exempt: yes
2016-05-21 17:34:45 -04:00
Paul Smith
e2ebea35f1 * read.c (eval): [SV 47960] Skip record waiting files when ignoring.
* tests/scripts/features/conditionals: Test this scenario.
2016-05-21 16:22:32 -04:00
Paul Smith
c73ed7dd1c Separate the GNU make load ABI from internal types.
Create an internal type "floc" and convert all users to that type.
* gnumake.h (gmk_floc): Remove the offset field from this type.
* loadapi.c (gmk_eval): Convert gmk_floc to internal floc.
2016-05-21 16:22:32 -04:00
Paul Eggert
ba8383efd8 Fixes for enhanced GCC warnings.
Move function prototypes into header files and out of .c files.
Use void argument lists for functions that accept no args.
Remove unused macros.  Make private functions static.  Align
types with printf format characters.
2016-05-21 16:22:25 -04:00
Paul Smith
6f7fb050b4 Fix compile issues with Windows and VMS.
* main.c (initialize_stopchar_map): isblank() is not part of C89.
Install bits for space and tab directly.
* makeint.h: Don't define vfork; autoconf handles this for us.
* vmsjobs.c: Rename NEXT_TOKEN to V_NEXT_TOKEN to avoid conflicts.
* dir.c (print_dir_data_base): Visual Studio C doesn't have int64_t.
* w32/subproc/sub_proc.c (process_begin): Missing arg to memset().
* build_w32.bat: Don't use obsolete Visual Studio flags.
2016-05-21 16:21:31 -04:00
Paul Smith
45200a42d3 Allow compiling with an ISO C 1989/1990 compiler.
* posixos.c (jobserver_post_child): Use C89 for loop syntax.
* remake.c (update_goal_chain): Ditto.
* variable.c (parse_variable_definition): Ditto.
2016-05-21 14:30:37 -04:00
Eli Zaretskii
4c9e10fd94 [SV 47942] Avoid random crashes in subordinate programs on MS-Windows
* w32/subproc/sub_proc.c (process_begin): Zero out startInfo
before using it.  Fixes crashes in Intel Fortran compiler invoked
by Make.
2016-05-17 18:15:26 +03:00
Eli Zaretskii
6e640321fd Fix the MS-Windows MinGW build
* build_w32.bat (GccCompile): Use -std=gnu99, as some code uses
C99 features ('for' loop initial declarations).

* dir.c (print_dir_data_base) [WINDOWS32]: Cast 'mtime' to
'int64_t', and use %I64d to print it, to avoid compile-time
warning about printing a 'time_t' value, which could be either
a 32-bit or a 64 bit integral type.
2016-04-24 09:53:38 +03:00
41 changed files with 325 additions and 218 deletions

8
.gitignore vendored
View File

@@ -35,10 +35,10 @@ make
*.sbr
# Windows build artifacts
/WinDebug/
/WinRel/
/GccDebug/
/GccRel/
WinDebug/
WinRel/
GccDebug/
GccRel/
# Distribution artifacts
.dep_segment

View File

@@ -74,7 +74,7 @@ endif
# Extra stuff to include in the distribution.
EXTRA_DIST = README build.sh.in $(man_MANS) \
EXTRA_DIST = ChangeLog README build.sh.in $(man_MANS) \
README.customs README.OS2 \
SCOPTIONS SMakefile \
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h \

13
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
11 Apr 2016
10 June 2016
See the end of this file for copyrights and conditions.
@@ -9,7 +9,16 @@ 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 4.1.90 (11 Apr 2016)
Version 4.2.1 (10 Jun 2016)
A complete list of bugs fixed in this version is available here:
h
ttp://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=107&set=custom
This release is a bug-fix release.
Version 4.2 (22 May 2016)
A complete list of bugs fixed in this version is available here:

View File

@@ -243,7 +243,8 @@ work on it:
Where to Announce
-----------------
Create the announcement in a text file, then sign it with GPG.
Create the announcement in a text file, using 'git shortlog',
then sign it with GPG:
gpg --clearsign <announcement.txt>

8
ar.c
View File

@@ -73,7 +73,7 @@ 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 size UNUSED, long int date,
int uid UNUSED, int gid UNUSED, int mode UNUSED,
int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
const void *name)
{
return ar_name_equal (name, mem, truncated) ? date : 0;
@@ -198,7 +198,7 @@ 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 size UNUSED, long int date UNUSED, int uid UNUSED,
int gid UNUSED, int mode UNUSED, const void *arg)
int gid UNUSED, unsigned int mode UNUSED, const void *arg)
{
struct ar_glob_state *state = (struct ar_glob_state *)arg;
@@ -224,7 +224,7 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
/* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
static int
glob_pattern_p (const char *pattern, int quote)
ar_glob_pattern_p (const char *pattern, int quote)
{
const char *p;
int opened = 0;
@@ -267,7 +267,7 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
#ifdef VMS
char *vms_member_pattern;
#endif
if (! glob_pattern_p (member_pattern, 1))
if (! ar_glob_pattern_p (member_pattern, 1))
return 0;
/* Scan the archive for matches.

View File

@@ -547,7 +547,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
int long_name = 0;
#endif
long int eltsize;
int eltmode;
unsigned int eltmode;
long int fnval;
off_t o;
@@ -872,7 +872,7 @@ 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 date UNUSED, int uid UNUSED, int gid UNUSED,
int mode UNUSED, const void *name)
unsigned int mode UNUSED, const void *name)
{
if (!ar_name_equal (name, mem, truncated))
return 0;
@@ -957,7 +957,8 @@ 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 date, int uid, int gid, int mode, const void *arg)
long int date, int uid, int gid, unsigned int mode,
const void *arg)
{
extern char *ctime ();

View File

@@ -149,7 +149,7 @@ if "%COMPILER%" == "gcc" goto GccCompile
:: MSVC Compile
echo on
cl.exe /nologo /MT /W4 /GX /YX %OPTS% /I %OUTDIR% /I . /I glob /I w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.obj /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
cl.exe /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR% /I . /I glob /I w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.obj /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
@echo off
echo %OUTDIR%\%1.obj >>%OUTDIR%\link.sc
goto :EOF
@@ -157,7 +157,7 @@ goto :EOF
:GccCompile
:: GCC Compile
echo on
gcc -mthreads -Wall -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c
gcc -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%\%1.o -c %1.c
@echo off
goto :EOF

View File

@@ -31,8 +31,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
# define FILE_LIST_SEPARATOR ' '
#endif
int remote_kill (int id, int sig);
#ifndef HAVE_UNISTD_H
int getpid ();
#endif

View File

@@ -19,7 +19,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
struct commands
{
gmk_floc fileinfo; /* Where commands were defined. */
floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
char **command_lines; /* Commands chopped up into lines. */
unsigned char *lines_flags; /* One set of flag bits for each line. */
@@ -34,6 +34,7 @@ struct commands
#define COMMANDS_SILENT 2 /* Silent: @. */
#define COMMANDS_NOERROR 4 /* No errors: -. */
RETSIGTYPE fatal_error_signal (int sig);
void execute_file_commands (struct file *file);
void print_commands (const struct commands *cmds);
void delete_child_targets (struct child *child);

View File

@@ -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/>.
AC_INIT([GNU make],[4.1.90],[bug-make@gnu.org])
AC_INIT([GNU make],[4.2.1],[bug-make@gnu.org])
AC_PREREQ([2.69])

4
dep.h
View File

@@ -63,7 +63,7 @@ struct goaldep
{
DEP (struct goaldep);
unsigned short error;
gmk_floc floc;
floc floc;
};
/* Options for parsing lists of filenames. */
@@ -127,5 +127,5 @@ SI void free_goal_chain(struct goaldep *g) { free_dep_chain((struct dep *)g); }
struct dep *copy_dep_chain (const struct dep *d);
struct goaldep *read_all_makefiles (const char **makefiles);
void eval_buffer (char *buffer, const gmk_floc *floc);
void eval_buffer (char *buffer, const floc *floc);
enum update_status update_goal_chain (struct goaldep *goals);

14
dir.c
View File

@@ -1082,8 +1082,9 @@ print_dir_data_base (void)
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 %I64u): could not be opened.\n"),
dir->name, dir->contents->path_key,
(unsigned long long)dir->contents->mtime);
#else /* WINDOWS32 */
#ifdef VMS_INO_T
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
@@ -1118,8 +1119,9 @@ print_dir_data_base (void)
}
}
#ifdef WINDOWS32
printf (_("# %s (key %s, mtime %d): "),
dir->name, dir->contents->path_key, dir->contents->mtime);
printf (_("# %s (key %s, mtime %I64u): "),
dir->name, dir->contents->path_key,
(unsigned long long)dir->contents->mtime);
#else /* WINDOWS32 */
#ifdef VMS_INO_T
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
@@ -1167,8 +1169,6 @@ print_dir_data_base (void)
/* Hooks for globbing. */
#include <glob.h>
/* Structure describing state of iterating through a directory hash table. */
struct dirstream
@@ -1261,7 +1261,9 @@ read_dirstream (__ptr_t stream)
*/
#if !defined(stat) && !defined(WINDOWS32) || defined(VMS)
# ifndef VMS
# ifndef HAVE_SYS_STAT_H
int stat (const char *path, struct stat *sbuf);
# endif
# else
/* We are done with the fake stat. Go back to the real stat */
# ifdef stat

View File

@@ -3,7 +3,7 @@
@setfilename make.info
@include version.texi
@set EDITION 0.73
@set EDITION 0.74
@settitle GNU @code{make}
@setchapternewpage odd

View File

@@ -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 gmk_floc **expanding_var = &reading_file;
const 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
@@ -96,8 +96,8 @@ char *
recursively_expand_for_file (struct variable *v, struct file *file)
{
char *value;
const gmk_floc *this_var;
const gmk_floc **saved_varp;
const floc *this_var;
const floc **saved_varp;
struct variable_set_list *save = 0;
int set_reading = 0;
@@ -458,7 +458,7 @@ variable_expand_for_file (const char *line, struct file *file)
{
char *result;
struct variable_set_list *savev;
const gmk_floc *savef;
const floc *savef;
if (file == 0)
return variable_expand (line);

3
file.c
View File

@@ -57,9 +57,6 @@ file_hash_cmp (const void *x, const void *y)
((struct file const *) y)->hname);
}
#ifndef FILE_BUCKETS
#define FILE_BUCKETS 1007
#endif
static struct hash_table files;
/* Whether or not .SECONDARY with no prerequisites was given. */

View File

@@ -58,6 +58,8 @@ struct file
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
has been performed. */
unsigned int considered; /* equal to 'considered' if file has been
considered on current scan of goal chain */
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
enum update_status /* Status of the last attempt to update. */
{
@@ -96,14 +98,12 @@ struct file
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. */
unsigned int considered:1; /* equal to 'considered' if file has been
considered on current scan of goal chain */
unsigned int no_diag:1; /* True if the file failed to update and no
diagnostics has been issued (dontcare). */
};
extern struct file *suffix_file, *default_file;
extern struct file *default_file;
struct file *lookup_file (const char *name);
@@ -117,9 +117,12 @@ void rehash_file (struct file *file, const char *name);
void set_command_state (struct file *file, enum cmd_state state);
void notice_finished_file (struct file *file);
void init_hash_files (void);
void verify_file_data_base (void);
char *build_target_list (char *old_list);
void print_prereqs (const struct dep *deps);
void print_file_data_base (void);
int try_implicit_rule (struct file *file, unsigned int depth);
int stemlen_compare (const void *v1, const void *v2);
#if FILE_TIMESTAMP_HI_RES
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \

View File

@@ -627,6 +627,7 @@ func_basename_dir (char *o, char **argv, const char *funcname)
else if (is_dir)
#ifdef VMS
{
extern int vms_report_unix_paths;
if (vms_report_unix_paths)
o = variable_buffer_output (o, "./", 2);
else
@@ -1975,7 +1976,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
}
#endif /* _AMIGA */
char *
static char *
func_shell (char *o, char **argv, const char *funcname UNUSED)
{
return func_shell_base (o, argv, 1);
@@ -2633,7 +2634,7 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
}
void
define_new_function (const gmk_floc *flocp, const char *name,
define_new_function (const floc *flocp, const char *name,
unsigned int min, unsigned int max, unsigned int flags,
gmk_func_ptr func)
{
@@ -2653,10 +2654,10 @@ define_new_function (const gmk_floc *flocp, const char *name,
OS (fatal, flocp, _("Function name too long: %s"), name);
if (min > 255)
ONS (fatal, flocp,
_("Invalid minimum argument count (%d) for function %s"), min, name);
_("Invalid minimum argument count (%u) for function %s"), min, name);
if (max > 255 || (max && max < min))
ONS (fatal, flocp,
_("Invalid maximum argument count (%d) for function %s"), max, name);
_("Invalid maximum argument count (%u) for function %s"), max, name);
ent = xmalloc (sizeof (struct function_table_entry));
ent->name = name;

View File

@@ -24,7 +24,6 @@ typedef struct
{
const char *filenm;
unsigned long lineno;
unsigned long offset;
} gmk_floc;
typedef char *(*gmk_func_ptr)(const char *nm, unsigned int argc, char **argv);

View File

@@ -140,7 +140,7 @@ func_guile (const char *funcname UNUSED, unsigned int argc UNUSED, char **argv)
/* 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 gmk_floc *flocp UNUSED)
guile_gmake_setup (const floc *flocp UNUSED)
{
/* Create a make function "guile". */
gmk_add_function ("guile", func_guile, 0, 1, GMK_FUNC_DEFAULT);
@@ -151,7 +151,7 @@ guile_gmake_setup (const gmk_floc *flocp UNUSED)
#else
int
guile_gmake_setup (const gmk_floc *flocp UNUSED)
guile_gmake_setup (const floc *flocp UNUSED)
{
return 1;
}

12
job.c
View File

@@ -24,7 +24,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "commands.h"
#include "variable.h"
#include "os.h"
#include "debug.h"
#include <string.h>
@@ -208,14 +207,10 @@ pid2str (pid_t pid)
return pidstring;
}
#ifndef HAVE_GETLOADAVG
int getloadavg (double loadavg[], int nelem);
int start_remote_job (char **argv, char **envp, int stdin_fd, int *is_remote,
int *id_ptr, int *used_stdin);
int start_remote_job_p (int);
int remote_status (int *exit_code_ptr, int *signal_ptr, int *coredump_ptr,
int block);
#endif
RETSIGTYPE child_handler (int);
static void free_child (struct child *);
static void start_job_command (struct child *child);
static int load_too_high (void);
@@ -479,7 +474,7 @@ child_error (struct child *child,
const char *post = "";
const char *dump = "";
const struct file *f = child->file;
const gmk_floc *flocp = &f->cmds->fileinfo;
const floc *flocp = &f->cmds->fileinfo;
const char *nm;
size_t l;
@@ -2285,7 +2280,6 @@ exec_command (char **argv, char **envp)
case ENOEXEC:
{
/* The file is not executable. Try it as a shell script. */
extern char *getenv ();
const char *shell;
char **new_argv;
int argc;

8
load.c
View File

@@ -45,8 +45,8 @@ struct load_list
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)
load_object (const floc *flocp, int noerror, const char *ldname,
const char *symname)
{
static void *global_dl = NULL;
load_func_t symp;
@@ -119,7 +119,7 @@ load_object (const gmk_floc *flocp, int noerror,
}
int
load_file (const gmk_floc *flocp, const char **ldname, int noerror)
load_file (const floc *flocp, const char **ldname, int noerror)
{
int nmlen = strlen (*ldname);
char *new = alloca (nmlen + CSTRLEN (SYMBOL_EXTENSION) + 1);
@@ -249,7 +249,7 @@ unload_file (const char *name)
#else
int
load_file (const gmk_floc *flocp, const char **ldname UNUSED, int noerror)
load_file (const floc *flocp, const char **ldname UNUSED, int noerror)
{
if (! noerror)
O (fatal, flocp,

View File

@@ -37,17 +37,29 @@ gmk_free (char *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)
gmk_eval (const char *buffer, const gmk_floc *gfloc)
{
/* Preserve existing variable buffer context. */
char *pbuf;
unsigned int plen;
char *s;
floc fl;
floc *flp;
if (gfloc)
{
fl.filenm = gfloc->filenm;
fl.lineno = gfloc->lineno;
fl.offset = 0;
flp = &fl;
}
else
flp = NULL;
install_variable_buffer (&pbuf, &plen);
s = xstrdup (buffer);
eval_buffer (s, floc);
eval_buffer (s, flp);
free (s);
restore_variable_buffer (pbuf, plen);

35
main.c
View File

@@ -84,18 +84,6 @@ char x;
}
#endif
void init_dir (void);
void remote_setup (void);
void remote_cleanup (void);
RETSIGTYPE fatal_error_signal (int sig);
void print_variable_data_base (void);
void print_dir_data_base (void);
void print_rule_data_base (void);
void print_vpath_data_base (void);
void verify_file_data_base (void);
#if defined HAVE_WAITPID || defined HAVE_WAIT3
# define HAVE_WAIT_NOHANG
#endif
@@ -645,7 +633,7 @@ initialize_global_hash_tables (void)
Each element is true if we should stop parsing on that character. */
static void
initialize_stopchar_map ()
initialize_stopchar_map (void)
{
int i;
@@ -663,6 +651,9 @@ initialize_stopchar_map ()
stopchar_map[(int)'-'] = MAP_USERFUNC;
stopchar_map[(int)'_'] = MAP_USERFUNC;
stopchar_map[(int)' '] = MAP_BLANK;
stopchar_map[(int)'\t'] = MAP_BLANK;
stopchar_map[(int)'/'] = MAP_DIRSEP;
#if defined(VMS)
stopchar_map[(int)':'] |= MAP_DIRSEP;
@@ -674,9 +665,7 @@ initialize_stopchar_map ()
for (i = 1; i <= UCHAR_MAX; ++i)
{
if (isblank (i))
stopchar_map[i] |= MAP_BLANK;
else if (isspace (i))
if (isspace (i) && NONE_SET (stopchar_map[i], MAP_BLANK))
/* Don't mark blank characters as newline characters. */
stopchar_map[i] |= MAP_NEWLINE;
else if (isalnum (i))
@@ -1062,7 +1051,7 @@ msdos_return_to_initial_directory (void)
#endif /* __MSDOS__ */
static void
reset_jobserver ()
reset_jobserver (void)
{
jobserver_clear ();
free (jobserver_auth);
@@ -1894,7 +1883,6 @@ main (int argc, char **argv, char **envp)
If none of these are true, we don't need a signal handler at all. */
{
RETSIGTYPE child_handler (int sig);
# if defined SIGCHLD
bsd_signal (SIGCHLD, child_handler);
# endif
@@ -2274,10 +2262,6 @@ main (int argc, char **argv, char **envp)
for (i = 0, d = read_files; d != 0; ++i, d = d->next)
{
/* Reset the considered flag; we may need to look at the file
again to print an error. */
d->file->considered = 0;
if (d->file->updated)
{
/* This makefile was updated. */
@@ -2470,6 +2454,11 @@ main (int argc, char **argv, char **envp)
exit (WIFEXITED(r) ? WEXITSTATUS(r) : EXIT_FAILURE);
}
#else
#ifdef SET_STACK_SIZE
/* Reset limits, if necessary. */
if (stack_limit.rlim_cur)
setrlimit (RLIMIT_STACK, &stack_limit);
#endif
exec_command ((char **)nargv, environ);
#endif
free (aargv);
@@ -3368,7 +3357,7 @@ print_version (void)
/* Print a bunch of information about this and that. */
static void
print_data_base ()
print_data_base (void)
{
time_t when = time ((time_t *) 0);

View File

@@ -144,7 +144,7 @@ ChangeLog: .check-git-HEAD
## ---------------- ##
## Updating files. ##
## ---------------- ##
RSYNC = rsync -Lrtvz
WGET = wget --passive-ftp -np -nv
ftp-gnu = ftp://ftp.gnu.org/gnu
@@ -165,13 +165,14 @@ move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
po_repo = http://translationproject.org/latest/$(PACKAGE)
po_sync = translationproject.org::tp/latest/$(PACKAGE)/
.PHONY: do-po-update po-update
do-po-update:
tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
&& rm -rf "$$tmppo" \
&& mkdir "$$tmppo" \
&& (cd "$$tmppo" \
&& $(WGET) $(po_wget_flags) -A '*.po' $(po_repo)) \
&& $(RSYNC) $(po_sync) "$$tmppo" \
&& cp "$$tmppo"/*.po $(top_srcdir)/po \
&& rm -rf "$$tmppo"
cd po && $(MAKE) update-po

View File

@@ -137,9 +137,6 @@ extern int errno;
#ifdef HAVE_VFORK_H
# include <vfork.h>
#endif
#if !HAVE_WORKING_VFORK
# define vfork fork
#endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
@@ -453,7 +450,9 @@ extern int unixy_shell;
extern struct rlimit stack_limit;
#endif
#define NILF ((gmk_floc *)0)
#include <glob.h>
#define NILF ((floc *)0)
#define CSTRLEN(_s) (sizeof (_s)-1)
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
@@ -469,13 +468,22 @@ extern struct rlimit stack_limit;
#endif
/* Specify the location of elements read from makefiles. */
typedef struct
{
const char *filenm;
unsigned long lineno;
unsigned long offset;
} floc;
const char *concat (unsigned int, ...);
void message (int prefix, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
void error (const gmk_floc *flocp, size_t length, const char *fmt, ...)
void error (const floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
void fatal (const gmk_floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
void fatal (const floc *flocp, size_t length, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
#define O(_t,_a,_f) _t((_a), 0, (_f))
#define OS(_t,_a,_f,_s) _t((_a), strlen (_s), (_f), (_s))
@@ -521,7 +529,8 @@ 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);
int gid, unsigned 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);
@@ -535,6 +544,8 @@ int file_exists_p (const char *);
int file_impossible_p (const char *);
void file_impossible (const char *);
const char *dir_name (const char *);
void print_dir_data_base (void);
void dir_setup_glob (glob_t *);
void hash_init_directories (void);
void define_default_variables (void);
@@ -557,7 +568,7 @@ void child_access (void);
char *strip_whitespace (const char **begpp, const char **endpp);
void show_goal_error ();
void show_goal_error (void);
/* String caching */
void strcache_init (void);
@@ -567,11 +578,11 @@ const char *strcache_add (const char *str);
const char *strcache_add_len (const char *str, unsigned int len);
/* Guile support */
int guile_gmake_setup (const gmk_floc *flocp);
int guile_gmake_setup (const floc *flocp);
/* 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);
typedef int (*load_func_t)(const floc *flocp);
int load_file (const 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,
@@ -584,16 +595,16 @@ long int atol ();
long int lseek ();
# endif
#endif /* Not GNU C library or POSIX. */
#ifdef HAVE_GETCWD
# if !defined(VMS) && !defined(__DECC)
# ifdef HAVE_GETCWD
# if !defined(VMS) && !defined(__DECC)
char *getcwd ();
# endif
#else
# endif
# else
char *getwd ();
# define getcwd(buf, len) getwd (buf)
#endif
# define getcwd(buf, len) getwd (buf)
# endif
#endif /* Not GNU C library or POSIX. */
#if !HAVE_STRCASECMP
# if HAVE_STRICMP
@@ -622,11 +633,12 @@ int strncasecmp (const char *s1, const char *s2, int n);
#define OUTPUT_SYNC_TARGET 2
#define OUTPUT_SYNC_RECURSE 3
extern const gmk_floc *reading_file;
extern const gmk_floc **expanding_var;
/* Non-GNU systems may not declare this in unistd.h. */
extern char **environ;
extern const floc *reading_file;
extern const floc **expanding_var;
extern unsigned short stopchar_map[];
extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
@@ -637,6 +649,8 @@ 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, output_sync, verify_flag;
extern const char *default_shell;
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;
@@ -688,6 +702,17 @@ vms_restore_symbol (const char *string);
#endif
void remote_setup (void);
void remote_cleanup (void);
int start_remote_job_p (int);
int start_remote_job (char **, char **, int, int *, int *, int *);
int remote_status (int *, int *, int *, int);
void block_remote_children (void);
void unblock_remote_children (void);
int remote_kill (int id, int sig);
void print_variable_data_base (void);
void print_vpath_data_base (void);
extern char *starting_directory;
extern unsigned int makelevel;
extern char *version_string, *remote_description, *make_host;

18
os.h
View File

@@ -20,7 +20,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef MAKE_JOBSERVER
/* Returns 1 if the jobserver is enabled, else 0. */
unsigned int jobserver_enabled ();
unsigned int jobserver_enabled (void);
/* Called in the master instance to set up the jobserver initially. */
unsigned int jobserver_setup (int job_slots);
@@ -29,28 +29,28 @@ unsigned int jobserver_setup (int job_slots);
unsigned int jobserver_parse_auth (const char* auth);
/* Returns an allocated buffer used to pass to child instances. */
char *jobserver_get_auth ();
char *jobserver_get_auth (void);
/* Clear this instance's jobserver configuration. */
void jobserver_clear ();
void jobserver_clear (void);
/* Recover all the jobserver tokens and return the number we got. */
unsigned int jobserver_acquire_all ();
unsigned int jobserver_acquire_all (void);
/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
void jobserver_release (int is_fatal);
/* Notify the jobserver that a child exited. */
void jobserver_signal ();
void jobserver_signal (void);
/* Get ready to start a non-recursive child. */
void jobserver_pre_child ();
void jobserver_pre_child (int);
/* Complete starting a non-recursive child. */
void jobserver_post_child ();
void jobserver_post_child (int);
/* Set up to acquire a new token. */
void jobserver_pre_acquire ();
void jobserver_pre_acquire (void);
/* Wait until we can acquire a jobserver token.
TIMEOUT is 1 if we have other jobs waiting for the load to go down;
@@ -78,7 +78,7 @@ unsigned int jobserver_acquire (int timeout);
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
#if !defined(VMD) && !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
int get_bad_stdin ();
int get_bad_stdin (void);
#else
# define get_bad_stdin() (-1)
#endif

View File

@@ -174,7 +174,7 @@ static sync_handle_t sync_handle = -1;
/* Set up the sync handle. Disables output_sync on error. */
static int
sync_init ()
sync_init (void)
{
int combined_output = 0;
@@ -283,7 +283,7 @@ release_semaphore (void *sem)
/* 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 ()
output_tmpfd (void)
{
int fd = -1;
FILE *tfile = tmpfile ();
@@ -558,7 +558,7 @@ output_close (struct output *out)
/* We're about to generate output: be sure it's set up. */
void
output_start ()
output_start (void)
{
#ifndef NO_OUTPUT_SYNC
/* If we're syncing output make sure the temporary file is set up. */
@@ -640,7 +640,7 @@ message (int prefix, size_t len, const char *fmt, ...)
/* Print an error message. */
void
error (const gmk_floc *flocp, size_t len, const char *fmt, ...)
error (const floc *flocp, size_t len, const char *fmt, ...)
{
va_list args;
char *p;
@@ -671,7 +671,7 @@ error (const gmk_floc *flocp, size_t len, const char *fmt, ...)
/* Print an error message and exit. */
void
fatal (const gmk_floc *flocp, size_t len, const char *fmt, ...)
fatal (const floc *flocp, size_t len, const char *fmt, ...)
{
va_list args;
const char *stop = _(". Stop.\n");

View File

@@ -45,7 +45,7 @@ static int job_rfd = -1;
static char token = '+';
static int
make_job_rfd ()
make_job_rfd (void)
{
#ifdef HAVE_PSELECT
/* Pretend we succeeded. */
@@ -117,7 +117,7 @@ jobserver_parse_auth (const char *auth)
}
char *
jobserver_get_auth ()
jobserver_get_auth (void)
{
char *auth = xmalloc ((INTSTR_LENGTH * 2) + 2);
sprintf (auth, "%d,%d", job_fds[0], job_fds[1]);
@@ -125,13 +125,13 @@ jobserver_get_auth ()
}
unsigned int
jobserver_enabled ()
jobserver_enabled (void)
{
return job_fds[0] >= 0;
}
void
jobserver_clear ()
jobserver_clear (void)
{
if (job_fds[0] >= 0)
close (job_fds[0]);
@@ -157,7 +157,7 @@ jobserver_release (int is_fatal)
}
unsigned int
jobserver_acquire_all ()
jobserver_acquire_all (void)
{
unsigned int tokens = 0;
@@ -193,21 +193,24 @@ jobserver_post_child (int recursive)
{
#if defined(F_GETFD) && defined(F_SETFD)
if (!recursive && job_fds[0] >= 0)
for (int i = 0; i < 2; ++i)
{
int flags;
EINTRLOOP (flags, fcntl (job_fds[i], F_GETFD));
if (flags >= 0)
{
int r;
EINTRLOOP (r, fcntl (job_fds[i], F_SETFD, flags & ~FD_CLOEXEC));
}
}
{
unsigned int i;
for (i = 0; i < 2; ++i)
{
int flags;
EINTRLOOP (flags, fcntl (job_fds[i], F_GETFD));
if (flags >= 0)
{
int r;
EINTRLOOP (r, fcntl (job_fds[i], F_SETFD, flags & ~FD_CLOEXEC));
}
}
}
#endif
}
void
jobserver_signal ()
jobserver_signal (void)
{
if (job_rfd >= 0)
{
@@ -217,7 +220,7 @@ jobserver_signal ()
}
void
jobserver_pre_acquire ()
jobserver_pre_acquire (void)
{
/* Make sure we have a dup'd FD. */
if (job_rfd < 0 && job_fds[0] >= 0 && make_job_rfd () < 0)
@@ -399,7 +402,7 @@ jobserver_acquire (int timeout)
/* Create a "bad" file descriptor for stdin when parallel jobs are run. */
int
get_bad_stdin ()
get_bad_stdin (void)
{
static int bad_stdin = -1;

44
read.c
View File

@@ -18,8 +18,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
#include <glob.h>
#include "filedef.h"
#include "dep.h"
#include "job.h"
@@ -54,7 +52,7 @@ struct ebuffer
char *bufstart; /* Start of the entire buffer. */
unsigned int size; /* Malloc'd size of buffer. */
FILE *fp; /* File, or NULL if this is an internal buffer. */
gmk_floc floc; /* Info on the file in fp (if any). */
floc floc; /* Info on the file in fp (if any). */
};
/* Track the modifiers we can have on variable assignments */
@@ -128,7 +126,7 @@ static unsigned int max_incl_len;
/* The filename and pointer to line number of the
makefile currently being read in. */
const gmk_floc *reading_file = 0;
const floc *reading_file = 0;
/* The chain of files read by read_all_makefiles. */
@@ -142,16 +140,16 @@ static void do_undefine (char *name, enum variable_origin origin,
struct ebuffer *ebuf);
static struct variable *do_define (char *name, enum variable_origin origin,
struct ebuffer *ebuf);
static int conditional_line (char *line, int len, const gmk_floc *flocp);
static int conditional_line (char *line, int len, const floc *flocp);
static void record_files (struct nameseq *filenames, const char *pattern,
const char *pattern_percent, char *depstr,
unsigned int cmds_started, char *commands,
unsigned int commands_idx, int two_colon,
char prefix, const gmk_floc *flocp);
char prefix, const floc *flocp);
static void record_target_var (struct nameseq *filenames, char *defn,
enum variable_origin origin,
struct vmodifiers *vmod,
const gmk_floc *flocp);
const floc *flocp);
static enum make_word_type get_next_mword (char *buffer, char *delim,
char **startp, unsigned int *length);
static void remove_comments (char *line);
@@ -318,7 +316,7 @@ eval_makefile (const char *filename, int flags)
{
struct goaldep *deps;
struct ebuffer ebuf;
const gmk_floc *curfile;
const floc *curfile;
char *expanded = 0;
int makefile_errno;
@@ -450,12 +448,12 @@ eval_makefile (const char *filename, int flags)
}
void
eval_buffer (char *buffer, const gmk_floc *floc)
eval_buffer (char *buffer, const floc *flocp)
{
struct ebuffer ebuf;
struct conditionals *saved;
struct conditionals new;
const gmk_floc *curfile;
const floc *curfile;
/* Evaluate the buffer */
@@ -463,8 +461,8 @@ eval_buffer (char *buffer, const gmk_floc *floc)
ebuf.buffer = ebuf.bufnext = ebuf.bufstart = buffer;
ebuf.fp = NULL;
if (floc)
ebuf.floc = *floc;
if (flocp)
ebuf.floc = *flocp;
else if (reading_file)
ebuf.floc = *reading_file;
else
@@ -585,8 +583,8 @@ eval (struct ebuffer *ebuf, int set_default)
char prefix = cmd_prefix;
const char *pattern = 0;
const char *pattern_percent;
gmk_floc *fstart;
gmk_floc fi;
floc *fstart;
floc fi;
#define record_waiting_files() \
do \
@@ -726,9 +724,6 @@ eval (struct ebuffer *ebuf, int set_default)
struct variable *v;
enum variable_origin origin = vmod.override_v ? o_override : o_file;
/* Variable assignment ends the previous rule. */
record_waiting_files ();
/* If we're ignoring then we're done now. */
if (ignoring)
{
@@ -737,6 +732,9 @@ eval (struct ebuffer *ebuf, int set_default)
continue;
}
/* Variable assignment ends the previous rule. */
record_waiting_files ();
if (vmod.undefine_v)
{
do_undefine (p, origin, ebuf);
@@ -1446,7 +1444,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
{
struct variable *v;
struct variable var;
gmk_floc defstart;
floc defstart;
int nlevels = 1;
unsigned int length = 100;
char *definition = xmalloc (length);
@@ -1562,7 +1560,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
1 if following text should be ignored. */
static int
conditional_line (char *line, int len, const gmk_floc *flocp)
conditional_line (char *line, int len, const floc *flocp)
{
const char *cmdname;
enum { c_ifdef, c_ifndef, c_ifeq, c_ifneq, c_else, c_endif } cmdtype;
@@ -1833,7 +1831,7 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
static void
record_target_var (struct nameseq *filenames, char *defn,
enum variable_origin origin, struct vmodifiers *vmod,
const gmk_floc *flocp)
const floc *flocp)
{
struct nameseq *nextf;
struct variable_set_list *global;
@@ -1937,7 +1935,7 @@ record_files (struct nameseq *filenames, const char *pattern,
const char *pattern_percent, char *depstr,
unsigned int cmds_started, char *commands,
unsigned int commands_idx, int two_colon,
char prefix, const gmk_floc *flocp)
char prefix, const floc *flocp)
{
struct commands *cmds;
struct dep *deps;
@@ -2920,7 +2918,6 @@ tilde_expand (const char *name)
#ifndef VMS
if (name[1] == '/' || name[1] == '\0')
{
extern char *getenv ();
char *home_dir;
int is_variable;
@@ -2943,7 +2940,6 @@ tilde_expand (const char *name)
# if !defined(_AMIGA) && !defined(WINDOWS32)
if (home_dir == 0 || home_dir[0] == '\0')
{
extern char *getlogin ();
char *logname = getlogin ();
home_dir = 0;
if (logname != 0)
@@ -3008,8 +3004,6 @@ tilde_expand (const char *name)
PARSEFS_NOCACHE - Do not add filenames to the strcache (caller frees)
*/
void dir_setup_glob (glob_t *glob);
void *
parse_file_seq (char **stringp, unsigned int size, int stopmap,
const char *prefix, int flags)

View File

@@ -37,8 +37,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <io.h>
#endif
extern int try_implicit_rule (struct file *file, unsigned int depth);
/* The test for circular dependencies is based on the 'updating' bit in
'struct file'. However, double colon targets have separate 'struct
@@ -59,8 +57,9 @@ unsigned int commands_started = 0;
static struct goaldep *goal_list;
static struct dep *goal_dep;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
static unsigned int considered;
/* Current value for pruning the scan of the goal chain.
All files start with considered == 0. */
static unsigned int considered = 0;
static enum update_status update_file (struct file *file, unsigned int depth);
static enum update_status update_file_1 (struct file *file, unsigned int depth);
@@ -92,12 +91,12 @@ update_goal_chain (struct goaldep *goaldeps)
goal_list = rebuilding_makefiles ? goaldeps : NULL;
/* All files start with the considered bit 0, so the global value is 1. */
considered = 1;
#define MTIME(file) (rebuilding_makefiles ? file_mtime_no_search (file) \
: file_mtime (file))
/* Start a fresh batch of consideration. */
++considered;
/* Update all the goals until they are all finished. */
while (goals != 0)
@@ -249,10 +248,10 @@ update_goal_chain (struct goaldep *goaldeps)
}
}
/* If we reached the end of the dependency graph toggle the considered
flag for the next pass. */
/* If we reached the end of the dependency graph update CONSIDERED
for the next pass. */
if (g == 0)
considered = !considered;
++considered;
}
if (rebuilding_makefiles)
@@ -269,12 +268,14 @@ update_goal_chain (struct goaldep *goaldeps)
about errors, show an error message the first time. */
void
show_goal_error ()
show_goal_error (void)
{
struct goaldep *goal;
if ((goal_dep->flags & (RM_INCLUDED|RM_DONTCARE)) != RM_INCLUDED)
return;
for (struct goaldep *goal = goal_list; goal; goal = goal->next)
for (goal = goal_list; goal; goal = goal->next)
if (goal_dep->file == goal->file)
{
if (goal->error)
@@ -320,7 +321,7 @@ update_file (struct file *file, unsigned int depth)
&& !f->dontcare && f->no_diag))
{
DBF (DB_VERBOSE, _("Pruning file '%s'.\n"));
return f->command_state == cs_finished ? f->update_status : 0;
return f->command_state == cs_finished ? f->update_status : us_success;
}
}
@@ -344,12 +345,9 @@ update_file (struct file *file, unsigned int depth)
if (f->command_state == cs_running
|| f->command_state == cs_deps_running)
{
/* Don't run the other :: rules for this
file until this rule is finished. */
status = us_success;
break;
}
/* Don't run other :: rules for this target until
this rule is finished. */
return us_success;
if (new > status)
status = new;
@@ -618,8 +616,8 @@ update_file_1 (struct file *file, unsigned int depth)
break;
if (!running)
/* The prereq is considered changed if the timestamp has changed while
it was built, OR it doesn't exist. */
/* The prereq is considered changed if the timestamp has changed
while it was built, OR it doesn't exist. */
d->changed = ((file_mtime (d->file) != mtime)
|| (mtime == NONEXISTENT_MTIME));
@@ -653,7 +651,7 @@ update_file_1 (struct file *file, unsigned int depth)
/* We may have already considered this file, when we didn't know
we'd need to update it. Force update_file() to consider it and
not prune it. */
d->file->considered = !considered;
d->file->considered = 0;
new = update_file (d->file, depth);
if (new > dep_status)
@@ -1090,7 +1088,7 @@ check_dep (struct file *file, unsigned int depth,
/* If the target was waiting for a dependency it has to be
reconsidered, as that dependency might have finished. */
if (file->command_state == cs_deps_running)
file->considered = !considered;
file->considered = 0;
set_command_state (file, cs_not_started);
}
@@ -1274,6 +1272,7 @@ FILE_TIMESTAMP
f_mtime (struct file *file, int search)
{
FILE_TIMESTAMP mtime;
int propagate_timestamp;
/* File's mtime is not known; must get it from the system. */
@@ -1450,10 +1449,13 @@ f_mtime (struct file *file, int search)
}
}
/* Store the mtime into all the entries for this file. */
/* Store the mtime into all the entries for this file for which it is safe
to do so: avoid propagating timestamps to double-colon rules that haven't
been examined so they're run or not based on the pre-update timestamp. */
if (file->double_colon)
file = file->double_colon;
propagate_timestamp = file->updated;
do
{
/* If this file is not implicit but it is intermediate then it was
@@ -1465,7 +1467,8 @@ f_mtime (struct file *file, int search)
&& !file->tried_implicit && file->intermediate)
file->intermediate = 0;
file->last_mtime = mtime;
if (file->updated == propagate_timestamp)
file->last_mtime = mtime;
file = file->prev;
}
while (file != 0);

1
rule.h
View File

@@ -55,3 +55,4 @@ void install_pattern_rule (struct pspec *p, int terminal);
void create_pattern_rule (const char **targets, const char **target_percents,
unsigned int num, int terminal, struct dep *deps,
struct commands *commands, int override);
void print_rule_data_base (void);

View File

@@ -141,6 +141,22 @@ all: ; @:',
'',
'success');
# SV 47960 : ensure variable assignments in non-taken legs don't cause problems
run_make_test('
ifneq ($(FOO),yes)
target:
else
BAR = bar
target:
endif
@echo one
',
'', "one\n");
# This tells the test driver that the perl test script executed properly.
1;
### Local Variables:
### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
### End:

View File

@@ -151,8 +151,7 @@ two');
unlink('result','one','two');
# TEST 10: check for proper backslash handling
# Savannah bug #33399
# TEST 10: SV 33399 : check for proper backslash handling
run_make_test('
a\ xb :: ; @echo one
@@ -160,5 +159,62 @@ a\ xb :: ; @echo two
',
'', "one\ntwo\n");
# Test 11: SV 44742 : All double-colon rules should be run in parallel build.
run_make_test('result :: 01
@echo update
@touch $@
result :: 02
@echo update
@touch $@
result :: 03
@echo update
@touch $@
result :: 04
@echo update
@touch $@
result :: 05
@echo update
@touch $@
01 02 03 04 05:
@touch 01 02 03 04 05
',
'-j10 result', "update\nupdate\nupdate\nupdate\nupdate\n");
unlink('result', '01', '02', '03', '04', '05');
# Test 12: SV 44742 : Double-colon rules with parallelism
run_make_test('
root: all
echo root
all::
echo all_one
all:: 3
echo all_two
%:
sleep $*
',
'-rs -j2 1 2 root', "all_one\nall_two\nroot\n");
# SV 47995 : Parallel double-colon rules with FORCE
run_make_test('
all:: ; @echo one
all:: joe ; @echo four
joe: FORCE ; touch joe-is-forced
FORCE:
',
'-j5', "one\ntouch joe-is-forced\nfour\n");
unlink('joe-is-forced');
# This tells the test driver that the perl test script executed properly.
1;
### Local Variables:
### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
### End:

View File

@@ -6,17 +6,17 @@ $details = "";
run_make_test('
.DELETE_ON_ERROR:
all: ; false > $@
all: ; exit 1 > $@
',
'', "false > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
'', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512);
run_make_test('
.DELETE_ON_ERROR:
all: foo.x ;
%.x : %.q ; echo > $@
%.q : ; false > $@
%.q : ; exit 1 > $@
',
'', "false > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
'', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512);
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -196,7 +196,7 @@ struct variable *
define_variable_in_set (const char *name, unsigned int length,
const char *value, enum variable_origin origin,
int recursive, struct variable_set *set,
const gmk_floc *flocp)
const floc *flocp)
{
struct variable *v;
struct variable **var_slot;
@@ -822,7 +822,6 @@ merge_variable_set_lists (struct variable_set_list **setlist0,
void
define_automatic_variables (void)
{
extern const char* default_shell;
struct variable *v;
char buf[200];
@@ -1049,7 +1048,6 @@ target_environment (struct file *file)
/* If this is the SHELL variable and it's not exported,
then add the value from our original environment, if
the original environment defined a value for SHELL. */
extern struct variable shell_var;
if (streq (v->name, "SHELL") && shell_var.value)
{
v = &shell_var;
@@ -1136,7 +1134,7 @@ set_special_var (struct variable *var)
* result. This removes only ONE newline (if any) at the end, for maximum
* compatibility with the *BSD makes. If it fails, returns NULL. */
char *
static char *
shell_result (const char *p)
{
char *buf;
@@ -1159,7 +1157,7 @@ shell_result (const char *p)
See the try_variable_definition() function for details on the parameters. */
struct variable *
do_variable_definition (const gmk_floc *flocp, const char *varname,
do_variable_definition (const floc *flocp, const char *varname,
const char *value, enum variable_origin origin,
enum variable_flavor flavor, int target_var)
{
@@ -1449,6 +1447,7 @@ parse_variable_definition (const char *p, struct variable *var)
/* This begins a variable expansion reference. Make sure we don't
treat chars inside the reference as assignment tokens. */
char closeparen;
unsigned int count;
c = *p++;
if (c == '(')
@@ -1463,7 +1462,7 @@ parse_variable_definition (const char *p, struct variable *var)
/* P now points past the opening paren or brace.
Count parens or braces until it is matched. */
for (unsigned int count = 1; *p != '\0'; ++p)
for (count = 1; *p != '\0'; ++p)
{
if (*p == closeparen && --count == 0)
{
@@ -1593,7 +1592,7 @@ assign_variable_definition (struct variable *v, const char *line)
returned. */
struct variable *
try_variable_definition (const gmk_floc *flocp, const char *line,
try_variable_definition (const floc *flocp, const char *line,
enum variable_origin origin, int target_var)
{
struct variable v;
@@ -1738,7 +1737,7 @@ print_variable_data_base (void)
{
struct pattern_var *p;
int rules = 0;
unsigned int rules = 0;
for (p = pattern_vars; p != 0; p = p->next)
{

View File

@@ -51,7 +51,7 @@ struct variable
{
char *name; /* Variable name. */
char *value; /* Variable value. */
gmk_floc fileinfo; /* Where the variable was defined. */
floc fileinfo; /* Where the variable was defined. */
int length; /* strlen (name) */
unsigned int recursive:1; /* Gets recursively re-evaluated. */
unsigned int append:1; /* Nonzero if an appending target-specific
@@ -110,6 +110,7 @@ struct pattern_var
extern char *variable_buffer;
extern struct variable_set_list *current_variable_set_list;
extern struct variable *default_goal_var;
extern struct variable shell_var;
/* expand.c */
char *variable_buffer_output (char *ptr, const char *string, unsigned int length);
@@ -148,11 +149,10 @@ void pop_variable_scope (void);
void define_automatic_variables (void);
void initialize_file_variables (struct file *file, int reading);
void print_file_variables (const struct file *file);
void print_file_variables (const struct file *file);
void print_target_variables (const struct file *file);
void merge_variable_set_lists (struct variable_set_list **to_list,
struct variable_set_list *from_list);
struct variable *do_variable_definition (const gmk_floc *flocp,
struct variable *do_variable_definition (const floc *flocp,
const char *name, const char *value,
enum variable_origin origin,
enum variable_flavor flavor,
@@ -160,12 +160,12 @@ struct variable *do_variable_definition (const gmk_floc *flocp,
char *parse_variable_definition (const char *line,
struct variable *v);
struct variable *assign_variable_definition (struct variable *v, const char *line);
struct variable *try_variable_definition (const gmk_floc *flocp, const char *line,
struct variable *try_variable_definition (const floc *flocp, const char *line,
enum variable_origin origin,
int target_var);
void init_hash_global_variable_set (void);
void hash_init_function_table (void);
void define_new_function(const gmk_floc *flocp, const char *name,
void define_new_function(const floc *flocp, const char *name,
unsigned int min, unsigned int max, unsigned int flags,
gmk_func_ptr func);
struct variable *lookup_variable (const char *name, unsigned int length);
@@ -177,7 +177,7 @@ struct variable *define_variable_in_set (const char *name, unsigned int length,
enum variable_origin origin,
int recursive,
struct variable_set *set,
const gmk_floc *flocp);
const floc *flocp);
/* Define a variable in the current variable set. */

View File

@@ -264,14 +264,14 @@ tryToSetupYAst(void)
{ token->cmd_errno = ERANGE; return x; }}
/* Check if we are out of space for more tokens */
#define NEXT_TOKEN { if (cmd_tkn_index < MAX_DCL_TOKENS) \
#define V_NEXT_TOKEN { if (cmd_tkn_index < MAX_DCL_TOKENS) \
cmd_tokens[++cmd_tkn_index] = NULL; \
else { token.cmd_errno = E2BIG; break; } \
token.length = 0;}
#define UPDATE_TOKEN {cmd_tokens[cmd_tkn_index] = strdup(token.text); \
NEXT_TOKEN;}
V_NEXT_TOKEN;}
#define EOS_ERROR(x) { if (*x == 0) { token->cmd_errno = ERANGE; break; }}

View File

@@ -52,7 +52,7 @@ static struct vpath *gpaths;
variable. */
void
build_vpath_lists ()
build_vpath_lists (void)
{
register struct vpath *new = 0;
register struct vpath *old, *nexto;

View File

@@ -22,4 +22,5 @@ noinst_LIBRARIES = libw32.a
libw32_a_SOURCES = subproc/misc.c subproc/sub_proc.c subproc/w32err.c \
compat/posixfcn.c pathstuff.c w32os.c
libw32_a_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/subproc -I$(top_srcdir)
libw32_a_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/subproc -I$(top_srcdir) \
-I$(top_srcdir)/glob

View File

@@ -32,7 +32,7 @@ convert_vpath_to_windows32(char *Path, char to_delim)
* contain blanks get trounced here. Use 8.3 format as a workaround.
*/
for (etok = Path; etok && *etok; etok++)
if (isblank ((unsigned char) *etok))
if (ISBLANK ((unsigned char) *etok))
*etok = to_delim;
return (convert_Path_to_windows32(Path, to_delim));

View File

@@ -677,6 +677,7 @@ process_begin(
/*
* Set up inherited stdin, stdout, stderr for child
*/
memset(&startInfo, '\0', sizeof(startInfo));
GetStartupInfo(&startInfo);
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.lpReserved = 0;