2445 |
19 Mar 11 |
peter |
## $Id$ |
2445 |
19 Mar 11 |
peter |
2 |
|
2445 |
19 Mar 11 |
peter |
3 |
# |
2865 |
11 Nov 12 |
peter |
# serial 3 (yat 0.10) |
2445 |
19 Mar 11 |
peter |
5 |
# |
2445 |
19 Mar 11 |
peter |
6 |
|
2445 |
19 Mar 11 |
peter |
7 |
# |
2787 |
23 Jul 12 |
peter |
# Copyright (C) 2011, 2012 Peter Johansson |
2445 |
19 Mar 11 |
peter |
9 |
# |
2445 |
19 Mar 11 |
peter |
# This file is part of the yat library, http://dev.thep.lu.se/yat |
2445 |
19 Mar 11 |
peter |
11 |
# |
2445 |
19 Mar 11 |
peter |
# The yat library is free software; you can redistribute it and/or |
2445 |
19 Mar 11 |
peter |
# modify it under the terms of the GNU General Public License as |
2445 |
19 Mar 11 |
peter |
# published by the Free Software Foundation; either version 3 of the |
2445 |
19 Mar 11 |
peter |
# License, or (at your option) any later version. |
2445 |
19 Mar 11 |
peter |
16 |
# |
2445 |
19 Mar 11 |
peter |
# The yat library is distributed in the hope that it will be useful, |
2445 |
19 Mar 11 |
peter |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2445 |
19 Mar 11 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
2445 |
19 Mar 11 |
peter |
# General Public License for more details. |
2445 |
19 Mar 11 |
peter |
21 |
# |
2445 |
19 Mar 11 |
peter |
# You should have received a copy of the GNU General Public License |
2445 |
19 Mar 11 |
peter |
# along with yat. If not, see <http://www.gnu.org/licenses/>. |
2445 |
19 Mar 11 |
peter |
24 |
# |
2445 |
19 Mar 11 |
peter |
25 |
|
2445 |
19 Mar 11 |
peter |
# YAT_MSG_ERROR(ERROR) |
2445 |
19 Mar 11 |
peter |
27 |
# |
2445 |
19 Mar 11 |
peter |
# Just like AC_MSG_ERROR this macro prints an error message, ERROR, to |
2445 |
19 Mar 11 |
peter |
# standard error and exits. But rather than doing that immediately |
2445 |
19 Mar 11 |
peter |
# this macro lets configure continue and prints the error message and |
2445 |
19 Mar 11 |
peter |
# exits just before the end. |
2445 |
19 Mar 11 |
peter |
32 |
# |
2445 |
19 Mar 11 |
peter |
33 |
AC_DEFUN([YAT_MSG_ERROR], |
2445 |
19 Mar 11 |
peter |
34 |
[ |
2445 |
19 Mar 11 |
peter |
35 |
AC_REQUIRE([YAT_MSG_ERROR_PREPARE]) |
2865 |
11 Nov 12 |
peter |
36 |
AS_ECHO(["$1"]) >> yat_msg_error.txt |
2726 |
18 Apr 12 |
peter |
37 |
AS_ECHO(["$as_me:$LINENO: error: $1"]) >& AS_MESSAGE_LOG_FD |
2445 |
19 Mar 11 |
peter |
38 |
]) # YAT_MSG_ERROR |
2445 |
19 Mar 11 |
peter |
39 |
|
2445 |
19 Mar 11 |
peter |
# YAT_MSG_ERROR_PREPARE([MESSAGE]) |
2445 |
19 Mar 11 |
peter |
41 |
# |
2445 |
19 Mar 11 |
peter |
# The error messages generated by YAT_MSG_ERROR is preceeded by a |
2445 |
19 Mar 11 |
peter |
# message: 'some requirements were not fulfilled, see below'. This |
2445 |
19 Mar 11 |
peter |
# default message can can be changed to MESSAGE by calling |
2445 |
19 Mar 11 |
peter |
# YAT_MSG_ERROR_PREPARE prior the first YAT_MSG_ERROR. |
2445 |
19 Mar 11 |
peter |
46 |
AC_DEFUN([YAT_MSG_ERROR_PREPARE], |
2445 |
19 Mar 11 |
peter |
47 |
[ |
2865 |
11 Nov 12 |
peter |
48 |
rm -f yat_msg_error.txt |
2445 |
19 Mar 11 |
peter |
49 |
AC_CONFIG_COMMANDS_PRE([ |
2865 |
11 Nov 12 |
peter |
50 |
AS_IF([test -f yat_msg_error.txt], [ |
2445 |
19 Mar 11 |
peter |
51 |
msg="m4_default([$1], [some requirements were not fulfilled, see below])" |
2726 |
18 Apr 12 |
peter |
52 |
AS_ECHO(["$as_me: error: $msg"]) >&2 |
2865 |
11 Nov 12 |
peter |
53 |
cat yat_msg_error.txt >&2 |
2445 |
19 Mar 11 |
peter |
54 |
AS_EXIT([1]) |
2445 |
19 Mar 11 |
peter |
55 |
]) |
2445 |
19 Mar 11 |
peter |
56 |
]) |
2445 |
19 Mar 11 |
peter |
57 |
]) # _YAT_MSG_ERROR |