VirtualBox

Changeset 153 in kBuild


Ignore:
Timestamp:
Sep 8, 2004 2:43:30 AM (21 years ago)
Author:
bird
Message:

GNU Make 3.81beta1.

Location:
branches/GNU/src/gmake
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gmake/ChangeLog

    r54 r153  
     12004-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
     122004-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
     262004-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
     322004-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
     372004-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
     522004-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
     812004-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
     922004-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
     982004-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
     1142004-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
     1202004-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
     1382003-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
    11442003-11-02  Paul D. Smith  <[email protected]>
    2145
     
    17160        (get-config/config.guess get-config/config.sub): Get these files
    18161        from the Savannah config project instead of ftp.gnu.org.
     162
     1632003-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 :-/.
    19167
    201682003-07-18  Paul D. Smith  <[email protected]>
  • branches/GNU/src/gmake/INSTALL

    r54 r153  
     1Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
     2Foundation, Inc.
     3
     4   This file is free documentation; the Free Software Foundation gives
     5unlimited permission to copy, distribute and modify it.
     6
    17Basic Installation
    28==================
     9
     10   These are generic installation instructions.
    311
    412   The `configure' shell script attempts to guess correct values for
     
    715It may also create one or more `.h' files containing system-dependent
    816definitions.  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').
     17you can run in the future to recreate the current configuration, and a
     18file `config.log' containing compiler output (useful mainly for
     19debugging `configure').
     20
     21   It can also use an optional file (typically called `config.cache'
     22and enabled with `--cache-file=config.cache' or simply `-C') that saves
     23the results of its tests to speed up reconfiguring.  (Caching is
     24disabled by default to prevent problems with accidental use of stale
     25cache files.)
    1326
    1427   If you need to do unusual things to compile the package, please try
    1528to figure out how `configure' could check whether to do them, and mail
    1629diffs 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'.
     30be considered for the next release.  If you are using the cache, and at
     31some point `config.cache' contains results you don't want to keep, you
     32may 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
     37a newer version of `autoconf'.
    2338
    2439The simplest way to compile this package is:
     
    3550  2. Type `make' to compile the package.
    3651
    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
    4453     the package.
    4554
     
    6069
    6170   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
     71the `configure' script does not know about.  Run `./configure --help'
     72for details on some of the pertinent environment variables.
     73
     74   You can give `configure' initial values for configuration parameters
     75by setting variables in the command line or in the environment.  Here
     76is an example:
     77
     78     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
     79
     80   *Note Defining Variables::, for more details.
    7081
    7182Compiling For Multiple Architectures
     
    8091source code in the directory that `configure' is in and in `..'.
    8192
    82    If you have to use a `make' that does not supports the `VPATH'
    83 variable, you have to compile the package for one architecture at a time
    84 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'
     94variable, you have to compile the package for one architecture at a
     95time in the source code directory.  After you have installed the
     96package for one architecture, use `make distclean' before reconfiguring
     97for another architecture.
    8798
    8899Installation Names
     
    127138==========================
    128139
    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
     141automatically, but needs to determine by the type of machine the package
     142will 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
     144a 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
     146type, such as `sun4', or a canonical name which has the form:
     147
    135148     CPU-COMPANY-SYSTEM
    136149
    137 See the file `config.sub' for the possible values of each field.  If
     150where 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
    138155`config.sub' isn't included in this package, then this package doesn't
    139 need to know the host type.
    140 
    141    If you are building compiler tools for cross-compiling, you can also
     156need to know the machine type.
     157
     158   If you are _building_ compiler tools for cross-compiling, you should
    142159use 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.
     160produce code for.
     161
     162   If you want to _use_ a cross compiler, that generates code for a
     163platform different from the build platform, you should specify the
     164"host" platform (i.e., that on which the generated programs will
     165eventually be run) with `--host=TYPE'.
    145166
    146167Sharing Defaults
     
    155176A warning: not all `configure' scripts look for a site script.
    156177
    157 Operation Controls
     178Defining Variables
    158179==================
     180
     181   Variables not defined in a site shell script can be set in the
     182environment passed to `configure'.  However, some packages may run
     183configure again during the build, and the customized values of these
     184variables may be lost.  In order to avoid this problem, you should set
     185them in the `configure' command line, using `VAR=value'.  For example:
     186
     187     ./configure CC=/usr/local2/bin/gcc
     188
     189will cause the specified gcc to be used as the C compiler (unless it is
     190overridden in the site shell script).
     191
     192`configure' Invocation
     193======================
    159194
    160195   `configure' recognizes the following options to control how it
    161196operates.
    162197
     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
    163207`--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'.
    170215
    171216`--quiet'
     
    180225     `configure' can determine that directory automatically.
    181226
    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  
    11# This is a -*-Makefile-*-, or close enough
    22
    3 AUTOMAKE_OPTIONS = 1.7.6 dist-bzip2 check-news ansi2knr
     3AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr
    44ACLOCAL_AMFLAGS =  -I config
    55
     
    6161
    6262localedir =     $(datadir)/locale
    63 
    64 # We need this due to a bug in gettext 0.12.1 Makefile.in.in: without this I
    65 # can't run distcheck because this file is created but not removed during
    66 # distclean.
    67 
    68 distclean-local:
    69         test "$(srcdir)" = . || rm -f po/stamp-po
    7063
    7164# --------------- Local INSTALL Section
     
    153146                   done; fi ;; \
    154147            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); \
    157150          else \
    158151            echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
  • branches/GNU/src/gmake/NEWS

    r54 r153  
    11GNU make NEWS                                               -*-indented-text-*-
    22  History of user-visible changes.
    3   17 April 2003
    4 
    5 Copyright (C) 2002,2003  Free Software Foundation, Inc.
     3  06 March 2004
     4
     5Copyright (C) 2002,2003,2004  Free Software Foundation, Inc.
    66See the end for copying conditions.
    77
     
    1010
    1111Please 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
     12See the README file and the GNU make manual for details on reporting bugs.
     13
     14
     15Version 3.81beta1
    1716
    1817* GNU make is ported to OS/2.
     
    2827  call are now masked in the context of the inner call.
    2928
     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
    3035* Enhancements for POSIX compatibility:
    3136   - Only touch targets (under -t) if they have at least one command.
    3237
    33 * Updated to autoconf 2.57, automake 1.7.6, and gettext 0.12.1.  Users
     38* Updated to autoconf 2.59, automake 1.8.2, and gettext 0.14.1.  Users
    3439  should not be impacted.
    3540
  • branches/GNU/src/gmake/ar.c

    r54 r153  
    124124/* ARGSUSED */
    125125static 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)
     126ar_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)
    129130{
    130131  return ar_name_equal (name, mem, truncated) ? date : 0;
     
    213214
    214215static 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)
     216ar_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)
    219220{
    220221  if (fnmatch (state->pattern, mem, FNM_PATHNAME|FNM_PERIOD) == 0)
  • branches/GNU/src/gmake/arscan.c

    r54 r153  
    742742/* ARGSUSED */
    743743static 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)
     744ar_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)
    747748{
    748749  if (!ar_name_equal (name, mem, truncated))
     
    761762ar_member_touch (char *arname, char *memname)
    762763{
    763   register long int pos = ar_scan (arname, ar_member_pos, (long int) memname);
    764   register int fd;
     764  long int pos = ar_scan (arname, ar_member_pos, (long int) memname);
     765  int fd;
    765766  struct ar_hdr ar_hdr;
    766   register int i;
     767  int i;
     768  unsigned int ui;
    767769  struct stat statbuf;
    768770
     
    791793#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
    792794  /* 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] = ' ';
    795797  sprintf (ar_hdr.ar_date, "%ld", (long int) statbuf.st_mtime);
    796798#ifdef AIAMAG
  • branches/GNU/src/gmake/build_w32.bat

    r54 r153  
    11set make=gnumake
    2 +if not exist config.h copy config.h.W32 config.h
     2if not exist config.h copy config.h.W32 config.h
    33cd w32\subproc
    44echo "Creating the subproc library"
  • branches/GNU/src/gmake/commands.c

    r54 r153  
    129129  {
    130130    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;
    132132
    133133    unsigned int qmark_len, plus_len, bar_len;
  • branches/GNU/src/gmake/configure.in

    r54 r153  
    11# Process this file with autoconf to produce a configure script.
    22
    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 $]])
     3AC_INIT([GNU make],[3.81beta1],[[email protected]])
     4
     5AC_PREREQ(2.59)
     6AC_REVISION([[$Id: configure.in,v 1.125 2004/03/06 08:05:19 psmith Exp $]])
    87
    98# Autoconf setup
     
    1312
    1413# Automake setup
    15 AM_INIT_AUTOMAKE([1.7.6])
     14AM_INIT_AUTOMAKE([1.8.2])
    1615
    1716# Checks for programs.
     
    3534# Enable gettext, in "external" mode.
    3635
    37 AM_GNU_GETTEXT_VERSION(0.12.1)
     36AM_GNU_GETTEXT_VERSION(0.14.1)
    3837AM_GNU_GETTEXT([external])
    3938
     
    5453                 memory.h sys/param.h sys/time.h sys/timeb.h)
    5554
     55# Set a flag if we have an ANSI C compiler
     56if 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.])
     59fi
     60
     61
     62# Determine what kind of variadic function calls we support
     63AC_CHECK_HEADERS(stdarg.h varargs.h, break)
     64
    5665AM_PROG_CC_C_O
    57 AM_PROG_CC_STDC
    5866AC_C_CONST
    5967AC_TYPE_SIGNAL
     
    131139                strerror strsignal)
    132140
    133 make_FUNC_SETVBUF_REVERSED
     141AC_FUNC_SETVBUF_REVERSED
    134142
    135143# strcoll() is used by the GNU glob library
     
    246254    [make_cv_sa_restart=yes],
    247255    [make_cv_sa_restart=no])])
     256
     257# enable make_cv_sa_restart for OS/2
     258case "$host_os" in
     259  os2*) make_cv_sa_restart=yes ;;
     260esac
     261
    248262if test "$make_cv_sa_restart" != no; then
    249263  AC_DEFINE(HAVE_SA_RESTART, 1,
     
    328342AM_WITH_DMALLOC
    329343
     344# Forcibly disable SET_MAKE.  If it's set it breaks things like the test
     345# scripts, etc.
     346SET_MAKE=
    330347
    331348# Sanity check and inform the user of what we found
  • branches/GNU/src/gmake/doc/make.texi

    r53 r153  
    88@c FSF publishers: format makebook.texi instead of using this file directly.
    99
    10 @set RCSID $Id: make.texi,v 1.16 2003/11/03 22:04:12 psmith Exp $
     10@set RCSID $Id: make.texi,v 1.18 2004/02/23 06:25:54 psmith Exp $
    1111@set EDITION 0.61
    1212@set VERSION 3.81
     
    3939of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
    4040
    41 Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
     41Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
     421998, 1999, 2000, 2002, 2003, 2004
    4243Free Software Foundation, Inc.
    4344
     
    5859@subtitle GNU @code{make} Version @value{VERSION}
    5960@subtitle @value{UPDATE-MONTH}
    60 @author Richard M. Stallman, Roland McGrath, Paul Smith
     61@author Richard M. Stallman, Roland McGrath, Paul D. Smith
    6162@page
    6263@vskip 0pt plus 1filll
    6364Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
    64 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
     651996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
    6566@sp 2
    6667Published by the Free Software Foundation @*
     
    351352This manual describes GNU @code{make}, which was implemented by Richard
    352353Stallman and Roland McGrath.  Development since Version 3.76 has been
    353 handled by Paul Smith.
     354handled by Paul D. Smith.
    354355
    355356GNU @code{make} conforms to section 6.2 of @cite{IEEE Standard
     
    19491950directories that @code{make} should search.  Most often, the
    19501951directories 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.
     1952current directory; however, @code{make} uses @code{VPATH} as a search
     1953list for both prerequisites and targets of rules.
    19541954
    19551955Thus, if a file that is listed as a target or prerequisite does not exist
     
    36763676Using the @code{MAKE} variable has the same effect as using a @samp{+}
    36773677character at the beginning of the command line.  @xref{Instead of
    3678 Execution, ,Instead of Executing the Commands}.@refill
     3678Execution, ,Instead of Executing the Commands}.  This special feature
     3679is only enabled if the @code{MAKE} variable appears directly in the
     3680command script: it does not apply if the @code{MAKE} variable is
     3681referenced through expansion of another variable.  In the latter case
     3682you must use the @samp{+} token to get these special effects.@refill
    36793683
    36803684Consider the command @samp{make -t} in the above example.  (The
     
    52265230variable value to be preferred.
    52275231
    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
     5232There is one more special feature of target-specific variables: when
     5233you define a target-specific variable that variable value is also in
     5234effect for all prerequisites of this target, and all their
     5235prerequisites, etc. (unless those prerequisites override that variable
     5236with their own target-specific variable value).  So, for example, a
    52325237statement like this:
    52335238
     
    52415246@file{prog}, but it will also set @code{CFLAGS} to @samp{-g} in the
    52425247command 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
     5249prerequisites.
     5250
     5251Be aware that a given prerequisite will only be built once per
     5252invocation of make, at most.  If the same file is a prerequisite of
     5253multiple targets, and each of those targets has a different value for
     5254the same target-specific variable, then the first target to be built
     5255will cause that prerequisite to be built and the prerequisite will
     5256inherit the target-specific value from the first target.  It will
     5257ignore the target-specific values from any other targets.
    52445258
    52455259@node Pattern-specific,  , Target-specific, Using Variables
     
    64566470
    64576471define PROGRAM_template
    6458  $(1): $$($(1)_OBJ) $$($(1)_LIBS:%=-l%)
     6472 $(1): $$($(1)_OBJS) $$($(1)_LIBS:%=-l%)
    64596473 ALL_OBJS   += $$($(1)_OBJS)
    64606474endef
     
    65866600@cindex shell command, function for
    65876601
    6588 The @code{shell} function is unlike any other function except the
     6602The @code{shell} function is unlike any other function other than the
    65896603@code{wildcard} function
    65906604(@pxref{Wildcard Function, ,The Function @code{wildcard}}) in that it
     
    65926606
    65936607The @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}.
     6609This means that it takes as an argument a shell command and evaluates
     6610to the output of the command.  The only processing @code{make} does on
     6611the result is to convert each newline (or carriage-return / newline
     6612pair) to a single space.  If there is a trailing (carriage-return
     6613and) newline it will simply be removed.@refill
    66016614
    66026615The commands run by calls to the @code{shell} function are run when the
  • branches/GNU/src/gmake/file.c

    r54 r153  
    531531
    532532void
    533 set_command_state (struct file *file, int state)
     533set_command_state (struct file *file, enum cmd_state state)
    534534{
    535535  struct dep *d;
     
    759759  if (f->cmds != 0)
    760760    print_commands (f->cmds);
     761
     762  if (f->prev)
     763    print_file ((const void *) f->prev);
    761764}
    762765
  • branches/GNU/src/gmake/filedef.h

    r54 r153  
    6666                                   or -1 if none has been made.  */
    6767
    68     enum                        /* State of the commands.  */
     68    enum cmd_state              /* State of the commands.  */
    6969      {         /* Note: It is important that cs_not_started be zero.  */
    7070        cs_not_started,         /* Not yet started.  */
     
    109109extern void rename_file PARAMS ((struct file *file, char *name));
    110110extern void rehash_file PARAMS ((struct file *file, char *name));
    111 extern void set_command_state PARAMS ((struct file *file, int state));
     111extern void set_command_state PARAMS ((struct file *file, enum cmd_state state));
    112112extern void notice_finished_file PARAMS ((struct file *file));
    113113extern void init_hash_files PARAMS ((void));
  • branches/GNU/src/gmake/function.c

    r54 r153  
    402402
    403403static char *
    404 func_patsubst (char *o, char **argv, const char *funcname)
     404func_patsubst (char *o, char **argv, const char *funcname UNUSED)
    405405{
    406406  o = patsubst_expand (o, argv[2], argv[0], argv[1], (char *) 0, (char *) 0);
     
    410410
    411411static char *
    412 func_join (char *o, char **argv, const char *funcname)
     412func_join (char *o, char **argv, const char *funcname UNUSED)
    413413{
    414414  int doneany = 0;
     
    450450
    451451static char *
    452 func_origin (char *o, char **argv, const char *funcname)
     452func_origin (char *o, char **argv, const char *funcname UNUSED)
    453453{
    454454  /* Expand the argument.  */
     
    645645
    646646static char *
    647 func_subst (char *o, char **argv, const char *funcname)
     647func_subst (char *o, char **argv, const char *funcname UNUSED)
    648648{
    649649  o = subst_expand (o, argv[2], argv[0], argv[1], strlen (argv[0]),
     
    655655
    656656static char *
    657 func_firstword (char *o, char **argv, const char *funcname)
     657func_firstword (char *o, char **argv, const char *funcname UNUSED)
    658658{
    659659  unsigned int i;
     
    669669
    670670static char *
    671 func_words (char *o, char **argv, const char *funcname)
     671func_words (char *o, char **argv, const char *funcname UNUSED)
    672672{
    673673  int i = 0;
     
    718718
    719719static char *
    720 func_word (char *o, char **argv, const char *funcname)
     720func_word (char *o, char **argv, const char *funcname UNUSED)
    721721{
    722722  char *end_p=0;
     
    744744
    745745static char *
    746 func_wordlist (char *o, char **argv, const char *funcname)
     746func_wordlist (char *o, char **argv, const char *funcname UNUSED)
    747747{
    748748  int start, count;
     
    781781
    782782static char*
    783 func_findstring (char *o, char **argv, const char *funcname)
     783func_findstring (char *o, char **argv, const char *funcname UNUSED)
    784784{
    785785  /* Find the first occurrence of the first string in the second.  */
     
    792792
    793793static char *
    794 func_foreach (char *o, char **argv, const char *funcname)
     794func_foreach (char *o, char **argv, const char *funcname UNUSED)
    795795{
    796796  /* expand only the first two.  */
     
    10121012
    10131013static char *
    1014 func_strip (char *o, char **argv, const char *funcname)
     1014func_strip (char *o, char **argv, const char *funcname UNUSED)
    10151015{
    10161016  char *p = argv[0];
     
    10811081 */
    10821082static char *
    1083 func_sort (char *o, char **argv, const char *funcname)
     1083func_sort (char *o, char **argv, const char *funcname UNUSED)
    10841084{
    10851085  char **words = 0;
     
    11431143
    11441144static char *
    1145 func_if (char *o, char **argv, const char *funcname)
     1145func_if (char *o, char **argv, const char *funcname UNUSED)
    11461146{
    11471147  const char *begp = argv[0];
     
    11841184
    11851185static char *
    1186 func_wildcard (char *o, char **argv, const char *funcname)
     1186func_wildcard (char *o, char **argv, const char *funcname UNUSED)
    11871187{
    11881188
     
    12051205
    12061206static char *
    1207 func_eval (char *o, char **argv, const char *funcname)
     1207func_eval (char *o, char **argv, const char *funcname UNUSED)
    12081208{
    12091209  char *buf;
     
    12241224
    12251225static char *
    1226 func_value (char *o, char **argv, const char *funcname)
     1226func_value (char *o, char **argv, const char *funcname UNUSED)
    12271227{
    12281228  /* Look up the variable.  */
     
    14241424#ifndef _AMIGA
    14251425static char *
    1426 func_shell (char *o, char **argv, const char *funcname)
     1426func_shell (char *o, char **argv, const char *funcname UNUSED)
    14271427{
    14281428  char* batch_filename = NULL;
    1429   int i;
     1429  unsigned int i;
    14301430
    14311431#ifdef __MSDOS__
     
    19211921
    19221922static char *
    1923 func_call (char *o, char **argv, const char *funcname)
     1923func_call (char *o, char **argv, const char *funcname UNUSED)
    19241924{
    19251925  static int max_args = 0;
  • branches/GNU/src/gmake/implicit.c

    r54 r153  
    106106  /* This buffer records all the dependencies actually found for a rule.  */
    107107  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));
    108110  /* Number of dep names now in FOUND_FILES.  */
    109111  unsigned int deps_found = 0;
     
    400402                  || ((!dep->changed || check_lastslash) && file_exists_p (p)))
    401403                {
     404                  found_files_im[deps_found] = dep->ignore_mtime;
    402405                  found_files[deps_found++] = xstrdup (p);
    403406                  continue;
     
    411414                       (_("Found prerequisite `%s' as VPATH `%s'\n"), p, vp));
    412415                  strcpy (vp, p);
     416                  found_files_im[deps_found] = dep->ignore_mtime;
    413417                  found_files[deps_found++] = vp;
    414418                  continue;
     
    440444                      intermediate_files[deps_found] = intermediate_file;
    441445                      intermediate_file = 0;
     446                      found_files_im[deps_found] = dep->ignore_mtime;
    442447                      /* Allocate an extra copy to go in FOUND_FILES,
    443448                         because every elt of FOUND_FILES is consumed
    444449                         or freed later.  */
    445                       found_files[deps_found] = xstrdup (p);
    446                       ++deps_found;
     450                      found_files[deps_found++] = xstrdup (p);
    447451                      continue;
    448452                    }
     
    544548
    545549      dep = (struct dep *) xmalloc (sizeof (struct dep));
    546       dep->ignore_mtime = 0;
     550      dep->ignore_mtime = found_files_im[deps_found];
    547551      s = found_files[deps_found];
    548552      if (recursions == 0)
  • branches/GNU/src/gmake/job.c

    r54 r153  
    5555#elif defined (__EMX__)
    5656
    57 const char *default_shell = "/bin/sh";
     57char *default_shell = "/bin/sh";
    5858int batch_mode_shell = 0;
    5959
     
    223223
    224224int unixy_shell = 1;
     225
     226/* Number of jobs started in the current second.  */
     227
     228unsigned long job_counter = 0;
    225229
    226230
     
    363367
    364368
    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 */
    369372
    370373static char *
    371 handle_apos (char *p)
     374vms_handle_apos (char *p)
    372375{
    373376  int alast;
    374   int inside;
    375377
    376378#define SEPCHARS ",/()= "
    377379
    378   inside = 0;
     380  alast = 0;
    379381
    380382  while (*p != 0)
     
    382384      if (*p == '"')
    383385        {
    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++;
    399390            }
    400391          else
     
    403394              if (strchr (SEPCHARS, *p))
    404395                break;
    405               inside = 1;
    406396              alast = 1;
    407               while (*p == '"')
    408                 {
    409                   alast++;
    410                   p++;
    411                 }
    412397            }
    413398        }
     
    434419static unsigned int dead_children = 0;
    435420
    436 #ifndef __EMX__ /* Don't use SIGCHLD handler on OS/2. */
    437421RETSIGTYPE
    438 child_handler (int sig)
     422child_handler (int sig UNUSED)
    439423{
    440424  ++dead_children;
     
    446430    }
    447431
     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().
    448438  DB (DB_JOBS, (_("Got a SIGCHLD; %u unreaped children.\n"), dead_children));
     439  */
    449440}
    450 #endif  /* !__EMX__ */
    451441
    452442extern int shell_function_pid, shell_function_completed;
     
    579569              coredump = WCOREDUMP (status);
    580570
    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;
    592574            }
    593575          else
     
    899881
    900882#ifdef MAKE_JOBSERVER
    901 # ifdef __EMX__
    902 /* Never install the SIGCHLD handler for EMX!!! */
    903 #  define set_child_handler_action_flags(x)
    904 # else
    905883/* Set the child handler action flags to FLAGS.  */
    906884static void
     
    918896#endif
    919897}
    920 #endif  /* !__EMX__ */
    921898#endif
    922899
     
    13571334#endif  /* __MSDOS__ or Amiga or WINDOWS32 */
    13581335
     1336  /* Bump the number of jobs started in this second.  */
     1337  ++job_counter;
     1338
    13591339  /* We are the parent side.  Set the state to
    13601340     say the commands are running and return.  */
     
    16451625        got_token = read (job_rfd, &token, 1);
    16461626        saved_errno = errno;
     1627#ifdef __EMX__
     1628        /* The child handler must be turned off here.  */
     1629        signal (SIGCHLD, SIG_DFL);
     1630#endif
    16471631        set_child_handler_action_flags (SA_RESTART);
    16481632
     
    17011685}
    17021686
     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
    17031727static int
    17041728load_too_high (void)
     
    17071731  return 1;
    17081732#else
    1709   double load;
     1733  static double last_sec;
     1734  static time_t last_now;
     1735  double load, guess;
     1736  time_t now;
    17101737
    17111738  if (max_load_average < 0)
    17121739    return 0;
    17131740
     1741  /* Find the real system load average.  */
    17141742  make_access ();
    17151743  if (getloadavg (&load, 1) != 1)
     
    17311759  user_access ();
    17321760
    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;
    17361782#endif
    17371783}
     
    21692215                 comma or space and before slash. */
    21702216            case '"':
    2171               q = handle_apos (q + 1);
     2217              q = vms_handle_apos (q);
    21722218              sep = q;
    21732219              break;
     
    27062752  char** sh_cmds;
    27072753#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
    27152761  register int i;
    27162762  register char *p;
  • branches/GNU/src/gmake/main.c

    r54 r153  
    392392    { CHAR_MAX+4, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0,
    393393        "warn-undefined-variables" },
    394     { '\0', }
     394    { 0 }
    395395  };
    396396
     
    550550
    551551static RETSIGTYPE
    552 debug_signal_handler (int sig)
     552debug_signal_handler (int sig UNUSED)
    553553{
    554554  db_level = db_level ? DB_NONE : DB_BASIC;
     
    839839{
    840840  static char *stdin_nm = 0;
    841   register struct file *f;
    842   register unsigned int i;
     841  struct file *f;
     842  int i;
    843843  char **p;
    844844  struct dep *read_makefiles;
     
    11631163  if (current_directory[0] != '\0'
    11641164      && 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      )
    11661171    argv[0] = concat (current_directory, "/", argv[0]);
    11671172#else  /* !__MSDOS__ */
     
    15101515  {
    15111516    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]))
    15151521        fatal (NILF, _("internal error: multiple --jobserver-fds options"));
    15161522
     
    17431749               in updating or could not be found at all.  */
    17441750            int any_failed = 0;
    1745             register unsigned int i;
     1751            unsigned int i;
    17461752            struct dep *d;
    17471753
     
    18171823            {
    18181824              /* These names might have changed.  */
    1819               register unsigned int i, j = 0;
     1825              int i, j = 0;
    18201826              for (i = 1; i < argc; ++i)
    18211827                if (strneq (argv[i], "-f", 2)) /* XXX */
     
    20222028init_switches (void)
    20232029{
    2024   register char *p;
    2025   register int c;
    2026   register unsigned int i;
     2030  char *p;
     2031  unsigned int c;
     2032  unsigned int i;
    20272033
    20282034  if (options[0] != '\0')
     
    22362242                  if (optarg == 0)
    22372243                    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                    }
    22382250
    22392251                  sl = *(struct stringlist **) cs->value_ptr;
  • branches/GNU/src/gmake/make.h

    r54 r153  
    211211# endif
    212212#endif
     213#define UNUSED  __attribute__ ((unused))
    213214
    214215#if defined (STDC_HEADERS) || defined (__GNU_LIBRARY__)
     
    388389
    389390
    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
    393401extern void message (int prefix, const char *fmt, ...)
    394402                     __attribute__ ((__format__ (__printf__, 2, 3)));
     
    448456extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath));
    449457extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr));
    450 extern int gpath_search PARAMS ((char *file, int len));
     458extern int gpath_search PARAMS ((char *file, unsigned int len));
    451459
    452460extern void construct_include_path PARAMS ((char **arg_dirs));
  • branches/GNU/src/gmake/misc.c

    r54 r153  
    3131   VA_END macros used here since we have multiple print functions.  */
    3232
    33 #if HAVE_VPRINTF || HAVE_DOPRNT
    34 # define HAVE_STDVARARGS 1
    35 # if __STDC__
     33#if USE_VARIADIC
     34# if HAVE_STDARG_H
    3635#  include <stdarg.h>
    3736#  define VA_START(args, lastarg) va_start(args, lastarg)
     
    4746# define VA_END(args) va_end(args)
    4847#else
    49 /* # undef HAVE_STDVARARGS */
     48/* We can't use any variadic interface! */
    5049# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
    5150# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
     
    211210
    212211void
    213 #if __STDC__ && HAVE_STDVARARGS
     212#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
    214213message (int prefix, const char *fmt, ...)
    215214#else
     
    220219#endif
    221220{
    222 #if HAVE_STDVARARGS
     221#if USE_VARIADIC
    223222  va_list args;
    224223#endif
     
    247246
    248247void
    249 #if __STDC__ && HAVE_STDVARARGS
     248#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
    250249error (const struct floc *flocp, const char *fmt, ...)
    251250#else
     
    256255#endif
    257256{
    258 #if HAVE_STDVARARGS
     257#if USE_VARIADIC
    259258  va_list args;
    260259#endif
     
    280279
    281280void
    282 #if __STDC__ && HAVE_STDVARARGS
     281#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
    283282fatal (const struct floc *flocp, const char *fmt, ...)
    284283#else
     
    289288#endif
    290289{
    291 #if HAVE_STDVARARGS
     290#if USE_VARIADIC
    292291  va_list args;
    293292#endif
     
    363362xmalloc (unsigned int size)
    364363{
    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);
    366366  if (result == 0)
    367367    fatal (NILF, _("virtual memory exhausted"));
     
    376376
    377377  /* Some older implementations of realloc() don't conform to ANSI.  */
     378  if (! size)
     379    size = 1;
    378380  result = ptr ? realloc (ptr, size) : malloc (size);
    379381  if (result == 0)
  • branches/GNU/src/gmake/read.c

    r54 r153  
    138138                        const struct floc *flocp, int set_default));
    139139static void record_target_var PARAMS ((struct nameseq *filenames, char *defn,
    140                                        int two_colon,
    141140                                       enum variable_origin origin,
    142141                                       int enabled,
     
    510509  while (1)
    511510    {
    512       int linelen;
     511      unsigned int linelen;
    513512      char *line;
    514513      int len;
     
    10581057        exported = 0;
    10591058        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          }
    10701071
    10711072        if (wtype != w_eol)
     
    10841085                p = variable_buffer + l;
    10851086              }
    1086             record_target_var (filenames, p, two_colon, v_origin, exported,
    1087                                fstart);
     1087            record_target_var (filenames, p, v_origin, exported, fstart);
    10881088            filenames = 0;
    10891089            continue;
     
    14641464      char *var;
    14651465      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;
    14681475      p = next_token (p);
    14691476      if (*p != '\0')
    14701477        return -1;
    14711478
    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';
    14771480      v = lookup_variable (var, strlen (var));
    14781481      conditionals->ignoring[conditionals->if_cmds - 1]
     
    16601663
    16611664static void
    1662 record_target_var (struct nameseq *filenames, char *defn, int two_colon,
     1665record_target_var (struct nameseq *filenames, char *defn,
    16631666                   enum variable_origin origin, int exported,
    16641667                   const struct floc *flocp)
  • branches/GNU/src/gmake/remake.c

    r54 r153  
    13421342    {
    13431343      static char *buf = NULL;
    1344       static int buflen = 0;
     1344      static unsigned int buflen = 0;
    13451345      static int libdir_maxlen = -1;
    13461346      char *libbuf = variable_expand ("");
  • branches/GNU/src/gmake/remote-stub.c

    r54 r153  
    4444
    4545int
    46 start_remote_job_p (int first_p)
     46start_remote_job_p (int first_p UNUSED)
    4747{
    4848  return 0;
     
    5858
    5959int
    60 start_remote_job (char **argv, char **envp, int stdin_fd,
    61                   int *is_remote, int *id_ptr, int *used_stdin)
     60start_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)
    6263{
    6364  return -1;
     
    7273
    7374int
    74 remote_status (int *exit_code_ptr, int *signal_ptr, int *coredump_ptr,
    75                int block)
     75remote_status (int *exit_code_ptr UNUSED, int *signal_ptr UNUSED,
     76               int *coredump_ptr UNUSED, int block UNUSED)
    7677{
    7778  errno = ECHILD;
     
    99100/* Send signal SIG to child ID.  Return 0 if successful, -1 if not.  */
    100101int
    101 remote_kill (int id, int sig)
     102remote_kill (int id UNUSED, int sig UNUSED)
    102103{
    103104  return -1;
  • branches/GNU/src/gmake/rule.c

    r54 r153  
    7272{
    7373  char *name;
    74   unsigned int namelen;
     74  int namelen;
    7575  register struct rule *rule, *lastrule;
    7676
  • branches/GNU/src/gmake/tests/ChangeLog

    r53 r153  
     12004-02-21  Paul D. Smith  <[email protected]>
     2
     3        * scripts/functions/origin: Set our own environment variable
     4        rather than relying on $HOME.
     5
     62004-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
     122004-01-07  Paul D. Smith  <[email protected]>
     13
     14        * scripts/features/order_only: Test order-only prerequisites in
     15        pattern rules (patch #2349).
     16
    1172003-11-02  Paul D. Smith  <[email protected]>
    218
  • branches/GNU/src/gmake/tests/scripts/features/conditionals

    r53 r153  
    8686endif
    8787
    88 all:; @echo DEF=$(DEF) DEF2=$(DEF2)
     88
     89DEF3 = no
     90FUNC = $1
     91ifdef $(call FUNC,DEF)3
     92  DEF3 = yes
     93endif
     94
     95all:; @echo DEF=$(DEF) DEF2=$(DEF2) DEF3=$(DEF3)
    8996
    9097EOF
     
    93100
    94101&run_make_with_options($makefile2,"",&get_logfile,0);
    95 $answer = "DEF=yes DEF2=yes\n";
     102$answer = "DEF=yes DEF2=yes DEF3=yes\n";
    96103&compare_output($answer,&get_logfile(1));
    97104
  • branches/GNU/src/gmake/tests/scripts/features/order_only

    r53 r153  
    110110unlink(qw(foo baz));
    111111
     112# Test order-only in pattern rules
     113
     114$makefile4 = &get_tmpfile;
     115
     116open(MAKEFILE,"> $makefile4");
     117
     118print MAKEFILE <<'EOF';
     119%.w : %.x | baz
     120        @echo '$$^ = $^'
     121        @echo '$$| = $|'
     122        touch $@
     123
     124all: foo.w
     125
     126.PHONY: baz
     127foo.x baz:
     128        touch $@
     129EOF
     130
     131close(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
     145unlink(qw(foo.w foo.x baz));
     146
    1121471;
  • branches/GNU/src/gmake/tests/scripts/functions/origin

    r53 r153  
    1616'automatic'            Automatic variable\n";
    1717
    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;
    2520
    2621open(MAKEFILE,"> $makefile");
     
    2823print MAKEFILE <<EOF;
    2924foo := bletch garf
    30 auto_var = udef CC $homevar MAKE foo CFLAGS WHITE \@
     25auto_var = udef CC MAKETEST MAKE foo CFLAGS WHITE \@
    3126av = \$(foreach var, \$(auto_var), \$(origin \$(var)) )
    3227override WHITE := BLACK
     
    3429\t\@echo \$(origin undefined)
    3530\t\@echo \$(origin CC)
    36 \t\@echo \$(origin $homevar)
     31\t\@echo \$(origin MAKETEST)
    3732\t\@echo \$(origin MAKE)
    3833\t\@echo \$(origin foo)
  • branches/GNU/src/gmake/vpath.c

    r54 r153  
    320320
    321321int
    322 gpath_search (char *file, int len)
     322gpath_search (char *file, unsigned int len)
    323323{
    324   register char **gp;
     324  char **gp;
    325325
    326326  if (gpaths && (len <= gpaths->maxlen))
  • branches/GNU/src/gmake/w32/subproc/sub_proc.c

    r53 r153  
    11941194  if (process_begin(hProcess, argv, envp, argv[0], NULL)) {
    11951195    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;
    11961199    ((sub_process*) hProcess)->exit_code = process_last_err(hProcess);
    11971200
  • branches/GNU/src/gmake/w32/subproc/w32err.c

    r53 r153  
    77 * Returns:  a pointer to a static error
    88 *
    9  * Notes/Dependencies:  I got this from 
     9 * Notes/Dependencies:  I got this from
    1010 *      comp.os.ms-windows.programmer.win32
    1111 */
    12 char * 
     12char *
    1313map_windows32_error_to_string (DWORD ercode) {
    1414/* __declspec (thread) necessary if you will use multiple threads */
    1515__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
    1919         */
    20     wsprintf (szMessageBuffer, "Error %ld", ercode);
     20    wsprintf (szMessageBuffer, "Error %ld\n", ercode);
    2121
    2222        /*
     
    3434                                NULL);
    3535                        FreeLibrary(hModule);
    36                 } 
     36                }
    3737        } else {
    3838                /*
     
    4949    return szMessageBuffer;
    5050}
    51  
     51
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette