]> git.draconx.ca Git - upkg.git/blob - configure.ac
configure: Implement glib checking macro that actually links a test program.
[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 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9
10 AC_PROG_CC_C99
11 gl_EARLY
12
13 LT_CONFIG_LTDL_DIR([libltdl])
14 LT_INIT([dlopen])
15 LTDL_INIT([recursive])
16
17 AM_CONDITIONAL([BUNDLED_LIBLTDL], [test x$LTDLDEPS != x])
18
19 gl_INIT
20
21 CHECK_GLIB_2([],[gobject], [have_gobject=yes], [have_gobject=no])
22 AM_CONDITIONAL([BUILD_UPKG], [test x$have_gobject = xyes])
23
24 AC_ARG_WITH([modlib],
25         [AS_HELP_STRING([--with-modlib],
26                 [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
27         )],
28         [with_modlib=$withval],
29         [with_modlib=auto])
30
31 CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
32 AC_MSG_CHECKING([which module library to use])
33 case $with_modlib in
34 none)
35         use_modlib=none
36 ;;
37 no)
38         use_modlib=none
39 ;;
40 modplug)
41         if test x$have_libmodplug = xyes; then
42                 use_modlib=modplug
43         else
44                 use_modlib=none
45         fi
46 ;;
47 auto)
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_RESULT([$use_modlib])
59
60 AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
61 AM_CONDITIONAL([USE_DUMMYMOD],   [test x$use_modlib = xnone])
62
63 AC_CONFIG_FILES([
64         Makefile
65         libltdl/Makefile
66         lib/Makefile
67         src/Makefile
68 ])
69 AC_OUTPUT