-# guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
-#
-# Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
-#
-# This file is part of guile-irrlicht.
-#
-# guile-irrlicht is free software; you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation; either version 3 of the
-# License, or (at your option) any later version.
-#
-# guile-irrlicht is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with guile-irrlicht. If not, see
-# <http://www.gnu.org/licenses/>.
+define(GUILE_IRRLICHT_CONFIGURE_COPYRIGHT, [[
+guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+Copyright (C) 2021 Javier Sancho <jsf@jsancho.org>
+
+This file is part of guile-irrlicht.
+
+guile-irrlicht is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 3 of the
+License, or (at your option) any later version.
+
+guile-irrlicht is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with guile-irrlicht. If not, see
+<http://www.gnu.org/licenses/>.
+
+]])
AC_INIT([guile-irrlicht], [0.1], [jsf@jsancho.org])
-AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects])
-AC_CONFIG_MACRO_DIRS([m4])
-AM_PROG_AR
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+AC_COPYRIGHT(GUILE_IRRLICHT_CONFIGURE_COPYRIGHT)
+
+AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability foreign])
AC_PROG_CXX
+AC_LANG([C++])
LT_INIT
-PKG_CHECK_MODULES([GUILE], [guile-2.2])
+# Check for 'guile'
+PKG_CHECK_MODULES([GUILE], [guile-3.0],, [
+ PKG_CHECK_MODULES([GUILE], [guile-2.2])
+])
GUILE_SITE_DIR
+# Check for 'irrlicht'
AC_CHECK_LIB(
[Irrlicht],
[createDevice],
[],
- AC_MSG_ERROR([Missing Irrlicht lib. Try option --with-irrlicht-lib])
+ AC_MSG_ERROR([Irrlicht is required to build.])
+)
+AC_CHECK_HEADERS(
+ [irrlicht/irrlicht.h],
+ [
+ IRRLICHT_CFLAGS=-I/usr/include/irrlicht
+ AC_SUBST([IRRLICHT_CFLAGS])
+ ],
+ AC_MSG_ERROR([Irrlicht header files are required to build.])
)
-AC_CONFIG_FILES([
- Makefile
-])
+# Find swig executable
+# http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html
+AX_PKG_SWIG([], [], [ AC_MSG_ERROR([SWIG is required to build.]) ])
+
+# Enable SWIG C++ support
+# https://www.gnu.org/software/autoconf-archive/ax_swig_enable_cxx.html
+AX_SWIG_ENABLE_CXX
+
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_OUTPUT