X-Git-Url: https://git.draconx.ca/gitweb/liblbx.git/blobdiff_plain/fba9c8ad290c71471cdb8b52d1c5f0e4eb1fb83e..e7aea0c6f323c6bbf364093305e60bb78999a23f:/configure.ac diff --git a/configure.ac b/configure.ac index 48c392c..9ba3d42 100644 --- a/configure.ac +++ b/configure.ac @@ -1,37 +1,62 @@ -AC_PREREQ(2.60) +dnl Copyright (C) 2009 Nick Bowler +dnl Copying and distribution of this file, with or without modification, +dnl are permitted in any medium without royalty provided the copyright +dnl notice and this notice are preserved. This file is offered as-is, +dnl without any warranty. + +AC_PREREQ([2.62]) AC_INIT([liblbx], [0.1], [toom-devel@lists.sourceforge.net]) AC_CONFIG_SRCDIR([src/lbx.c]) AC_CONFIG_HEADER([config.h]) +AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects]) +AM_SILENT_RULES([yes]) AC_PROG_CC_C99 -AC_HEADER_ASSERT -AC_C_BIGENDIAN +AM_PROG_CC_C_O +gl_EARLY -# pkg-config -PKG_INIT -if test x"$PKG_CONFIG" = x""; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -fi +AC_HEADER_ASSERT +LT_INIT +gl_INIT -dnl Dirty hack to disable useless C++/Fortran checks -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [:]) -AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [:]) +m4_include([lib/gnulib.mk]) -AC_PROG_LIBTOOL +PKG_PROG_PKG_CONFIG -# 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) +AC_ARG_ENABLE([lbximg], + [AS_HELP_STRING([--enable-lbximg], + [build the lbximg tool (requires libpng) [default=auto]])], + [enable_lbximg=$enableval], + [enable_lbximg=auto]) +have_libpng=no +if test x"$enable_lbximg" = x"auto"; then +DX_CHECK_LIBPNG([1.5], [have_libpng=yes], [have_libpng=no]) +fi +if test x"$enable_lbximg" = x"yes"; then +DX_CHECK_LIBPNG([1.5], [have_libpng=yes]) +fi AM_CONDITIONAL([BUILD_LBXIMG], [test x"$have_libpng" = x"yes"]) +AC_ARG_ENABLE([lbxgui], + [AS_HELP_STRING([--enable-lbxgui], + [build the lbxgui tool (requires GTK+) [default=auto]])], + [enable_lbxgui=$enableval], + [enable_lbxgui=auto]) + +have_gtk=no +if test x"$enable_lbxgui" = x"auto"; then +DX_CHECK_GTK2([2.16], [have_gtk=yes], [have_gtk=no]) +fi +if test x"$enable_lbxgui" = x"yes"; then +DX_CHECK_GTK2([2.16], [have_gtk=yes]) +fi +AM_CONDITIONAL([BUILD_LBXGUI], [test x"$have_gtk" = x"yes"]) + AC_CONFIG_FILES([ Makefile - src/Makefile ]) AC_OUTPUT