New version.
[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
37
38AC_CHECK_PROGS([AUTOM4TE], [autom4te])
39
40dnl--------------------------------------------------------------------------
41dnl Checking for Lisp implementations.
42
43imagedir=$localstatedir/$PACKAGE_NAME; AC_SUBST(imagedir)
44mdw_DEFINE_PATHS([
45 mdw_DEFINE_PATH([IMAGEDIR], [$imagedir])
46 mdw_DEFINE_PATH([DATADIR], [$datadir/$PACKAGE_NAME])])
47
48AC_ARG_ENABLE([imagedump],
49 [AS_HELP_STRING([--enable-imagedump[=SYSTEMS]],
50 [make dumps of Lisp SYSTEMS with ASDF etc. preloaded;
51 SYSTEMS is `yes', `no', or a comma-separated list of
52 system names])],
53 [], [enable_imagedump=yes])
54
55AC_DEFUN([mdw_CHECK_LISP],
56[AC_CHECK_PROGS([$1], [$2])
57AC_ARG_VAR([$1], [Path to the $1 Lisp system.])
58case ,$enable_imagedump, in
59 ,yes, | *,$2,*) dump=t ;;
60 *) dump=nil ;;
61esac
62AM_CONDITIONAL([DUMP_$1], [test $dump = t])])
63
64mdw_CHECK_LISP([SBCL], [sbcl])
65mdw_CHECK_LISP([CCL], [ccl])
66mdw_CHECK_LISP([CLISP], [clisp])
67mdw_CHECK_LISP([ECL], [ecl])
68mdw_CHECK_LISP([CMUCL], [cmucl])
69mdw_CHECK_LISP([ABCL], [abcl])
70
71dnl ECL is changing its command-line option syntax, because that will make
72dnl things much better or something. So we need to figure out which version
73dnl of the syntax to use.
74mdw_ecl_opts=hunoz
75if test "x$ECL" != x; then
76 AC_MSG_CHECKING([ECL command-line option flavour])
77 ver=$($ECL --version)
78 case $ver in
79 [ECL\ [0-9].*] | [ECL\ 1[0-5].*]) mdw_ecl_opts=trad ;;
80 [ECL\ 1[6-9].*] | [ECL\ [2-9][0-9].*]) mdw_ecl_opts=gnu ;;
81 *) AC_MSG_ERROR([unsupported ECL version \`$ver']) ;;
82 esac
83 AC_MSG_RESULT([$mdw_ecl_opts])
84 case $mdw_ecl_opts in
85 gnu) AC_DEFINE([ECL_OPTIONS_GNU], [1],
86 [Define 1 if ECL uses GNU-style `--FOO' options]) ;;
87 esac
88fi
89case $mdw_ecl_opts in
90 gnu) ECLOPT=-- ;;
91 trad) ECLOPT=- ;;
92 *) AC_MSG_ERROR([internal error: unexpected value for `$mdw_ecl_opts']) ;;
93esac
94AC_SUBST([ECLOPT])
95
96dnl--------------------------------------------------------------------------
97dnl Benchmarking support.
98
99dnl This has lots of random dependencies, and isn't really very useful. Turn
100dnl it off unless the user is very keen.
101AC_ARG_ENABLE([benchmark],
102 [AS_HELP_STRING([--enable-benchmark],
103 [turn on script-startup benchmark machinery])],
104 [mdw_bench=$enableval], [mdw_bench=no])
105AM_CONDITIONAL([BENCHMARK], [test "$mdw_bench" = yes])
106
107dnl--------------------------------------------------------------------------
108dnl Produce output.
109
110AC_CONFIG_HEADER([config/config.h])
111AC_CONFIG_TESTDIR([t])
112
113AC_CONFIG_FILES([Makefile]
114 [bench/Makefile doc/Makefile]
115 [t/Makefile t/atlocal])
116AC_OUTPUT
117
118dnl----- That's all, folks --------------------------------------------------