make/src
Paul Smith 2dc0280d82 Support "unexport" in target-specific variables.
Rewrite the environment variable algorithm to correctly inherit
export settings from parent variable sets.  The new algorithm
for computing the table of environment variables is:

- Start with the most local variable set and proceed to global.
- If the variable already exists in the table and we don't know
  its export status, update it with the current variable's status.
- If the variable is not in the table and it's not global, add it
  regardless of its status so if it's unexported we remember that.
- If the variable is not in the table and is global, check its
  export status and don't add it if we won't export it.

Then when generating the environment variables, check the export
status of each variable in case it was a target-specific variable
and we have determined it should not be exported.

Rework SHELL handling to check at the end whether we added it or
not and if we didn't, add the value from the environment.

* NEWS: Announce support for target-specific "unexport"."
* doc/make.texi (Target-specific): Document the support.
* src/variable.h (enum variable_export): Make into a global type.
* src/read.c (struct vmodifiers): Use enum variable_export rather
than individual booleans.
(parse_var_assignment): Parse the "unexport" keyword.
(eval): Remember the vmodifier value in the variable.
(record_target_var): Ditto.
* src/variable.c (should_export): Check if the variable should be
exported.
(target_environment): Implement the above algorithm.
* tests/scripts/features/export: Test export/unexport with variable
assignments on the same line.
* tests/scripts/features/targetvars: Add a comprehensive suite of
tests for different types of target-specific export / unexport.
* tests/scripts/variables/SHELL: Update the comment.
2020-11-29 17:57:33 -05:00
..
w32 * src/output.h: [WINDOWS32] [SV 57888] Use gnulib fcntl if available 2020-03-31 01:07:43 -04:00
amiga.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
amiga.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
ar.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
arscan.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
commands.c Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
commands.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
config.ami.template Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
config.h-vms.template Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
config.h.W32.template Add support for building with Tiny C for MS-Windows 2020-02-29 11:14:46 +02:00
configh.dos.template Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
debug.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
default.c * src/default.c (default_variables) [AIX]: [SV 59096] Fix ARFLAGS 2020-11-29 17:55:32 -05:00
dep.h Enable compilation with C90 compilers 2020-01-04 13:23:23 -05:00
dir.c [SV 57930] Cast char to unsigned char to call ctype functions 2020-05-03 14:54:56 -04:00
expand.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
file.c Enable compilation with C90 compilers 2020-01-04 13:23:23 -05:00
filedef.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
function.c [SV 59093] Rewrite filter/filter-out to avoid large stack usage 2020-11-13 00:44:24 -05:00
getopt1.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
getopt.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
getopt.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
gettext.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
gmk-default.scm Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
gnumake.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
guile.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
hash.c * src/hash.c (jhash_string): Don't read past end of string. 2019-10-05 11:23:31 -04:00
hash.h Rework directory structure to use GNU-recommended "src" directory. 2017-11-19 14:07:22 -05:00
implicit.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
job.c * src/job.c (unblock_sigs): [!POSIX] [SV 58743] Fix syntax errors 2020-07-10 11:59:38 -04:00
job.h Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
load.c [SV 57930] Cast char to unsigned char to call ctype functions 2020-05-03 14:54:56 -04:00
loadapi.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
main.c [SV 58735] Define the order that makefiles are rebuilt. 2020-07-19 13:56:23 -04:00
makeint.h * src/makeint.h: [ARM] [SV 58347] Don't assume ARM is not POSIX 2020-07-10 11:59:40 -04:00
misc.c [SV 57930] Cast char to unsigned char to call ctype functions 2020-05-03 14:54:56 -04:00
os.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
output.c [SV 57967] Only set APPEND mode for regular files 2020-03-31 00:19:20 -04:00
output.h * src/output.h: [WINDOWS32] [SV 57888] Use gnulib fcntl if available 2020-03-31 01:07:43 -04:00
posixos.c [SV 58232] Disable inheritance of jobserver FDs for recursive make 2020-05-02 20:09:29 -04:00
read.c Support "unexport" in target-specific variables. 2020-11-29 17:57:33 -05:00
remake.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
remote-cstms.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
remote-stub.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
rule.c [SV 40657] Reinstate old behavior for suffix rules with prereqs 2020-01-19 17:04:52 -05:00
rule.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
signame.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
strcache.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
variable.c Support "unexport" in target-specific variables. 2020-11-29 17:57:33 -05:00
variable.h Support "unexport" in target-specific variables. 2020-11-29 17:57:33 -05:00
version.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
vms_exit.c Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
vms_export_symbol.c Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
vms_progname.c [SV 57930] Cast char to unsigned char to call ctype functions 2020-05-03 14:54:56 -04:00
vmsdir.h Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
vmsfunctions.c Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
vmsify.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00
vmsjobs.c [SV 57930] Cast char to unsigned char to call ctype functions 2020-05-03 14:54:56 -04:00
vpath.c Update copyright statements for 2020 2020-01-03 02:08:59 -05:00