]> git.ipfire.org Git - thirdparty/make.git/commitdiff
[SV 63037] Fix tests for newer OS / compiler
authorPaul Smith <psmith@gnu.org>
Sat, 10 Sep 2022 21:15:23 +0000 (17:15 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 10 Sep 2022 21:15:23 +0000 (17:15 -0400)
* tests/scripts/features/load: Add function prototypes.
* tests/scripts/features/temp_stdin: Only set user execute bits.
Some configurations don't allow changing the group bits...??

tests/scripts/features/load
tests/scripts/features/temp_stdin

index fa4b86f6cb16834ba6ca4b166ebc9cfd55a55f1e..6d1978a5bf025cb99195dc780a9e2c4567288899 100644 (file)
@@ -4,7 +4,7 @@ $description = "Test the load operator.";
 $details = "Test dynamic loading of modules.";
 
 # Don't do anything if this system doesn't support "load"
-exists $FEATURES{load} or return -1;
+exists $FEATURES{'load'} or return -1;
 
 my $cc = get_config('CC');
 if (! $cc) {
@@ -26,6 +26,9 @@ print $F <<'EOF' ;
 
 int plugin_is_GPL_compatible;
 
+int testload_gmk_setup (gmk_floc *);
+int explicit_setup (gmk_floc *);
+
 int
 testload_gmk_setup (gmk_floc *pos)
 {
@@ -46,14 +49,14 @@ close($F) or die "close: testload.c: $!\n";
 
 # Make sure we can compile
 
-my $cflags = get_config('CFLAGS');
-my $cppflags = get_config('CPPFLAGS');
-my $ldflags = get_config('LDFLAGS');
-my $sobuild = "$cc ".($srcdir? "-I$srcdir/src":'')." $cppflags $cflags -shared -fPIC $ldflags -o testload.so testload.c";
+my $cppflags = get_config('CPPFLAGS') . ($srcdir ? " -I$srcdir/src" : '');
+my $cflags = get_config('CFLAGS') . ' -fPIC';
+my $ldflags = get_config('LDFLAGS') . ' -shared';
+my $sobuild = "$cc $cppflags $cflags $ldflags -o testload.so testload.c";
 
 my $clog = `$sobuild 2>&1`;
 if ($? != 0) {
-    $verbose and print "Failed to build testload.so:\n$sobuild\n$_";
+    $verbose and print "Failed to build testload.so:\n$sobuild\n$clog";
     return -1;
 }
 
index 5b65c51b610002df4a9ad49d49bb42b2d2515b19..8c7a47a085a8eb44094dbb97dbcd5e935b72120e 100644 (file)
@@ -56,7 +56,7 @@ use File::Copy;
 my $makecopy = File::Spec->catfile($TEMPDIR, "make");
 copy("$mkpath", $makecopy);
 # Set file mode bits, because perl copy won't.
-chmod 0750, $makecopy;
+chmod 0700, $makecopy;
 
 my @make_orig = @make_command;
 @make_command = ($makecopy);
@@ -68,10 +68,10 @@ open(STDIN, "<", 'input.mk') || die "$0: cannot open input.mk for reading: $!";
 run_make_test("
 include bye.mk
 all:; \$(info hello)
-\$(MAKE_RESTARTS)bye.mk: force; touch \$@ && chmod -x $makecopy
+\$(MAKE_RESTARTS)bye.mk: force; touch \$@ && chmod u-x $makecopy
 force:
 ",
-              "-f-", "touch bye.mk && chmod -x $makecopy\nmake: $makecopy: $ERR_nonexe_file\n", 32512);
+              "-f-", "touch bye.mk && chmod u-x $makecopy\nmake: $makecopy: $ERR_nonexe_file\n", 32512);
 
 @make_command = @make_orig;
 unlink($makecopy);