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