aboutsummaryrefslogtreecommitdiffstats
path: root/fsoaudiod/configure.ac
blob: 37192644f692a2b2e65113d0d0c009192dbcf7b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
m4_define([fsoaudiod_released], [0])
m4_define([fsoaudiod_base_version], [0.11.0])
m4_define([fsoaudiod_maybe_gitrev], m4_if(fsoaudiod_released, [1], [], [m4_esyscmd([git show-ref --hash=5 HEAD | tr -d '\n\r'])]))
m4_define([fsoaudiod_version], m4_if(fsoaudiod_released, [1], [fsoaudiod_base_version], [fsoaudiod_base_version-fsoaudiod_maybe_gitrev]))

AC_INIT([fsoaudiod], fsoaudiod_version, [smartphones-userland@linuxtogo.org], [fsoaudiod])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip tar-ustar])
AM_MAINTAINER_MODE([enable])

AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CC_C99
AC_GNU_SOURCE
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
PKG_PROG_PKG_CONFIG([0.21])

AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

#########################################################################################
# Vala building options -- allows tarball builds without installing vala
#########################################################################################

VALA_REQUIRED=0.14.2

AC_ARG_ENABLE([vala], AS_HELP_STRING([--enable-vala],[Enable building from Vala sources]),
              [enable_vala=$enableval], [enable_vala=no])

# Force Vala for non-release builds
m4_if(fsosystem_released, [1], [],
      [
        enable_vala=yes
        echo "Vala compiler required for non-release builds; requiring Vala..."
      ])

if test "x$enable_vala" = "xyes" ; then
    AM_PROG_VALAC([$VALA_REQUIRED])
    if test "x$VALAC" = "x" ; then
        AC_MSG_ERROR([Vala requested but valac is not installed])
    fi
fi

AM_CONDITIONAL([HAVE_VALA], [test "x$enable_vala" = "xyes"])

#########################################################################################
# Check for various dependencies
#########################################################################################

GLIB_REQUIRED=2.26.0
GEE_REQUIRED=0.5.0
FSO_GLIB_REQUIRED=2012.04.18.1
FSO_REQUIRED=0.10.0
ALSA_REQUIRED=0.20
CMTSPEECHDATA_REQUIRED=2.1.1

PKG_CHECK_MODULES(GLIB,
  glib-2.0 >= $GLIB_REQUIRED
  gobject-2.0 >= $GLIB_REQUIRED
  gio-2.0 >= $GLIB_REQUIRED)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

PKG_CHECK_MODULES(GEE,
  gee-1.0 >= $GEE_REQUIRED)
AC_SUBST(GEE_CFLAGS)
AC_SUBST(GEE_LIBS)

PKG_CHECK_MODULES(ALSA,
  alsa >= $ALSA_REQUIRED)
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)

PKG_CHECK_MODULES(FSO,
  fsoframework-2.0 >= $FSO_REQUIRED
  fso-glib-1.0 >= $FSO_GLIB_REQUIRED)
AC_SUBST(FSO_CFLAGS)
AC_SUBST(FSO_LIBS)

#########################################################################################
# dbus conf directory
#########################################################################################

AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH], [path to D-Bus config directory]),
			[path_dbusconf=${withval}], [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])

if (test -z "${path_dbusconf}"); then
  DBUS_DIR="${sysconfdir}/dbus-1"
else
  DBUS_DIR="${path_dbusconf}/dbus-1"
fi
AC_SUBST(DBUS_DIR)

#########################################################################################
# dbus service directory
#########################################################################################

AC_ARG_WITH(dbusservicedir, AC_HELP_STRING([--with-dbusdatadir=PATH], [path to D-Bus data directory]),
			[path_dbusdata=${withval}], [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])

if (test -z "${path_dbusdata}"); then
	DBUS_SERVICE_DIR="${datadir}/dbus-1/system-services"
else
	DBUS_SERVICE_DIR="${path_dbusdata}/dbus-1/system-services"
fi
AC_SUBST(DBUS_SERVICE_DIR)

#########################################################################################
# optional feature: GSM voice call audio using libcmtspeechdata
#########################################################################################

AC_ARG_ENABLE(cmtspeechdata,
  [  --enable-cmtspeechdata  Enable building the gsm voicecall plugin using libcmtspeechdata (default=disabled)],
  [cmtspeechdata=$enableval],
  [cmtspeechdata="no"])

if test x$cmtspeechdata = "xyes"; then
    PKG_CHECK_MODULES(CMTSPEECHDATA,
      libcmtspeechdata >= $CMTSPEECHDATA_REQUIRED)
AC_SUBST(CMTSPEECHDATA_CFLAGS)
AC_SUBST(CMTSPEECHDATA_LIBS)

fi
AM_CONDITIONAL( [WANT_CMTSPEECHDATA], [test x"$cmtspeechdata" = x"yes"])

#########################################################################################
# optional feature: GSM voice call audio forwarding using libsamplerate
#########################################################################################

AC_ARG_ENABLE(samplerate,
  [  --enable-samplerate  Enable building the gsm voicecall plugin using libsamplerate (default=disabled)],
  [samplerate=$enableval],
  [samplerate="no"])

if test x$samplerate = "xyes"; then
    PKG_CHECK_MODULES(SAMPLERATE,
      [samplerate])
AC_SUBST(SAMPLERATE_CFLAGS)
AC_SUBST(SAMPLERATE_LIBS)

fi
AM_CONDITIONAL( [WANT_SAMPLERATE], [test x"$samplerate" = x"yes"])

#########################################################################################
# data files
#########################################################################################

AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
			[don't install configuration and data files]),
					[enable_datafiles=${enableval}])
AM_CONDITIONAL(WANT_DATAFILES, test "${enable_datafiles}" != "no")

#########################################################################################
# check for debugging
#########################################################################################

AC_ARG_ENABLE(debug,
  [  --enable-debug            Enable debug build (default=disabled)],
  [enable_debug=$enableval],
  [enable_debug="no"])
AM_CONDITIONAL( [WANT_DEBUG], [test x"$enable_debug" = x"yes"])

#########################################################################################
# datadir
#########################################################################################

if test "x$prefix" != "xNONE"; then
  pkgdatadir='${prefix}/share/fsoaudiod'
else
  pkgdatadir='/usr/local/share/fsoaudiod'
fi
eval PACKAGE_DATADIR="${pkgdatadir}"
AC_DEFINE_UNQUOTED([PACKAGE_DATADIR], ["${PACKAGE_DATADIR}"], [Shared data directory])

#########################################################################################
# output
#########################################################################################

AC_CONFIG_FILES([
  Makefile
  conf/Makefile
  conf/default/Makefile
  conf/palm_pre/Makefile
  conf/palm_pre/audio-scripts/Makefile
  conf/nokia_n900/Makefile
  conf/openmoko_gta/Makefile
  conf/herring/Makefile
  conf/herring/alsa-default/Makefile
  conf/GTA04/Makefile
  data/Makefile
  data/org.freesmartphone.oaudiod.service
  vapi/Makefile
  src/Makefile
  src/lib/Makefile
  src/bin/Makefile
  src/alsa_hooks/Makefile
  src/alsa_hooks/session/Makefile
  src/plugins/Makefile
  src/plugins/gsmvoice_alsa_cmtspeechdata/Makefile
  src/plugins/gsmvoice_alsa_forwarder/Makefile
  src/plugins/manager/Makefile
  src/plugins/router_palmpre/Makefile
  src/plugins/router_alsa/Makefile
  src/plugins/streamcontrol_alsa/Makefile
  src/plugins/sessionpolicy_default/Makefile
  src/plugins/system_integration/Makefile
])
AC_OUTPUT

#########################################################################################
# info
#########################################################################################

echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE_NAME $PACKAGE_VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options:"
echo
echo "  gsmvoice_alsa_cmtspeechdata:.........: $cmtspeechdata"
echo
echo "  gsmvoice_alsa_forwarder:.............: $samplerate"
echo
echo "  Vala.................................: $enable_vala"
echo
echo "  Vala Compiler........................: ${VALAC}"
echo
echo "  debug build..........................: $enable_debug"
echo
echo "  prefix...............................: $prefix"
echo
echo "------------------------------------------------------------------------"
echo
echo "Now type 'make' to compile and 'make install' to install this package."