5 my $description = "Test that make can execute binaries as well as scripts with"
6 ." various shabangs and without a shebang";
7 my $details = "The various shells that this test uses are the default"
8 ." /bin/sh, \$SHELL and the perl interpreter that is"
9 ." executing this test program. The shells are used for the value"
10 ." of SHELL inside the test makefile and also as a shebang in the"
11 ." executed script. There is also a test which executes a script"
12 ." that has no shebang.";
14 # Only bother with this on UNIX systems
15 $port_type eq 'UNIX' or return -1;
17 my $usersh = $origENV{SHELL};
18 my $answer = 'hello, world';
20 my @shebangs = ('', '#!/bin/sh', "#!$usersh", "#!$perl_name");
21 my @shells = ('', 'SHELL=/bin/sh', "SHELL=$usersh");
24 # Have a makefile with various SHELL= exec a shell program with varios
25 # shebangs or without a shebang at all.
26 my $stem = './exec.cmd';
28 for my $shebang (@shebangs) {
29 for my $shell (@shells) {
30 my $cmd = $k ? "$stem.$k" : $stem;
34 print CMD "$shebang\n";
35 print CMD "printf \"$answer\\n\";\n";
41 !, "$shell CMD=$cmd", "$answer\n");
48 # Exec a binary from a makefile that has SHELL=.
49 for my $shell (@shells) {
51 all:; @#PERL# -e 'printf "$(ANSWER)\n"';
52 !, "$shell ANSWER='$answer'", "$answer\n");
56 # Use perl as a shell.
60 all:; @printf "$(ANSWER)\n";
61 !, "ANSWER='$answer'", "$answer\n");