Add gnetlist:get-input-files scheme function.
[geda-gaf/peter-b.git] / m4 / geda-guile-display-error.m4
blob05faa122e51f958466b8992868b8a9af0188fce2
1 # geda-guile-display-error.m4                             -*-Autoconf-*-
2 # serial 1
4 dnl Check for behaviour of scm_display_error().
5 dnl Copyright (C) 2011  Peter Brett <peter@peter-b.co.uk>
6 dnl
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
11 dnl
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 dnl GNU General Public License for more details.
16 dnl
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 AC_DEFUN([AX_GUILE_DISPLAY_ERROR],
23   AC_PREREQ([2.60])dnl
24   AC_REQUIRE([AX_CHECK_GUILE])dnl
26   AC_ARG_VAR([GUILE], [Path to guile executable])
27   AC_CHECK_PROG([GUILE], [guile], [guile], [no])
29   if test "X$GUILE" != "Xno"; then
31     AC_MSG_CHECKING([whether scm_display_error expects a stack argument])
32     if $GUILE -c \
33 "(exit
34    (false-if-exception
35      (begin
36        (display-error (make-stack #t) (current-output-port) \"a\" \"b\" '() '())
37        #t)))" > /dev/null; then
38       AC_MSG_RESULT([yes])
39       AC_DEFINE([HAVE_SCM_DISPLAY_ERROR_STACK], 1,
40                 [Define to 1 if scm_display_error expects a stack as first argument.])
41     else
42       AC_MSG_RESULT([no])
43     fi
45     AC_MSG_CHECKING([whether scm_display_error expects a frame argument])
46     if $GUILE -c \
47 "(exit
48    (false-if-exception
49      (begin
50        (display-error (stack-ref (make-stack #t) 0)
51                       (current-output-port) \"a\" \"b\" '() '())
52        #t)))" > /dev/null; then
53       AC_MSG_RESULT([yes])
54       AC_DEFINE([HAVE_SCM_DISPLAY_ERROR_FRAME], 1,
55                 [Define to 1 if scm_display_error expects a frame as first argument.])
56     else
57       AC_MSG_RESULT([no])
58     fi
59   fi
60 ])dnl AX_GUILE_DISPLAY_ERROR