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 |
20 |
# exported to the subshell! I wanted to set SHELL to be $^X (perl) in the |
# exported to the subshell! I wanted to set SHELL to be $^X (perl) in the |
21 |
# makefile, but make runs $(SHELL) -c 'commandline' and that doesn't work at |
# makefile, but make runs $(SHELL) -c 'commandline' and that doesn't work at |
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 /./ which |
23 |
# for the best on non-UNIX platforms :-/. |
# works well on UNIX and seems to work OK on at least some non-UNIX systems. |
24 |
|
|
25 |
$extraENV{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" |
29 |
', '', "/$mshell $mshell"); |
', '', "/./$mshell $mshell"); |
30 |
|
|
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; |
$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"); |
39 |
|
|
40 |
|
|
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 |
43 |
|
|
44 |
$extraENV{SHELL} = $mshell; |
$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; |
$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"); |
55 |
|
|
56 |
1; |
1; |