1 ## makeopts.m4 -*- autoconf -*- vim: filetype=config
5 ## Written by Keith Marshall <keithmarshall@users.sourceforge.net>
6 ## Copyright (C) 2013, MinGW.org Project
9 ## Autoconf macros to check for options supported by 'make'.
12 ## This is free software. Permission is hereby granted to copy
13 ## and redistribute this software, either as is or in modified form,
14 ## subject only to the restrictions that the original author's notice
15 ## of copyright and disclaimers of warranty and of liability shall be
16 ## preserved without change in EVERY copy, and that modified copies
17 ## shall be clearly identified as such.
19 ## This software is provided "as is", in the hope that it may prove
20 ## useful, but there is NO WARRANTY OF ANY KIND; not even an implied
21 ## WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR A PARTICULAR PURPOSE.
22 ## Under no circumstances will the author, or the MinGW Project, accept
23 ## liability for any damages, however caused, arising from the use of
27 # MINGW_AC_MAKE_OPTION_SUPPORTED( VARNAME, OPTION )
28 # -------------------------------------------------
29 # If OPTION is supported by make, set VARNAME=' OPTION', otherwise
30 # set VARNAME to nothing; in either case, call AC_SUBST for VARNAME.
32 AC_DEFUN([MINGW_AC_MAKE_OPTION_SUPPORTED],
33 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
34 AC_MSG_CHECKING([whether make supports the $2 option])
35 TAB=' ' $1=; mkdir conftest.dir
36 cat <<-EOF> conftest.dir/Makefile
38 ${TAB}@\$(MAKE) $2 conftest-recursive
43 ( cd conftest.dir; make >/dev/null 2>&1 ) && ac_val=yes $1=' $2' || ac_val=no
45 AC_MSG_RESULT([$ac_val])dnl
47 ])# MINGW_AC_MAKE_OPTION_SUPPORTED
49 # MINGW_AC_MAKE_NO_PRINT_DIRECTORY
50 # --------------------------------
51 # Assign NO_PRINT_DIRECTORY=" --no-print-directory", if make supports
52 # the --no-print-directory option, otherwise leave NO_PRINT_DIRECTORY
53 # unassigned; in either case, call AC_SUBST for NO_PRINT_DIRECTORY.
55 AC_DEFUN([MINGW_AC_MAKE_NO_PRINT_DIRECTORY],
56 [MINGW_AC_MAKE_OPTION_SUPPORTED([NO_PRINT_DIRECTORY],[--no-print-directory])dnl
57 ])# MINGW_AC_MAKE_NO_PRINT_DIRECTORY
59 # $RCSfile$: end of file