/[make]/make/tests/scripts/variables/SHELL
ViewVC logotype

Diff of /make/tests/scripts/variables/SHELL

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by psmith, Mon Jul 4 03:51:00 2005 UTC revision 1.3 by psmith, Tue Jul 12 04:35:13 2005 UTC
# Line 4  $description = "Test proper handling of Line 4  $description = "Test proper handling of
4    
5  # Find the default value when SHELL is not set.  On UNIX it will be /bin/sh,  # Find the default value when SHELL is not set.  On UNIX it will be /bin/sh,
6  # but on other platforms who knows?  # but on other platforms who knows?
7  $oshell = $ENV{SHELL};  resetENV();
8  delete $ENV{SHELL};  delete $ENV{SHELL};
9  $mshell = `echo 'all:;\@echo \$(SHELL)' | $make_path -f-`;  $mshell = `echo 'all:;\@echo \$(SHELL)' | $make_path -f-`;
10  chop $mshell;  chop $mshell;
11    
12  # According to POSIX, the value of SHELL in the environment has no impact on  # According to POSIX, the value of SHELL in the environment has no impact on
13  # the value in the makefile.  # the value in the makefile.
14    # Note %extraENV takes precedence over the default value for the shell.
15    
16  $ENV{SHELL} = '/dev/null';  $extraENV{SHELL} = '/dev/null';
17  run_make_test('all:;@echo "$(SHELL)"', '', $mshell);  run_make_test('all:;@echo "$(SHELL)"', '', $mshell);
18    
19  # According to POSIX, any value of SHELL set in the makefile should _NOT_ be  # According to POSIX, any value of SHELL set in the makefile should _NOT_ be
# Line 21  run_make_test('all:;@echo "$(SHELL)"', ' Line 22  run_make_test('all:;@echo "$(SHELL)"', '
22  # all when $(SHELL) is perl :-/.  So, we just add an extra initial / and hope  # all when $(SHELL) is perl :-/.  So, we just add an extra initial / and hope
23  # for the best on non-UNIX platforms :-/.  # for the best on non-UNIX platforms :-/.
24    
25  $ENV{SHELL} = $mshell;  $extraENV{SHELL} = $mshell;
26    
27  run_make_test("SHELL := /$mshell\n".'  run_make_test("SHELL := /$mshell\n".'
28  all:;@echo "$(SHELL) $$SHELL"  all:;@echo "$(SHELL) $$SHELL"
# Line 30  all:;@echo "$(SHELL) $$SHELL" Line 31  all:;@echo "$(SHELL) $$SHELL"
31  # As a GNU make extension, if make's SHELL variable is explicitly exported,  # As a GNU make extension, if make's SHELL variable is explicitly exported,
32  # then we really _DO_ export it.  # then we really _DO_ export it.
33    
34    $extraENV{SHELL} = $mshell;
35    
36  run_make_test("export SHELL := /$mshell\n".'  run_make_test("export SHELL := /$mshell\n".'
37  all:;@echo "$(SHELL) $$SHELL"  all:;@echo "$(SHELL) $$SHELL"
38  ', '', "/$mshell /$mshell");  ', '', "/$mshell /$mshell");
# Line 38  all:;@echo "$(SHELL) $$SHELL" Line 41  all:;@echo "$(SHELL) $$SHELL"
41  # Test out setting of SHELL, both exported and not, as a target-specific  # Test out setting of SHELL, both exported and not, as a target-specific
42  # variable.  # variable.
43    
44    $extraENV{SHELL} = $mshell;
45    
46  run_make_test("all: SHELL := /$mshell\n".'  run_make_test("all: SHELL := /$mshell\n".'
47  all:;@echo "$(SHELL) $$SHELL"  all:;@echo "$(SHELL) $$SHELL"
48  ', '', "/$mshell $mshell");  ', '', "/$mshell $mshell");
49    
50    $extraENV{SHELL} = $mshell;
51    
52  run_make_test("all: export SHELL := /$mshell\n".'  run_make_test("all: export SHELL := /$mshell\n".'
53  all:;@echo "$(SHELL) $$SHELL"  all:;@echo "$(SHELL) $$SHELL"
54  ', '', "/$mshell $mshell");  ', '', "/$mshell $mshell");

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26