Solaris /bin/sh can't handle multiple options ("-e -c").
authorPaul Smith <psmith@gnu.org>
Sun, 29 Sep 2013 17:31:32 +0000 (13:31 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 30 Sep 2013 04:12:18 +0000 (00:12 -0400)
tests/ChangeLog
tests/scripts/targets/ONESHELL
tests/scripts/variables/SHELL

index c785d34b55bd07026bb0ba50cb99d46b26ca62f7..75cf8dcffaccd74bea05b13589041ee512495704 100644 (file)
@@ -1,5 +1,9 @@
 2013-09-29  Paul Smith  <psmith@gnu.org>
 
+       * scripts/variables/SHELL: Solaris /bin/sh can't handle options in
+       multiple words; skip that test.
+       * scripts/targets/ONESHELL: Ditto.
+
        * scripts/variables/GNUMAKEFLAGS: Verify that GNUMAKEFLAGS is
        cleared and options are not duplicated.
 
index 0660e9250f52935ab758c0d00508bfca1551fe7f..87713da474ac8a86be5417bf16a868b97858a472 100644 (file)
@@ -4,6 +4,10 @@ $description = "Test the behaviour of the .ONESHELL target.";
 
 $details = "";
 
+# Some shells (*shakes fist at Solaris*) cannot handle multiple flags in
+# separate arguments.
+my $t = `/bin/sh -e -c true 2>/dev/null`;
+my $multi_ok = $? == 0;
 
 # Simple
 
@@ -19,7 +23,8 @@ all:
 
 # Simple but use multi-word SHELLFLAGS
 
-run_make_test(q!
+if ($multi_ok) {
+    run_make_test(q!
 .ONESHELL:
 .SHELLFLAGS = -e -c
 all:
@@ -29,6 +34,7 @@ all:
               '', 'a=$$
 [ 0"$a" -eq "$$" ] || echo fail
 ');
+}
 
 # Again, but this time with inner prefix chars
 
index 4c73890c15aab6e12fc56638e73ccedbc4ef1f37..1d01ba3f264e1de68e871bcbd97d842595b95b99 100644 (file)
@@ -71,12 +71,20 @@ all: ; \@$script
               '', $out);
 
 # Do it again but add spaces to SHELLFLAGS
-$flags = '-x -c';
-run_make_test(qq!
+
+# Some shells (*shakes fist at Solaris*) cannot handle multiple flags in
+# separate arguments.
+my $t = `/bin/sh -e -c true 2>/dev/null`;
+my $multi_ok = $? == 0;
+
+if ($multi_ok) {
+    $flags = '-x -c';
+    run_make_test(qq!
 .SHELLFLAGS = $flags
 all: ; \@$script
 !,
               '', $out);
+}
 
 # We can't just use "false" because on different systems it provides a
 # different exit code--once again Solaris: false exits with 255 not 1