]> git.draconx.ca Git - slotifier.git/commitdiff
Add configure test for slot support in libgerbv.
authorNick Bowler <nbowler@draconx.ca>
Sun, 6 Jan 2019 17:31:28 +0000 (12:31 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sun, 6 Jan 2019 17:31:28 +0000 (12:31 -0500)
Since slot support in gerbv is quite new, ensure that configure
detects old versions which do not support this feature and fail
early.

configure.ac

index d5024213caf01f8bfb4959f53082ede33cda48b2..f5c7c70dc80a5437a17f90972cf56eb749498de3 100644 (file)
@@ -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.
 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
 
 LT_INIT
 gl_INIT
 
+AC_CACHE_SAVE
+
 m4_include([lib/gnulib.mk])
 
 dnl We provide our own makefile rules for gettext.  Disable tracing of
 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
 
 AM_GNU_GETTEXT([external])
 DX_LINGUAS
 
-DX_LIB_LIBGERBV
 DX_LIB_CNEARTREE
 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
 
 AC_CONFIG_TESTDIR([.])
 DX_PROG_AUTOTEST