configure.ac: Don't try to dump Lisps which we couldn't find.
[runlisp] / configure.ac
CommitLineData
e29834b8
MW
1dnl -*-autoconf-*-
2dnl
3dnl Configuration script for `runlisp'
4dnl
5dnl (c) 2020 Mark Wooding
6dnl
7
8dnl----- Licensing notice ---------------------------------------------------
9dnl
10dnl This file is part of Runlisp, a tool for invoking Common Lisp scripts.
11dnl
12dnl Runlisp is free software: you can redistribute it and/or modify it
13dnl under the terms of the GNU General Public License as published by the
14dnl Free Software Foundation; either version 3 of the License, or (at your
15dnl option) any later version.
16dnl
17dnl Runlisp is distributed in the hope that it will be useful, but WITHOUT
18dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20dnl for more details.
21dnl
22dnl You should have received a copy of the GNU General Public License
23dnl along with Runlisp. If not, see <https://www.gnu.org/licenses/>.
24
25dnl--------------------------------------------------------------------------
26dnl Initialization.
27
28mdw_AUTO_VERSION
29AC_INIT([runlisp], AUTO_VERSION, [mdw@distorted.org.uk])
30AC_CONFIG_SRCDIR([runlisp.c])
31AC_CONFIG_AUX_DIR([config])
32AM_INIT_AUTOMAKE([foreign])
33mdw_SILENT_RULES
34
35AC_PROG_CC
36AX_CFLAGS_WARN_ALL
7b8ff279
MW
37mdw_DECL_ENVIRON
38AC_CHECK_FUNC([strsignal])
39case $ac_cv_func_strsignal in no) AC_DECL_SYS_SIGLIST ;; esac
e29834b8 40
8996f767
MW
41AC_PROG_RANLIB
42
e29834b8
MW
43AC_CHECK_PROGS([AUTOM4TE], [autom4te])
44
45dnl--------------------------------------------------------------------------
46dnl Checking for Lisp implementations.
47
48imagedir=$localstatedir/$PACKAGE_NAME; AC_SUBST(imagedir)
49mdw_DEFINE_PATHS([
50 mdw_DEFINE_PATH([IMAGEDIR], [$imagedir])
8996f767 51 mdw_DEFINE_PATH([ETCDIR], [$sysconfdir/$PACKAGE_NAME])
e29834b8
MW
52 mdw_DEFINE_PATH([DATADIR], [$datadir/$PACKAGE_NAME])])
53
54AC_ARG_ENABLE([imagedump],
55 [AS_HELP_STRING([--enable-imagedump[=SYSTEMS]],
56 [make dumps of Lisp SYSTEMS with ASDF etc. preloaded;
57 SYSTEMS is `yes', `no', or a comma-separated list of
58 system names])],
59 [], [enable_imagedump=yes])
60
61AC_DEFUN([mdw_CHECK_LISP],
62[AC_CHECK_PROGS([$1], [$2])
63AC_ARG_VAR([$1], [Path to the $1 Lisp system.])
e41cbc79
MW
64case $[]$1:,$enable_imagedump, in
65 :*) dump=nil ;;
66 *:,yes, | *:*,$2,*) dump=t ;;
e29834b8
MW
67 *) dump=nil ;;
68esac
69AM_CONDITIONAL([DUMP_$1], [test $dump = t])])
70
71mdw_CHECK_LISP([SBCL], [sbcl])
72mdw_CHECK_LISP([CCL], [ccl])
73mdw_CHECK_LISP([CLISP], [clisp])
74mdw_CHECK_LISP([ECL], [ecl])
75mdw_CHECK_LISP([CMUCL], [cmucl])
76mdw_CHECK_LISP([ABCL], [abcl])
77
78dnl ECL is changing its command-line option syntax, because that will make
79dnl things much better or something. So we need to figure out which version
80dnl of the syntax to use.
81mdw_ecl_opts=hunoz
82if test "x$ECL" != x; then
83 AC_MSG_CHECKING([ECL command-line option flavour])
84 ver=$($ECL --version)
85 case $ver in
86 [ECL\ [0-9].*] | [ECL\ 1[0-5].*]) mdw_ecl_opts=trad ;;
87 [ECL\ 1[6-9].*] | [ECL\ [2-9][0-9].*]) mdw_ecl_opts=gnu ;;
88 *) AC_MSG_ERROR([unsupported ECL version \`$ver']) ;;
89 esac
90 AC_MSG_RESULT([$mdw_ecl_opts])
91 case $mdw_ecl_opts in
92 gnu) AC_DEFINE([ECL_OPTIONS_GNU], [1],
93 [Define 1 if ECL uses GNU-style `--FOO' options]) ;;
94 esac
95fi
96case $mdw_ecl_opts in
97 gnu) ECLOPT=-- ;;
98 trad) ECLOPT=- ;;
99 *) AC_MSG_ERROR([internal error: unexpected value for `$mdw_ecl_opts']) ;;
100esac
101AC_SUBST([ECLOPT])
102
103dnl--------------------------------------------------------------------------
104dnl Benchmarking support.
105
106dnl This has lots of random dependencies, and isn't really very useful. Turn
107dnl it off unless the user is very keen.
108AC_ARG_ENABLE([benchmark],
109 [AS_HELP_STRING([--enable-benchmark],
110 [turn on script-startup benchmark machinery])],
111 [mdw_bench=$enableval], [mdw_bench=no])
112AM_CONDITIONAL([BENCHMARK], [test "$mdw_bench" = yes])
113
114dnl--------------------------------------------------------------------------
115dnl Produce output.
116
117AC_CONFIG_HEADER([config/config.h])
118AC_CONFIG_TESTDIR([t])
119
120AC_CONFIG_FILES([Makefile]
121 [bench/Makefile doc/Makefile]
122 [t/Makefile t/atlocal])
123AC_OUTPUT
124
125dnl----- That's all, folks --------------------------------------------------