bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnu-make.m4 on NetBSD


From: Bruno Haible
Subject: Re: gnu-make.m4 on NetBSD
Date: Mon, 29 Oct 2018 22:37:53 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-137-generic; KDE/5.18.0; x86_64; ; )

[Changed the subject to something meaningful]

Hi Reuben,

> Problem reported to me by a NetBSD user:
> 
> m4/gnu-make.m4 […] has wrong assumptions:
> 
>     11  # Set GNU_MAKE if we are using a recent-enough version of GNU make.
>     12
>     13  # Use --version AND trailing junk, because SGI Make doesn't
> fail on --version.
>     14
>     15  AC_DEFUN([gl_GNU_MAKE],
>     16  [
>     17    AM_CONDITIONAL([GNU_MAKE],
>     18      [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1])
>     19  ])
> 
> (Of course on NetBSD make --version /cannot/make/this cleanly return a
> succesfull exit status!)

'make' on NetBSD 7 worked as expected. But on NetBSD 8, indeed,
'make --version' outputs an empty line and exits successfully.

There are at least two easy fixes:

- Use --help instead of --version. NetBSD 8 'make --help' exits with code 2.
  (But it may not take too long until they change it as well.)

- Actually look at the output of 'make --version'.

Proposed change:


diff --git a/m4/gnu-make.m4 b/m4/gnu-make.m4
index 1f833d9..29d6a1b 100644
--- a/m4/gnu-make.m4
+++ b/m4/gnu-make.m4
@@ -10,10 +10,8 @@
 
 # Set GNU_MAKE if we are using a recent-enough version of GNU make.
 
-# Use --version AND trailing junk, because SGI Make doesn't fail on --version.
-
 AC_DEFUN([gl_GNU_MAKE],
 [
   AM_CONDITIONAL([GNU_MAKE],
-    [${MAKE-make} --version /cannot/make/this >/dev/null 2>&1])
+    [${MAKE-make} --version 2>/dev/null | grep GNU >/dev/null])
 ])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]