pump up version number and update changelog
[profile/ivi/pulseaudio-module-murphy-ivi.git] / configure.ac
1 m4_define(FULL_PAVER, esyscmd(/usr/bin/pkg-config --silence-errors --modversion pulsecore | tr -d \\n))
2 m4_define(PAVER, regexp(FULL_PAVER, [\([0123456789.]+\).*], [\1]))
3
4 AC_PREREQ(2.61)
5
6 AC_INIT([pulseaudio-murphy-ivi],[PAVER],[janos.kovacs@intel.com])
7
8 AC_CONFIG_SRCDIR([murphy/module-murphy-ivi.c])
9 AC_CONFIG_HEADER([foo.h])
10 AC_CONFIG_MACRO_DIR([m4])
11 AM_INIT_AUTOMAKE([foreign 1.8.5 -Wall])
12
13
14 # this would not be really needed if everything would be as it should be
15 AS_IF([test x${exec_prefix} = xNONE], [LIBDIR=$ac_default_prefix/lib], [LIBDIR=${libdir}])
16 AC_SUBST(LIBDIR)
17
18 AC_SUBST(PA_MAJORMINOR, [PAVER])
19
20 AC_PROG_MKDIR_P
21 AC_PROG_CC
22 AC_PROG_CC_C99
23 AM_PROG_CC_C_O
24 AC_PROG_GCC_TRADITIONAL
25 AC_USE_SYSTEM_EXTENSIONS
26
27 AC_PATH_PROG([M4], [m4 gm4], [no])
28 if test "x$M4" = xno ; then
29    AC_MSG_ERROR([m4 missing])
30 fi
31
32 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
33
34 #dnl Compiler flags
35 #DESIRED_FLAGS="-Wall -W -Wextra -pedantic -pipe -Wno-long-long -Wvla -Wno-overlength-strings -Wconversion -Wundef -Wformat -Wlogical-op -Wpacked -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wdeclaration-after-statement -Wfloat-equal -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-unused-parameter -ffast-math"
36
37 #for flag in $DESIRED_FLAGS ; do
38 #  CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"])
39 #done
40
41 AC_LTDL_ENABLE_INSTALL
42 AC_LIBLTDL_INSTALLABLE
43 AC_LIBTOOL_DLOPEN
44 AC_LIBTOOL_WIN32_DLL
45 AC_PROG_LIBTOOL
46 AC_SUBST(LTDLINCL)
47 AC_SUBST(LIBLTDL)
48 AC_CONFIG_SUBDIRS(libltdl)
49
50 AC_HEADER_STDC
51 AC_C_CONST
52 AC_C_BIGENDIAN
53 AC_TYPE_PID_T
54 AC_TYPE_SIZE_T
55 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
56     [Define ssize_t if it is not done by the standard libs.])])
57 AC_TYPE_OFF_T
58 AC_TYPE_SIGNAL
59 AC_TYPE_UID_T
60 AC_CHECK_DECLS(environ)
61
62 AC_DEFINE_UNQUOTED(PA_CFLAGS,"$CFLAGS", [The CFLAGS used during compilation])
63
64 PKG_CHECK_MODULES(LIBPULSE, [libpulse])
65 AC_SUBST(LIBPULSE_CFLAGS)
66 AC_SUBST(LIBPULSE_LIBS)
67
68
69 PKG_CHECK_MODULES(PULSEDEVEL, [pulseaudio-module-devel])
70 AC_SUBST(PULSEDEVEL_CFLAGS)
71 AC_SUBST(PULSEDEVEL_LIBS)
72
73 PKG_CHECK_MODULES(MURPHYCOMMON, [murphy-common])
74 AC_SUBST(MURPHYCOMMON_CFLAGS)
75 AC_SUBST(MURPHYCOMMON_LIBS)
76
77 PKG_CHECK_MODULES(LUAUTILS, [murphy-lua-utils])
78 AC_SUBST(LUAUTILS_CFLAGS)
79 AC_SUBST(LUAUTILS_LIBS)
80
81
82 PKG_CHECK_MODULES(LUA, lua >= 5.1.1)
83 AC_SUBST(LUA_CFLAGS)
84 AC_SUBST(LUA_LIBS)
85
86 PKG_CHECK_MODULES(AUL, aul, [have_aul=yes], [have_aul=no])
87 if test "$have_aul" = "no" -a "$enable_aul" = "yes"; then
88    AC_MSG_ERROR([AUL development headers not found.])
89 fi
90 AC_SUBST(AUL_CFLAGS)
91 AC_SUBST(AUL_LIBS)
92
93 AM_CONDITIONAL(HAVE_AUL,  [ test x$have_aul = "xyes" ])
94
95 # D-Bus
96 AC_ARG_WITH([dbus],
97             [ AS_HELP_STRING([--with-dbus],
98                              [Use D-Bus towards with Murphy and AudioManager])
99             ],
100             [ build_with_dbus="yes" ;
101               PKG_CHECK_MODULES(DBUS, [dbus-1])
102               AC_SUBST(DBUS_CFLAGS)
103               AC_SUBST(DBUS_LIBS)
104             ],
105             [ build_with_dbus="no" ]
106 )
107
108 AM_CONDITIONAL(BUILD_WITH_DBUS,  [ test "x$build_with_dbus" = "xyes" ])
109
110 # murphy interface
111 AC_ARG_WITH([murphyif],
112             [ AS_HELP_STRING([--with-murphyif],
113                              [Enable murphy domain-controller interface])
114             ],
115             [ build_with_murphyif="yes" ;
116               PKG_CHECK_MODULES(MURPHYIF,
117                                 [murphy-domain-controller murphy-pulse])
118               AC_SUBST(MURPHYIF_CFLAGS)
119               AC_SUBST(MURPHYIF_LIBS)
120               AC_DEFINE([WITH_MURPHYIF], 1, [Enable Murphy interface ?])
121             ],
122             [ build_with_murphyif="no" ]
123 )
124
125 AM_CONDITIONAL(BUILD_WITH_MURPHYIF,  [ test "x$build_with_murphyif" = "xyes" ])
126
127
128
129 PKG_CHECK_MODULES(MURPHYDOMCTL, [murphy-domain-controller murphy-pulse])
130 AC_SUBST(MURPHYDOMCTL_CFLAGS)
131 AC_SUBST(MURPHYDOMCTL_LIBS)
132
133
134
135
136 # module directory
137 AC_ARG_WITH([module-dir],
138             [AS_HELP_STRING([--with-module-dir], [Directory where to install the modules to (defaults to ${LIBDIR}/pulse-${PA_MAJORMINOR}/modules/])],
139             [modlibexecdir=$withval],
140             [modlibexecdir=${LIBDIR}/pulse-${PA_MAJORMINOR}/modules]
141 )
142
143 AC_SUBST(modlibexecdir)
144
145
146 # documentation
147 AC_ARG_WITH([documentation],
148             [AS_HELP_STRING([--with-documentation],
149                             [generate pdf, html and other doc files])],
150             [],
151             [with_documentation=auto]
152 )
153
154 AS_IF( [ test x$with_documentation = xno ],
155        [ has_doc_tools="no" ],
156        [ AC_PATH_TOOL([PA_DOXYGEN], doxygen)
157          AC_PATH_TOOL([PA_LYX], lyx)
158          AC_PATH_TOOL([PA_INKSCAPE], inkscape)
159          AC_PATH_TOOL([PA_PYTHON], python)
160          AC_PATH_TOOL([PA_TOUCH], touch)
161          AC_PATH_TOOL([PA_DBLATEX], dblatex)
162          AC_PATH_TOOL([PA_XMLTO], xmlto)
163
164          AS_IF( [ test x$PA_DOXYGEN = x -o x$PA_LYX = x -o \
165                        x$PA_INKSCAPE = x -o x$PA_PYTHON = x -o \
166                        x$PA_TOUCH = x],
167                 [ has_doc_tools="no";
168                   AC_MSG_WARN([Some essential doc-tool is missing]) ],
169                 [ has_doc_tools="yes";
170                   PA_DOCINIT() ]
171          ) ]
172 )
173
174 AS_IF( [ test x$has_doc_tools == "xno" -o x$PA_DBLATEX = x ],
175        [ can_make_pdfs="no";
176          AC_WARN([No PDF documentation will be generated]) ],
177        [ can_make_pdfs="yes"]
178 )
179
180 AS_IF([ test x$has_doc_tools == "xno" -o x$PA_XMLTO = x ],
181       [ can_make_html="no";
182         AC_WARN([No HTML documentation will be generated]) ],
183       [ can_make_html="yes" ]
184 )
185
186
187 AM_CONDITIONAL(BUILD_DOCUMENTATION,  [ test x$has_doc_tools = "xyes" ])
188 AM_CONDITIONAL(BUILD_PDF_DOCUMENTS,  [ test x$can_make_pdfs = "xyes" ])
189 AM_CONDITIONAL(BUILD_HTML_DOCUMENTS, [ test x$can_make_html = "xyes" ])
190
191 AC_SUBST(PA_DOCDIR, [`pwd`/doc])
192 AC_SUBST(PA_FIGDIR, [$PA_DOCDIR/common/figures])
193 AC_SUBST(PA_MAKE_DOCRULES, [$PA_DOCDIR/Makefile.rules])
194 AC_SUBST(PA_DOCSCRIPT_DIR, [$PA_DOCDIR/scripts])
195 AC_SUBST(PA_DBLYXFIX, [$PA_DOCSCRIPT_DIR/dblyxfix.py])
196 AC_SUBST(PA_DOXML2DB, [$PA_DOCSCRIPT_DIR/doxml2db.py])
197 AC_SUBST(PA_DOXYDEPS, [$PA_DOCSCRIPT_DIR/doxydeps.py])
198
199
200 # Shave by default
201 SHAVE_INIT([build-aux], [enable])
202
203 AC_CONFIG_FILES([
204         build-aux/shave
205         build-aux/shave-libtool
206         Makefile
207         murphy/Makefile
208         combine/Makefile
209         augment/Makefile
210         doc/Makefile
211         doc/murphy-audio/Makefile
212         doc/murphy-audio/db/Makefile
213 ])
214 AC_OUTPUT
215
216 echo "
217  ---{ $PACKAGE_NAME $VERSION }---
218
219     prefix:               ${prefix}
220     sysconfdir:           ${sysconfdir}
221     localstatedir:        ${localstatedir}
222     modlibexecdir:        ${modlibexecdir}
223     Compiler:             ${CC}
224     CFLAGS:               ${CFLAGS}
225     LIBDIR:               ${LIBDIR}
226     LIBPULSE_CFLAGS:      ${LIBPULSE_CFLAGS}
227     LIBPULSE_LIBS:        ${LIBPULSE_LIBS}
228     LIBPULSECORE_CFLAGS:  ${LIBPULSECORE_CFLAGS}
229     LIBPULSECORE_LIBS:    ${LIBPULSECORE_LIBS}
230     PULSEDEVEL_CFLAGS     ${PULSEDEVEL_CFLAGS}
231     PULSEDEVEL_LIBS       ${PULSEDEVEL_LIBS}
232     MAJORMINOR:           ${PA_MAJORMINOR}
233     DBUS_CFLAGS:          ${DBUS_CFLAGS}
234     DBUS_LIBS:            ${DBUS_LIBS}
235     MURPHYCOMMON_CFLAGS   ${MURPHYCOMMON_CFLAGS}
236     MURPHYCOMMON_LIBS     ${MURPHYCOMMON_LIBS}
237     LUAUTILS_CFLAGS       ${LUAUTILS_CFLAGS}
238     LUAUTILS_LIBS         ${LUAUTILS_LIBS}
239     LUAUTILS_CFLAGS       ${LUAUTILS_CFLAGS}
240     LUAUTILS_LIBS         ${LUAUTILS_LIBS}
241     LUA_CFLAGS:           ${LUA_CFLAGS}
242     LUA_LIBS:             ${LUA_LIBS}
243     AUL_CFLAGS            ${AUL_CFLAGS}
244     AUL_LIBS              ${AUL_LIBS}
245     murphyif enabled:     $build_with_murphyif
246     MURPHYIF_CFLAGS       ${MURPHYIF_CFLAGS}
247     MURPHYIF_LIBS         ${MURPHYIF_LIBS}
248 "