augmenting: module-augment-properties copied from PA
[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_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([foreign 1.8.5 -Wall])
11
12
13 # this would not be really needed if everything would be as it should be
14 AS_IF([test x${exec_prefix} = xNONE], [LIBDIR=$ac_default_prefix/lib], [LIBDIR=${libdir}])
15 AC_SUBST(LIBDIR)
16
17 AC_SUBST(PA_MAJORMINOR, [PAVER])
18
19 AC_PROG_MKDIR_P
20 AC_PROG_CC
21 AC_PROG_CC_C99
22 AM_PROG_CC_C_O
23 AC_PROG_GCC_TRADITIONAL
24 AC_USE_SYSTEM_EXTENSIONS
25
26 AC_PATH_PROG([M4], [m4 gm4], [no])
27 if test "x$M4" = xno ; then
28    AC_MSG_ERROR([m4 missing])
29 fi
30
31 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
32
33 #dnl Compiler flags
34 #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"
35
36 #for flag in $DESIRED_FLAGS ; do
37 #  CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"])
38 #done
39
40 AC_LTDL_ENABLE_INSTALL
41 AC_LIBLTDL_INSTALLABLE
42 AC_LIBTOOL_DLOPEN
43 AC_LIBTOOL_WIN32_DLL
44 AC_PROG_LIBTOOL
45 AC_SUBST(LTDLINCL)
46 AC_SUBST(LIBLTDL)
47 AC_CONFIG_SUBDIRS(libltdl)
48
49 AC_HEADER_STDC
50 AC_C_CONST
51 AC_C_BIGENDIAN
52 AC_TYPE_PID_T
53 AC_TYPE_SIZE_T
54 AC_CHECK_TYPES(ssize_t, , [AC_DEFINE([ssize_t], [signed long],
55     [Define ssize_t if it is not done by the standard libs.])])
56 AC_TYPE_OFF_T
57 AC_TYPE_SIGNAL
58 AC_TYPE_UID_T
59 AC_CHECK_DECLS(environ)
60
61 AC_DEFINE_UNQUOTED(PA_CFLAGS,"$CFLAGS", [The CFLAGS used during compilation])
62
63 PKG_CHECK_MODULES(LIBPULSE, [libpulse])
64 AC_SUBST(LIBPULSE_CFLAGS)
65 AC_SUBST(LIBPULSE_LIBS)
66
67
68 PKG_CHECK_MODULES(PULSEDEVEL, [pulseaudio-module-devel])
69 AC_SUBST(PULSEDEVEL_CFLAGS)
70 AC_SUBST(PULSEDEVEL_LIBS)
71
72
73 # D-Bus
74 AC_ARG_WITH([dbus],
75             [ AS_HELP_STRING([--with-dbus],
76                              [Use D-Bus towards with Murphy and AudioManager])
77             ],
78             [ build_with_dbus="yes" ;
79               PKG_CHECK_MODULES(DBUS, [dbus-1])
80               AC_SUBST(DBUS_CFLAGS)
81               AC_SUBST(DBUS_LIBS)
82             ],
83             [ build_with_dbus="no" ]
84 )
85
86 AM_CONDITIONAL(BUILD_WITH_DBUS,  [ test "x$build_with_dbus" = "xyes" ])
87
88
89 # module directory
90 AC_ARG_WITH([module-dir],
91             [AS_HELP_STRING([--with-module-dir], [Directory where to install the modules to (defaults to ${LIBDIR}/pulse-${PA_MAJORMINOR}/modules/])],
92             [modlibexecdir=$withval],
93             [modlibexecdir=${LIBDIR}/pulse-${PA_MAJORMINOR}/modules]
94 )
95
96 AC_SUBST(modlibexecdir)
97
98
99 # documentation
100 AC_ARG_WITH([documentation],
101             [AS_HELP_STRING([--with-documentation],
102                             [generate pdf, html and other doc files])],
103             [],
104             [with_documentation=auto]
105 )
106
107 AS_IF( [ test x$with_documentation = xno ],
108        [ has_doc_tools="no" ],
109        [ AC_PATH_TOOL([PA_DOXYGEN], doxygen)
110          AC_PATH_TOOL([PA_LYX], lyx)
111          AC_PATH_TOOL([PA_INKSCAPE], inkscape)
112          AC_PATH_TOOL([PA_PYTHON], python)
113          AC_PATH_TOOL([PA_TOUCH], touch)
114          AC_PATH_TOOL([PA_DBLATEX], dblatex)
115          AC_PATH_TOOL([PA_XMLTO], xmlto)
116
117          AS_IF( [ test x$PA_DOXYGEN = x -o x$PA_LYX = x -o \
118                        x$PA_INKSCAPE = x -o x$PA_PYTHON = x -o \
119                        x$PA_TOUCH = x],
120                 [ has_doc_tools="no";
121                   AC_MSG_WARN([Some essential doc-tool is missing]) ],
122                 [ has_doc_tools="yes";
123                   PA_DOCINIT() ]
124          ) ]
125 )
126
127 AS_IF( [ test x$has_doc_tools == "xno" -o x$PA_DBLATEX = x ],
128        [ can_make_pdfs="no";
129          AC_WARN([No PDF documentation will be generated]) ],
130        [ can_make_pdfs="yes"]
131 )
132
133 AS_IF([ test x$has_doc_tools == "xno" -o x$PA_XMLTO = x ],
134       [ can_make_html="no";
135         AC_WARN([No HTML documentation will be generated]) ],
136       [ can_make_html="yes" ]
137 )
138
139
140 AM_CONDITIONAL(BUILD_DOCUMENTATION,  [ test x$has_doc_tools = "xyes" ])
141 AM_CONDITIONAL(BUILD_PDF_DOCUMENTS,  [ test x$can_make_pdfs = "xyes" ])
142 AM_CONDITIONAL(BUILD_HTML_DOCUMENTS, [ test x$can_make_html = "xyes" ])
143
144 AC_SUBST(PA_DOCDIR, [`pwd`/doc])
145 AC_SUBST(PA_FIGDIR, [$PA_DOCDIR/common/figures])
146 AC_SUBST(PA_MAKE_DOCRULES, [$PA_DOCDIR/Makefile.rules])
147 AC_SUBST(PA_DOCSCRIPT_DIR, [$PA_DOCDIR/scripts])
148 AC_SUBST(PA_DBLYXFIX, [$PA_DOCSCRIPT_DIR/dblyxfix.py])
149 AC_SUBST(PA_DOXML2DB, [$PA_DOCSCRIPT_DIR/doxml2db.py])
150 AC_SUBST(PA_DOXYDEPS, [$PA_DOCSCRIPT_DIR/doxydeps.py])
151
152
153 # Shave by default
154 SHAVE_INIT([build-aux], [enable])
155
156 AC_CONFIG_FILES([
157         build-aux/shave
158         build-aux/shave-libtool
159         Makefile
160         murphy/Makefile
161         combine/Makefile
162         augment/Makefile
163         doc/Makefile
164         doc/murphy-audio/Makefile
165         doc/murphy-audio/db/Makefile
166 ])
167 AC_OUTPUT
168
169 echo "
170  ---{ $PACKAGE_NAME $VERSION }---
171
172     prefix:               ${prefix}
173     sysconfdir:           ${sysconfdir}
174     localstatedir:        ${localstatedir}
175     modlibexecdir:        ${modlibexecdir}
176     Compiler:             ${CC}
177     CFLAGS:               ${CFLAGS}
178     LIBDIR:               ${LIBDIR}
179     LIBPULSE_CFLAGS:      ${LIBPULSE_CFLAGS}
180     LIBPULSE_LIBS:        ${LIBPULSE_LIBS}
181     LIBPULSECORE_CFLAGS:  ${LIBPULSECORE_CFLAGS}
182     LIBPULSECORE_LIBS:    ${LIBPULSECORE_LIBS}
183     MAJORMINOR:           ${PA_MAJORMINOR}
184     DBUS_CFLAGS:          ${DBUS_CFLAGS}
185     DBUS_LIBS:            ${DBUS_LIBS}
186 "