aboutsummaryrefslogtreecommitdiff
path: root/am/guile.m4
diff options
context:
space:
mode:
Diffstat (limited to 'am/guile.m4')
-rw-r--r--am/guile.m4110
1 files changed, 0 insertions, 110 deletions
diff --git a/am/guile.m4 b/am/guile.m4
deleted file mode 100644
index c793a70..0000000
--- a/am/guile.m4
+++ /dev/null
@@ -1,110 +0,0 @@
1dnl This file is part of GNU mailutils.
2dnl Copyright (C) 2001,2004 Free Software Foundation, Inc.
3dnl
4dnl This program is free software; you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 2 of the License, or
7dnl (at your option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12dnl GNU General Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License
15dnl along with this program; if not, write to the Free Software
16dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17dnl
18
19dnl MU_RESULT_ACTIONS -- generate shell code for the result of a test
20dnl $1 -- CVAR -- cache variable to check
21dnl $2 -- NAME -- if not empty, used to generate a default value TRUE:
22dnl `AC_DEFINE(HAVE_NAME)'
23dnl $2 -- TRUE -- what to do if the CVAR is not `no'
24dnl $3 -- FALSE -- what to do otherwise; defaults to `:'
25dnl
26AC_DEFUN([MU_RESULT_ACTIONS], [
27[if test "$$1" != "" -a "$$1" != no; then
28 ]ifelse([$3], ,
29 [AC_DEFINE(HAVE_]translit($2, [a-z ./<>], [A-Z___])[,1,[FIXME])],
30 [$3])[
31else
32 ]ifelse([$4], , [:], [$4])[
33fi]])dnl
34
35AC_DEFUN([MU_CHECK_GUILE],
36[
37 if test "x$mu_cv_lib_guile" = x; then
38 cached=""
39 AC_PATH_PROG(GUILE_CONFIG, guile-config, no, $PATH)
40 if test $GUILE_CONFIG = no; then
41 mu_cv_lib_guile=no
42 else
43 GUILE_INCLUDES=`guile-config compile`
44 GUILE_LIBS=`guile-config link`
45 fi
46
47 if test $GUILE_CONFIG != no; then
48 AC_MSG_CHECKING(for guile version 1.6 or higher)
49 GUILE_VERSION=`($GUILE_CONFIG --version 2>&1; echo '')|sed -n 's/guile-config - Guile version \([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\2/p'`
50 case "x$GUILE_VERSION" in
51 x[[0-9]]*)
52 if test $GUILE_VERSION -lt 16; then
53 AC_MSG_RESULT(Nope. Version number too low.)
54 mu_cv_lib_guile=no
55 else
56 AC_DEFINE_UNQUOTED(GUILE_VERSION, $GUILE_VERSION,
57 [Guile version number: MAX*10 + MIN])
58 AC_MSG_RESULT(OK)
59 save_LIBS=$LIBS
60 save_CFLAGS=$CFLAGS
61 LIBS="$LIBS $GUILE_LIBS"
62 CFLAGS="$CFLAGS $GUILE_INCLUDES"
63 AC_TRY_LINK([#include <libguile.h>],
64 ifelse([$1], , scm_shell(0, NULL);, [$1]),
65 [mu_cv_lib_guile=yes],
66 [mu_cv_lib_guile=no])
67 LIBS=$save_LIBS
68 CFLAGS=$save_CFLAGS
69 fi ;;
70 *) AC_MSG_RESULT(Nope. Unknown version number)
71 mu_cv_lib_guile=no;;
72 esac
73 fi
74 else
75 cached=" (cached) "
76 GUILE_INCLUDES=`$GUILE_CONFIG compile`
77 GUILE_LIBS=`$GUILE_CONFIG link`
78 fi
79 AC_MSG_CHECKING(whether to build guile support)
80 MU_RESULT_ACTIONS([mu_cv_lib_guile],[LIBGUILE],[$2],[$3])
81 AC_MSG_RESULT(${cached}$mu_cv_lib_guile)
82
83 if test $mu_cv_lib_guile = yes; then
84 AC_ARG_WITH([guiledir],
85 AC_HELP_STRING([--with-guiledir=DIR],
86 [Specify the directory to install guile modules to]),
87 [case $withval in
88 /*) GUILE_SITE=$withval;;
89 yes) GUILE_SITE=`$GUILE_CONFIG info pkgdatadir`/site;;
90 *) AC_MSG_ERROR([Argument to --with-guiledir must be an absolute directory name]);;
91 esac],
92 [GUILE_SITE=`$GUILE_CONFIG info pkgdatadir`/site
93 pfx=$prefix
94 test "x$pfx" = xNONE && pfx=$ac_default_prefix
95 case $GUILE_SITE in
96 $pfx/*) ;; # OK
97 *) AC_MSG_WARN([guile site directory "$GUILE_SITE" lies outside your current prefix ($pfx).])
98 GUILE_SITE='$(datadir)/guile/site'
99 AC_MSG_WARN([Falling back to ${GUILE_SITE} instead. Use --with-guiledir to force using site directory.])
100 ;;
101 esac])
102 fi
103
104 AC_SUBST(GUILE_SITE)
105 AC_SUBST(GUILE_INCLUDES)
106 AC_SUBST(GUILE_LIBS)
107])
108
109
110

Return to:

Send suggestions and report system problems to the System administrator.