| 1 | dnl -*-autoconf-*- |
| 2 | dnl |
| 3 | dnl Configuration script for SOD |
| 4 | dnl |
| 5 | dnl (c) 2015 Straylight/Edgeware |
| 6 | dnl |
| 7 | |
| 8 | dnl----- Licensing notice --------------------------------------------------- |
| 9 | dnl |
| 10 | dnl This file is part of the Sensble Object Design, an object system for C. |
| 11 | dnl |
| 12 | dnl SOD is free software; you can redistribute it and/or modify |
| 13 | dnl it under the terms of the GNU General Public License as published by |
| 14 | dnl the Free Software Foundation; either version 2 of the License, or |
| 15 | dnl (at your option) any later version. |
| 16 | dnl |
| 17 | dnl SOD is distributed in the hope that it will be useful, |
| 18 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | dnl GNU General Public License for more details. |
| 21 | dnl |
| 22 | dnl You should have received a copy of the GNU General Public License |
| 23 | dnl along with SOD; if not, write to the Free Software Foundation, |
| 24 | dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 25 | |
| 26 | dnl-------------------------------------------------------------------------- |
| 27 | dnl Initialization. |
| 28 | |
| 29 | mdw_AUTO_VERSION |
| 30 | AC_INIT([sod], AUTO_VERSION, [mdw@distorted.org.uk]) |
| 31 | AC_CONFIG_SRCDIR([lib/sod.h]) |
| 32 | AC_CONFIG_AUX_DIR([config]) |
| 33 | AM_INIT_AUTOMAKE([foreign]) |
| 34 | mdw_SILENT_RULES |
| 35 | |
| 36 | AC_PROG_CC |
| 37 | AM_PROG_LIBTOOL |
| 38 | AX_CFLAGS_WARN_ALL |
| 39 | mdw_LIBTOOL_VERSION_INFO |
| 40 | |
| 41 | dnl-------------------------------------------------------------------------- |
| 42 | dnl Common Lisp things. |
| 43 | |
| 44 | AC_ARG_WITH([lisp-system], |
| 45 | [AS_HELP_STRING([--with-lisp-system=SYSTEMS], |
| 46 | [preference order of cl-launch Lisp systems])], |
| 47 | [], [with_lisp_system="sbcl clisp"]) |
| 48 | |
| 49 | AC_CHECK_PROGS([CL_LAUNCH], [cl-launch], [not-found]) |
| 50 | case "$CL_LAUNCH" in |
| 51 | not-found) AC_MSG_ERROR([\`cl-launch' not found]) ;; |
| 52 | esac |
| 53 | |
| 54 | AC_MSG_CHECKING([for best choice of Lisp system]) |
| 55 | if ! LISPSYS=$($CL_LAUNCH -l "$with_lisp_system" \ |
| 56 | -ip '(string-downcase (lisp-implementation-type))'); then |
| 57 | AC_MSG_ERROR([cl-launch didn't like any Lisp system]) |
| 58 | fi |
| 59 | AC_SUBST([LISPSYS]) |
| 60 | AC_MSG_RESULT([$LISPSYS]) |
| 61 | |
| 62 | AC_MSG_CHECKING([FASL file extension]) |
| 63 | fasl=$($CL_LAUNCH -l $LISPSYS -ip \ |
| 64 | '(pathname-type (compile-file-pathname "foo.lisp"))') |
| 65 | AC_SUBST([fasl]) |
| 66 | AC_MSG_RESULT([.$fasl]) |
| 67 | |
| 68 | AC_ARG_WITH([lisp-source-dir], |
| 69 | [AS_HELP_STRING([--with-lisp-source-dir=DIR], |
| 70 | [where to install Common Lisp source files])], |
| 71 | [], [with_lisp_source_dir='${datadir}/common-lisp/source']) |
| 72 | AC_ARG_WITH([lisp-system-dir], |
| 73 | [AS_HELP_STRING([--with-lisp-system-dir=DIR], |
| 74 | [where to install ASDF system links])], |
| 75 | [], [with_lisp_system_dir='${datadir}/common-lisp/systems']) |
| 76 | AC_SUBST([lispsrcdir], [$with_lisp_source_dir]) |
| 77 | AC_SUBST([lispsysdir], [$with_lisp_system_dir]) |
| 78 | |
| 79 | dnl-------------------------------------------------------------------------- |
| 80 | dnl Output. |
| 81 | |
| 82 | AC_CONFIG_FILES([Makefile src/Makefile lib/Makefile test/Makefile]) |
| 83 | AC_OUTPUT |
| 84 | |
| 85 | dnl----- That's all, folks -------------------------------------------------- |