chiark / gitweb /
Introduce a proper build system and clear away old cruft.
[sod] / configure.ac
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..361421f
--- /dev/null
@@ -0,0 +1,85 @@
+dnl -*-autoconf-*-
+dnl
+dnl Configuration script for SOD
+dnl
+dnl (c) 2015 Straylight/Edgeware
+dnl
+
+dnl----- Licensing notice ---------------------------------------------------
+dnl
+dnl This file is part of the Sensble Object Design, an object system for C.
+dnl
+dnl SOD is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl SOD is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with SOD; if not, write to the Free Software Foundation,
+dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+dnl--------------------------------------------------------------------------
+dnl Initialization.
+
+mdw_AUTO_VERSION
+AC_INIT([sod], AUTO_VERSION, [mdw@distorted.org.uk])
+AC_CONFIG_SRCDIR([lib/sod.h])
+AC_CONFIG_AUX_DIR([config])
+AM_INIT_AUTOMAKE([foreign])
+mdw_SILENT_RULES
+
+AC_PROG_CC
+AM_PROG_LIBTOOL
+AX_CFLAGS_WARN_ALL
+mdw_LIBTOOL_VERSION_INFO
+
+dnl--------------------------------------------------------------------------
+dnl Common Lisp things.
+
+AC_ARG_WITH([lisp-system],
+       [AS_HELP_STRING([--with-lisp-system=SYSTEMS],
+                       [preference order of cl-launch Lisp systems])],
+       [], [with_lisp_system="sbcl clisp"])
+
+AC_CHECK_PROGS([CL_LAUNCH], [cl-launch], [not-found])
+case "$CL_LAUNCH" in
+  not-found) AC_MSG_ERROR([\`cl-launch' not found]) ;;
+esac
+
+AC_MSG_CHECKING([for best choice of Lisp system])
+if ! LISPSYS=$($CL_LAUNCH -l "$with_lisp_system" \
+               -ip '(string-downcase (lisp-implementation-type))'); then
+  AC_MSG_ERROR([cl-launch didn't like any Lisp system])
+fi
+AC_SUBST([LISPSYS])
+AC_MSG_RESULT([$LISPSYS])
+
+AC_MSG_CHECKING([FASL file extension])
+FASL_TYPE=$($CL_LAUNCH -l $LISPSYS -ip \
+       '(pathname-type (compile-file-pathname "foo.lisp"))')
+AC_SUBST([FASL_TYPE])
+AC_MSG_RESULT([.$FASL_TYPE])
+
+AC_ARG_WITH([lisp-source-dir],
+       [AS_HELP_STRING([--with-lisp-source-dir=DIR],
+                       [where to install Common Lisp source files])],
+       [], [with_lisp_source_dir='${datadir}/common-lisp/source'])
+AC_ARG_WITH([lisp-system-dir],
+       [AS_HELP_STRING([--with-lisp-system-dir=DIR],
+                       [where to install ASDF system links])],
+       [], [with_lisp_system_dir='${datadir}/common-lisp/systems'])
+AC_SUBST([lispsrcdir], [$with_lisp_source_dir])
+AC_SUBST([lispsysdir], [$with_lisp_system_dir])
+
+dnl--------------------------------------------------------------------------
+dnl Output.
+
+AC_CONFIG_FILES([Makefile src/Makefile lib/Makefile])
+AC_OUTPUT
+
+dnl----- That's all, folks --------------------------------------------------