make/tests/scripts/variables
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
..
automatic Apply spelling corrections from Fossies spellcheck 2020-01-20 19:25:54 -05:00
CURDIR Refresh the test suite framework implementation. 2019-09-16 08:25:33 -04:00
DEFAULT_GOAL Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines. 2012-03-04 00:24:20 +00:00
define Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines. 2012-03-04 00:24:20 +00:00
EXTRA_PREREQS Support the .EXTRA_PREREQS special variable 2020-01-03 02:08:59 -05:00
flavors * doc/make.texi: [SV 54116] Document whitespace removal trick. 2019-05-19 19:25:50 -04:00
GNUMAKEFLAGS tests: Simplify customization of %ENV 2020-04-01 02:02:57 -04:00
INCLUDE_DIRS Implemented the .INCLUDE_DIRS special variable. It expands to a list 2005-11-14 15:31:13 +00:00
LIBPATTERNS Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines. 2012-03-04 00:24:20 +00:00
MAKE Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines. 2012-03-04 00:24:20 +00:00
MAKE_RESTARTS [SV 102] Don't show unnecessary include file errors. 2016-04-09 20:06:46 -04:00
MAKECMDGOALS * A few script fixes and updates for 3.78. 1999-09-17 03:15:37 +00:00
MAKEFILES Add test suite support to Windows 2017-06-04 18:37:20 -04:00
MAKEFLAGS Preserve the real value of -jN in MAKEFLAGS using jobserver. 2016-04-04 01:38:37 -04:00
MAKELEVEL Fix for bug #1276: Handle SHELL according to POSIX requirements. 2004-11-28 23:11:23 +00:00
MFILE_LIST [SV 50823] Support filenames containing '$' in MAKEFILE_LIST 2017-06-04 18:37:21 -04:00
negative Add test suite support to Windows 2017-06-04 18:37:20 -04:00
private cosmetics: fix few innocuous typos 2013-05-05 20:50:37 -04:00
SHELL Support "unexport" in target-specific variables. 2020-11-29 17:57:33 -05:00
special * job.c (child_error): Combine file info with error message. 2016-03-20 14:23:22 -04:00
undefine Implement the new undefine directive. 2009-10-06 06:56:57 +00:00