The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/libsodium/m4/ax_check_gnu_make.m4

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 # ===========================================================================
    2 #    https://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html
    3 # ===========================================================================
    4 #
    5 # SYNOPSIS
    6 #
    7 #   AX_CHECK_GNU_MAKE()
    8 #
    9 # DESCRIPTION
   10 #
   11 #   This macro searches for a GNU version of make. If a match is found:
   12 #
   13 #     * The makefile variable `ifGNUmake' is set to the empty string, otherwise
   14 #       it is set to "#". This is useful for including a special features in a
   15 #       Makefile, which cannot be handled by other versions of make.
   16 #     * The variable `_cv_gnu_make_command` is set to the command to invoke
   17 #       GNU make if it exists, the empty string otherwise.
   18 #     * The variable `ax_cv_gnu_make_command` is set to the command to invoke
   19 #       GNU make by copying `_cv_gnu_make_command`, otherwise it is unset.
   20 #     * If GNU Make is found, its version is extracted from the output of
   21 #       `make --version` as the last field of a record of space-separated
   22 #       columns and saved into the variable `ax_check_gnu_make_version`.
   23 #
   24 #   Here is an example of its use:
   25 #
   26 #   Makefile.in might contain:
   27 #
   28 #     # A failsafe way of putting a dependency rule into a makefile
   29 #     $(DEPEND):
   30 #             $(CC) -MM $(srcdir)/*.c > $(DEPEND)
   31 #
   32 #     @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
   33 #     @ifGNUmake@ include $(DEPEND)
   34 #     @ifGNUmake@ endif
   35 #
   36 #   Then configure.in would normally contain:
   37 #
   38 #     AX_CHECK_GNU_MAKE()
   39 #     AC_OUTPUT(Makefile)
   40 #
   41 #   Then perhaps to cause gnu make to override any other make, we could do
   42 #   something like this (note that GNU make always looks for GNUmakefile
   43 #   first):
   44 #
   45 #     if  ! test x$_cv_gnu_make_command = x ; then
   46 #             mv Makefile GNUmakefile
   47 #             echo .DEFAULT: > Makefile ;
   48 #             echo \  $_cv_gnu_make_command \$@ >> Makefile;
   49 #     fi
   50 #
   51 #   Then, if any (well almost any) other make is called, and GNU make also
   52 #   exists, then the other make wraps the GNU make.
   53 #
   54 # LICENSE
   55 #
   56 #   Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
   57 #   Copyright (c) 2015 Enrico M. Crisostomo <enrico.m.crisostomo@gmail.com>
   58 #
   59 #   Copying and distribution of this file, with or without modification, are
   60 #   permitted in any medium without royalty provided the copyright notice
   61 #   and this notice are preserved. This file is offered as-is, without any
   62 #   warranty.
   63 
   64 #serial 9
   65 
   66 AC_DEFUN([AX_CHECK_GNU_MAKE],dnl
   67   [AC_PROG_AWK
   68   AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl
   69     _cv_gnu_make_command="" ;
   70 dnl Search all the common names for GNU make
   71     for a in "$MAKE" make gmake gnumake ; do
   72       if test -z "$a" ; then continue ; fi ;
   73       if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then
   74         _cv_gnu_make_command=$a ;
   75         AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make")
   76         ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }')
   77         break ;
   78       fi
   79     done ;])
   80 dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
   81   AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])],   [AS_VAR_SET([ifGNUmake], [""])])
   82   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}])])
   83   AC_SUBST([ifGNUmake])
   84 ])

Cache object: acec9b227bd4390ea5bd746b1eaf42fd


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.