From: Nick Bowler Date: Sun, 6 Jan 2019 17:31:28 +0000 (-0500) Subject: Add configure test for slot support in libgerbv. X-Git-Tag: v1~6 X-Git-Url: https://git.draconx.ca/gitweb/slotifier.git/commitdiff_plain/41712dbd49b5919a7ffe58ce31d6fcbd6f41e4de Add configure test for slot support in libgerbv. Since slot support in gerbv is quite new, ensure that configure detects old versions which do not support this feature and fail early. --- diff --git a/configure.ac b/configure.ac index d502421..f5c7c70 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -dnl Copyright © 2018 Nick Bowler +dnl Copyright © 2018-2019 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. @@ -17,6 +17,8 @@ gl_EARLY LT_INIT gl_INIT +AC_CACHE_SAVE + m4_include([lib/gnulib.mk]) dnl We provide our own makefile rules for gettext. Disable tracing of @@ -26,8 +28,28 @@ m4_traceoff([AM_GNU_GETTEXT]) 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 +#include +], [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 . +m4_newline([DX_LIB_USERFLAG_BLURB([libgerbv])]) +m4_newline([DX_LIB_PKGCONFIG_BLURB([libgerbv])]) +])]) AC_CONFIG_TESTDIR([.]) DX_PROG_AUTOTEST