]> git.draconx.ca Git - upkg.git/blob - configure.ac
42594de730addfda86b819a926ef11e4cbbc2f3e
[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 AC_ARG_WITH([gobject],
22         [AS_HELP_STRING([--with-gobject],
23                 [build tools requiring libgobject [default=yes]]
24         )],
25         [],
26         [with_gobject=yes])
27
28 have_gobject=no
29 if test x$with_gobject = xyes; then
30 AM_PATH_GLIB_2_0(, [have_gobject=yes], [have_gobject=no], [gobject])
31 fi
32
33 AC_ARG_WITH([modlib],
34         [AS_HELP_STRING([--with-modlib],
35                 [specify which module decoding library to use - one of modplug, none or auto. [default=auto]]
36         )],
37         [with_modlib=$withval],
38         [with_modlib=auto])
39
40 CHECK_LIBMODPLUG([have_libmodplug=yes], [have_libmodplug=no])
41 AC_MSG_CHECKING([which module library to use])
42 case $with_modlib in
43 none)
44         use_modlib=none
45 ;;
46 no)
47         use_modlib=none
48 ;;
49 modplug)
50         if test x$have_libmodplug = xyes; then
51                 use_modlib=modplug
52         else
53                 use_modlib=none
54         fi
55 ;;
56 auto)
57         if test x$have_libmodplug = xyes; then
58                 use_modlib=modplug
59         else
60                 use_modlib=none
61         fi
62 ;;
63 *)
64         AC_MSG_ERROR([Invalid argument to --with-modlib: $with_modlib])
65 ;;
66 esac
67 AC_MSG_RESULT([$use_modlib])
68
69 AM_CONDITIONAL([USE_LIBMODPLUG], [test x$use_modlib = xmodplug])
70 AM_CONDITIONAL([USE_DUMMYMOD],   [test x$use_modlib = xnone])
71
72 AM_CONDITIONAL([BUILD_UPKG], [test x$have_gobject = xyes])
73
74 AC_CONFIG_FILES([
75         Makefile
76         libltdl/Makefile
77         lib/Makefile
78         src/Makefile
79 ])
80 AC_OUTPUT