]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Fix build and test issues on Windows
authorPaul Smith <psmith@gnu.org>
Sun, 28 Mar 2021 20:22:57 +0000 (16:22 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 28 Mar 2021 20:25:52 +0000 (16:25 -0400)
* src/dep.h (DEP): Remove extraneous semicolon.
* src/dir.c (find_directory) [W32]: Replace removed variable.
* tests/scripts/features/include: Allow the extra default makefile
searched for on Windows.
* tests/scripts/functions/file: Use $(info ...) to avoid "command
too long" errors on Windows.

src/dep.h
src/dir.c
tests/scripts/features/include
tests/scripts/functions/file

index a86e40fad6cebd0d70f69779f811753f70a496c2..e492a0b307eeb233b17397e7928d48b685faac23 100644 (file)
--- a/src/dep.h
+++ b/src/dep.h
@@ -53,7 +53,7 @@ struct nameseq
     unsigned int staticpattern : 1;             \
     unsigned int need_2nd_expansion : 1;        \
     unsigned int ignore_automatic_vars : 1;     \
-    unsigned int is_explicit : 1;
+    unsigned int is_explicit : 1
 
 struct dep
   {
index d237d4bd64abf1cc479be74805734a0cf5ec6daa..edabcaf894823cf0749eab321f00f9401b3a1f51 100644 (file)
--- a/src/dir.c
+++ b/src/dir.c
@@ -522,14 +522,15 @@ find_directory (const char *name)
 #if defined(WINDOWS32)
   {
     char tem[MAXPATHLEN], *tstart, *tend;
+    size_t len = strlen (name);
 
     /* Remove any trailing slashes.  Windows32 stat fails even on
        valid directories if they end in a slash. */
-    memcpy (tem, name, p - name + 1);
+    memcpy (tem, name, len + 1);
     tstart = tem;
     if (tstart[1] == ':')
       tstart += 2;
-    for (tend = tem + (p - name - 1);
+    for (tend = tem + (len - 1);
          tend > tstart && (*tend == '/' || *tend == '\\');
          tend--)
       *tend = '\0';
index 11e30736525df17ac407a88a8cd4cbb457ab0bce..16b2e8e3b2e592d443b08ea61bdf68903feb7295 100644 (file)
@@ -288,9 +288,15 @@ unlink('hello.mk');
 # Check the default makefiles... this requires us to invoke make with no
 # arguments.  Also check MAKEFILES
 
+if ($port_type eq 'W32') {
+    $defaults = "GNUmakefile\nmakefile\nMakefile\nmakefile.mak";
+} else {
+    $defaults = "GNUmakefile\nmakefile\nMakefile";
+}
+
 $ENV{MAKEFILES} = 'foobar barfoo';
-run_make_with_options(undef, q!-E '%:;@echo $@' -E 'all:;' -E '-include bizbaz' -E '-include bazbiz'!, get_logfile(0));
-$answer = "bizbaz\nbazbiz\nfoobar\nbarfoo\nGNUmakefile\nmakefile\nMakefile\n#MAKE#: 'all' is up to date.\n";
+run_make_with_options(undef, ['-E', '%:;@echo $@', '-E', 'all:;', '-E', '-include bizbaz', '-E', '-include bazbiz'], get_logfile(0));
+$answer = "bizbaz\nbazbiz\nfoobar\nbarfoo\n$defaults\n#MAKE#: 'all' is up to date.\n";
 &compare_output(subst_make_string($answer), &get_logfile(1));
 
 1;
index a9bf111950b7b8c57d29d79f54f544b7e054a2f4..50948a04b02c1ad5f1a0c4d2b92d44d877bc0c38 100644 (file)
@@ -176,15 +176,16 @@ unlink('file.out');
 # 200 is the initial size of variable_buffer.
 # File bigger than 200 bytes causes a realloc.
 # The size of the file in this test not only exceeds 200 bytes, it exceeds 65k.
+# Use $(info ...) here to avoid command line limitations
 
 my $s = "hello world, hello world, hello world, hello world, hello world";
 my $answer = $s x 2000;
 create_file('file.out', $answer);
 run_make_test(q!# <hugestring>
 X1 := x$(file <file.out)y
-x:;@echo '$(X1)'
+x:;@$(info $(X1))
 !,
-              '', "x${answer}y\n");
+              '', "x${answer}y\n#MAKE#: 'x' is up to date.\n");
 
 unlink('file.out');