]> git.draconx.ca Git - liblbx.git/blob - configure.ac
build: Split out core logic from libpng detection.
[liblbx.git] / configure.ac
1 dnl Copyright (C) 2009 Nick Bowler
2 dnl Copying and distribution of this file, with or without modification,
3 dnl are permitted in any medium without royalty provided the copyright
4 dnl notice and this notice are preserved.  This file is offered as-is,
5 dnl without any warranty.
6
7 AC_PREREQ([2.62])
8 AC_INIT([liblbx], [0.1], [toom-devel@lists.sourceforge.net])
9 AC_CONFIG_SRCDIR([src/lbx.c])
10 AC_CONFIG_HEADER([config.h])
11 AC_CONFIG_MACRO_DIR([m4])
12
13 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
14 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
15
16 AC_PROG_CC_C99
17 gl_EARLY
18
19 AC_HEADER_ASSERT
20 LT_INIT
21 gl_INIT
22 PKG_PROG_PKG_CONFIG
23
24 AC_ARG_ENABLE([lbximg],
25         [AS_HELP_STRING([--enable-lbximg],
26                 [build the lbximg tool (requires libpng) [default=auto]])],
27         [enable_lbximg=$enableval],
28         [enable_lbximg=auto])
29
30 have_libpng=no
31 if test x"$enable_lbximg" = x"auto"; then
32 DX_CHECK_LIBPNG([1.2], [have_libpng=yes], [have_libpng=no])
33 fi
34 if test x"$enable_lbximg" = x"yes"; then
35 DX_CHECK_LIBPNG([1.2], [have_libpng=yes])
36 fi
37 AM_CONDITIONAL([BUILD_LBXIMG], [test x"$have_libpng" = x"yes"])
38
39 # A horrible combination of bugs makes this necessary for GTK+ detection.
40 unset POSIXLY_CORRECT
41
42 AM_PATH_GTK_2_0([2.16.0], [have_gtk=yes], [have_gtk=no])
43 AM_CONDITIONAL([BUILD_LBXGUI], [test x"$have_gtk" = x"yes"])
44
45 AC_CONFIG_FILES([
46         Makefile
47         lib/Makefile
48 ])
49
50 AC_OUTPUT