1- dnl aclocal.m4 generated automatically by aclocal 1.4-p6
1+ # generated automatically by aclocal 1.17 -*- Autoconf -*-
22
3- dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4- dnl This file is free software; the Free Software Foundation
5- dnl gives unlimited permission to copy and/or distribute it,
6- dnl with or without modifications, as long as this notice is preserved.
3+ # Copyright (C) 1996-2024 Free Software Foundation, Inc.
74
8- dnl This program is distributed in the hope that it will be useful,
9- dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10- dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11- dnl PARTICULAR PURPOSE.
5+ # This file is free software; the Free Software Foundation
6+ # gives unlimited permission to copy and/or distribute it,
7+ # with or without modifications, as long as this notice is preserved.
128
9+ # This program is distributed in the hope that it will be useful,
10+ # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12+ # PARTICULAR PURPOSE.
13+
14+ m4_ifndef ( [ AC_CONFIG_MACRO_DIRS] , [ m4_defun([ _AM_CONFIG_MACRO_DIRS] , [ ] )m4_defun([ AC_CONFIG_MACRO_DIRS] , [ _AM_CONFIG_MACRO_DIRS($@ )] )] )
1315# ===========================================================================
14- # http ://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
16+ # https ://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
1517# ===========================================================================
1618#
1719# SYNOPSIS
1820#
19- # AX_CHECK_GNU_MAKE()
21+ # AX_CHECK_GNU_MAKE([run-if-true],[run-if-false] )
2022#
2123# DESCRIPTION
2224#
23- # This macro searches for a GNU version of make. If a match is found, the
24- # makefile variable `ifGNUmake' is set to the empty string, otherwise it
25- # is set to "#". This is useful for including a special features in a
26- # Makefile, which cannot be handled by other versions of make. The
27- # variable _cv_gnu_make_command is set to the command to invoke GNU make
28- # if it exists, the empty string otherwise.
25+ # This macro searches for a GNU version of make. If a match is found:
26+ #
27+ # * The makefile variable `ifGNUmake' is set to the empty string, otherwise
28+ # it is set to "#". This is useful for including a special features in a
29+ # Makefile, which cannot be handled by other versions of make.
30+ # * The makefile variable `ifnGNUmake' is set to #, otherwise
31+ # it is set to the empty string. This is useful for including a special
32+ # features in a Makefile, which can be handled
33+ # by other versions of make or to specify else like clause.
34+ # * The variable `_cv_gnu_make_command` is set to the command to invoke
35+ # GNU make if it exists, the empty string otherwise.
36+ # * The variable `ax_cv_gnu_make_command` is set to the command to invoke
37+ # GNU make by copying `_cv_gnu_make_command`, otherwise it is unset.
38+ # * If GNU Make is found, its version is extracted from the output of
39+ # `make --version` as the last field of a record of space-separated
40+ # columns and saved into the variable `ax_check_gnu_make_version`.
41+ # * Additionally if GNU Make is found, run shell code run-if-true
42+ # else run shell code run-if-false.
2943#
3044# Here is an example of its use:
3145#
@@ -37,6 +51,8 @@ dnl PARTICULAR PURPOSE.
3751#
3852# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
3953# @ifGNUmake@ include $(DEPEND)
54+ # @ifGNUmake@ else
55+ # fallback code
4056# @ifGNUmake@ endif
4157#
4258# Then configure.in would normally contain:
@@ -60,32 +76,35 @@ dnl PARTICULAR PURPOSE.
6076# LICENSE
6177#
6278# Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
79+ # Copyright (c) 2015 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
6380#
6481# Copying and distribution of this file, with or without modification, are
6582# permitted in any medium without royalty provided the copyright notice
6683# and this notice are preserved. This file is offered as-is, without any
6784# warranty.
6885
69- # serial 7
86+ # serial 12
7087
71- AC_DEFUN ( [ AX_CHECK_GNU_MAKE ] , [ AC_CACHE_CHECK ( for GNU make ,_cv_gnu_make_command ,
72- _cv_gnu_make_command='' ;
88+ AC_DEFUN ( [ AX_CHECK_GNU_MAKE ] ,dnl
89+ [ AC_PROG_AWK
90+ AC_CACHE_CHECK ( [ for GNU make] ,[ _cv_gnu_make_command] ,[ dnl
91+ _cv_gnu_make_command="" ;
7392dnl Search all the common names for GNU make
74- for a in "$MAKE" make gmake gnumake ; do
75- if test - z "$a" ; then continue ; fi ;
76- if ( sh - c "$a -- version" 2> / dev/null | grep GNU 2>&1 > / dev/null ) ; then
77- _cv_gnu_make_command=$a ;
78- break;
79- fi
80- done ;
81- ) ;
93+ for a in "$MAKE" make gmake gnumake ; do
94+ if test -z "$a" ; then continue ; fi ;
95+ if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
96+ _cv_gnu_make_command=$a ;
97+ AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make")
98+ ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }')
99+ break ;
100+ fi
101+ done ;] )
82102dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
83- if test "x$_cv_gnu_make_command" != "x" ; then
84- ifGNUmake='' ;
85- else
86- ifGNUmake='#' ;
87- AC_MSG_RESULT ( "Not found" ) ;
88- fi
89- AC_SUBST ( ifGNUmake )
90- ] )
103+ AS_VAR_IF ( [ _cv_gnu_make_command] , [ ""] , [ AS_VAR_SET ( [ ifGNUmake] , [ "#"] ) ] , [ AS_VAR_SET ( [ ifGNUmake] , [ ""] ) ] )
104+ AS_VAR_IF ( [ _cv_gnu_make_command] , [ ""] , [ AS_VAR_SET ( [ ifnGNUmake] , [ ""] ) ] , [ AS_VAR_SET ( [ ifnGNUmake] , [ "#"] ) ] )
105+ AS_VAR_IF ( [ _cv_gnu_make_command] , [ ""] , [ AS_UNSET ( ax_cv_gnu_make_command ) ] , [ AS_VAR_SET ( [ ax_cv_gnu_make_command] , [ ${_cv_gnu_make_command}] ) ] )
106+ AS_VAR_IF ( [ _cv_gnu_make_command] , [ ""] ,[ $2 ] ,[ $1 ] )
107+ AC_SUBST ( [ ifGNUmake] )
108+ AC_SUBST ( [ ifnGNUmake] )
109+ ] )
91110
0 commit comments