VirtualBox

source: kBuild/trunk/src/gmake/tests/scripts/variables/SHELL@ 285

最後變更 在這個檔案從285是 282,由 bird 提交於 20 年 前

Initial revision

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.5 KB
 
1# -*-perl-*-
2
3$description = "Test proper handling of SHELL.";
4
5# Find the default value when SHELL is not set. On UNIX it will be /bin/sh,
6# but on other platforms who knows?
7$oshell = $ENV{SHELL};
8delete $ENV{SHELL};
9$mshell = `echo 'all:;\@echo \$(SHELL)' | $make_name -f-`;
10chop $mshell;
11
12# According to POSIX, the value of SHELL in the environment has no impact on
13# the value in the makefile.
14
15$ENV{SHELL} = '/dev/null';
16run_make_test('all:;@echo "$(SHELL)"', '', $mshell);
17
18# According to POSIX, any value of SHELL set in the makefile should _NOT_ be
19# exported to the subshell! I wanted to set SHELL to be $^X (perl) in the
20# makefile, but make runs $(SHELL) -c 'commandline' and that doesn't work at
21# all when $(SHELL) is perl :-/. So, we just add an extra initial / and hope
22# for the best on non-UNIX platforms :-/.
23
24$ENV{SHELL} = $mshell;
25
26run_make_test("SHELL := /$mshell\n".'
27all:;@echo "$(SHELL) $$SHELL"
28', '', "/$mshell $mshell");
29
30# As a GNU make extension, if make's SHELL variable is explicitly exported,
31# then we really _DO_ export it.
32
33run_make_test("export SHELL := /$mshell\n".'
34all:;@echo "$(SHELL) $$SHELL"
35', '', "/$mshell /$mshell");
36
37
38# Test out setting of SHELL, both exported and not, as a target-specific
39# variable.
40
41run_make_test("all: SHELL := /$mshell\n".'
42all:;@echo "$(SHELL) $$SHELL"
43', '', "/$mshell $mshell");
44
45run_make_test("all: export SHELL := /$mshell\n".'
46all:;@echo "$(SHELL) $$SHELL"
47', '', "/$mshell $mshell");
48
491;
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette