diff options
author | joerg <joerg@pkgsrc.org> | 2010-09-07 14:28:00 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2010-09-07 14:28:00 +0000 |
commit | 048b1bc3f65d2c18d3ba4596b5cdf87f84c0ff6d (patch) | |
tree | 2c38dd909b0c62a9ea47243377638625c72bacf0 /devel/bmake | |
parent | 6d347fb38eb1f86903e80ba4a674484e644ecbe2 (diff) | |
download | pkgsrc-048b1bc3f65d2c18d3ba4596b5cdf87f84c0ff6d.tar.gz |
Merge for bmake-20100808
Diffstat (limited to 'devel/bmake')
-rw-r--r-- | devel/bmake/files/ChangeLog | 59 | ||||
-rw-r--r-- | devel/bmake/files/Makefile.in | 6 | ||||
-rw-r--r-- | devel/bmake/files/bmake.1 | 67 | ||||
-rw-r--r-- | devel/bmake/files/bmake.cat1 | 409 | ||||
-rwxr-xr-x | devel/bmake/files/boot-strap | 6 | ||||
-rw-r--r-- | devel/bmake/files/compat.c | 24 | ||||
-rw-r--r-- | devel/bmake/files/job.c | 111 | ||||
-rw-r--r-- | devel/bmake/files/main.c | 30 | ||||
-rw-r--r-- | devel/bmake/files/make.1 | 67 | ||||
-rw-r--r-- | devel/bmake/files/nonints.h | 10 | ||||
-rw-r--r-- | devel/bmake/files/os.sh | 8 | ||||
-rw-r--r-- | devel/bmake/files/parse.c | 21 | ||||
-rw-r--r-- | devel/bmake/files/unit-tests/Makefile.in | 8 | ||||
-rw-r--r-- | devel/bmake/files/util.c | 41 | ||||
-rw-r--r-- | devel/bmake/files/var.c | 17 |
15 files changed, 567 insertions, 317 deletions
diff --git a/devel/bmake/files/ChangeLog b/devel/bmake/files/ChangeLog index fcb4f720f1f..19052c5561f 100644 --- a/devel/bmake/files/ChangeLog +++ b/devel/bmake/files/ChangeLog @@ -1,3 +1,62 @@ +2010-08-08 Simon J. Gerraty <sjg@bad.crufty.net> + + * boot-strap (TOOL_DIFF): set this to ensure tests use + the same version of diff that configure tested + + * Makefile.in (MAKE_VERSION): bump version to 20100808 + Merge with NetBSD make, pick up + o in jobs mode, when we discover we cannot make something, + call PrintOnError before exit. + +2010-08-06 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile.in (MAKE_VERSION): bump version to 20100806 + Merge with NetBSD make, pick up + o formatting fixes for ignored errors + o ensure jobs are cleaned up regardless of where wait() was called. + +2010-06-28 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile.in (MAKE_VERSION): bump version to 20100618 + * os.sh (MACHINE_ARCH): watch out for drivel from uname -p + +2010-06-16 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile.in (MAKE_VERSION): bump version to 20100616 + Merge with NetBSD make, pick up + o man page update + o call PrintOnError from JobFinish when we detect an error we + are not ignoring. + +2010-06-06 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile.in (MAKE_VERSION): bump version to 20100606 + Merge with NetBSD make, pick up + o man page update + +2010-06-05 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile.in (MAKE_VERSION): bump version to 20100605 + Merge with NetBSD make, pick up + o use bmake_signal() which is a wrapper around sigaction() + in place of signal() + o add .export-env to allow exporting variables to environment + without tracking (so no re-export when the internal value is + changed). + +2010-05-24 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile.in (MAKE_VERSION): bump version to 20100524 + Merge with NetBSD make, pick up + o fix for .info et al being greedy. + +2010-05-23 Simon J. Gerraty <sjg@bad.crufty.net> + + * Makefile.in (MAKE_VERSION): bump version to 20100520 + Merge with NetBSD make, pick up + o back to using realpath on argv[0] + but only if contains '/' and does not start with '/'. + 2010-05-10 Simon J. Gerraty <sjg@bad.crufty.net> * boot-strap: use absolute path for bmake when running tests. diff --git a/devel/bmake/files/Makefile.in b/devel/bmake/files/Makefile.in index 6cee77da38f..cc83ce533b5 100644 --- a/devel/bmake/files/Makefile.in +++ b/devel/bmake/files/Makefile.in @@ -1,7 +1,7 @@ -# $NetBSD: Makefile.in,v 1.17 2010/05/13 18:43:07 joerg Exp $ +# $NetBSD: Makefile.in,v 1.18 2010/09/07 14:28:00 joerg Exp $ # @(#)Makefile 5.2 (Berkeley) 12/28/90 -# $Id: Makefile.in,v 1.17 2010/05/13 18:43:07 joerg Exp $ +# $Id: Makefile.in,v 1.18 2010/09/07 14:28:00 joerg Exp $ PROG= bmake SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \ @@ -21,7 +21,7 @@ srcdir= @srcdir@ CC?= @CC@ # Base version on src date -MAKE_VERSION= 20100510 +MAKE_VERSION= 20100808 MACHINE=@machine@ MACHINE_ARCH=@machine_arch@ DEFAULT_SYS_PATH = @default_sys_path@ diff --git a/devel/bmake/files/bmake.1 b/devel/bmake/files/bmake.1 index a5219e236c3..76f511ce859 100644 --- a/devel/bmake/files/bmake.1 +++ b/devel/bmake/files/bmake.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: bmake.1,v 1.6 2010/05/13 18:43:07 joerg Exp $ +.\" $NetBSD: bmake.1,v 1.7 2010/09/07 14:28:00 joerg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd April 21, 2010 +.Dd June 30, 2010 .Dt MAKE 1 .Os .Sh NAME @@ -536,11 +536,48 @@ If the result of expanding a variable contains a dollar sign .Pq Ql \&$ the string is expanded again. .Pp -Variable substitution occurs at two distinct times, depending on where +Variable substitution occurs at three distinct times, depending on where the variable is being used. +.Bl -enum +.It Variables in dependency lines are expanded as the line is read. +.It Variables in shell commands are expanded when the shell command is executed. +.It +.Dq .for +loop index variables are expanded on each loop iteration. +Note that other variables are not expanded inside loops so +the following example code: +.Bd -literal -offset indent + +.Dv .for i in 1 2 3 +a+= ${i} +j= ${i} +b+= ${j} +.Dv .endfor + +all: + @echo ${a} + @echo ${b} + +.Ed +will print: +.Bd -literal -offset indent +1 2 3 +3 3 3 + +.Ed +Because while ${a} contains +.Dq 1 2 3 +after the loop is executed, ${b} +contains +.Dq ${j} ${j} ${j} +which expands to +.Dq 3 3 3 +since after the loop completes ${j} contains +.Dq 3 . +.El .Ss Variable classes The four different classes of variables (in order of increasing precedence) are: @@ -576,7 +613,7 @@ The list of sources for this target that were deemed out-of-date; also known as .Ql Va \&? . .It Va .PREFIX -The file prefix of the file, containing only the file portion, no suffix +The file prefix of the target, containing only the file portion, no suffix or preceding directory components; also known as .Ql Va * . .It Va .TARGET @@ -660,7 +697,7 @@ from which generated dependencies are read. The list of variables exported by .Nm . .It Va .MAKE.JOBS -The argument to the +The argument to the .Fl j option. .It Va .MAKE.JOB.PREFIX @@ -791,8 +828,10 @@ is set in the environment or on the command line.) .Pp Variable expansion is performed on the value before it's used, so expressions such as -.Dl ${.CURDIR:C,^/usr/src,/var/obj,} +.Dl ${.CURDIR:S,^/usr/src,/var/obj,} may be used. +This is especially useful with +.Ql Ev MAKEOBJDIR . .Pp .Ql Va .OBJDIR may be modified in the makefile as a global variable. @@ -853,6 +892,8 @@ is set to the value of for all programs which .Nm executes. +.It Ev .TARGETS +The list of targets explicitly specified on the command line, if any. .It Ev VPATH Colon-separated .Pq Dq \&: @@ -902,7 +943,7 @@ The standard shell wildcard characters .Pf ( Ql * , .Ql \&? , and -.Ql Op ) +.Ql Oo Oc ) may be used. The wildcard characters may be escaped with a backslash @@ -1320,6 +1361,15 @@ flag, so should be used with caution. Appending a variable name to .Va .MAKE.EXPORTED is equivalent to exporting a variable. +.It Ic .export-env Ar variable ... +The same as +.Ql .export , +except that the variable is not appended to +.Va .MAKE.EXPORTED . +This allows exporting a value to the environment which is different from that +used by +.Nm +internally. .It Ic .info Ar message The message is printed along with the name of the makefile and line number. .It Ic .undef Ar variable @@ -1582,6 +1632,9 @@ correspond to an actual file; it is always considered to be out of date, and will not be created with the .Fl t option. +Suffix-transformation rules are not applied to +.Ic .PHONY +targets. .It Ic .PRECIOUS When .Nm diff --git a/devel/bmake/files/bmake.cat1 b/devel/bmake/files/bmake.cat1 index 752aa7e011d..a6df53d1063 100644 --- a/devel/bmake/files/bmake.cat1 +++ b/devel/bmake/files/bmake.cat1 @@ -10,11 +10,11 @@ SSYYNNOOPPSSIISS [_t_a_r_g_e_t _._._.] DDEESSCCRRIIPPTTIIOONN - bbmmaakkee is a program designed to simplify the maintenance of other pro- - grams. Its input is a list of specifications as to the files upon which - programs and other files depend. If no --ff _m_a_k_e_f_i_l_e makefile option is - given, bbmmaakkee will try to open `_m_a_k_e_f_i_l_e' then `_M_a_k_e_f_i_l_e' in order to find - the specifications. If the file `_._d_e_p_e_n_d' exists, it is read (see + bbmmaakkee is a program designed to simplify the maintenance of other + programs. Its input is a list of specifications as to the files upon + which programs and other files depend. If no --ff _m_a_k_e_f_i_l_e makefile option + is given, bbmmaakkee will try to open `_m_a_k_e_f_i_l_e' then `_M_a_k_e_f_i_l_e' in order to + find the specifications. If the file `_._d_e_p_e_n_d' exists, it is read (see mkdep(1)). This manual page is intended as a reference document only. For a more @@ -31,10 +31,10 @@ DDEESSCCRRIIPPTTIIOONN dependency line in sequence. --CC _d_i_r_e_c_t_o_r_y - Change to _d_i_r_e_c_t_o_r_y before reading the makefiles or doing any- - thing else. If multiple --CC options are specified, each is inter- - preted relative to the previous one: --CC _/ --CC _e_t_c is equivalent to - --CC _/_e_t_c. + Change to _d_i_r_e_c_t_o_r_y before reading the makefiles or doing + anything else. If multiple --CC options are specified, each is + interpreted relative to the previous one: --CC _/ --CC _e_t_c is + equivalent to --CC _/_e_t_c. --DD _v_a_r_i_a_b_l_e Define _v_a_r_i_a_b_l_e to be 1, in the global context. @@ -47,8 +47,8 @@ DDEESSCCRRIIPPTTIIOONN information is printed to standard error, but this can be changed using the _F debugging flag. The debugging output is always unbuffered; in addition, if debugging is enabled but debugging - output is not directed to standard output, then the standard out- - put is line buffered. _F_l_a_g_s is one or more of the following: + output is not directed to standard output, then the standard + output is line buffered. _F_l_a_g_s is one or more of the following: _A Print all possible debugging information; equivalent to specifying all of the debugging flags. @@ -56,8 +56,8 @@ DDEESSCCRRIIPPTTIIOONN _a Print debugging information about archive searching and caching. - _C Print debugging information about current working direc- - tory. + _C Print debugging information about current working + directory. _c Print debugging information about conditional evaluation. @@ -96,24 +96,25 @@ DDEESSCCRRIIPPTTIIOONN they are prefixed by `@' or other "quiet" flags. Also known as "loud" behavior. - _m Print debugging information about making targets, includ- - ing modification dates. + _m Print debugging information about making targets, + including modification dates. _n Don't delete the temporary command scripts created when running commands. These temporary scripts are created in - the directory referred to by the TMPDIR environment vari- - able, or in _/_t_m_p if TMPDIR is unset or set to the empty - string. The temporary scripts are created by mkstemp(3), - and have names of the form _m_a_k_e_X_X_X_X_X_X. _N_O_T_E: This can - create many files in TMPDIR or _/_t_m_p, so use with care. + the directory referred to by the TMPDIR environment + variable, or in _/_t_m_p if TMPDIR is unset or set to the + empty string. The temporary scripts are created by + mkstemp(3), and have names of the form _m_a_k_e_X_X_X_X_X_X. _N_O_T_E: + This can create many files in TMPDIR or _/_t_m_p, so use with + care. _p Print debugging information about makefile parsing. _s Print debugging information about suffix-transformation rules. - _t Print debugging information about target list mainte- - nance. + _t Print debugging information about target list + maintenance. _v Print debugging information about variable assignment. @@ -133,8 +134,9 @@ DDEESSCCRRIIPPTTIIOONN makefiles. The system makefile directory (or directories, see the --mm option) is automatically included as part of this list. - --ii Ignore non-zero exit of shell commands in the makefile. Equiva- - lent to specifying `--' before each command line in the makefile. + --ii Ignore non-zero exit of shell commands in the makefile. + Equivalent to specifying `--' before each command line in the + makefile. --JJ _p_r_i_v_a_t_e This option should _n_o_t be specified by the user. @@ -147,12 +149,13 @@ DDEESSCCRRIIPPTTIIOONN Specify the maximum number of jobs that bbmmaakkee may have running at any one time. Turns compatibility mode off, unless the _B flag is also specified. When compatibility mode is off, all commands - associated with a target are executed in a single shell invoca- - tion as opposed to the traditional one shell invocation per line. - This can break traditional scripts which change directories on - each command invocation and then expect to start with a fresh - environment on the next line. It is more efficient to correct - the scripts rather than turn backwards compatibility on. + associated with a target are executed in a single shell + invocation as opposed to the traditional one shell invocation per + line. This can break traditional scripts which change + directories on each command invocation and then expect to start + with a fresh environment on the next line. It is more efficient + to correct the scripts rather than turn backwards compatibility + on. --kk Continue processing after errors are encountered, but only on those targets that do not depend on the target whose creation @@ -162,9 +165,9 @@ DDEESSCCRRIIPPTTIIOONN Specify a directory in which to search for sys.mk and makefiles included via the <_f_i_l_e>-style include statement. The --mm option can be used multiple times to form a search path. This path will - override the default system include path: /usr/share/mk. Fur- - thermore the system include path will be appended to the search - path used for "_f_i_l_e"-style include statements (see the --II + override the default system include path: /usr/share/mk. + Furthermore the system include path will be appended to the + search path used for "_f_i_l_e"-style include statements (see the --II option). If a file or directory name in the --mm argument (or the @@ -179,8 +182,8 @@ DDEESSCCRRIIPPTTIIOONN (e.g., by using ".../mk/sys.mk" as an argument). --nn Display the commands that would have been executed, but do not - actually execute them unless the target depends on the .MAKE spe- - cial source (see below). + actually execute them unless the target depends on the .MAKE + special source (see below). --NN Display the commands which would have been executed, but do not actually execute any of them; useful for debugging top-level @@ -199,12 +202,12 @@ DDEESSCCRRIIPPTTIIOONN for each job started and completed. --tt Rather than re-building a target as specified in the makefile, - create it or update its modification time to make it appear up- - to-date. + create it or update its modification time to make it appear + up-to-date. --VV _v_a_r_i_a_b_l_e - Print bbmmaakkee's idea of the value of _v_a_r_i_a_b_l_e, in the global con- - text. Do not build any targets. Multiple instances of this + Print bbmmaakkee's idea of the value of _v_a_r_i_a_b_l_e, in the global + context. Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. If _v_a_r_i_a_b_l_e contains a `$' then the value will be expanded before @@ -212,18 +215,18 @@ DDEESSCCRRIIPPTTIIOONN --WW Treat any warnings during makefile parsing as errors. - --XX Don't export variables passed on the command line to the environ- - ment individually. Variables passed on the command line are - still exported via the _M_A_K_E_F_L_A_G_S environment variable. This + --XX Don't export variables passed on the command line to the + environment individually. Variables passed on the command line + are still exported via the _M_A_K_E_F_L_A_G_S environment variable. This option may be useful on systems which have a small limit on the size of command arguments. _v_a_r_i_a_b_l_e_=_v_a_l_u_e Set the value of the variable _v_a_r_i_a_b_l_e to _v_a_l_u_e. Normally, all values passed on the command line are also exported to sub-makes - in the environment. The --XX flag disables this behavior. Vari- - able assignments should follow options for POSIX compatibility - but no ordering is enforced. + in the environment. The --XX flag disables this behavior. + Variable assignments should follow options for POSIX + compatibility but no ordering is enforced. There are seven different types of lines in a makefile: file dependency specifications, shell commands, variable assignments, include statements, @@ -237,8 +240,8 @@ FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEECCIIFFIICCAATTIIOO Dependency lines consist of one or more targets, an operator, and zero or more sources. This creates a relationship where the targets ``depend'' on the sources and are usually created from them. The exact relationship - between the target and the source is determined by the operator that sep- - arates them. The three operators are as follows: + between the target and the source is determined by the operator that + separates them. The three operators are as follows: :: A target is considered out-of-date if its modification time is less than those of any of its sources. Sources for a target accumulate @@ -246,12 +249,12 @@ FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEECCIIFFIICCAATTIIOO removed if bbmmaakkee is interrupted. !! Targets are always re-created, but not until all sources have been - examined and re-created as necessary. Sources for a target accumu- - late over dependency lines when this operator is used. The target - is removed if bbmmaakkee is interrupted. + examined and re-created as necessary. Sources for a target + accumulate over dependency lines when this operator is used. The + target is removed if bbmmaakkee is interrupted. - :::: If no sources are specified, the target is always re-created. Oth- - erwise, a target is considered out-of-date if any of its sources + :::: If no sources are specified, the target is always re-created. + Otherwise, a target is considered out-of-date if any of its sources has been modified more recently than the target. Sources for a target do not accumulate over dependency lines when this operator is used. The target will not be removed if bbmmaakkee is interrupted. @@ -264,8 +267,8 @@ FFIILLEE DDEEPPEENNDDEENNCCYY SSPPEECCIIFFIICCAATTIIOO done in the shell. SSHHEELLLL CCOOMMMMAANNDDSS - Each target may have associated with it a series of shell commands, nor- - mally used to create the target. Each of the commands in this script + Each target may have associated with it a series of shell commands, + normally used to create the target. Each of the commands in this script _m_u_s_t be preceded by a tab. While any target may appear on a dependency line, only one of these dependencies may be followed by a creation script, unless the `::::' operator is used. @@ -279,25 +282,25 @@ SSHHEELLLL CCOOMMMMAANNDDSS line to be ignored. VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS - Variables in make are much like variables in the shell, and, by tradi- - tion, consist of all upper-case letters. + Variables in make are much like variables in the shell, and, by + tradition, consist of all upper-case letters. VVaarriiaabbllee aassssiiggnnmmeenntt mmooddiiffiieerrss The five operators that can be used to assign values to variables are as follows: - == Assign the value to the variable. Any previous value is overrid- - den. + == Assign the value to the variable. Any previous value is + overridden. ++== Append the value to the current value of the variable. ??== Assign the value to the variable if it is not already defined. ::== Assign with expansion, i.e. expand the value before assigning it - to the variable. Normally, expansion is not done until the vari- - able is referenced. _N_O_T_E: References to undefined variables are - _n_o_t expanded. This can cause problems when variable modifiers - are used. + to the variable. Normally, expansion is not done until the + variable is referenced. _N_O_T_E: References to undefined variables + are _n_o_t expanded. This can cause problems when variable + modifiers are used. !!== Expand the value and pass it to the shell for execution and assign the result to the variable. Any newlines in the result @@ -309,26 +312,53 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variables are expanded by surrounding the variable name with either curly braces (`{}') or parentheses (`()') and preceding it with a dollar sign - (`$'). If the variable name contains only a single letter, the surround- - ing braces or parentheses are not required. This shorter form is not - recommended. + (`$'). If the variable name contains only a single letter, the + surrounding braces or parentheses are not required. This shorter form is + not recommended. If the variable name contains a dollar, then the name itself is expanded - first. This allows almost arbitrary variable names, however names con- - taining dollar, braces, parenthesis, or whitespace are really best + first. This allows almost arbitrary variable names, however names + containing dollar, braces, parenthesis, or whitespace are really best avoided! If the result of expanding a variable contains a dollar sign (`$') the string is expanded again. - Variable substitution occurs at two distinct times, depending on where - the variable is being used. Variables in dependency lines are expanded - as the line is read. Variables in shell commands are expanded when the - shell command is executed. + Variable substitution occurs at three distinct times, depending on where + the variable is being used. + + 1. Variables in dependency lines are expanded as the line is read. + + 2. Variables in shell commands are expanded when the shell command is + executed. + + 3. ``.for'' loop index variables are expanded on each loop iteration. + Note that other variables are not expanded inside loops so the + following example code: + + + .for i in 1 2 3 + a+= ${i} + j= ${i} + b+= ${j} + .endfor + + all: + @echo ${a} + @echo ${b} + + will print: + + 1 2 3 + 3 3 3 + + Because while ${a} contains ``1 2 3'' after the loop is executed, + ${b} contains ``${j} ${j} ${j}'' which expands to ``3 3 3'' since + after the loop completes ${j} contains ``3''. VVaarriiaabbllee ccllaasssseess - The four different classes of variables (in order of increasing prece- - dence) are: + The four different classes of variables (in order of increasing + precedence) are: Environment variables Variables defined as part of bbmmaakkee's environment. @@ -358,15 +388,15 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS _._O_O_D_A_T_E The list of sources for this target that were deemed out-of-date; also known as `_?'. - _._P_R_E_F_I_X The file prefix of the file, containing only the file + _._P_R_E_F_I_X The file prefix of the target, containing only the file portion, no suffix or preceding directory components; also known as `_*'. _._T_A_R_G_E_T The name of the target; also known as `_@'. The shorter forms `_@', `_?', `_<', `_>', and `_*' are permitted for - backward compatibility with historical makefiles and are not rec- - ommended. The six variables `_@_F', `_@_D', `_<_F', `_<_D', `_*_F', and + backward compatibility with historical makefiles and are not + recommended. The six variables `_@_F', `_@_D', `_<_F', `_<_D', `_*_F', and `_*_D' are permitted for compatibility with AT&T System V UNIX makefiles and are not recommended. @@ -382,8 +412,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS dollar sign. _._A_L_L_T_A_R_G_E_T_S The list of all targets encountered in the Makefile. If - evaluated during Makefile parsing, lists only those tar- - gets encountered thus far. + evaluated during Makefile parsing, lists only those + targets encountered thus far. _._C_U_R_D_I_R A path to the directory where bbmmaakkee was executed. Refer to the description of `PWD' for more details. @@ -396,8 +426,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS the same name. _._M_A_K_E_._D_E_P_E_N_D_F_I_L_E - Names the makefile (default `_._d_e_p_e_n_d') from which gener- - ated dependencies are read. + Names the makefile (default `_._d_e_p_e_n_d') from which + generated dependencies are read. _._M_A_K_E_._E_X_P_O_R_T_E_D The list of variables exported by bbmmaakkee. @@ -409,15 +439,15 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS which can be controlled via _._M_A_K_E_._J_O_B_._P_R_E_F_I_X. For example: .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}] - would produce tokens like `---make[1234] target ---' mak- - ing it easier to track the degree of parallelism being + would produce tokens like `---make[1234] target ---' + making it easier to track the degree of parallelism being achieved. MAKEFLAGS The environment variable `MAKEFLAGS' may contain anything that may be specified on bbmmaakkee's command line. Anything specified on bbmmaakkee's command line is appended to the - `MAKEFLAGS' variable which is then entered into the envi- - ronment for all programs which bbmmaakkee executes. + `MAKEFLAGS' variable which is then entered into the + environment for all programs which bbmmaakkee executes. _._M_A_K_E_._L_E_V_E_L The recursion depth of bbmmaakkee. The initial instance of bbmmaakkee will be 0, and an incremented value is put into the @@ -453,8 +483,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS _M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R When bbmmaakkee stops due to an error, it prints its name and - the value of `_._C_U_R_D_I_R' as well as the value of any vari- - ables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'. + the value of `_._C_U_R_D_I_R' as well as the value of any + variables named in `_M_A_K_E___P_R_I_N_T___V_A_R___O_N___E_R_R_O_R'. _._n_e_w_l_i_n_e This variable is simply assigned a newline character as its value. This allows expansions using the ::@@ modifier @@ -464,13 +494,13 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}. _._O_B_J_D_I_R A path to the directory where the targets are built. Its - value is determined by trying to chdir(2) to the follow- - ing directories in order and using the first match: + value is determined by trying to chdir(2) to the + following directories in order and using the first match: 1. ${MAKEOBJDIRPREFIX}${.CURDIR} - (Only if `MAKEOBJDIRPREFIX' is set in the environ- - ment or on the command line.) + (Only if `MAKEOBJDIRPREFIX' is set in the + environment or on the command line.) 2. ${MAKEOBJDIR} @@ -487,13 +517,14 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variable expansion is performed on the value before it's used, so expressions such as - ${.CURDIR:C,^/usr/src,/var/obj,} - may be used. + ${.CURDIR:S,^/usr/src,/var/obj,} + may be used. This is especially useful with + `MAKEOBJDIR'. `_._O_B_J_D_I_R' may be modified in the makefile as a global variable. In all cases, bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' - and set `PWD' to that directory before executing any tar- - gets. + and set `PWD' to that directory before executing any + targets. _._P_A_R_S_E_D_I_R A path to the directory of the current `_M_a_k_e_f_i_l_e' being parsed. @@ -504,8 +535,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS _._P_A_T_H A variable that represents the list of directories that bbmmaakkee will search for files. The search list should be - updated using the target `_._P_A_T_H' rather than the vari- - able. + updated using the target `_._P_A_T_H' rather than the + variable. PWD Alternate path to the current directory. bbmmaakkee normally sets `_._C_U_R_D_I_R' to the canonical path given by getcwd(3). @@ -516,6 +547,9 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS contains a variable transform. `PWD' is set to the value of `_._O_B_J_D_I_R' for all programs which bbmmaakkee executes. + .TARGETS The list of targets explicitly specified on the command + line, if any. + VPATH Colon-separated (``:'') lists of directories that bbmmaakkee will search for files. The variable is supported for compatibility with old make programs only, use `_._P_A_T_H' @@ -523,8 +557,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS VVaarriiaabbllee mmooddiiffiieerrss Variable expansion may be modified to select or modify each word of the - variable (where a ``word'' is white-space delimited sequence of charac- - ters). The general format of a variable expansion is as follows: + variable (where a ``word'' is white-space delimited sequence of + characters). The general format of a variable expansion is as follows: ${variable[:modifier[:...]]} @@ -545,8 +579,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS ::EE Replaces each word in the variable with its suffix. - ::HH Replaces each word in the variable with everything but the last com- - ponent. + ::HH Replaces each word in the variable with everything but the last + component. ::MM_p_a_t_t_e_r_n Select only those words that match _p_a_t_t_e_r_n. The standard shell @@ -591,10 +625,10 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS ::ttll Converts variable to lower-case letters. ::ttss_c - Words in the variable are normally separated by a space on expan- - sion. This modifier sets the separator to the character _c. If _c is - omitted, then no separator is used. The common escapes (including - octal numeric codes), work as expected. + Words in the variable are normally separated by a space on + expansion. This modifier sets the separator to the character _c. If + _c is omitted, then no separator is used. The common escapes + (including octal numeric codes), work as expected. ::ttuu Converts variable to upper-case letters. @@ -610,8 +644,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS slash of the pattern, all occurrences in each word are replaced. If a `1' is appended to the last slash of the pattern, only the first word is affected. If a `W' is appended to the last slash of the - pattern, then the value is treated as a single word (possibly con- - taining embedded white space). If _o_l_d___s_t_r_i_n_g begins with a caret + pattern, then the value is treated as a single word (possibly + containing embedded white space). If _o_l_d___s_t_r_i_n_g begins with a caret (`^'), _o_l_d___s_t_r_i_n_g is anchored at the beginning of each word. If _o_l_d___s_t_r_i_n_g ends with a dollar sign (`$'), it is anchored at the end of each word. Inside _n_e_w___s_t_r_i_n_g, an ampersand (`&') is replaced by @@ -622,31 +656,31 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variable expansion occurs in the normal fashion inside both _o_l_d___s_t_r_i_n_g and _n_e_w___s_t_r_i_n_g with the single exception that a backslash - is used to prevent the expansion of a dollar sign (`$'), not a pre- - ceding dollar sign as is usual. + is used to prevent the expansion of a dollar sign (`$'), not a + preceding dollar sign as is usual. ::CC/_p_a_t_t_e_r_n/_r_e_p_l_a_c_e_m_e_n_t/[11ggWW] The ::CC modifier is just like the ::SS modifier except that the old and - new strings, instead of being simple strings, are a regular expres- - sion (see regex(3)) string _p_a_t_t_e_r_n and an ed(1)-style string + new strings, instead of being simple strings, are a regular + expression (see regex(3)) string _p_a_t_t_e_r_n and an ed(1)-style string _r_e_p_l_a_c_e_m_e_n_t. Normally, the first occurrence of the pattern _p_a_t_t_e_r_n in each word of the value is substituted with _r_e_p_l_a_c_e_m_e_n_t. The `1' modifier causes the substitution to apply to at most one word; the `g' modifier causes the substitution to apply to as many instances of the search pattern _p_a_t_t_e_r_n as occur in the word or words it is - found in; the `W' modifier causes the value to be treated as a sin- - gle word (possibly containing embedded white space). Note that `1' - and `g' are orthogonal; the former specifies whether multiple words - are potentially affected, the latter whether multiple substitutions - can potentially occur within each affected word. + found in; the `W' modifier causes the value to be treated as a + single word (possibly containing embedded white space). Note that + `1' and `g' are orthogonal; the former specifies whether multiple + words are potentially affected, the latter whether multiple + substitutions can potentially occur within each affected word. ::TT Replaces each word in the variable with its last component. ::uu Remove adjacent duplicate words (like uniq(1)). ::??_t_r_u_e___s_t_r_i_n_g::_f_a_l_s_e___s_t_r_i_n_g - If the variable name (not its value), when parsed as a .if condi- - tional expression, evaluates to true, return as its value the + If the variable name (not its value), when parsed as a .if + conditional expression, evaluates to true, return as its value the _t_r_u_e___s_t_r_i_n_g, otherwise return the _f_a_l_s_e___s_t_r_i_n_g. Since the variable name is used as the expression, :? must be the first modifier after the variable name itself - which will, of course, usually contain @@ -667,15 +701,15 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variable expansion occurs in the normal fashion inside both _o_l_d___s_t_r_i_n_g and _n_e_w___s_t_r_i_n_g with the single exception that a backslash - is used to prevent the expansion of a dollar sign (`$'), not a pre- - ceding dollar sign as is usual. + is used to prevent the expansion of a dollar sign (`$'), not a + preceding dollar sign as is usual. ::@@_t_e_m_p@@_s_t_r_i_n_g@@ - This is the loop expansion mechanism from the OSF Development Envi- - ronment (ODE) make. Unlike ..ffoorr loops expansion occurs at the time - of reference. Assign _t_e_m_p to each word in the variable and evaluate - _s_t_r_i_n_g. The ODE convention is that _t_e_m_p should start and end with a - period. For example. + This is the loop expansion mechanism from the OSF Development + Environment (ODE) make. Unlike ..ffoorr loops expansion occurs at the + time of reference. Assign _t_e_m_p to each word in the variable and + evaluate _s_t_r_i_n_g. The ODE convention is that _t_e_m_p should start and + end with a period. For example. ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@} ::UU_n_e_w_v_a_l @@ -724,8 +758,9 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Assign the output of _c_m_d to the variable. ::[[_r_a_n_g_e]] - Selects one or more words from the value, or performs other opera- - tions related to the way in which the value is divided into words. + Selects one or more words from the value, or performs other + operations related to the way in which the value is divided into + words. Ordinarily, a value is treated as a sequence of words delimited by white space. Some modifiers suppress this behaviour, causing a @@ -744,8 +779,8 @@ VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS _s_t_a_r_t...._e_n_d Selects all words from _s_t_a_r_t to _e_n_d, inclusive. For example, `::[[22....--11]]' selects all words from the second word to the last - word. If _s_t_a_r_t is greater than _e_n_d, then the words are out- - put in reverse order. For example, `::[[--11....11]]' selects all + word. If _s_t_a_r_t is greater than _e_n_d, then the words are + output in reverse order. For example, `::[[--11....11]]' selects all the words from last to first. ** Causes subsequent modifiers to treat the value as a single @@ -764,9 +799,9 @@ IINNCCLLUUDDEE SSTTAATTEEMMEENNTTSS,, CCOONNDDIITTIIOO Makefile inclusion, conditional structures and for loops reminiscent of the C programming language are provided in bbmmaakkee. All such structures are identified by a line beginning with a single dot (`.') character. - Files are included with either ..iinncclluuddee <_f_i_l_e> or ..iinncclluuddee "_f_i_l_e". Vari- - ables between the angle brackets or double quotes are expanded to form - the file name. If angle brackets are used, the included makefile is + Files are included with either ..iinncclluuddee <_f_i_l_e> or ..iinncclluuddee "_f_i_l_e". + Variables between the angle brackets or double quotes are expanded to + form the file name. If angle brackets are used, the included makefile is expected to be in the system makefile directory. If double quotes are used, the including makefile's directory and any directories specified using the --II option are searched before the system makefile directory. @@ -790,6 +825,12 @@ IINNCCLLUUDDEE SSTTAATTEEMMEENNTTSS,, CCOONNDDIITTIIOO Appending a variable name to _._M_A_K_E_._E_X_P_O_R_T_E_D is equivalent to exporting a variable. + ..eexxppoorrtt--eennvv _v_a_r_i_a_b_l_e _._._. + The same as `.export', except that the variable is not appended + to _._M_A_K_E_._E_X_P_O_R_T_E_D. This allows exporting a value to the + environment which is different from that used by bbmmaakkee + internally. + ..iinnffoo _m_e_s_s_a_g_e The message is printed along with the name of the makefile and line number. @@ -804,12 +845,13 @@ IINNCCLLUUDDEE SSTTAATTEEMMEENNTTSS,, CCOONNDDIITTIIOO all globals are unexported, and _._M_A_K_E_._E_X_P_O_R_T_E_D deleted. ..uunneexxppoorrtt--eennvv - Unexport all globals previously exported and clear the environ- - ment inherited from the parent. This operation will cause a mem- - ory leak of the original environment, so should be used spar- - ingly. Testing for _._M_A_K_E_._L_E_V_E_L being 0, would make sense. Also - note that any variables which originated in the parent environ- - ment should be explicitly preserved if desired. For example: + Unexport all globals previously exported and clear the + environment inherited from the parent. This operation will cause + a memory leak of the original environment, so should be used + sparingly. Testing for _._M_A_K_E_._L_E_V_E_L being 0, would make sense. + Also note that any variables which originated in the parent + environment should be explicitly preserved if desired. For + example: .if ${.MAKE.LEVEL} == 0 PATH := ${PATH} @@ -898,13 +940,13 @@ IINNCCLLUUDDEE SSTTAATTEEMMEENNTTSS,, CCOONNDDIITTIIOO _E_x_p_r_e_s_s_i_o_n may also be an arithmetic or string comparison. Variable expansion is performed on both sides of the comparison, after which the integral values are compared. A value is interpreted as hexadecimal if - it is preceded by 0x, otherwise it is decimal; octal numbers are not sup- - ported. The standard C relational operators are all supported. If after - variable expansion, either the left or right hand side of a `====' or `!!==' - operator is not an integral value, then string comparison is performed - between the expanded variables. If no relational operator is given, it - is assumed that the expanded variable is being compared against 0 or an - empty string in the case of a string comparison. + it is preceded by 0x, otherwise it is decimal; octal numbers are not + supported. The standard C relational operators are all supported. If + after variable expansion, either the left or right hand side of a `====' or + `!!==' operator is not an integral value, then string comparison is + performed between the expanded variables. If no relational operator is + given, it is assumed that the expanded variable is being compared against + 0 or an empty string in the case of a string comparison. When bbmmaakkee is evaluating one of these conditional expressions, and it encounters a (white-space separated) word it doesn't recognize, either @@ -913,8 +955,8 @@ IINNCCLLUUDDEE SSTTAATTEEMMEENNTTSS,, CCOONNDDIITTIIOO the ``defined'' expression is applied. Similarly, if the form is `..iiffmmaakkee' or `..iiffnnmmaakkee, tthhee' ``make'' expression is applied. - If the conditional evaluates to true the parsing of the makefile contin- - ues as before. If it evaluates to false, the following lines are + If the conditional evaluates to true the parsing of the makefile + continues as before. If it evaluates to false, the following lines are skipped. In both cases this continues until a `..eellssee' or `..eennddiiff' is found. @@ -933,15 +975,15 @@ IINNCCLLUUDDEE SSTTAATTEEMMEENNTTSS,, CCOONNDDIITTIIOO must be a multiple of three. CCOOMMMMEENNTTSS - Comments begin with a hash (`#') character, anywhere but in a shell com- - mand line, and continue to the end of an unescaped new line. + Comments begin with a hash (`#') character, anywhere but in a shell + command line, and continue to the end of an unescaped new line. SSPPEECCIIAALL SSOOUURRCCEESS ((AATTTTRRIIBBUUTTEESS)) - ..EEXXEECC Target is never out of date, but always execute commands any- - way. + ..EEXXEECC Target is never out of date, but always execute commands + anyway. - ..IIGGNNOORREE Ignore any errors from the commands associated with this tar- - get, exactly as if they all were preceded by a dash (`-'). + ..IIGGNNOORREE Ignore any errors from the commands associated with this + target, exactly as if they all were preceded by a dash (`-'). ..MMAADDEE Mark all sources of this target as being up-to-date. @@ -957,13 +999,14 @@ SSPPEECCIIAALL SSOOUURRCCEESS ((AATTTTRRIIBBUUTTEESS)) source prevents this target from being selected. ..OOPPTTIIOONNAALL - If a target is marked with this attribute and bbmmaakkee can't fig- - ure out how to create it, it will ignore this fact and assume - the file isn't needed or already exists. + If a target is marked with this attribute and bbmmaakkee can't + figure out how to create it, it will ignore this fact and + assume the file isn't needed or already exists. ..PPHHOONNYY The target does not correspond to an actual file; it is always considered to be out of date, and will not be created with the - --tt option. + --tt option. Suffix-transformation rules are not applied to + ..PPHHOONNYY targets. ..PPRREECCIIOOUUSS When bbmmaakkee is interrupted, it normally removes any partially @@ -976,8 +1019,8 @@ SSPPEECCIIAALL SSOOUURRCCEESS ((AATTTTRRIIBBUUTTEESS)) ..SSIILLEENNTT Do not echo any of the commands associated with this target, exactly as if they all were preceded by an at sign (`@'). - ..UUSSEE Turn the target into bbmmaakkee's version of a macro. When the tar- - get is used as a source for another target, the other target + ..UUSSEE Turn the target into bbmmaakkee's version of a macro. When the + target is used as a source for another target, the other target acquires the commands, sources, and attributes (except for ..UUSSEE) of the source. If the target already has commands, the ..UUSSEE target's commands are appended to them. @@ -990,8 +1033,8 @@ SSPPEECCIIAALL SSOOUURRCCEESS ((AATTTTRRIIBBUUTTEESS)) it are made before the sources that succeed it in the line. Since the dependents of files are not made until the file itself could be made, this also stops the dependents being - built unless they are needed for another branch of the depen- - dency tree. So given: + built unless they are needed for another branch of the + dependency tree. So given: x: a .WAIT b echo x @@ -1015,10 +1058,10 @@ SSPPEECCIIAALL TTAARRGGEETTSS ..DDEEFFAAUULLTT This is sort of a ..UUSSEE rule for any target (that was used only - as a source) that bbmmaakkee can't figure out any other way to cre- - ate. Only the shell script is used. The ..IIMMPPSSRRCC variable of a - target that inherits ..DDEEFFAAUULLTT's commands is set to the target's - own name. + as a source) that bbmmaakkee can't figure out any other way to + create. Only the shell script is used. The ..IIMMPPSSRRCC variable of + a target that inherits ..DDEEFFAAUULLTT's commands is set to the + target's own name. ..EENNDD Any command lines attached to this target are executed after everything else is done. @@ -1053,10 +1096,10 @@ SSPPEECCIIAALL TTAARRGGEETTSS variants. ..OORRDDEERR The named targets are made in sequence. This ordering does not - add targets to the list of targets to be made. Since the depen- - dents of a target do not get built until the target itself could - be built, unless `a' is built by another part of the dependency - graph, the following is a dependency loop: + add targets to the list of targets to be made. Since the + dependents of a target do not get built until the target itself + could be built, unless `a' is built by another part of the + dependency graph, the following is a dependency loop: .ORDER: a b b: a @@ -1065,10 +1108,10 @@ SSPPEECCIIAALL TTAARRGGEETTSS makes. ..PPAATTHH The sources are directories which are to be searched for files - not found in the current directory. If no sources are speci- - fied, any previously specified directories are deleted. If the - source is the special ..DDOOTTLLAASSTT target, then the current working - directory is searched last. + not found in the current directory. If no sources are + specified, any previously specified directories are deleted. If + the source is the special ..DDOOTTLLAASSTT target, then the current + working directory is searched last. ..PPHHOONNYY Apply the ..PPHHOONNYY attribute to any specified sources. @@ -1093,16 +1136,16 @@ SSPPEECCIIAALL TTAARRGGEETTSS _e_c_h_o The command to turn on echoing of commands executed. - _q_u_i_e_t The command to turn off echoing of commands exe- - cuted. + _q_u_i_e_t The command to turn off echoing of commands + executed. - _f_i_l_t_e_r The output to filter after issuing the _q_u_i_e_t com- - mand. It is typically identical to _q_u_i_e_t. + _f_i_l_t_e_r The output to filter after issuing the _q_u_i_e_t + command. It is typically identical to _q_u_i_e_t. _e_r_r_F_l_a_g The flag to pass the shell to enable error checking. - _e_c_h_o_F_l_a_g The flag to pass the shell to enable command echo- - ing. + _e_c_h_o_F_l_a_g The flag to pass the shell to enable command + echoing. _n_e_w_l_i_n_e The string literal to pass the shell that results in a single newline character when used outside of any @@ -1135,8 +1178,8 @@ EENNVVIIRROONNMMEENNTT PWD, and TMPDIR. MAKEOBJDIRPREFIX and MAKEOBJDIR may only be set in the environment or on - the command line to bbmmaakkee and not as makefile variables; see the descrip- - tion of `_._O_B_J_D_I_R' for more details. + the command line to bbmmaakkee and not as makefile variables; see the + description of `_._O_B_J_D_I_R' for more details. FFIILLEESS .depend list of dependencies @@ -1151,8 +1194,8 @@ CCOOMMPPAATTIIBBIILLIITTYY not. The way that parallel makes are scheduled changed in NetBSD 4.0 so that - .ORDER and .WAIT apply recursively to the dependant nodes. The algo- - rithms used may change again in the future. + .ORDER and .WAIT apply recursively to the dependant nodes. The + algorithms used may change again in the future. The way that .for loop variables are substituted changed after NetBSD 5.0 so that they still appear to be variable expansions. In particular this @@ -1166,4 +1209,4 @@ HHIISSTTOORRYY bbmmaakkee is derived from NetBSD's make(1). It uses autoconf to facilitate portability to other platforms. -NetBSD 5.0 April 21, 2010 NetBSD 5.0 +NetBSD 5.0 June 30, 2010 NetBSD 5.0 diff --git a/devel/bmake/files/boot-strap b/devel/bmake/files/boot-strap index ce510549fa6..b1e160081b9 100755 --- a/devel/bmake/files/boot-strap +++ b/devel/bmake/files/boot-strap @@ -53,7 +53,7 @@ # Simon J. Gerraty <sjg@crufty.net> # RCSid: -# $Id: boot-strap,v 1.8 2010/05/13 18:43:08 joerg Exp $ +# $Id: boot-strap,v 1.9 2010/09/07 14:28:00 joerg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -293,7 +293,9 @@ if [ -s "${mksrc:-/dev/null}/install-mk" ]; then *) MAKESYSPATH=".../mk:${MAKESYSPATH}";; esac fi -export MAKESYSPATH +# make sure test below uses the same diff that configure did +TOOL_DIFF=`type diff | sed 's,^[^/][^/]*,,;q'` +export MAKESYSPATH TOOL_DIFF if [ "$mksrc" ]; then $objdir/bmake test || exit 1 else diff --git a/devel/bmake/files/compat.c b/devel/bmake/files/compat.c index 49effd09a84..f2e46be124c 100644 --- a/devel/bmake/files/compat.c +++ b/devel/bmake/files/compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.7 2010/04/24 21:10:29 joerg Exp $ */ +/* $NetBSD: compat.c,v 1.8 2010/09/07 14:28:00 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.7 2010/04/24 21:10:29 joerg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.8 2010/09/07 14:28:00 joerg Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.7 2010/04/24 21:10:29 joerg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.8 2010/09/07 14:28:00 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -384,6 +384,8 @@ again: while (1) { while ((retstat = wait(&reason)) != cpid) { + if (retstat > 0) + JobReapChild(retstat, reason, FALSE); /* not ours? */ if (retstat == -1 && errno != EINTR) { break; } @@ -644,17 +646,17 @@ Compat_Run(Lst targs) Compat_Init(); - if (signal(SIGINT, SIG_IGN) != SIG_IGN) { - signal(SIGINT, CompatInterrupt); + if (bmake_signal(SIGINT, SIG_IGN) != SIG_IGN) { + bmake_signal(SIGINT, CompatInterrupt); } - if (signal(SIGTERM, SIG_IGN) != SIG_IGN) { - signal(SIGTERM, CompatInterrupt); + if (bmake_signal(SIGTERM, SIG_IGN) != SIG_IGN) { + bmake_signal(SIGTERM, CompatInterrupt); } - if (signal(SIGHUP, SIG_IGN) != SIG_IGN) { - signal(SIGHUP, CompatInterrupt); + if (bmake_signal(SIGHUP, SIG_IGN) != SIG_IGN) { + bmake_signal(SIGHUP, CompatInterrupt); } - if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) { - signal(SIGQUIT, CompatInterrupt); + if (bmake_signal(SIGQUIT, SIG_IGN) != SIG_IGN) { + bmake_signal(SIGQUIT, CompatInterrupt); } ENDNode = Targ_FindNode(".END", TARG_CREATE); diff --git a/devel/bmake/files/job.c b/devel/bmake/files/job.c index b84c97c12cc..ea4fa7e1e9b 100644 --- a/devel/bmake/files/job.c +++ b/devel/bmake/files/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.10 2010/04/24 21:10:29 joerg Exp $ */ +/* $NetBSD: job.c,v 1.11 2010/09/07 14:28:00 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.10 2010/04/24 21:10:29 joerg Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.11 2010/09/07 14:28:00 joerg Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.10 2010/04/24 21:10:29 joerg Exp $"); +__RCSID("$NetBSD: job.c,v 1.11 2010/09/07 14:28:00 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -357,7 +357,7 @@ static sigset_t caught_signals; /* Set of signals we handle */ static void JobChildSig(int); static void JobContinueSig(int); -static Job *JobFindPid(int, int); +static Job *JobFindPid(int, int, Boolean); static int JobPrintCommand(void *, void *); static int JobSaveCommand(void *, void *); static void JobClose(Job *); @@ -629,7 +629,7 @@ JobPassSig_suspend(int signo) *----------------------------------------------------------------------- */ static Job * -JobFindPid(int pid, int status) +JobFindPid(int pid, int status, Boolean isJobs) { Job *job; @@ -637,7 +637,7 @@ JobFindPid(int pid, int status) if ((job->job_state == status) && job->pid == pid) return job; } - if (DEBUG(JOB)) + if (DEBUG(JOB) && isJobs) job_table_dump("no pid"); return NULL; } @@ -726,6 +726,7 @@ JobPrintCommand(void *cmdp, void *jobp) shutUp = DEBUG(LOUD) ? FALSE : TRUE; break; case '-': + job->flags |= JOB_IGNERR; errOff = TRUE; break; case '+': @@ -774,7 +775,7 @@ JobPrintCommand(void *cmdp, void *jobp) } if (errOff) { - if ( !(job->flags & JOB_IGNERR) && !noSpecials) { + if (!noSpecials) { if (commandShell->hasErrCtl) { /* * we don't want the error-control commands showing @@ -1032,9 +1033,12 @@ JobFinish (Job *job, WAIT_T status) (void)printf("*** [%s] Error code %d%s\n", job->node->name, WEXITSTATUS(status), - (job->flags & JOB_IGNERR) ? "(ignored)" : ""); - if (job->flags & JOB_IGNERR) + (job->flags & JOB_IGNERR) ? " (ignored)" : ""); + if (job->flags & JOB_IGNERR) { WAIT_STATUS(status) = 0; + } else { + PrintOnError(job->node, NULL); + } } else if (DEBUG(JOB)) { if (job->node != lastNode) { MESSAGE(stdout, job->node); @@ -1243,11 +1247,11 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...)) } if (gn->type & OP_OPTIONAL) { - (void)fprintf(stdout, "%s%s %s(ignored)\n", progname, + (void)fprintf(stdout, "%s%s %s (ignored)\n", progname, msg, gn->name); (void)fflush(stdout); } else if (keepgoing) { - (void)fprintf(stdout, "%s%s %s(continuing)\n", progname, + (void)fprintf(stdout, "%s%s %s (continuing)\n", progname, msg, gn->name); (void)fflush(stdout); return FALSE; @@ -1563,6 +1567,7 @@ JobStart(GNode *gn, int flags) * also dead... */ if (!cmdsOK) { + PrintOnError(gn, NULL); /* provide some clue */ DieHorribly(); } @@ -1937,7 +1942,6 @@ void Job_CatchChildren(void) { int pid; /* pid of dead child */ - Job *job; /* job descriptor for dead child */ WAIT_T status; /* Exit/termination status */ /* @@ -1951,41 +1955,60 @@ Job_CatchChildren(void) (void)fprintf(debug_file, "Process %d exited/stopped status %x.\n", pid, WAIT_STATUS(status)); } + JobReapChild(pid, status, TRUE); + } +} + +/* + * It is possible that wait[pid]() was called from elsewhere, + * this lets us reap jobs regardless. + */ +void +JobReapChild(pid_t pid, WAIT_T status, Boolean isJobs) +{ + Job *job; /* job descriptor for dead child */ + + /* + * Don't even bother if we know there's no one around. + */ + if (jobTokensRunning == 0) + return; - job = JobFindPid(pid, JOB_ST_RUNNING); - if (job == NULL) { + job = JobFindPid(pid, JOB_ST_RUNNING, isJobs); + if (job == NULL) { + if (isJobs) { if (!lurking_children) Error("Child (%d) status %x not in table?", pid, status); - continue; } - if (WIFSTOPPED(status)) { - if (DEBUG(JOB)) { - (void)fprintf(debug_file, "Process %d (%s) stopped.\n", - job->pid, job->node->name); - } - if (!make_suspended) { - switch (WSTOPSIG(status)) { - case SIGTSTP: - (void)printf("*** [%s] Suspended\n", job->node->name); - break; - case SIGSTOP: - (void)printf("*** [%s] Stopped\n", job->node->name); - break; - default: - (void)printf("*** [%s] Stopped -- signal %d\n", - job->node->name, WSTOPSIG(status)); - } - job->job_suspended = 1; + return; /* not ours */ + } + if (WIFSTOPPED(status)) { + if (DEBUG(JOB)) { + (void)fprintf(debug_file, "Process %d (%s) stopped.\n", + job->pid, job->node->name); + } + if (!make_suspended) { + switch (WSTOPSIG(status)) { + case SIGTSTP: + (void)printf("*** [%s] Suspended\n", job->node->name); + break; + case SIGSTOP: + (void)printf("*** [%s] Stopped\n", job->node->name); + break; + default: + (void)printf("*** [%s] Stopped -- signal %d\n", + job->node->name, WSTOPSIG(status)); } - (void)fflush(stdout); - continue; + job->job_suspended = 1; } + (void)fflush(stdout); + return; + } - job->job_state = JOB_ST_FINISHED; - job->exit_status = WAIT_STATUS(status); + job->job_state = JOB_ST_FINISHED; + job->exit_status = WAIT_STATUS(status); - JobFinish(job, status); - } + JobFinish(job, status); } /*- @@ -2185,13 +2208,13 @@ Job_Init(void) /* * Install a SIGCHLD handler. */ - (void)signal(SIGCHLD, JobChildSig); + (void)bmake_signal(SIGCHLD, JobChildSig); sigaddset(&caught_signals, SIGCHLD); #define ADDSIG(s,h) \ - if (signal(s, SIG_IGN) != SIG_IGN) { \ + if (bmake_signal(s, SIG_IGN) != SIG_IGN) { \ sigaddset(&caught_signals, s); \ - (void)signal(s, h); \ + (void)bmake_signal(s, h); \ } /* @@ -2232,7 +2255,7 @@ static void JobSigReset(void) { #define DELSIG(s) \ if (sigismember(&caught_signals, s)) { \ - (void)signal(s, SIG_DFL); \ + (void)bmake_signal(s, SIG_DFL); \ } DELSIG(SIGINT) @@ -2245,7 +2268,7 @@ static void JobSigReset(void) DELSIG(SIGWINCH) DELSIG(SIGCONT) #undef DELSIG - (void)signal(SIGCHLD, SIG_DFL); + (void)bmake_signal(SIGCHLD, SIG_DFL); } /*- diff --git a/devel/bmake/files/main.c b/devel/bmake/files/main.c index 9ba9695d21b..d13e8c5fbcb 100644 --- a/devel/bmake/files/main.c +++ b/devel/bmake/files/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.9 2010/05/13 18:43:08 joerg Exp $ */ +/* $NetBSD: main.c,v 1.10 2010/09/07 14:28:00 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.9 2010/05/13 18:43:08 joerg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.10 2010/09/07 14:28:00 joerg Exp $"; #else #include <sys/cdefs.h> #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.9 2010/05/13 18:43:08 joerg Exp $"); +__RCSID("$NetBSD: main.c,v 1.10 2010/09/07 14:28:00 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -812,7 +812,7 @@ main(int argc, char **argv) debug_file = stderr; #ifdef SIGINFO - (void)signal(SIGINFO, siginfo); + (void)bmake_signal(SIGINFO, siginfo); #endif /* * Set the seed to produce a different random sequence @@ -933,7 +933,22 @@ main(int argc, char **argv) * MFLAGS also gets initialized empty, for compatibility. */ Parse_Init(); - p1 = argv[0]; + if (argv[0][0] == '/' || strchr(argv[0], '/') == NULL) { + /* + * Leave alone if it is an absolute path, or if it does + * not contain a '/' in which case we need to find it in + * the path, like execvp(3) and the shells do. + */ + p1 = argv[0]; + } else { + /* + * A relative path, canonicalize it. + */ + p1 = realpath(argv[0], mdpath); + if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) { + p1 = argv[0]; /* realpath failed */ + } + } Var_Set("MAKE", p1, VAR_GLOBAL, 0); Var_Set(".MAKE", p1, VAR_GLOBAL, 0); Var_Set(MAKEFLAGS, "", VAR_GLOBAL, 0); @@ -1680,9 +1695,10 @@ Cmd_Exec(const char *cmd, const char **errnum) /* * Wait for the process to exit. */ - while(((pid = waitpid(cpid, &status, 0)) != cpid) && (pid >= 0)) + while(((pid = waitpid(cpid, &status, 0)) != cpid) && (pid >= 0)) { + JobReapChild(pid, status, FALSE); continue; - + } cc = Buf_Size(&buf); res = Buf_Destroy(&buf, FALSE); diff --git a/devel/bmake/files/make.1 b/devel/bmake/files/make.1 index fb1db46cce0..e2e41f48afe 100644 --- a/devel/bmake/files/make.1 +++ b/devel/bmake/files/make.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.6 2010/04/24 21:10:29 joerg Exp $ +.\" $NetBSD: make.1,v 1.7 2010/09/07 14:28:00 joerg Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd April 21, 2010 +.Dd June 30, 2010 .Dt MAKE 1 .Os .Sh NAME @@ -536,11 +536,48 @@ If the result of expanding a variable contains a dollar sign .Pq Ql \&$ the string is expanded again. .Pp -Variable substitution occurs at two distinct times, depending on where +Variable substitution occurs at three distinct times, depending on where the variable is being used. +.Bl -enum +.It Variables in dependency lines are expanded as the line is read. +.It Variables in shell commands are expanded when the shell command is executed. +.It +.Dq .for +loop index variables are expanded on each loop iteration. +Note that other variables are not expanded inside loops so +the following example code: +.Bd -literal -offset indent + +.Dv .for i in 1 2 3 +a+= ${i} +j= ${i} +b+= ${j} +.Dv .endfor + +all: + @echo ${a} + @echo ${b} + +.Ed +will print: +.Bd -literal -offset indent +1 2 3 +3 3 3 + +.Ed +Because while ${a} contains +.Dq 1 2 3 +after the loop is executed, ${b} +contains +.Dq ${j} ${j} ${j} +which expands to +.Dq 3 3 3 +since after the loop completes ${j} contains +.Dq 3 . +.El .Ss Variable classes The four different classes of variables (in order of increasing precedence) are: @@ -576,7 +613,7 @@ The list of sources for this target that were deemed out-of-date; also known as .Ql Va \&? . .It Va .PREFIX -The file prefix of the file, containing only the file portion, no suffix +The file prefix of the target, containing only the file portion, no suffix or preceding directory components; also known as .Ql Va * . .It Va .TARGET @@ -660,7 +697,7 @@ from which generated dependencies are read. The list of variables exported by .Nm . .It Va .MAKE.JOBS -The argument to the +The argument to the .Fl j option. .It Va .MAKE.JOB.PREFIX @@ -791,8 +828,10 @@ is set in the environment or on the command line.) .Pp Variable expansion is performed on the value before it's used, so expressions such as -.Dl ${.CURDIR:C,^/usr/src,/var/obj,} +.Dl ${.CURDIR:S,^/usr/src,/var/obj,} may be used. +This is especially useful with +.Ql Ev MAKEOBJDIR . .Pp .Ql Va .OBJDIR may be modified in the makefile as a global variable. @@ -853,6 +892,8 @@ is set to the value of for all programs which .Nm executes. +.It Ev .TARGETS +The list of targets explicitly specified on the command line, if any. .It Ev VPATH Colon-separated .Pq Dq \&: @@ -902,7 +943,7 @@ The standard shell wildcard characters .Pf ( Ql * , .Ql \&? , and -.Ql Op ) +.Ql Oo Oc ) may be used. The wildcard characters may be escaped with a backslash @@ -1320,6 +1361,15 @@ flag, so should be used with caution. Appending a variable name to .Va .MAKE.EXPORTED is equivalent to exporting a variable. +.It Ic .export-env Ar variable ... +The same as +.Ql .export , +except that the variable is not appended to +.Va .MAKE.EXPORTED . +This allows exporting a value to the environment which is different from that +used by +.Nm +internally. .It Ic .info Ar message The message is printed along with the name of the makefile and line number. .It Ic .undef Ar variable @@ -1582,6 +1632,9 @@ correspond to an actual file; it is always considered to be out of date, and will not be created with the .Fl t option. +Suffix-transformation rules are not applied to +.Ic .PHONY +targets. .It Ic .PRECIOUS When .Nm diff --git a/devel/bmake/files/nonints.h b/devel/bmake/files/nonints.h index 394dc7a3259..2d4a7bd2a80 100644 --- a/devel/bmake/files/nonints.h +++ b/devel/bmake/files/nonints.h @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.5 2010/04/20 13:37:49 joerg Exp $ */ +/* $NetBSD: nonints.h,v 1.6 2010/09/07 14:28:00 joerg Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -106,6 +106,11 @@ int For_Eval(char *); int For_Accum(char *); void For_Run(int); +/* job.c */ +#ifdef WAIT_T +void JobReapChild(pid_t, WAIT_T, Boolean); +#endif + /* main.c */ void Main_ParseArgLine(const char *); void MakeMode(const char *); @@ -195,3 +200,6 @@ void Var_Dump(GNode *); void Var_ExportVars(void); void Var_Export(char *, int); void Var_UnExport(char *); + +/* util.c */ +void (*bmake_signal(int, void (*)(int)))(int); diff --git a/devel/bmake/files/os.sh b/devel/bmake/files/os.sh index df45cf51e9e..22b6c477c86 100644 --- a/devel/bmake/files/os.sh +++ b/devel/bmake/files/os.sh @@ -17,7 +17,7 @@ # Simon J. Gerraty <sjg@crufty.net> # RCSid: -# $Id: os.sh,v 1.4 2010/04/20 13:37:49 joerg Exp $ +# $Id: os.sh,v 1.5 2010/09/07 14:28:00 joerg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -41,6 +41,12 @@ OSMAJOR=`IFS=.; set $OSREL; echo $1` MACHINE=`uname -m` MACHINE_ARCH=`uname -p 2>/dev/null || echo $MACHINE` +# there is at least one case of `uname -p` outputting +# a bunch of usless drivel +case "$MACHINE_ARCH" in +*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";; +esac + # we need this here, and it is not always available... Which() { case "$1" in diff --git a/devel/bmake/files/parse.c b/devel/bmake/files/parse.c index ca6a0131ccb..d20ad586392 100644 --- a/devel/bmake/files/parse.c +++ b/devel/bmake/files/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.7 2010/05/13 18:43:08 joerg Exp $ */ +/* $NetBSD: parse.c,v 1.8 2010/09/07 14:28:00 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.8 2010/09/07 14:28:00 joerg Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.8 2010/09/07 14:28:00 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -510,11 +510,11 @@ Parse_Error(int type, const char *fmt, ...) * variables, print the message and exit(1) (for .error) or just print * a warning if the directive is malformed. */ -static void +static Boolean ParseMessage(char *line) { int mtype; - + switch(*line) { case 'i': mtype = 0; @@ -527,11 +527,13 @@ ParseMessage(char *line) break; default: Parse_Error(PARSE_WARNING, "invalid syntax: \".%s\"", line); - return; + return FALSE; } - while (!isspace((u_char)*line)) + while (isalpha((u_char)*line)) line++; + if (!isspace((u_char)*line)) + return FALSE; /* not for us */ while (isspace((u_char)*line)) line++; @@ -543,6 +545,7 @@ ParseMessage(char *line) /* Terminate immediately. */ exit(1); } + return TRUE; } /*- @@ -2567,8 +2570,8 @@ Parse_File(const char *name, int fd) } else if (strncmp(cp, "info", 4) == 0 || strncmp(cp, "error", 5) == 0 || strncmp(cp, "warning", 7) == 0) { - ParseMessage(cp); - continue; + if (ParseMessage(cp)) + continue; } } diff --git a/devel/bmake/files/unit-tests/Makefile.in b/devel/bmake/files/unit-tests/Makefile.in index 488cd4d68f8..362289e0c0e 100644 --- a/devel/bmake/files/unit-tests/Makefile.in +++ b/devel/bmake/files/unit-tests/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.6 2010/04/24 21:10:29 joerg Exp $ +# $Id: Makefile.in,v 1.7 2010/09/07 14:28:01 joerg Exp $ # -# $NetBSD: Makefile.in,v 1.6 2010/04/24 21:10:29 joerg Exp $ +# $NetBSD: Makefile.in,v 1.7 2010/09/07 14:28:01 joerg Exp $ # # Unit tests for make(1) # The main targets are: @@ -62,6 +62,8 @@ clean: TEST_MAKE?= ${.MAKE} TOOL_SED?= sed TOOL_TR?= tr +TOOL_DIFF?= diff +DIFF_FLAGS?= @diff_u@ # ensure consistent results from sort(1) LANG= C @@ -85,7 +87,7 @@ test: -e 's,${.CURDIR:C/\./\\\./g}/,,g' \ -e 's,${UNIT_TESTS:C/\./\\\./g}/,,g' > ${.TARGET}.out || { \ tail ${.TARGET}.out; mv ${.TARGET}.out ${.TARGET}.fail; exit 1; } - diff @diff_u@ ${UNIT_TESTS}/${.TARGET}.exp ${.TARGET}.out + ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/${.TARGET}.exp ${.TARGET}.out accept: mv test.out ${srcdir}/test.exp diff --git a/devel/bmake/files/util.c b/devel/bmake/files/util.c index 06683371079..9158fa76fcc 100644 --- a/devel/bmake/files/util.c +++ b/devel/bmake/files/util.c @@ -1,23 +1,24 @@ -/* $NetBSD: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $ */ +/* $NetBSD: util.c,v 1.8 2010/09/07 14:28:01 joerg Exp $ */ /* * Missing stuff from OS's * - * $Id: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $ + * $Id: util.c,v 1.8 2010/09/07 14:28:01 joerg Exp $ */ #include "make.h" #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"; +static char rcsid[] = "$NetBSD: util.c,v 1.8 2010/09/07 14:28:01 joerg Exp $"; #else #ifndef lint -__RCSID("$NetBSD: util.c,v 1.7 2010/05/13 18:43:08 joerg Exp $"); +__RCSID("$NetBSD: util.c,v 1.8 2010/09/07 14:28:01 joerg Exp $"); #endif #endif #include <errno.h> #include <time.h> +#include <signal.h> #if !defined(HAVE_STRERROR) extern int errno, sys_nerr; @@ -235,24 +236,6 @@ random(void) } #endif -/* turn into bsd signals */ -void (* -signal(int s, void (*a)(int)))(int) -{ - struct sigvec osv, sv; - - (void)sigvector(s, NULL, &osv); - sv = osv; - sv.sv_handler = a; -#ifdef SV_BSDSIG - sv.sv_flags = SV_BSDSIG; -#endif - - if (sigvector(s, &sv, NULL) == -1) - return (BADSIG); - return (osv.sv_handler); -} - #if !defined(__hpux__) && !defined(__hpux) int utimes(char *file, struct timeval tvp[2]) @@ -385,17 +368,9 @@ getcwd(path, sz) } #endif -#if !defined(FORCE_POSIX_SIGNALS) -/* - * If FORCE_POSIX_SIGNALS is defined - * then sigcompat will have done this. - */ -#if defined(sun) && (defined(__svr4__) || defined(__SVR4)) -#include <signal.h> - -/* turn into bsd signals */ +/* force posix signals */ void (* -signal(int s, void (*a)(int)))(int) +bmake_signal(int s, void (*a)(int)))(int) { struct sigaction sa, osa; @@ -408,8 +383,6 @@ signal(int s, void (*a)(int)))(int) else return osa.sa_handler; } -#endif -#endif #if !defined(HAVE_VSNPRINTF) || !defined(HAVE_VASPRINTF) #include <stdarg.h> diff --git a/devel/bmake/files/var.c b/devel/bmake/files/var.c index 8b26a152128..1a020c2c43c 100644 --- a/devel/bmake/files/var.c +++ b/devel/bmake/files/var.c @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.7 2010/04/24 21:10:29 joerg Exp $ */ +/* $NetBSD: var.c,v 1.8 2010/09/07 14:28:01 joerg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.7 2010/04/24 21:10:29 joerg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.8 2010/09/07 14:28:01 joerg Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.7 2010/04/24 21:10:29 joerg Exp $"); +__RCSID("$NetBSD: var.c,v 1.8 2010/09/07 14:28:01 joerg Exp $"); #endif #endif /* not lint */ #endif @@ -682,6 +682,7 @@ Var_Export(char *str, int isExport) char *val; char **av; char *as; + int track; int ac; int i; @@ -690,6 +691,12 @@ Var_Export(char *str, int isExport) return; } + if (strncmp(str, "-env", 4) == 0) { + track = 0; + str += 4; + } else { + track = VAR_EXPORT_PARENT; + } val = Var_Subst(NULL, str, VAR_GLOBAL, 0); av = brk_string(val, &ac, FALSE, &as); for (i = 0; i < ac; i++) { @@ -709,10 +716,10 @@ Var_Export(char *str, int isExport) continue; } } - if (Var_Export1(name, VAR_EXPORT_PARENT)) { + if (Var_Export1(name, track)) { if (VAR_EXPORTED_ALL != var_exportedVars) var_exportedVars = VAR_EXPORTED_YES; - if (isExport) { + if (isExport && track) { Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL); } } |