]> git.draconx.ca Git - liblbx.git/blobdiff - configure.ac
Trivial manual fixes.
[liblbx.git] / configure.ac
index 5494e25b4914d79a4636a1496df82b7005ff01e4..98cc477b38c3d0746ce46e2ef9c3074a131653d6 100644 (file)
@@ -1,38 +1,70 @@
-AC_PREREQ(2.60)
-AC_INIT([liblbx], [0.1], [toom-devel@lists.sourceforge.net])
+dnl Copyright © 2009, 2013-2014, 2021, 2023 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.
+
+DX_PATCH_GNULIB
+
+AC_PREREQ([2.68])
+AC_INIT([liblbx], [0.1], [nbowler@draconx.ca])
 AC_CONFIG_SRCDIR([src/lbx.c])
-AC_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
 
-AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
+AM_SILENT_RULES([yes])
+DX_AUTOMAKE_COMPAT
 
 AC_PROG_CC_C99
+AM_PROG_CC_C_O
+gl_EARLY
+
 AC_HEADER_ASSERT
-AC_C_BIGENDIAN
+LT_INIT
+gl_INIT
+
+AC_C_FLEXIBLE_ARRAY_MEMBER
+
+m4_include([lib/gnulib.mk])
+
+AC_ARG_WITH([libpng],
+  [AS_HELP_STRING([--with-libpng],
+    [build support for PNG output using libpng. [default=auto]])],
+  [with_libpng=$withval], [with_libpng=auto])
+
+AS_CASE([$with_libpng],
+  [no], [have_libpng=false],
+  [yes], [DX_LIB_LIBPNG([1.5], [have_libpng=true])],
+  [DX_LIB_LIBPNG([1.5], [have_libpng=true], [have_libpng=false])])
+
+AM_CONDITIONAL([HAVE_LIBPNG], [$have_libpng])
+AS_IF([$have_libpng], [AC_DEFINE([HAVE_LIBPNG], [1],
+  [Define to 1 if libpng support is available])])
 
-# pkg-config
-PKG_INIT
-if test x"$PKG_CONFIG" = x""; then
-       AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-fi
+AC_ARG_ENABLE([lbxgui],
+  [AS_HELP_STRING([--enable-lbxgui],
+    [build the lbxgui tool (requires GTK+) [default=auto]])],
+  [enable_lbxgui=$enableval],
+  [enable_lbxgui=auto])
 
-dnl Dirty hack to disable useless C++/Fortran checks
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [:])
+AS_CASE([$enable_lbxgui],
+  [no], [have_gtk=false],
+  [yes], [DX_LIB_GTK2([2.16], [have_gtk=true])],
+  [DX_LIB_GTK2([2.16], [have_gtk=true], [have_gtk=false])])
 
-AC_PROG_LIBTOOL
+AM_CONDITIONAL([BUILD_LBXGUI], [$have_gtk])
 
-# libpng
-PKG_CHECK(libpng, yes, [PNG], [libpng-config], [png.h], png,
-          png_create_write_struct, libpng, [http://www.libpng.org/])
-AC_SUBST(PNG_CFLAGS)
-AC_SUBST(PNG_LIBS)
+# Check for utilities used by the test suite.
+DX_PROG_MD5
 
-AM_CONDITIONAL([BUILD_LBXIMG], [test x"$have_libpng" = x"yes"])
+AC_CHECK_PROGS([PAMARITH], [pamarith], [false])
+AC_CHECK_PROGS([PAMCHANNEL], [pamchannel], [false])
+AC_SUBST([PAMCHANNEL])
+AC_SUBST([PAMARITH])
 
-AC_CONFIG_FILES([
-       Makefile
-       src/Makefile
-       doc/man/Makefile
-])
+AC_CONFIG_TESTDIR([.])
+DX_PROG_AUTOTEST
+AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
 
+AC_CONFIG_FILES([Makefile])
 AC_OUTPUT