libupkg: Make decodeindex test accept an empty string.
[upkg.git] / configure.ac
1 dnl Copyright © 2009-2011 Nick Bowler
2 dnl
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
6
7 AC_PREREQ(2.62)
8 AC_INIT([upkg],[0.1],[nbowler@draconx.ca])
9 AC_CONFIG_SRCDIR([src/libupkg.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 LT_CONFIG_LTDL_DIR([libltdl])
20 LT_INIT([dlopen])
21 LTDL_INIT([nonrecursive])
22
23 AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x])
24
25 gl_INIT
26
27 m4_include([lib/gnulib.mk])
28
29 CHECK_GLIB_2([], [gobject])
30
31 AC_ARG_WITH([modlib],
32         [AS_HELP_STRING([--with-modlib],
33                 [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
34         )],
35         [with_modlib=$withval],
36         [with_modlib=auto])
37
38 case $with_modlib in
39 no|none)
40         use_modlib=none
41 ;;
42 modplug)
43         DX_CHECK_LIBMODPLUG([use_modlib=modplug], [])
44 ;;
45 auto)
46         DX_CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
47
48         if test x$have_libmodplug = xyes; then
49                 use_modlib=modplug
50         else
51                 use_modlib=none
52         fi
53 ;;
54 *)
55         AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])
56 ;;
57 esac
58 AC_MSG_CHECKING([which module library to use])
59 AC_MSG_RESULT([$use_modlib])
60
61 AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
62 AM_CONDITIONAL([USE_DUMMYMOD],   [test x$use_modlib = xnone])
63
64 GOB2_CHECK([2.0.0])
65
66 AC_CONFIG_FILES([
67         Makefile
68         libuobject.pc
69 ])
70 AC_OUTPUT