From 53fba0e052502d7192bacdcef1bd8a51b066686b Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Wed, 10 Apr 2013 14:44:57 +0100 Subject: [PATCH] Add extra autoconf macro support for 'make' feature checks. --- ChangeLog | 10 ++++++++++ m4/makeopts.m4 | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 m4/makeopts.m4 diff --git a/ChangeLog b/ChangeLog index a2654b5..bd28287 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-04-10 Keith Marshall + + Add extra autoconf macro support for 'make' feature checks. + + * m4/makeopts.m4: New file; it provides this... + (MINGW_AC_MAKE_OPTION_SUPPORTED): ...generic check for acceptance of + any nominated 'make' command line option, extended by this... + (MINGW_AC_MAKE_NO_PRINT_DIRECTORY): ...specific check for support for + GNU make's '--no-print-directory' option. + 2012-08-06 Earnie Boyd * .gitignore: New file. diff --git a/m4/makeopts.m4 b/m4/makeopts.m4 new file mode 100644 index 0000000..2696646 --- /dev/null +++ b/m4/makeopts.m4 @@ -0,0 +1,59 @@ +## makeopts.m4 -*- autoconf -*- vim: filetype=config +## +## $Id$ +## +## Written by Keith Marshall +## Copyright (C) 2013, MinGW.org Project +## +## +## Autoconf macros to check for options supported by 'make'. +## +## +## This is free software. Permission is hereby granted to copy +## and redistribute this software, either as is or in modified form, +## subject only to the restrictions that the original author's notice +## of copyright and disclaimers of warranty and of liability shall be +## preserved without change in EVERY copy, and that modified copies +## shall be clearly identified as such. +## +## This software is provided "as is", in the hope that it may prove +## useful, but there is NO WARRANTY OF ANY KIND; not even an implied +## WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR A PARTICULAR PURPOSE. +## Under no circumstances will the author, or the MinGW Project, accept +## liability for any damages, however caused, arising from the use of +## this software. + + +# MINGW_AC_MAKE_OPTION_SUPPORTED( VARNAME, OPTION ) +# ------------------------------------------------- +# If OPTION is supported by make, set VARNAME=' OPTION', otherwise +# set VARNAME to nothing; in either case, call AC_SUBST for VARNAME. +# +AC_DEFUN([MINGW_AC_MAKE_OPTION_SUPPORTED], +[AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_MSG_CHECKING([whether make supports the $2 option]) + TAB=' ' $1=; mkdir conftest.dir + cat <<-EOF> conftest.dir/Makefile + conftest: + ${TAB}@\$(MAKE) $2 conftest-recursive + + conftest-recursive: + ${TAB}@true + EOF + ( cd conftest.dir; make >/dev/null 2>&1 ) && ac_val=yes $1=' $2' || ac_val=no + rm -rf conftest.dir + AC_MSG_RESULT([$ac_val])dnl + AC_SUBST([$1])dnl +])# MINGW_AC_MAKE_OPTION_SUPPORTED + +# MINGW_AC_MAKE_NO_PRINT_DIRECTORY +# -------------------------------- +# Assign NO_PRINT_DIRECTORY=" --no-print-directory", if make supports +# the --no-print-directory option, otherwise leave NO_PRINT_DIRECTORY +# unassigned; in either case, call AC_SUBST for NO_PRINT_DIRECTORY. +# +AC_DEFUN([MINGW_AC_MAKE_NO_PRINT_DIRECTORY], +[MINGW_AC_MAKE_OPTION_SUPPORTED([NO_PRINT_DIRECTORY],[--no-print-directory])dnl +])# MINGW_AC_MAKE_NO_PRINT_DIRECTORY + +# $RCSfile$: end of file -- 2.11.0