Changeset 153 in kBuild
- Timestamp:
- Sep 8, 2004 2:43:30 AM (21 years ago)
- Location:
- branches/GNU/src/gmake
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gmake/ChangeLog
r54 r153 1 2004-03-06 Paul D. Smith <[email protected]> 2 3 * configure.in (HAVE_ANSI_COMPILER): Define if we have an ANSI/ISO 4 compiler. 5 * make.h: Convert uses of __STDC__ to HAVE_ANSI_COMPILER. 6 * misc.c (message,error,fatal): Ditto. 7 * configh.dos.template: Define HAVE_ANSI_COMPILER. 8 * config.h.W32.template: Ditto. 9 * config.h-vms.template: Ditto. 10 * config.ami.template: Ditto. 11 12 2004-03-04 Paul D. Smith <[email protected]> 13 14 * README.template: Add a note about broken /bin/sh on SunOS 15 4.1.3_U1 & 4.1.4. Fix up Savannah links. 16 17 * misc.c (message, error, fatal): Don't use "..." if we're using 18 varargs. ansi2knr should handle this but it doesn't work: it 19 translates "..." to va_dcl etc. but _AFTER_ the preprocessor is 20 done. On many systems (SunOS for example) va_dcl is a #define. 21 So, force the use of the non-"..." version on pre-ANSI compilers. 22 23 * maintMakefile (sign-dist): Create some rules to help automate 24 the new GNU ftp upload method. 25 26 2004-02-24 Paul D. Smith <[email protected]> 27 28 * config.h.W32.template: Add HAVE_STDARG_H 29 * config.h-vms.template: Ditto. 30 * config.ami.template: Ditto. 31 32 2004-02-23 Jonathan Grant <[email protected]> 33 34 * README.W32.template: Add a notation about -j with BATCH_MODE_ONLY. 35 * build_w32.bat: Remove extra "+". 36 37 2004-02-23 Paul D. Smith <[email protected]> 38 39 * make.h: Create an UNUSED macro to mark unused parameters. 40 * (many): Clean up warnings by applying UNUSED, fixing 41 signed/unsigned incompatibilities, etc. 42 43 * acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add quoting to silence 44 autoconf warnings. 45 * filedef.h: Name the command_state enumeration. 46 * file.c (set_command_state): Use the enumeration in the function 47 argument. 48 49 * configure.in: Explicitly set SET_MAKE to empty, to disable 50 MAKE=make even when no make already exists. Fix bug #3823. 51 52 2004-02-22 Paul D. Smith <[email protected]> 53 54 * maintMakefile: Perl script to clean up all non-CVS files. Use 55 it on all the subdirectories for the cvs-clean target. 56 57 * main.c (decode_switches): Require non-empty strings for all our 58 string command-line options. Fixes Debian bug # 164165. 59 60 * configure.in: Check for stdarg.h and varargs.h. 61 * make.h (USE_VARIADIC): Set this if we can use variadic functions 62 for printing messages. 63 * misc.c: Check USE_VARIADIC instead of (obsolete) HAVE_STDVARARGS. 64 (message): Ditto. 65 (error): Ditto. 66 (fatal): Ditto. 67 68 A number of patches for OS/2 support from Andreas Buening 69 <[email protected]>: 70 71 * job.c (child_handler) [OS/2]: Allow this on OS/2 but we have to 72 disable the SIGCHLD handler. 73 (reap_children) [OS/2]: Remove special handling of job_rfd. 74 (set_child_handler_action_flags) [OS/2]: Use this function in OS/2. 75 (new_job) [OS/2]: Disable the SIGCHLD handler on OS/2. 76 * main.c (main) [OS/2]: Special handling for paths in OS/2. 77 * configure.in [OS/2]: Force SA_RESTART for OS/2. 78 * Makefile.am (check-regression): Use $(EXEEXT) for Windows-type 79 systems. 80 81 2004-02-21 Paul D. Smith <[email protected]> 82 83 * w32/subproc/sub_proc.c (process_easy) [W32]: Christoph Schulz 84 <[email protected]> reports that if process_begin() fails we don't 85 handle the error condition correctly in all cases. 86 * w32/subproc/w32err.c (map_windows32_error_to_string): Make sure 87 to have a newline on the message. 88 89 * job.c (construct_command_argv_internal): Add "test" to UNIX 90 sh_cmds[]. Fixes Savannah bug # 7606. 91 92 2004-02-04 Paul D. Smith <[email protected]> 93 94 * job.c (vms_handle_apos) [VMS]: Fix various string handling 95 situations in VMS DCL. Fixes Savannah bug #5533. Fix provided by 96 Hartmut Becker <[email protected]>. 97 98 2004-01-21 Paul D. Smith <[email protected]> 99 100 * job.c (load_too_high): Implement an algorithm to control the 101 "thundering herd" problem when using -l to control job creation 102 via the load average. The system only recomputes the load once a 103 second but we can start many jobs in a second. To solve this we 104 keep track of the number of jobs started in the last second and 105 apply a weight to try to guess what a correct load would be. 106 The algorithm was provided by Thomas Riedl <[email protected]>. 107 Also fixes bug #4693. 108 (reap_children): Decrease the job count for this second. 109 (start_job_command): Increase the job count for this second. 110 111 * read.c (conditional_line): Expand the text after ifn?def before 112 checking to see if it's a single word. Fixes bug #7257. 113 114 2004-01-09 Paul D. Smith <[email protected]> 115 116 * file.c (print_file): Recurse to print all targets in 117 double-colon rules. Fixes bug #4518, reported (with patch) by 118 Andrew Chatham <[email protected]>. 119 120 2004-01-07 Paul D. Smith <[email protected]> 121 122 * acinclude.m4: Remove make_FUNC_SETVBUF_REVERSED. 123 * configure.in: Change make_FUNC_SETVBUF_REVERSED to 124 AC_FUNC_SETVBUF_REVERSED. 125 126 * doc/make.texi (Target-specific): Fix Savannah bug #1772. 127 (MAKE Variable): Fix Savannah bug #4898. 128 129 * job.c (construct_command_argv_internal): Add "!" to the list of 130 shell escape chars. POSIX sh allows it to appear before a 131 command, to negate the exit code. Fixes bug #6404. 132 133 * implicit.c (pattern_search): When matching an implicit rule, 134 remember which dependencies have the ignore_mtime flag set. 135 Original fix provided in Savannah patch #2349, by Benoit 136 Poulot-Cazajous <[email protected]>. 137 138 2003-11-22 Paul D. Smith <[email protected]> 139 140 * README.W32.template (Outputs): Clarification on -j with 141 BATCH_MODE_ONLY_SEHLL suggested by Jonathan R. Grant 142 <[email protected]>. 143 1 144 2003-11-02 Paul D. Smith <[email protected]> 2 145 … … 17 160 (get-config/config.guess get-config/config.sub): Get these files 18 161 from the Savannah config project instead of ftp.gnu.org. 162 163 2003-08-22 Paul D. Smith <[email protected]> 164 165 * misc.c (xmalloc, xrealloc): Add one to 0 sizes, to cater to 166 systems which don't yet implement the C89 standard :-/. 19 167 20 168 2003-07-18 Paul D. Smith <[email protected]> -
branches/GNU/src/gmake/INSTALL
r54 r153 1 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software 2 Foundation, Inc. 3 4 This file is free documentation; the Free Software Foundation gives 5 unlimited permission to copy, distribute and modify it. 6 1 7 Basic Installation 2 8 ================== 9 10 These are generic installation instructions. 3 11 4 12 The `configure' shell script attempts to guess correct values for … … 7 15 It may also create one or more `.h' files containing system-dependent 8 16 definitions. Finally, it creates a shell script `config.status' that 9 you can run in the future to recreate the current configuration, a file 10 `config.cache' that saves the results of its tests to speed up 11 reconfiguring, and a file `config.log' containing compiler output 12 (useful mainly for debugging `configure'). 17 you can run in the future to recreate the current configuration, and a 18 file `config.log' containing compiler output (useful mainly for 19 debugging `configure'). 20 21 It can also use an optional file (typically called `config.cache' 22 and enabled with `--cache-file=config.cache' or simply `-C') that saves 23 the results of its tests to speed up reconfiguring. (Caching is 24 disabled by default to prevent problems with accidental use of stale 25 cache files.) 13 26 14 27 If you need to do unusual things to compile the package, please try 15 28 to figure out how `configure' could check whether to do them, and mail 16 29 diffs or instructions to the address given in the `README' so they can 17 be considered for the next release. If at some point `config.cache' 18 contains results you don't want to keep, you may remove or edit it. 19 20 The file `configure.in' is used to create `configure' by a program 21 called `autoconf'. You only need `configure.in' if you want to change 22 it or regenerate `configure' using a newer version of `autoconf'. 30 be considered for the next release. If you are using the cache, and at 31 some point `config.cache' contains results you don't want to keep, you 32 may remove or edit it. 33 34 The file `configure.ac' (or `configure.in') is used to create 35 `configure' by a program called `autoconf'. You only need 36 `configure.ac' if you want to change it or regenerate `configure' using 37 a newer version of `autoconf'. 23 38 24 39 The simplest way to compile this package is: … … 35 50 2. Type `make' to compile the package. 36 51 37 If you're building GNU make on a system which does not already have 38 a `make', you can use the build.sh shell script to compile. Run 39 `sh ./build.sh'. This should compile the program in the current 40 directory. Then you will have a Make program that you can use for 41 `make install', or whatever else. 42 43 3. Optionally, type `./make check' to run any self-tests that come with 52 3. Optionally, type `make check' to run any self-tests that come with 44 53 the package. 45 54 … … 60 69 61 70 Some systems require unusual options for compilation or linking that 62 the `configure' script does not know about. You can give `configure' 63 initial values for variables by setting them in the environment. Using 64 a Bourne-compatible shell, you can do that on the command line like 65 this: 66 CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure 67 68 Or on systems that have the `env' program, you can do it like this: 69 env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 71 the `configure' script does not know about. Run `./configure --help' 72 for details on some of the pertinent environment variables. 73 74 You can give `configure' initial values for configuration parameters 75 by setting variables in the command line or in the environment. Here 76 is an example: 77 78 ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix 79 80 *Note Defining Variables::, for more details. 70 81 71 82 Compiling For Multiple Architectures … … 80 91 source code in the directory that `configure' is in and in `..'. 81 92 82 If you have to use a `make' that does not support sthe `VPATH'83 variable, you have to compile the package for one architecture at a time84 in the source code directory. After you have installed the package for 85 one architecture, use `make distclean' before reconfiguring for another 86 architecture.93 If you have to use a `make' that does not support the `VPATH' 94 variable, you have to compile the package for one architecture at a 95 time in the source code directory. After you have installed the 96 package for one architecture, use `make distclean' before reconfiguring 97 for another architecture. 87 98 88 99 Installation Names … … 127 138 ========================== 128 139 129 There may be some features `configure' can not figure out 130 automatically, but needs to determine by the type of host the package 131 will run on. Usually `configure' can figure that out, but if it prints 132 a message saying it can not guess the host type, give it the 133 `--host=TYPE' option. TYPE can either be a short name for the system 134 type, such as `sun4', or a canonical name with three fields: 140 There may be some features `configure' cannot figure out 141 automatically, but needs to determine by the type of machine the package 142 will run on. Usually, assuming the package is built to be run on the 143 _same_ architectures, `configure' can figure that out, but if it prints 144 a message saying it cannot guess the machine type, give it the 145 `--build=TYPE' option. TYPE can either be a short name for the system 146 type, such as `sun4', or a canonical name which has the form: 147 135 148 CPU-COMPANY-SYSTEM 136 149 137 See the file `config.sub' for the possible values of each field. If 150 where SYSTEM can have one of these forms: 151 152 OS KERNEL-OS 153 154 See the file `config.sub' for the possible values of each field. If 138 155 `config.sub' isn't included in this package, then this package doesn't 139 need to know the hosttype.140 141 If you are building compiler tools for cross-compiling, you can also156 need to know the machine type. 157 158 If you are _building_ compiler tools for cross-compiling, you should 142 159 use the `--target=TYPE' option to select the type of system they will 143 produce code for and the `--build=TYPE' option to select the type of 144 system on which you are compiling the package. 160 produce code for. 161 162 If you want to _use_ a cross compiler, that generates code for a 163 platform different from the build platform, you should specify the 164 "host" platform (i.e., that on which the generated programs will 165 eventually be run) with `--host=TYPE'. 145 166 146 167 Sharing Defaults … … 155 176 A warning: not all `configure' scripts look for a site script. 156 177 157 Operation Controls178 Defining Variables 158 179 ================== 180 181 Variables not defined in a site shell script can be set in the 182 environment passed to `configure'. However, some packages may run 183 configure again during the build, and the customized values of these 184 variables may be lost. In order to avoid this problem, you should set 185 them in the `configure' command line, using `VAR=value'. For example: 186 187 ./configure CC=/usr/local2/bin/gcc 188 189 will cause the specified gcc to be used as the C compiler (unless it is 190 overridden in the site shell script). 191 192 `configure' Invocation 193 ====================== 159 194 160 195 `configure' recognizes the following options to control how it 161 196 operates. 162 197 198 `--help' 199 `-h' 200 Print a summary of the options to `configure', and exit. 201 202 `--version' 203 `-V' 204 Print the version of Autoconf used to generate the `configure' 205 script, and exit. 206 163 207 `--cache-file=FILE' 164 Use and save the results of the tests in FILE instead of 165 `./config.cache'. Set FILE to `/dev/null' to disable caching, for 166 debugging `configure'. 167 168 `--help' 169 Print a summary of the options to `configure', and exit. 208 Enable the cache: use and save the results of the tests in FILE, 209 traditionally `config.cache'. FILE defaults to `/dev/null' to 210 disable caching. 211 212 `--config-cache' 213 `-C' 214 Alias for `--cache-file=config.cache'. 170 215 171 216 `--quiet' … … 180 225 `configure' can determine that directory automatically. 181 226 182 `--version' 183 Print the version of Autoconf used to generate the `configure' 184 script, and exit. 185 186 `configure' also accepts some other, not widely useful, options. 187 227 `configure' also accepts some other, not widely useful, options. Run 228 `configure --help' for more details. 229 -
branches/GNU/src/gmake/Makefile.am
r54 r153 1 1 # This is a -*-Makefile-*-, or close enough 2 2 3 AUTOMAKE_OPTIONS = 1. 7.6dist-bzip2 check-news ansi2knr3 AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr 4 4 ACLOCAL_AMFLAGS = -I config 5 5 … … 61 61 62 62 localedir = $(datadir)/locale 63 64 # We need this due to a bug in gettext 0.12.1 Makefile.in.in: without this I65 # can't run distcheck because this file is created but not removed during66 # distclean.67 68 distclean-local:69 test "$(srcdir)" = . || rm -f po/stamp-po70 63 71 64 # --------------- Local INSTALL Section … … 153 146 done; fi ;; \ 154 147 esac; \ 155 echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS)"; \156 cd tests && $(PERL) ./run_make_tests.pl -make ../make $(MAKETESTFLAGS); \148 echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \ 149 cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \ 157 150 else \ 158 151 echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \ -
branches/GNU/src/gmake/NEWS
r54 r153 1 1 GNU make NEWS -*-indented-text-*- 2 2 History of user-visible changes. 3 17 April 20034 5 Copyright (C) 2002,2003 Free Software Foundation, Inc.3 06 March 2004 4 5 Copyright (C) 2002,2003,2004 Free Software Foundation, Inc. 6 6 See the end for copying conditions. 7 7 … … 10 10 11 11 Please send GNU make bug reports to <[email protected]>. 12 See the README file and the GNU make manual for details on sending bug 13 reports. 14 15 16 Version 3.81rc1 12 See the README file and the GNU make manual for details on reporting bugs. 13 14 15 Version 3.81beta1 17 16 18 17 * GNU make is ported to OS/2. … … 28 27 call are now masked in the context of the inner call. 29 28 29 * Implemented a solution for the "thundering herd" problem with "-j -l". 30 This version of GNU make uses an algorithm suggested by Thomas Riedl 31 <[email protected]> to track the number of jobs started in the 32 last second and adjust GNU make's view of the system's load average 33 accordingly. 34 30 35 * Enhancements for POSIX compatibility: 31 36 - Only touch targets (under -t) if they have at least one command. 32 37 33 * Updated to autoconf 2.5 7, automake 1.7.6, and gettext 0.12.1. Users38 * Updated to autoconf 2.59, automake 1.8.2, and gettext 0.14.1. Users 34 39 should not be impacted. 35 40 -
branches/GNU/src/gmake/ar.c
r54 r153 124 124 /* ARGSUSED */ 125 125 static long int 126 ar_member_date_1 (int desc, char *mem, int truncated, 127 long int hdrpos, long int datapos, long int size, 128 long int date, int uid, int gid, int mode, char *name) 126 ar_member_date_1 (int desc UNUSED, char *mem, int truncated, 127 long int hdrpos UNUSED, long int datapos UNUSED, 128 long int size UNUSED, long int date, 129 int uid UNUSED, int gid UNUSED, int mode UNUSED, char *name) 129 130 { 130 131 return ar_name_equal (name, mem, truncated) ? date : 0; … … 213 214 214 215 static long int 215 ar_glob_match (int desc , char *mem, int truncated,216 long int hdrpos , long int datapos, long int size,217 long int date, int uid, int gid, int mode,218 struct ar_glob_state *state)216 ar_glob_match (int desc UNUSED, char *mem, int truncated UNUSED, 217 long int hdrpos UNUSED, long int datapos UNUSED, 218 long int size UNUSED, long int date UNUSED, int uid UNUSED, 219 int gid UNUSED, int mode UNUSED, struct ar_glob_state *state) 219 220 { 220 221 if (fnmatch (state->pattern, mem, FNM_PATHNAME|FNM_PERIOD) == 0) -
branches/GNU/src/gmake/arscan.c
r54 r153 742 742 /* ARGSUSED */ 743 743 static long int 744 ar_member_pos (int desc, char *mem, int truncated, 745 long int hdrpos, long int datapos, long int size, 746 long int date, int uid, int gid, int mode, char *name) 744 ar_member_pos (int desc UNUSED, char *mem, int truncated, 745 long int hdrpos, long int datapos UNUSED, long int size UNUSED, 746 long int date UNUSED, int uid UNUSED, int gid UNUSED, 747 int mode UNUSED, char *name) 747 748 { 748 749 if (!ar_name_equal (name, mem, truncated)) … … 761 762 ar_member_touch (char *arname, char *memname) 762 763 { 763 registerlong int pos = ar_scan (arname, ar_member_pos, (long int) memname);764 registerint fd;764 long int pos = ar_scan (arname, ar_member_pos, (long int) memname); 765 int fd; 765 766 struct ar_hdr ar_hdr; 766 register int i; 767 int i; 768 unsigned int ui; 767 769 struct stat statbuf; 768 770 … … 791 793 #if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32) 792 794 /* Advance member's time to that time */ 793 for ( i = 0; i < sizeof ar_hdr.ar_date;i++)794 ar_hdr.ar_date[ i] = ' ';795 for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++) 796 ar_hdr.ar_date[ui] = ' '; 795 797 sprintf (ar_hdr.ar_date, "%ld", (long int) statbuf.st_mtime); 796 798 #ifdef AIAMAG -
branches/GNU/src/gmake/build_w32.bat
r54 r153 1 1 set make=gnumake 2 +if not exist config.h copy config.h.W32 config.h2 if not exist config.h copy config.h.W32 config.h 3 3 cd w32\subproc 4 4 echo "Creating the subproc library" -
branches/GNU/src/gmake/commands.c
r54 r153 129 129 { 130 130 static char *plus_value=0, *bar_value=0, *qmark_value=0; 131 static int qmark_max=0, plus_max=0, bar_max=0;131 static unsigned int qmark_max=0, plus_max=0, bar_max=0; 132 132 133 133 unsigned int qmark_len, plus_len, bar_len; -
branches/GNU/src/gmake/configure.in
r54 r153 1 1 # Process this file with autoconf to produce a configure script. 2 2 3 AC_INIT([GNU make],[3.81rc1],[[email protected]]) 4 5 AC_PREREQ(2.57) 6 7 AC_REVISION([[$Id: configure.in,v 1.120 2003/07/31 13:04:32 psmith Exp $]]) 3 AC_INIT([GNU make],[3.81beta1],[[email protected]]) 4 5 AC_PREREQ(2.59) 6 AC_REVISION([[$Id: configure.in,v 1.125 2004/03/06 08:05:19 psmith Exp $]]) 8 7 9 8 # Autoconf setup … … 13 12 14 13 # Automake setup 15 AM_INIT_AUTOMAKE([1. 7.6])14 AM_INIT_AUTOMAKE([1.8.2]) 16 15 17 16 # Checks for programs. … … 35 34 # Enable gettext, in "external" mode. 36 35 37 AM_GNU_GETTEXT_VERSION(0.1 2.1)36 AM_GNU_GETTEXT_VERSION(0.14.1) 38 37 AM_GNU_GETTEXT([external]) 39 38 … … 54 53 memory.h sys/param.h sys/time.h sys/timeb.h) 55 54 55 # Set a flag if we have an ANSI C compiler 56 if test "$ac_cv_prog_cc_stdc" != no; then 57 AC_DEFINE(HAVE_ANSI_COMPILER, 1, 58 [Define if your compiler conforms to the ANSI C standard.]) 59 fi 60 61 62 # Determine what kind of variadic function calls we support 63 AC_CHECK_HEADERS(stdarg.h varargs.h, break) 64 56 65 AM_PROG_CC_C_O 57 AM_PROG_CC_STDC58 66 AC_C_CONST 59 67 AC_TYPE_SIGNAL … … 131 139 strerror strsignal) 132 140 133 make_FUNC_SETVBUF_REVERSED141 AC_FUNC_SETVBUF_REVERSED 134 142 135 143 # strcoll() is used by the GNU glob library … … 246 254 [make_cv_sa_restart=yes], 247 255 [make_cv_sa_restart=no])]) 256 257 # enable make_cv_sa_restart for OS/2 258 case "$host_os" in 259 os2*) make_cv_sa_restart=yes ;; 260 esac 261 248 262 if test "$make_cv_sa_restart" != no; then 249 263 AC_DEFINE(HAVE_SA_RESTART, 1, … … 328 342 AM_WITH_DMALLOC 329 343 344 # Forcibly disable SET_MAKE. If it's set it breaks things like the test 345 # scripts, etc. 346 SET_MAKE= 330 347 331 348 # Sanity check and inform the user of what we found -
branches/GNU/src/gmake/doc/make.texi
r53 r153 8 8 @c FSF publishers: format makebook.texi instead of using this file directly. 9 9 10 @set RCSID $Id: make.texi,v 1.1 6 2003/11/03 22:04:12psmith Exp $10 @set RCSID $Id: make.texi,v 1.18 2004/02/23 06:25:54 psmith Exp $ 11 11 @set EDITION 0.61 12 12 @set VERSION 3.81 … … 39 39 of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}. 40 40 41 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 41 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 42 1998, 1999, 2000, 2002, 2003, 2004 42 43 Free Software Foundation, Inc. 43 44 … … 58 59 @subtitle GNU @code{make} Version @value{VERSION} 59 60 @subtitle @value{UPDATE-MONTH} 60 @author Richard M. Stallman, Roland McGrath, Paul Smith61 @author Richard M. Stallman, Roland McGrath, Paul D. Smith 61 62 @page 62 63 @vskip 0pt plus 1filll 63 64 Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 64 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.65 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. 65 66 @sp 2 66 67 Published by the Free Software Foundation @* … … 351 352 This manual describes GNU @code{make}, which was implemented by Richard 352 353 Stallman and Roland McGrath. Development since Version 3.76 has been 353 handled by Paul Smith.354 handled by Paul D. Smith. 354 355 355 356 GNU @code{make} conforms to section 6.2 of @cite{IEEE Standard … … 1949 1950 directories that @code{make} should search. Most often, the 1950 1951 directories are expected to contain prerequisite files that are not in the 1951 current directory; however, @code{VPATH} specifies a search list that 1952 @code{make} applies for all files, including files which are targets of 1953 rules. 1952 current directory; however, @code{make} uses @code{VPATH} as a search 1953 list for both prerequisites and targets of rules. 1954 1954 1955 1955 Thus, if a file that is listed as a target or prerequisite does not exist … … 3676 3676 Using the @code{MAKE} variable has the same effect as using a @samp{+} 3677 3677 character at the beginning of the command line. @xref{Instead of 3678 Execution, ,Instead of Executing the Commands}.@refill 3678 Execution, ,Instead of Executing the Commands}. This special feature 3679 is only enabled if the @code{MAKE} variable appears directly in the 3680 command script: it does not apply if the @code{MAKE} variable is 3681 referenced through expansion of another variable. In the latter case 3682 you must use the @samp{+} token to get these special effects.@refill 3679 3683 3680 3684 Consider the command @samp{make -t} in the above example. (The … … 5226 5230 variable value to be preferred. 5227 5231 5228 There is one more special feature of target-specific variables: when you 5229 define a target-specific variable, that variable value is also in effect 5230 for all prerequisites of this target (unless those prerequisites override 5231 it with their own target-specific variable value). So, for example, a 5232 There is one more special feature of target-specific variables: when 5233 you define a target-specific variable that variable value is also in 5234 effect for all prerequisites of this target, and all their 5235 prerequisites, etc. (unless those prerequisites override that variable 5236 with their own target-specific variable value). So, for example, a 5232 5237 statement like this: 5233 5238 … … 5241 5246 @file{prog}, but it will also set @code{CFLAGS} to @samp{-g} in the 5242 5247 command scripts that create @file{prog.o}, @file{foo.o}, and 5243 @file{bar.o}, and any command scripts which create their prerequisites. 5248 @file{bar.o}, and any command scripts which create their 5249 prerequisites. 5250 5251 Be aware that a given prerequisite will only be built once per 5252 invocation of make, at most. If the same file is a prerequisite of 5253 multiple targets, and each of those targets has a different value for 5254 the same target-specific variable, then the first target to be built 5255 will cause that prerequisite to be built and the prerequisite will 5256 inherit the target-specific value from the first target. It will 5257 ignore the target-specific values from any other targets. 5244 5258 5245 5259 @node Pattern-specific, , Target-specific, Using Variables … … 6456 6470 6457 6471 define PROGRAM_template 6458 $(1): $$($(1)_OBJ ) $$($(1)_LIBS:%=-l%)6472 $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) 6459 6473 ALL_OBJS += $$($(1)_OBJS) 6460 6474 endef … … 6586 6600 @cindex shell command, function for 6587 6601 6588 The @code{shell} function is unlike any other function exceptthe6602 The @code{shell} function is unlike any other function other than the 6589 6603 @code{wildcard} function 6590 6604 (@pxref{Wildcard Function, ,The Function @code{wildcard}}) in that it … … 6592 6606 6593 6607 The @code{shell} function performs the same function that backquotes 6594 (@samp{`}) perform in most shells: it does @dfn{command expansion}. This 6595 means that it takes an argument that is a shell command and returns the 6596 output of the command. The only processing @code{make} does on the result, 6597 before substituting it into the surrounding text, is to convert each 6598 newline or carriage-return / newline pair to a single space. It also 6599 removes the trailing (carriage-return and) newline, if it's the last 6600 thing in the result.@refill 6608 (@samp{`}) perform in most shells: it does @dfn{command expansion}. 6609 This means that it takes as an argument a shell command and evaluates 6610 to the output of the command. The only processing @code{make} does on 6611 the result is to convert each newline (or carriage-return / newline 6612 pair) to a single space. If there is a trailing (carriage-return 6613 and) newline it will simply be removed.@refill 6601 6614 6602 6615 The commands run by calls to the @code{shell} function are run when the -
branches/GNU/src/gmake/file.c
r54 r153 531 531 532 532 void 533 set_command_state (struct file *file, intstate)533 set_command_state (struct file *file, enum cmd_state state) 534 534 { 535 535 struct dep *d; … … 759 759 if (f->cmds != 0) 760 760 print_commands (f->cmds); 761 762 if (f->prev) 763 print_file ((const void *) f->prev); 761 764 } 762 765 -
branches/GNU/src/gmake/filedef.h
r54 r153 66 66 or -1 if none has been made. */ 67 67 68 enum 68 enum cmd_state /* State of the commands. */ 69 69 { /* Note: It is important that cs_not_started be zero. */ 70 70 cs_not_started, /* Not yet started. */ … … 109 109 extern void rename_file PARAMS ((struct file *file, char *name)); 110 110 extern void rehash_file PARAMS ((struct file *file, char *name)); 111 extern void set_command_state PARAMS ((struct file *file, intstate));111 extern void set_command_state PARAMS ((struct file *file, enum cmd_state state)); 112 112 extern void notice_finished_file PARAMS ((struct file *file)); 113 113 extern void init_hash_files PARAMS ((void)); -
branches/GNU/src/gmake/function.c
r54 r153 402 402 403 403 static char * 404 func_patsubst (char *o, char **argv, const char *funcname )404 func_patsubst (char *o, char **argv, const char *funcname UNUSED) 405 405 { 406 406 o = patsubst_expand (o, argv[2], argv[0], argv[1], (char *) 0, (char *) 0); … … 410 410 411 411 static char * 412 func_join (char *o, char **argv, const char *funcname )412 func_join (char *o, char **argv, const char *funcname UNUSED) 413 413 { 414 414 int doneany = 0; … … 450 450 451 451 static char * 452 func_origin (char *o, char **argv, const char *funcname )452 func_origin (char *o, char **argv, const char *funcname UNUSED) 453 453 { 454 454 /* Expand the argument. */ … … 645 645 646 646 static char * 647 func_subst (char *o, char **argv, const char *funcname )647 func_subst (char *o, char **argv, const char *funcname UNUSED) 648 648 { 649 649 o = subst_expand (o, argv[2], argv[0], argv[1], strlen (argv[0]), … … 655 655 656 656 static char * 657 func_firstword (char *o, char **argv, const char *funcname )657 func_firstword (char *o, char **argv, const char *funcname UNUSED) 658 658 { 659 659 unsigned int i; … … 669 669 670 670 static char * 671 func_words (char *o, char **argv, const char *funcname )671 func_words (char *o, char **argv, const char *funcname UNUSED) 672 672 { 673 673 int i = 0; … … 718 718 719 719 static char * 720 func_word (char *o, char **argv, const char *funcname )720 func_word (char *o, char **argv, const char *funcname UNUSED) 721 721 { 722 722 char *end_p=0; … … 744 744 745 745 static char * 746 func_wordlist (char *o, char **argv, const char *funcname )746 func_wordlist (char *o, char **argv, const char *funcname UNUSED) 747 747 { 748 748 int start, count; … … 781 781 782 782 static char* 783 func_findstring (char *o, char **argv, const char *funcname )783 func_findstring (char *o, char **argv, const char *funcname UNUSED) 784 784 { 785 785 /* Find the first occurrence of the first string in the second. */ … … 792 792 793 793 static char * 794 func_foreach (char *o, char **argv, const char *funcname )794 func_foreach (char *o, char **argv, const char *funcname UNUSED) 795 795 { 796 796 /* expand only the first two. */ … … 1012 1012 1013 1013 static char * 1014 func_strip (char *o, char **argv, const char *funcname )1014 func_strip (char *o, char **argv, const char *funcname UNUSED) 1015 1015 { 1016 1016 char *p = argv[0]; … … 1081 1081 */ 1082 1082 static char * 1083 func_sort (char *o, char **argv, const char *funcname )1083 func_sort (char *o, char **argv, const char *funcname UNUSED) 1084 1084 { 1085 1085 char **words = 0; … … 1143 1143 1144 1144 static char * 1145 func_if (char *o, char **argv, const char *funcname )1145 func_if (char *o, char **argv, const char *funcname UNUSED) 1146 1146 { 1147 1147 const char *begp = argv[0]; … … 1184 1184 1185 1185 static char * 1186 func_wildcard (char *o, char **argv, const char *funcname )1186 func_wildcard (char *o, char **argv, const char *funcname UNUSED) 1187 1187 { 1188 1188 … … 1205 1205 1206 1206 static char * 1207 func_eval (char *o, char **argv, const char *funcname )1207 func_eval (char *o, char **argv, const char *funcname UNUSED) 1208 1208 { 1209 1209 char *buf; … … 1224 1224 1225 1225 static char * 1226 func_value (char *o, char **argv, const char *funcname )1226 func_value (char *o, char **argv, const char *funcname UNUSED) 1227 1227 { 1228 1228 /* Look up the variable. */ … … 1424 1424 #ifndef _AMIGA 1425 1425 static char * 1426 func_shell (char *o, char **argv, const char *funcname )1426 func_shell (char *o, char **argv, const char *funcname UNUSED) 1427 1427 { 1428 1428 char* batch_filename = NULL; 1429 int i;1429 unsigned int i; 1430 1430 1431 1431 #ifdef __MSDOS__ … … 1921 1921 1922 1922 static char * 1923 func_call (char *o, char **argv, const char *funcname )1923 func_call (char *o, char **argv, const char *funcname UNUSED) 1924 1924 { 1925 1925 static int max_args = 0; -
branches/GNU/src/gmake/implicit.c
r54 r153 106 106 /* This buffer records all the dependencies actually found for a rule. */ 107 107 char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *)); 108 /* Remember whether the associated dep has an "ignore_mtime" flag set. */ 109 unsigned char *found_files_im = (unsigned char *) alloca (max_pattern_deps * sizeof (unsigned char)); 108 110 /* Number of dep names now in FOUND_FILES. */ 109 111 unsigned int deps_found = 0; … … 400 402 || ((!dep->changed || check_lastslash) && file_exists_p (p))) 401 403 { 404 found_files_im[deps_found] = dep->ignore_mtime; 402 405 found_files[deps_found++] = xstrdup (p); 403 406 continue; … … 411 414 (_("Found prerequisite `%s' as VPATH `%s'\n"), p, vp)); 412 415 strcpy (vp, p); 416 found_files_im[deps_found] = dep->ignore_mtime; 413 417 found_files[deps_found++] = vp; 414 418 continue; … … 440 444 intermediate_files[deps_found] = intermediate_file; 441 445 intermediate_file = 0; 446 found_files_im[deps_found] = dep->ignore_mtime; 442 447 /* Allocate an extra copy to go in FOUND_FILES, 443 448 because every elt of FOUND_FILES is consumed 444 449 or freed later. */ 445 found_files[deps_found] = xstrdup (p); 446 ++deps_found; 450 found_files[deps_found++] = xstrdup (p); 447 451 continue; 448 452 } … … 544 548 545 549 dep = (struct dep *) xmalloc (sizeof (struct dep)); 546 dep->ignore_mtime = 0;550 dep->ignore_mtime = found_files_im[deps_found]; 547 551 s = found_files[deps_found]; 548 552 if (recursions == 0) -
branches/GNU/src/gmake/job.c
r54 r153 55 55 #elif defined (__EMX__) 56 56 57 c onst char *default_shell = "/bin/sh";57 char *default_shell = "/bin/sh"; 58 58 int batch_mode_shell = 0; 59 59 … … 223 223 224 224 int unixy_shell = 1; 225 226 /* Number of jobs started in the current second. */ 227 228 unsigned long job_counter = 0; 225 229 226 230 … … 363 367 364 368 365 /* 366 found apostrophe at (p-1) 367 368 inc p until after closing apostrophe. */ 369 /* found apostrophe at (p-1) 370 inc p until after closing apostrophe. 371 */ 369 372 370 373 static char * 371 handle_apos (char *p)374 vms_handle_apos (char *p) 372 375 { 373 376 int alast; 374 int inside;375 377 376 378 #define SEPCHARS ",/()= " 377 379 378 inside= 0;380 alast = 0; 379 381 380 382 while (*p != 0) … … 382 384 if (*p == '"') 383 385 { 384 if (inside) 385 { 386 while ((alast > 0) 387 && (*p == '"')) 388 { 389 p++; 390 alast--; 391 } 392 if (alast == 0) 393 inside = 0; 394 else 395 { 396 fprintf (stderr, _("Syntax error, still inside '\"'\n")); 397 exit (3); 398 } 386 if (alast) 387 { 388 alast = 0; 389 p++; 399 390 } 400 391 else … … 403 394 if (strchr (SEPCHARS, *p)) 404 395 break; 405 inside = 1;406 396 alast = 1; 407 while (*p == '"')408 {409 alast++;410 p++;411 }412 397 } 413 398 } … … 434 419 static unsigned int dead_children = 0; 435 420 436 #ifndef __EMX__ /* Don't use SIGCHLD handler on OS/2. */437 421 RETSIGTYPE 438 child_handler (int sig )422 child_handler (int sig UNUSED) 439 423 { 440 424 ++dead_children; … … 446 430 } 447 431 432 #ifdef __EMX__ 433 /* The signal handler must called only once! */ 434 signal (SIGCHLD, SIG_DFL); 435 #endif 436 437 /* This causes problems if the SIGCHLD interrupts a printf(). 448 438 DB (DB_JOBS, (_("Got a SIGCHLD; %u unreaped children.\n"), dead_children)); 439 */ 449 440 } 450 #endif /* !__EMX__ */451 441 452 442 extern int shell_function_pid, shell_function_completed; … … 579 569 coredump = WCOREDUMP (status); 580 570 581 #ifdef __EMX__ 582 /* the SIGCHLD handler must not be used on OS/2 because, unlike 583 on UNIX systems, it had to call wait() itself. Therefore 584 job_rfd has to be closed here. */ 585 if (job_rfd >= 0) 586 { 587 close (job_rfd); 588 job_rfd = -1; 589 } 590 #endif 591 571 /* If we have started jobs in this second, remove one. */ 572 if (job_counter) 573 --job_counter; 592 574 } 593 575 else … … 899 881 900 882 #ifdef MAKE_JOBSERVER 901 # ifdef __EMX__902 /* Never install the SIGCHLD handler for EMX!!! */903 # define set_child_handler_action_flags(x)904 # else905 883 /* Set the child handler action flags to FLAGS. */ 906 884 static void … … 918 896 #endif 919 897 } 920 #endif /* !__EMX__ */921 898 #endif 922 899 … … 1357 1334 #endif /* __MSDOS__ or Amiga or WINDOWS32 */ 1358 1335 1336 /* Bump the number of jobs started in this second. */ 1337 ++job_counter; 1338 1359 1339 /* We are the parent side. Set the state to 1360 1340 say the commands are running and return. */ … … 1645 1625 got_token = read (job_rfd, &token, 1); 1646 1626 saved_errno = errno; 1627 #ifdef __EMX__ 1628 /* The child handler must be turned off here. */ 1629 signal (SIGCHLD, SIG_DFL); 1630 #endif 1647 1631 set_child_handler_action_flags (SA_RESTART); 1648 1632 … … 1701 1685 } 1702 1686 1687 /* Determine if the load average on the system is too high to start a new job. 1688 The real system load average is only recomputed once a second. However, a 1689 very parallel make can easily start tens or even hundreds of jobs in a 1690 second, which brings the system to its knees for a while until that first 1691 batch of jobs clears out. 1692 1693 To avoid this we use a weighted algorithm to try to account for jobs which 1694 have been started since the last second, and guess what the load average 1695 would be now if it were computed. 1696 1697 This algorithm was provided by Thomas Riedl <[email protected]>, 1698 who writes: 1699 1700 ! calculate something load-oid and add to the observed sys.load, 1701 ! so that latter can catch up: 1702 ! - every job started increases jobctr; 1703 ! - every dying job decreases a positive jobctr; 1704 ! - the jobctr value gets zeroed every change of seconds, 1705 ! after its value*weight_b is stored into the 'backlog' value last_sec 1706 ! - weight_a times the sum of jobctr and last_sec gets 1707 ! added to the observed sys.load. 1708 ! 1709 ! The two weights have been tried out on 24 and 48 proc. Sun Solaris-9 1710 ! machines, using a several-thousand-jobs-mix of cpp, cc, cxx and smallish 1711 ! sub-shelled commands (rm, echo, sed...) for tests. 1712 ! lowering the 'direct influence' factor weight_a (e.g. to 0.1) 1713 ! resulted in significant excession of the load limit, raising it 1714 ! (e.g. to 0.5) took bad to small, fast-executing jobs and didn't 1715 ! reach the limit in most test cases. 1716 ! 1717 ! lowering the 'history influence' weight_b (e.g. to 0.1) resulted in 1718 ! exceeding the limit for longer-running stuff (compile jobs in 1719 ! the .5 to 1.5 sec. range),raising it (e.g. to 0.5) overrepresented 1720 ! small jobs' effects. 1721 1722 */ 1723 1724 #define LOAD_WEIGHT_A 0.25 1725 #define LOAD_WEIGHT_B 0.25 1726 1703 1727 static int 1704 1728 load_too_high (void) … … 1707 1731 return 1; 1708 1732 #else 1709 double load; 1733 static double last_sec; 1734 static time_t last_now; 1735 double load, guess; 1736 time_t now; 1710 1737 1711 1738 if (max_load_average < 0) 1712 1739 return 0; 1713 1740 1741 /* Find the real system load average. */ 1714 1742 make_access (); 1715 1743 if (getloadavg (&load, 1) != 1) … … 1731 1759 user_access (); 1732 1760 1733 DB (DB_JOBS, ("Current system load = %f (max requested = %f)\n", 1734 load, max_load_average)); 1735 return load >= max_load_average; 1761 /* If we're in a new second zero the counter and correct the backlog 1762 value. Only keep the backlog for one extra second; after that it's 0. */ 1763 now = time (NULL); 1764 if (last_now < now) 1765 { 1766 if (last_now == now - 1) 1767 last_sec = LOAD_WEIGHT_B * job_counter; 1768 else 1769 last_sec = 0.0; 1770 1771 job_counter = 0; 1772 last_now = now; 1773 } 1774 1775 /* Try to guess what the load would be right now. */ 1776 guess = load + (LOAD_WEIGHT_A * (job_counter + last_sec)); 1777 1778 DB (DB_JOBS, ("Estimated system load = %f (actual = %f) (max requested = %f)\n", 1779 guess, load, max_load_average)); 1780 1781 return guess >= max_load_average; 1736 1782 #endif 1737 1783 } … … 2169 2215 comma or space and before slash. */ 2170 2216 case '"': 2171 q = handle_apos (q + 1);2217 q = vms_handle_apos (q); 2172 2218 sep = q; 2173 2219 break; … … 2706 2752 char** sh_cmds; 2707 2753 #else /* must be UNIX-ish */ 2708 static char sh_chars[] = "#;\"*?[]&|<>(){}$`^~ ";2709 static char *sh_cmds[] = { " cd", "eval", "exec", "exit", "login",2710 "logout", "set", "umask", "wait", "while", "for",2711 "case", "if", ":", ".", "break", "continue",2712 "export", "read", "readonly", "shift", "times",2713 "trap", "switch", 0 };2714 #endif /* __MSDOS__ */2754 static char sh_chars[] = "#;\"*?[]&|<>(){}$`^~!"; 2755 static char *sh_cmds[] = { ".", ":", "break", "case", "cd", "continue", 2756 "eval", "exec", "exit", "export", "for", "if", 2757 "login", "logout", "read", "readonly", "set", 2758 "shift", "switch", "test", "times", "trap", 2759 "umask", "wait", "while", 0 }; 2760 #endif 2715 2761 register int i; 2716 2762 register char *p; -
branches/GNU/src/gmake/main.c
r54 r153 392 392 { CHAR_MAX+4, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0, 393 393 "warn-undefined-variables" }, 394 { '\0',}394 { 0 } 395 395 }; 396 396 … … 550 550 551 551 static RETSIGTYPE 552 debug_signal_handler (int sig )552 debug_signal_handler (int sig UNUSED) 553 553 { 554 554 db_level = db_level ? DB_NONE : DB_BASIC; … … 839 839 { 840 840 static char *stdin_nm = 0; 841 registerstruct file *f;842 register unsignedint i;841 struct file *f; 842 int i; 843 843 char **p; 844 844 struct dep *read_makefiles; … … 1163 1163 if (current_directory[0] != '\0' 1164 1164 && argv[0] != 0 1165 && (argv[0][0] != '/' && (argv[0][0] == '\0' || argv[0][1] != ':'))) 1165 && (argv[0][0] != '/' && (argv[0][0] == '\0' || argv[0][1] != ':')) 1166 #ifdef __EMX__ 1167 /* do not prepend cwd if argv[0] contains no '/', e.g. "make" */ 1168 && (strchr (argv[0], '/') != 0 || strchr (argv[0], '\\') != 0) 1169 # endif 1170 ) 1166 1171 argv[0] = concat (current_directory, "/", argv[0]); 1167 1172 #else /* !__MSDOS__ */ … … 1510 1515 { 1511 1516 char *cp; 1512 1513 for (i=1; i < jobserver_fds->idx; ++i) 1514 if (!streq (jobserver_fds->list[0], jobserver_fds->list[i])) 1517 unsigned int ui; 1518 1519 for (ui=1; ui < jobserver_fds->idx; ++ui) 1520 if (!streq (jobserver_fds->list[0], jobserver_fds->list[ui])) 1515 1521 fatal (NILF, _("internal error: multiple --jobserver-fds options")); 1516 1522 … … 1743 1749 in updating or could not be found at all. */ 1744 1750 int any_failed = 0; 1745 registerunsigned int i;1751 unsigned int i; 1746 1752 struct dep *d; 1747 1753 … … 1817 1823 { 1818 1824 /* These names might have changed. */ 1819 register unsignedint i, j = 0;1825 int i, j = 0; 1820 1826 for (i = 1; i < argc; ++i) 1821 1827 if (strneq (argv[i], "-f", 2)) /* XXX */ … … 2022 2028 init_switches (void) 2023 2029 { 2024 registerchar *p;2025 registerint c;2026 registerunsigned int i;2030 char *p; 2031 unsigned int c; 2032 unsigned int i; 2027 2033 2028 2034 if (options[0] != '\0') … … 2236 2242 if (optarg == 0) 2237 2243 optarg = cs->noarg_value; 2244 else if (*optarg == '\0') 2245 { 2246 error (NILF, _("the `-%c' option requires a non-empty string argument"), 2247 cs->c); 2248 bad = 1; 2249 } 2238 2250 2239 2251 sl = *(struct stringlist **) cs->value_ptr; -
branches/GNU/src/gmake/make.h
r54 r153 211 211 # endif 212 212 #endif 213 #define UNUSED __attribute__ ((unused)) 213 214 214 215 #if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) … … 388 389 389 390 390 /* Fancy processing for variadic functions in both ANSI and pre-ANSI 391 compilers. */ 392 #if defined __STDC__ && __STDC__ 391 /* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use 392 variadic versions of these functions. */ 393 394 #if HAVE_STDARG_H || HAVE_VARARGS_H 395 # if HAVE_VPRINTF || HAVE_DOPRNT 396 # define USE_VARIADIC 1 397 # endif 398 #endif 399 400 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 393 401 extern void message (int prefix, const char *fmt, ...) 394 402 __attribute__ ((__format__ (__printf__, 2, 3))); … … 448 456 extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath)); 449 457 extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr)); 450 extern int gpath_search PARAMS ((char *file, int len));458 extern int gpath_search PARAMS ((char *file, unsigned int len)); 451 459 452 460 extern void construct_include_path PARAMS ((char **arg_dirs)); -
branches/GNU/src/gmake/misc.c
r54 r153 31 31 VA_END macros used here since we have multiple print functions. */ 32 32 33 #if HAVE_VPRINTF || HAVE_DOPRNT 34 # define HAVE_STDVARARGS 1 35 # if __STDC__ 33 #if USE_VARIADIC 34 # if HAVE_STDARG_H 36 35 # include <stdarg.h> 37 36 # define VA_START(args, lastarg) va_start(args, lastarg) … … 47 46 # define VA_END(args) va_end(args) 48 47 #else 49 /* # undef HAVE_STDVARARGS*/48 /* We can't use any variadic interface! */ 50 49 # define va_alist a1, a2, a3, a4, a5, a6, a7, a8 51 50 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; … … 211 210 212 211 void 213 #if __STDC__ && HAVE_STDVARARGS212 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 214 213 message (int prefix, const char *fmt, ...) 215 214 #else … … 220 219 #endif 221 220 { 222 #if HAVE_STDVARARGS221 #if USE_VARIADIC 223 222 va_list args; 224 223 #endif … … 247 246 248 247 void 249 #if __STDC__ && HAVE_STDVARARGS248 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 250 249 error (const struct floc *flocp, const char *fmt, ...) 251 250 #else … … 256 255 #endif 257 256 { 258 #if HAVE_STDVARARGS257 #if USE_VARIADIC 259 258 va_list args; 260 259 #endif … … 280 279 281 280 void 282 #if __STDC__ && HAVE_STDVARARGS281 #if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H 283 282 fatal (const struct floc *flocp, const char *fmt, ...) 284 283 #else … … 289 288 #endif 290 289 { 291 #if HAVE_STDVARARGS290 #if USE_VARIADIC 292 291 va_list args; 293 292 #endif … … 363 362 xmalloc (unsigned int size) 364 363 { 365 char *result = (char *) malloc (size); 364 /* Make sure we don't allocate 0, for pre-ANSI libraries. */ 365 char *result = (char *) malloc (size ? size : 1); 366 366 if (result == 0) 367 367 fatal (NILF, _("virtual memory exhausted")); … … 376 376 377 377 /* Some older implementations of realloc() don't conform to ANSI. */ 378 if (! size) 379 size = 1; 378 380 result = ptr ? realloc (ptr, size) : malloc (size); 379 381 if (result == 0) -
branches/GNU/src/gmake/read.c
r54 r153 138 138 const struct floc *flocp, int set_default)); 139 139 static void record_target_var PARAMS ((struct nameseq *filenames, char *defn, 140 int two_colon,141 140 enum variable_origin origin, 142 141 int enabled, … … 510 509 while (1) 511 510 { 512 int linelen;511 unsigned int linelen; 513 512 char *line; 514 513 int len; … … 1058 1057 exported = 0; 1059 1058 if (wtype == w_static) 1060 if (word1eq ("override")) 1061 { 1062 v_origin = o_override; 1063 wtype = get_next_mword (p+len, NULL, &p, &len); 1064 } 1065 else if (word1eq ("export")) 1066 { 1067 exported = 1; 1068 wtype = get_next_mword (p+len, NULL, &p, &len); 1069 } 1059 { 1060 if (word1eq ("override")) 1061 { 1062 v_origin = o_override; 1063 wtype = get_next_mword (p+len, NULL, &p, &len); 1064 } 1065 else if (word1eq ("export")) 1066 { 1067 exported = 1; 1068 wtype = get_next_mword (p+len, NULL, &p, &len); 1069 } 1070 } 1070 1071 1071 1072 if (wtype != w_eol) … … 1084 1085 p = variable_buffer + l; 1085 1086 } 1086 record_target_var (filenames, p, two_colon, v_origin, exported, 1087 fstart); 1087 record_target_var (filenames, p, v_origin, exported, fstart); 1088 1088 filenames = 0; 1089 1089 continue; … … 1464 1464 char *var; 1465 1465 struct variable *v; 1466 register char *p = end_of_token (line); 1467 i = p - line; 1466 register char *p; 1467 1468 /* Expand the thing we're looking up, so we can use indirect and 1469 constructed variable names. */ 1470 var = allocated_variable_expand (line); 1471 1472 /* Make sure there's only one variable name to test. */ 1473 p = end_of_token (var); 1474 i = p - var; 1468 1475 p = next_token (p); 1469 1476 if (*p != '\0') 1470 1477 return -1; 1471 1478 1472 /* Expand the thing we're looking up, so we can use indirect and 1473 constructed variable names. */ 1474 line[i] = '\0'; 1475 var = allocated_variable_expand (line); 1476 1479 var[i] = '\0'; 1477 1480 v = lookup_variable (var, strlen (var)); 1478 1481 conditionals->ignoring[conditionals->if_cmds - 1] … … 1660 1663 1661 1664 static void 1662 record_target_var (struct nameseq *filenames, char *defn, int two_colon,1665 record_target_var (struct nameseq *filenames, char *defn, 1663 1666 enum variable_origin origin, int exported, 1664 1667 const struct floc *flocp) -
branches/GNU/src/gmake/remake.c
r54 r153 1342 1342 { 1343 1343 static char *buf = NULL; 1344 static int buflen = 0;1344 static unsigned int buflen = 0; 1345 1345 static int libdir_maxlen = -1; 1346 1346 char *libbuf = variable_expand (""); -
branches/GNU/src/gmake/remote-stub.c
r54 r153 44 44 45 45 int 46 start_remote_job_p (int first_p )46 start_remote_job_p (int first_p UNUSED) 47 47 { 48 48 return 0; … … 58 58 59 59 int 60 start_remote_job (char **argv, char **envp, int stdin_fd, 61 int *is_remote, int *id_ptr, int *used_stdin) 60 start_remote_job (char **argv UNUSED, char **envp UNUSED, int stdin_fd UNUSED, 61 int *is_remote UNUSED, int *id_ptr UNUSED, 62 int *used_stdin UNUSED) 62 63 { 63 64 return -1; … … 72 73 73 74 int 74 remote_status (int *exit_code_ptr , int *signal_ptr, int *coredump_ptr,75 int block)75 remote_status (int *exit_code_ptr UNUSED, int *signal_ptr UNUSED, 76 int *coredump_ptr UNUSED, int block UNUSED) 76 77 { 77 78 errno = ECHILD; … … 99 100 /* Send signal SIG to child ID. Return 0 if successful, -1 if not. */ 100 101 int 101 remote_kill (int id , int sig)102 remote_kill (int id UNUSED, int sig UNUSED) 102 103 { 103 104 return -1; -
branches/GNU/src/gmake/rule.c
r54 r153 72 72 { 73 73 char *name; 74 unsignedint namelen;74 int namelen; 75 75 register struct rule *rule, *lastrule; 76 76 -
branches/GNU/src/gmake/tests/ChangeLog
r53 r153 1 2004-02-21 Paul D. Smith <[email protected]> 2 3 * scripts/functions/origin: Set our own environment variable 4 rather than relying on $HOME. 5 6 2004-01-21 Paul D. Smith <[email protected]> 7 8 * scripts/features/conditionals: Test arguments to ifn?def which 9 contain whitespace (such as a function that is evaluated). Bug 10 #7257. 11 12 2004-01-07 Paul D. Smith <[email protected]> 13 14 * scripts/features/order_only: Test order-only prerequisites in 15 pattern rules (patch #2349). 16 1 17 2003-11-02 Paul D. Smith <[email protected]> 2 18 -
branches/GNU/src/gmake/tests/scripts/features/conditionals
r53 r153 86 86 endif 87 87 88 all:; @echo DEF=$(DEF) DEF2=$(DEF2) 88 89 DEF3 = no 90 FUNC = $1 91 ifdef $(call FUNC,DEF)3 92 DEF3 = yes 93 endif 94 95 all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3) 89 96 90 97 EOF … … 93 100 94 101 &run_make_with_options($makefile2,"",&get_logfile,0); 95 $answer = "DEF=yes DEF2=yes \n";102 $answer = "DEF=yes DEF2=yes DEF3=yes\n"; 96 103 &compare_output($answer,&get_logfile(1)); 97 104 -
branches/GNU/src/gmake/tests/scripts/features/order_only
r53 r153 110 110 unlink(qw(foo baz)); 111 111 112 # Test order-only in pattern rules 113 114 $makefile4 = &get_tmpfile; 115 116 open(MAKEFILE,"> $makefile4"); 117 118 print MAKEFILE <<'EOF'; 119 %.w : %.x | baz 120 @echo '$$^ = $^' 121 @echo '$$| = $|' 122 touch $@ 123 124 all: foo.w 125 126 .PHONY: baz 127 foo.x baz: 128 touch $@ 129 EOF 130 131 close(MAKEFILE); 132 133 # TEST #7 -- make sure the parser was correct. 134 135 &run_make_with_options($makefile4, "", &get_logfile); 136 $answer = "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n"; 137 &compare_output($answer,&get_logfile(1)); 138 139 # TEST #8 -- now we do it again: this time foo.w won't be built 140 141 &run_make_with_options($makefile4, "", &get_logfile); 142 $answer = "touch baz\n"; 143 &compare_output($answer,&get_logfile(1)); 144 145 unlink(qw(foo.w foo.x baz)); 146 112 147 1; -
branches/GNU/src/gmake/tests/scripts/functions/origin
r53 r153 16 16 'automatic' Automatic variable\n"; 17 17 18 # On WIN32 systems, HOME is meaningless. SystemRoot should be defined 19 # though. With DJGPP, HOME is not guaranteed to be defined. Use DJDIR 20 # instead. 21 # 22 $homevar = (($port_type eq 'Windows') ? "SystemRoot" 23 : (($port_type eq 'DOS') ? "DJDIR" 24 : "HOME")); 18 # Set an environment variable 19 $ENV{MAKETEST} = 1; 25 20 26 21 open(MAKEFILE,"> $makefile"); … … 28 23 print MAKEFILE <<EOF; 29 24 foo := bletch garf 30 auto_var = udef CC $homevarMAKE foo CFLAGS WHITE \@25 auto_var = udef CC MAKETEST MAKE foo CFLAGS WHITE \@ 31 26 av = \$(foreach var, \$(auto_var), \$(origin \$(var)) ) 32 27 override WHITE := BLACK … … 34 29 \t\@echo \$(origin undefined) 35 30 \t\@echo \$(origin CC) 36 \t\@echo \$(origin $homevar)31 \t\@echo \$(origin MAKETEST) 37 32 \t\@echo \$(origin MAKE) 38 33 \t\@echo \$(origin foo) -
branches/GNU/src/gmake/vpath.c
r54 r153 320 320 321 321 int 322 gpath_search (char *file, int len)322 gpath_search (char *file, unsigned int len) 323 323 { 324 registerchar **gp;324 char **gp; 325 325 326 326 if (gpaths && (len <= gpaths->maxlen)) -
branches/GNU/src/gmake/w32/subproc/sub_proc.c
r53 r153 1194 1194 if (process_begin(hProcess, argv, envp, argv[0], NULL)) { 1195 1195 fake_exits_pending++; 1196 /* process_begin() failed: make a note of that. */ 1197 if (!((sub_process*) hProcess)->last_err) 1198 ((sub_process*) hProcess)->last_err = -1; 1196 1199 ((sub_process*) hProcess)->exit_code = process_last_err(hProcess); 1197 1200 -
branches/GNU/src/gmake/w32/subproc/w32err.c
r53 r153 7 7 * Returns: a pointer to a static error 8 8 * 9 * Notes/Dependencies: I got this from 9 * Notes/Dependencies: I got this from 10 10 * comp.os.ms-windows.programmer.win32 11 11 */ 12 char * 12 char * 13 13 map_windows32_error_to_string (DWORD ercode) { 14 14 /* __declspec (thread) necessary if you will use multiple threads */ 15 15 __declspec (thread) static char szMessageBuffer[128]; 16 17 /* Fill message buffer with a default message in 18 * case FormatMessage fails 16 17 /* Fill message buffer with a default message in 18 * case FormatMessage fails 19 19 */ 20 wsprintf (szMessageBuffer, "Error %ld ", ercode);20 wsprintf (szMessageBuffer, "Error %ld\n", ercode); 21 21 22 22 /* … … 34 34 NULL); 35 35 FreeLibrary(hModule); 36 } 36 } 37 37 } else { 38 38 /* … … 49 49 return szMessageBuffer; 50 50 } 51 51
Note:
See TracChangeset
for help on using the changeset viewer.