1AC_INIT("","",[echo.choi@intel.com])
2
3AC_CONFIG_MACRO_DIR(m4)
4
5AS_MIX_VERSION(mixaudio, MIXAUDIO, 0, 3, 5)
6
7dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode
8AM_MAINTAINER_MODE
9
10AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
11
12MIXAUDIO_PKG_DEPS="glib-2.0, gobject-2.0, gthread-2.0 mixcommon"
13AC_SUBST(MIXAUDIO_PKG_DEPS)
14
15dnl make aclocal work in maintainer mode
16AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
17
18AM_CONFIG_HEADER(config.h)
19
20dnl check for tools
21AC_PROG_CC_C_O
22AC_PROG_CC
23AC_PROG_LIBTOOL
24
25MIX_CFLAGS="-Wall -Werror -O"
26
27AC_ARG_ENABLE([lpestub],
28    [  --enable-lpestub    Stub LPE methods],
29    [case "${enableval}" in
30      yes) lpestub=true ;;
31      no)  lpestub=false ;;
32      *) AC_MSG_ERROR([bad value ${enableval} for --enable-lpestub]) ;;
33    esac],[lpestub=false])
34
35AM_CONDITIONAL([LPESTUB], [test x$lpestub = xtrue])
36
37AC_ARG_ENABLE([workaround],
38    [  --enable-workaround    Enable workaround for LPE DROP],
39    [case "${enableval}" in
40      yes) workaround=true ;;
41      no)  workaround=false ;;
42      *) AC_MSG_ERROR([bad value ${enableval} for --enable-workaround]) ;;
43    esac],[workaround=false])
44
45AM_CONDITIONAL([WORKAROUND], [test x$workaround = xtrue])
46
47AC_ARG_ENABLE([audiomanager],
48    [  --enable-audiomanager    Audio Manager methods(default=enable)],
49    [case "${enableval}" in
50      yes) audiomanager=true ;;
51      no)  audiomanager=false ;;
52      *) AC_MSG_ERROR([bad value ${enableval} for --enable-audiomanager]) ;;
53    esac],[audiomanager=true])
54
55AM_CONDITIONAL([AUDIO_MANAGER], [test x$audiomanager = xtrue])
56
57dnl decide on error flags
58dnl AS_COMPILER_FLAG(-Wall, MIX_ERROR="$MIX_ERROR -Wall", MIX_ERROR="$MIX_ERROR")
59dnl AS_COMPILER_FLAG(-Werror,MIX_ERROR="$MIX_ERROR -Werror",MIX_ERROR="$MIX_ERROR")
60
61dnl Check for pkgconfig first
62AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
63
64dnl Give error and exit if we don't have pkgconfig
65if test "x$HAVE_PKGCONFIG" = "xno"; then
66  AC_MSG_ERROR(you need to have pkgconfig installed !)
67fi
68
69dnl GLib
70dnl FIXME: need to align with moblin glib version
71dnl FIXME: currently using an earlier version so it can be built on dev box.
72GLIB_REQ=2.18
73
74dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
75dnl PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB_REQ,HAVE_GLIB=yes,HAVE_GLIB=no)
76PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQ,HAVE_GLIB=yes,HAVE_GLIB=no)
77if test "x$HAVE_GLIB" = "xno"; then
78  AC_MSG_ERROR(You need glib development packages installed !)
79fi
80
81PKG_CHECK_MODULES(GOBJECT, gobject-2.0 >= $GLIB_REQ,HAVE_GOBJECT=yes,HAVE_GOBJECT=no)
82if test "x$HAVE_GOBJECT" = "xno"; then
83  AC_MSG_ERROR(You need glib development packages installed !)
84fi
85
86PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GLIB_REQ,HAVE_GTHREAD=yes,HAVE_GTHREAD=no)
87if test "x$HAVE_GTRHEAD" = "xno"; then
88  AC_MSG_ERROR(You need glib development packages installed !)
89fi
90
91MIXCOMMON_REQUIRED=0.1.6
92PKG_CHECK_MODULES(MIXCOMMON, mixcommon >= $MIXCOMMON_REQUIRED , HAVE_MIXCOMMON=yes, HAVE_MIXCOMMON=no)
93if test "x$HAVE_MIXCOMMON" = "xno"; then
94  AC_MSG_ERROR(You need mixcommon development package $MIXCOMMON_REQUIRED installed !)
95fi
96
97if test "x$audiomanager" = "xtrue"; then
98  PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1)
99fi
100
101dnl Check for documentation xrefs
102dnl GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
103dnl AC_SUBST(GLIB_PREFIX)
104
105AC_SUBST(GLIB_CFLAGS)
106AC_SUBST(GLIB_LIBS)
107AC_SUBST(GOBJECT_CFLAGS)
108AC_SUBST(GOBJECT_LIBS)
109AC_SUBST(MIX_CFLAGS)
110AC_SUBST(GTHREAD_CFLAGS)
111AC_SUBST(GTHREAD_LIBS)
112AC_SUBST(MIXCOMMON_CFLAGS)
113AC_SUBST(MIXCOMMON_LIBS)
114
115dnl check for gtk-doc
116dnl GTK_DOC_CHECK(1.9)
117
118AC_CONFIG_FILES(
119Makefile
120src/Makefile
121tests/Makefile
122tests/smoke/Makefile
123pkgconfig/Makefile
124pkgconfig/mixaudio.pc
125)
126
127dnl Additional Makefiles if we are building document with gtkdoc.
128dnl Un-comment this section to enable building of documentation.
129dnl AC_CONFIG_FILES(
130dnl docs/Makefile
131dnl docs/reference/Makefile
132dnl docs/reference/MixAudio/Makefile
133dnl )
134
135AC_OUTPUT
136
137
138