1 ## missing.m4 -*- autoconf -*- vim: filetype=config
5 ## Written by Keith Marshall <keithmarshall@users.sourceforge.net>
6 ## Copyright (C) 2010, MinGW Project
9 ## Autoconf macros to gracefully abort configure, on identified
10 ## non-availability of specified build prerequisites.
13 ## This is free software. Permission is hereby granted to copy
14 ## and redistribute this software, either as is or in modified form,
15 ## subject only to the restrictions that the original author's notice
16 ## of copyright and disclaimers of warranty and of liability shall be
17 ## preserved without change in EVERY copy, and that modified copies
18 ## shall be clearly identified as such.
20 ## This software is provided "as is", in the hope that it may prove
21 ## useful, but there is NO WARRANTY OF ANY KIND; not even an implied
22 ## WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR A PARTICULAR PURPOSE.
23 ## Under no circumstances will the author, or the MinGW Project, accept
24 ## liability for any damages, however caused, arising from the use of
28 # MINGW_AC_ASSERT_MISSING( PACKAGE, [TARNAME] )
29 # ---------------------------------------------
30 # Add PACKAGE to the list of prerequisite packages which are
31 # identified as missing from the build system; this will then
32 # be included in the diagnostic message which will be displayed,
33 # if MINGW_AC_ABORT_IF_MISSING_PREREQ is subsequently invoked.
35 # If TARNAME is also specified, then it too will be included
36 # in the message, as a recommended package to be installed in
37 # order to satisfy the prerequisite.
39 AC_DEFUN([MINGW_AC_ASSERT_MISSING],
40 [test -n "${mingw_ac_missing_list}" && {
41 mingw_ac_missing_plural=s mingw_ac_missing_appear=; }
42 mingw_ac_missing_list="${mingw_ac_missing_list}
44 test -n "$2" && { test -n "${mingw_ac_missing_providers}" && {
45 mingw_ac_missing_providers_plural=s; }
46 mingw_ac_missing_providers="${mingw_ac_missing_providers}
48 ])# MINGW_AC_ASSERT_MISSING
50 # MINGW_AC_ABORT_IF_MISSING_PREREQ
51 # --------------------------------
52 # Invoked unconditionally after any MINGW_AC_ASSERT_MISSING request,
53 # and prior to AC_OUTPUT, causes configure to abort with a diagnostic
54 # message if any missing prerequisite has been identified.
56 AC_DEFUN([_MINGW_AC_ABORT_IF_MISSING_PREREQ],
57 [test -n "$mingw_ac_missing_list" && { _MINGW_AC_SUGGEST_PROVIDERS
58 AC_MSG_ERROR([missing prerequisite${mingw_ac_missing_plural}:
60 The following prerequisite package${mingw_ac_missing_plural} dnl
61 appear${mingw_ac_missing_appear-s} to be missing from
63 ${mingw_ac_missing_list}]); }
64 ])# MINGW_AC_ABORT_IF_MISSING_PREREQ
66 # _MINGW_AC_SUGGEST_PROVIDERS
67 # ---------------------------
68 # Helper macro, invoked only by MINGW_AC_ABORT_IF_MISSING_PREREQ;
69 # it causes any TARNAME references from MINGW_AC_ASSERT_MISSING to
70 # be itemised in the diagnostic output.
72 AC_DEFUN([_MINGW_AC_SUGGEST_PROVIDERS],
73 [test -n "${mingw_ac_missing_providers}" && {
74 test -z "${mingw_ac_missing_providers_plural}" \
75 && mingw_ac_newer="a newer" \
76 || mingw_ac_newer=newer
77 mingw_ac_missing_list="${mingw_ac_missing_list}
79 To continue building ${PACKAGE_TARNAME}, you should install the following
80 or ${mingw_ac_newer} version${mingw_ac_missing_providers_plural} of:--
81 ${mingw_ac_missing_providers}
83 and run configure again.
85 ])# _MINGW_AC_SUGGEST_PROVIDERS
87 # $RCSfile$: end of file