-dnl Copyright © 2018 Nick Bowler
+dnl Copyright © 2018-2019, 2021 Nick Bowler
dnl
dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
dnl This is free software: you are free to do what the fuck you want to.
dnl There is NO WARRANTY, to the extent permitted by law.
-AC_INIT([slotifier], [0], [nbowler@draconx.ca])
-AC_CONFIG_HEADER([config.h])
+AC_INIT([slotifier], [1.1], [nbowler@draconx.ca])
+AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
+AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects dist-xz])
AM_SILENT_RULES([yes])
AC_PROG_CC
LT_INIT
gl_INIT
+AC_CACHE_SAVE
+
m4_include([lib/gnulib.mk])
dnl We provide our own makefile rules for gettext. Disable tracing of
AM_GNU_GETTEXT([external])
DX_LINGUAS
-DX_LIB_LIBGERBV
DX_LIB_CNEARTREE
+DX_LIB_LIBGERBV
+
+AS_IF([test x"$dx_cv_libgerbv_lib_found" = x"yes"],
+[AC_CACHE_CHECK([if libgerbv supports G85 slots], [dx_cv_gerbv_supports_g85],
+[save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $LIBGERBV_CFLAGS"
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[#include <gerbv.h>
+#include <stddef.h>
+], [static int g85_supported@<:@
+ offsetof(gerbv_drill_stats_t, G85) >= 0 ? 1 : -1
+@:>@;])], [dx_cv_gerbv_supports_g85=yes], [dx_cv_gerbv_supports_g85=no])
+CFLAGS=$save_CFLAGS])])
+
+AS_IF([test x"$dx_cv_gerbv_supports_g85" != x"yes"],
+[AC_MSG_FAILURE([Your installation of libgerbv appears not to
+support slots. An updated version of libgerbv is likely required.
+The latest version may be found at <http://gerbv.geda-project.org/>.
+m4_newline([DX_LIB_USERFLAG_BLURB([libgerbv])])
+m4_newline([DX_LIB_PKGCONFIG_BLURB([libgerbv])])
+])])
AC_CONFIG_TESTDIR([.])
DX_PROG_AUTOTEST