]> git.draconx.ca Git - upkg.git/blob - configure.ac
Implement support for libmodplug in Engine.Music.
[upkg.git] / configure.ac
1 AC_PREREQ(2.62)
2 AC_INIT([upkg],[0.1],[nbowler@draconx.ca])
3 AC_CONFIG_SRCDIR([src/libupkg.c])
4 AC_CONFIG_HEADER([config.h])
5 AC_CONFIG_MACRO_DIR([m4])
6
7 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
8
9 AC_PROG_CC_C99
10 gl_EARLY
11
12 LT_CONFIG_LTDL_DIR([libltdl])
13 LT_INIT([dlopen])
14 LTDL_INIT([recursive])
15
16 AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x])
17
18 gl_INIT
19
20 AC_ARG_WITH([gobject],
21         [AS_HELP_STRING([--with-gobject],
22                 [build tools requiring libgobject [default=yes]]
23         )],
24         [],
25         [with_gobject=yes])
26
27 have_gobject=no
28 if test x$with_gobject = xyes; then
29 AM_PATH_GLIB_2_0(, [have_gobject=yes], [have_gobject=no], [gobject])
30 fi
31
32 AC_ARG_WITH([modlib],
33         [AS_HELP_STRING([--with-modlib],
34                 [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
35         )],
36         [with_modlib=$withval],
37         [with_modlib=auto])
38
39 CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
40 AC_MSG_CHECKING([which module library to use])
41 case $with_modlib in
42 none)
43         use_modlib=none
44 ;;
45 no)
46         use_modlib=none
47 ;;
48 modplug)
49         if test x$have_libmodplug = xyes; then
50                 use_modlib=modplug
51         else
52                 use_modlib=none
53         fi
54 ;;
55 auto)
56         if test x$have_libmodplug = xyes; then
57                 use_modlib=modplug
58         else
59                 use_modlib=none
60         fi
61 ;;
62 *)
63         AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])
64 ;;
65 esac
66 AC_MSG_RESULT([$use_modlib])
67
68 AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
69 AM_CONDITIONAL([USE_DUMMYMOD],   [test x$use_modlib = xnone])
70
71 AM_CONDITIONAL([BUILD_UPKG], [test x$have_gobject = xyes])
72
73 AC_CONFIG_FILES([
74         Makefile
75         libltdl/Makefile
76         lib/Makefile
77         src/Makefile
78 ])
79 AC_OUTPUT