22
20
# along with PulseAudio; if not, write to the Free Software Foundation,
23
21
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
25
m4_define(PA_MAJOR, [0])
28
26
m4_define(PA_MINOR, [9])
29
m4_define(PA_MICRO, [10])
27
m4_define(PA_MICRO, [13])
31
AC_INIT([pulseaudio], PA_MAJOR.PA_MINOR.PA_MICRO,[mzchyfrnhqvb (at) 0pointer (dot) net])
29
AC_INIT([pulseaudio],[PA_MAJOR.PA_MINOR.PA_MICRO],[mzchyfrnhqvb (at) 0pointer (dot) net])
32
30
AC_CONFIG_SRCDIR([src/daemon/main.c])
31
AC_CONFIG_MACRO_DIR([m4])
33
32
AC_CONFIG_HEADERS([config.h])
34
AM_INIT_AUTOMAKE([foreign -Wall])
33
AM_INIT_AUTOMAKE([foreign 1.10 -Wall])
36
35
AC_SUBST(PA_MAJORMINOR, "PA_MAJOR.PA_MINOR")
37
36
AC_SUBST(PACKAGE_URL, [http://pulseaudio.org/])
39
AC_SUBST(PA_API_VERSION, 11)
40
AC_SUBST(PA_PROTOCOL_VERSION, 12)
38
AC_SUBST(PA_API_VERSION, 12)
39
AC_SUBST(PA_PROTOCOL_VERSION, 14)
42
41
# The stable ABI for client applications, for the version info x:y:z
43
42
# always will hold y=z
44
AC_SUBST(LIBPULSE_VERSION_INFO, [4:1:4])
43
AC_SUBST(LIBPULSE_VERSION_INFO, [7:0:7])
46
45
# A simplified, synchronous, ABI-stable interface for client
47
46
# applications, for the version info x:y:z always will hold y=z
48
AC_SUBST(LIBPULSE_SIMPLE_VERSION_INFO, [0:1:0])
47
AC_SUBST(LIBPULSE_SIMPLE_VERSION_INFO, [0:2:0])
50
49
# The ABI-stable network browsing interface for client applications,
51
50
# for the version info x:y:z always will hold y=z
54
53
# The ABI-stable GLib adapter for client applications, for the version
55
54
# info x:y:z always will hold y=z
56
AC_SUBST(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO, [0:3:0])
55
AC_SUBST(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO, [0:4:0])
58
57
# An internally used, ABI-unstable library that contains the
59
58
# PulseAudio core, SONAMEs are bumped on every release, version info
60
59
# suffix will always be 0:0
61
AC_SUBST(LIBPULSECORE_VERSION_INFO, [5:1:0])
60
AC_SUBST(LIBPULSECORE_VERSION_INFO, [8:0:0])
63
AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
65
65
if type -p stow > /dev/null && test -d /usr/local/stow ; then
66
66
AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
97
98
AC_MSG_ERROR([m4 missing])
103
AC_LANG_CONFTEST([int main(int argc, char*argv[]) {}])
104
$CC -c conftest.c $CFLAGS -o conftest.o > /dev/null 2> /dev/null
110
# If using GCC specify some additional parameters
111
if test "x$GCC" = "xyes" ; then
113
# We use gnu99 instead of c99 because many have interpreted the standard
114
# in a way that int64_t isn't defined on non-64 bit platforms.
115
DESIRED_FLAGS="-std=gnu99 -Wall -W -Wextra -pedantic -pipe -Wformat -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 -Winline -Wno-unused-parameter -ffast-math"
117
for flag in $DESIRED_FLAGS ; do
118
AC_MSG_CHECKING([whether $CC accepts $flag])
119
if test_gcc_flag $flag ; then
120
CFLAGS="$CFLAGS $flag"
102
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"
104
for flag in $DESIRED_FLAGS ; do
105
CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"])
128
108
# Native atomic operation support
129
109
AC_ARG_ENABLE([atomic-arm-linux-helpers],
130
AC_HELP_STRING([--disable-atomic-arm-linux-helpers], [use inline asm or libatomic_ops instead]),
110
AS_HELP_STRING([--disable-atomic-arm-linux-helpers],[use inline asm or libatomic_ops instead]),
132
112
case "${enableval}" in
133
113
yes) atomic_arm_linux_helpers=yes ;;
138
118
[atomic_arm_linux_helpers=auto])
140
120
AC_ARG_ENABLE([atomic-arm-memory-barrier],
141
AC_HELP_STRING([--enable-atomic-arm-memory-barrier], [only really needed in SMP arm systems]),
121
AS_HELP_STRING([--enable-atomic-arm-memory-barrier],[only really needed in SMP arm systems]),
143
123
case "${enableval}" in
144
124
yes) AC_DEFINE_UNQUOTED(ATOMIC_ARM_MEMORY_BARRIER_ENABLED, 1, [Enable memory barriers]) ;;
162
142
# If everything else fails use libatomic_ops
163
143
need_libatomic_ops=yes
165
AC_MSG_CHECKING([whether $CC knows __sync_bool_compare_and_swap()])
166
AC_LANG_CONFTEST([int main() { int a = 4; __sync_bool_compare_and_swap(&a, 4, 5); }])
167
$CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null
169
rm -f conftest.o conftest
170
if test $ret -eq 0 ; then
145
AC_CACHE_CHECK([whether $CC knows __sync_bool_compare_and_swap()],
146
pulseaudio_cv_sync_bool_compare_and_swap,
148
AC_LANG_PROGRAM([], [[int a = 4; __sync_bool_compare_and_swap(&a, 4, 5);]]),
149
[pulseaudio_cv_sync_bool_compare_and_swap=yes],
150
[pulseaudio_cv_sync_bool_compare_and_swap=no])
153
if test "$pulseaudio_cv_sync_bool_compare_and_swap" = "yes" ; then
171
154
AC_DEFINE([HAVE_ATOMIC_BUILTINS], 1, [Have __sync_bool_compare_and_swap() and friends.])
173
155
need_libatomic_ops=no
176
157
# HW specific atomic ops stuff
177
158
AC_MSG_CHECKING([architecture for native atomic operations])
178
159
case $host_cpu in
188
169
need_libatomic_ops=no
190
171
AC_MSG_RESULT([no])
191
AC_MSG_CHECKING([compiler support for arm inline asm atomic operations])
192
AC_LANG_CONFTEST([[int main()
196
asm volatile ("ldrex %0, [%1]\n"
198
"strexeq %0, %3, [%1]\n"
200
: "r" (&a), "Ir" (o), "r" (n)
202
return (a==1 ? 0 : -1);
204
$CC conftest.c $CFLAGS -o conftest > /dev/null 2>&1
206
rm -f conftest.o conftest
207
if test $ret -eq 0 ; then
172
AC_CACHE_CHECK([compiler support for arm inline asm atomic operations],
173
pulseaudio_cv_support_arm_atomic_ops,
178
asm volatile ("ldrex %0, [%1]\n"
180
"strexeq %0, %3, [%1]\n"
182
: "r" (&a), "Ir" (o), "r" (n)
184
return (a==1 ? 0 : -1);
186
[pulseaudio_cv_support_arm_atomic_ops=yes],
187
[pulseaudio_cv_support_arm_atomic_ops=no])
189
AS_IF([test "$pulseaudio_cv_support_arm_atomic_ops" = "yes"], [
208
190
AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARMv6 instructions.])
210
191
need_libatomic_ops=no
222
AC_MSG_CHECKING([whether $CC knows __thread])
223
AC_LANG_CONFTEST([static __thread int a = 6; int main() { a = 5; }])
224
$CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null
226
rm -f conftest.o conftest
227
if test $ret -eq 0 ; then
228
AC_DEFINE([HAVE_TLS_BUILTIN], 1, [Have __thread().])
234
AC_MSG_CHECKING([whether $CC knows _Bool])
235
AC_LANG_CONFTEST([int main() { _Bool b; }])
236
$CC conftest.c $CFLAGS -o conftest > /dev/null 2> /dev/null
238
rm -f conftest.o conftest
239
if test $ret -eq 0 ; then
203
AC_CACHE_CHECK([whether $CC knows _Bool],
206
AC_LANG_PROGRAM([], [[_Bool b;]]),
207
[pulseaudio_cv__Bool=yes],
208
[pulseaudio_cv__Bool=no])
211
AS_IF([test "$pulseaudio_cv__Bool" = "yes"], [
240
212
AC_DEFINE([HAVE_STD_BOOL], 1, [Have _Bool.])
246
215
#### libtool stuff ####
327
296
AC_CHECK_HEADERS([sys/ioctl.h])
328
297
AC_CHECK_HEADERS([byteswap.h])
329
298
AC_CHECK_HEADERS([sys/syscall.h])
299
AC_CHECK_HEADERS([sys/eventfd.h])
331
301
#### Typdefs, structures, etc. ####
376
347
# build, disabling its ability to make dlls.
377
348
AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
350
AC_CHECK_LIB(gdbm, gdbm_open)
351
AC_CHECK_HEADERS(gdbm.h, [], [AC_MSG_ERROR([gdbm.h not found])])
379
353
#### Check for functions ####
410
384
AC_CHECK_FUNCS([setresuid setresgid setreuid setregid seteuid setegid ppoll strsignal sig2str strtof_l])
412
AC_MSG_CHECKING([for PTHREAD_PRIO_INHERIT])
413
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
415
int main() { int i = PTHREAD_PRIO_INHERIT; }]])])
416
$PTHREAD_CC conftest.c $PTHREAD_CFLAGS $CFLAGS $PTHREAD_LIBS -o conftest > /dev/null 2> /dev/null
418
rm -f conftest.o conftest
420
if test $ret -eq 0 ; then
388
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
389
pulseaudio_cv_PTHREAD_PRIO_INHERIT,
390
[save_CC=$CC; CC=$PTHREAD_CC
391
save_CFLAGS=$CFLAGS; CFLAGS=$PTHREAD_CFLAGS
392
save_LIBS=$LIBS; LIBS=$PTHREAD_LIBS
398
[[int i = PTHREAD_PRIO_INHERIT;]]),
399
[pulseaudio_cv_PTHREAD_PRIO_INHERIT=yes],
400
[pulseaudio_cv_PTHREAD_PRIO_INHERIT=no])
406
AS_IF([test "$pulseaudio_cv_PTHREAD_PRIO_INHERIT" = "yes"], [
421
407
AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])
410
AC_DEFINE_UNQUOTED(PA_CFLAGS,"$CFLAGS", [The CFLAGS used during compilation])
427
412
#### Large File-Support (LFS) ####
423
IT_PROG_INTLTOOL([0.35.0])
424
GETTEXT_PACKAGE=pulseaudio
425
AC_SUBST([GETTEXT_PACKAGE])
426
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
429
pulselocaledir='${prefix}/${DATADIRNAME}/locale'
430
AC_SUBST(pulselocaledir)
438
432
###################################
439
433
# External libraries #
440
434
###################################
464
AC_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
458
AS_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
466
460
if test "x${with_caps}" != "xno"; then
467
461
AC_SEARCH_LIBS([cap_init], [cap], [], [
492
490
AC_SUBST(LIBSNDFILE_CFLAGS)
493
491
AC_SUBST(LIBSNDFILE_LIBS)
493
PKG_CHECK_MODULES(LIBSPEEX, [ speexdsp >= 1.2 ])
494
AC_SUBST(LIBSPEEX_CFLAGS)
495
AC_SUBST(LIBSPEEX_LIBS)
495
497
#### atomic-ops ###
497
499
AC_MSG_CHECKING([whether we need libatomic_ops])
512
514
#### Libsamplerate support (optional) ####
514
516
AC_ARG_ENABLE([samplerate],
515
AC_HELP_STRING([--disable-samplerate], [Disable optional libsamplerate support]),
517
AS_HELP_STRING([--disable-samplerate],[Disable optional libsamplerate support]),
517
519
case "${enableval}" in
518
520
yes) samplerate=yes ;;
547
549
#### OSS support (optional) ####
549
551
AC_ARG_ENABLE([oss],
550
AC_HELP_STRING([--disable-oss], [Disable optional OSS support]),
552
AS_HELP_STRING([--disable-oss],[Disable optional OSS support]),
552
554
case "${enableval}" in
580
582
#### ALSA support (optional) ####
582
584
AC_ARG_ENABLE([alsa],
583
AC_HELP_STRING([--disable-alsa], [Disable optional ALSA support]),
585
AS_HELP_STRING([--disable-alsa],[Disable optional ALSA support]),
585
587
case "${enableval}" in
593
595
if test "x${alsa}" != xno ; then
594
PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.0 ],
596
PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.17 ],
597
599
AC_DEFINE([HAVE_ALSA], 1, [Have ALSA?])
614
616
#### Solaris audio support (optional) ####
616
618
AC_ARG_ENABLE([solaris],
617
AC_HELP_STRING([--disable-solaris], [Disable optional Solaris audio support]),
619
AS_HELP_STRING([--disable-solaris],[Disable optional Solaris audio support]),
619
621
case "${enableval}" in
620
622
yes) solaris=yes ;;
646
648
#### GLib 2 support (optional) ####
648
650
AC_ARG_ENABLE([glib2],
649
AC_HELP_STRING([--disable-glib2], [Disable optional GLib 2 support]),
651
AS_HELP_STRING([--disable-glib2],[Disable optional GLib 2 support]),
651
653
case "${enableval}" in
652
654
yes) glib2=yes ;;
677
679
#### GConf support (optional) ####
679
681
AC_ARG_ENABLE([gconf],
680
AC_HELP_STRING([--disable-gconf], [Disable optional GConf support]),
682
AS_HELP_STRING([--disable-gconf],[Disable optional GConf support]),
682
684
case "${enableval}" in
683
685
yes) gconf=yes ;;
708
710
#### Avahi support (optional) ####
710
712
AC_ARG_ENABLE([avahi],
711
AC_HELP_STRING([--disable-avahi], [Disable optional Avahi support]),
713
AS_HELP_STRING([--disable-avahi],[Disable optional Avahi support]),
713
715
case "${enableval}" in
714
716
yes) avahi=yes ;;
776
778
#### Async DNS support (optional) ####
778
780
AC_ARG_ENABLE([asyncns],
779
AC_HELP_STRING([--disable-asyncns], [Disable optional Async DNS support]),
781
AS_HELP_STRING([--disable-asyncns],[Disable optional Async DNS support]),
781
783
case "${enableval}" in
782
784
yes) asyncns=yes ;;
811
813
#### TCP wrappers (optional) ####
813
815
AC_ARG_ENABLE([tcpwrap],
814
AC_HELP_STRING([--disable-tcpwrap], [Disable optional TCP wrappers support]),
816
AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]),
816
818
case "${enableval}" in
817
819
yes) tcpwrap=yes ;;
835
837
#### LIRC support (optional) ####
837
839
AC_ARG_ENABLE([lirc],
838
AC_HELP_STRING([--disable-lirc], [Disable optional LIRC support]),
840
AS_HELP_STRING([--disable-lirc],[Disable optional LIRC support]),
840
842
case "${enableval}" in
861
863
#### HAL support (optional) ####
863
865
AC_ARG_ENABLE([hal],
864
AC_HELP_STRING([--disable-hal], [Disable optional HAL support]),
866
AS_HELP_STRING([--disable-hal],[Disable optional HAL support]),
866
868
case "${enableval}" in
891
893
#### BlueZ support (optional) ####
893
895
AC_ARG_ENABLE([bluez],
894
AC_HELP_STRING([--disable-bluez], [Disable optional BlueZ support]),
896
AS_HELP_STRING([--disable-bluez],[Disable optional BlueZ support]),
896
898
case "${enableval}" in
897
899
yes) bluez=yes ;;
921
923
#### D-Bus support (optional) ####
923
925
AC_ARG_ENABLE([dbus],
924
AC_HELP_STRING([--disable-dbus], [Disable optional D-Bus support]),
926
AS_HELP_STRING([--disable-dbus],[Disable optional D-Bus support]),
926
928
case "${enableval}" in
964
966
#### PolicyKit support (optional) ####
966
968
AC_ARG_ENABLE([polkit],
967
AC_HELP_STRING([--disable-polkit], [Disable optional PolicyKit support]),
969
AS_HELP_STRING([--disable-polkit],[Disable optional PolicyKit support]),
969
971
case "${enableval}" in
970
972
yes) polkit=yes ;;
1007
1009
*) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
1008
1010
esac],[manpages=yes])
1010
if test x$manpages = xyes ; then
1012
# XMLTOMAN manpage generation
1014
AC_ARG_ENABLE(xmltoman,
1015
AS_HELP_STRING([--disable-xmltoman],[Enable rebuilding of man pages with xmltoman]),
1016
[case "${enableval}" in
1017
yes) xmltoman=yes ;;
1019
*) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
1020
esac],[xmltoman=yes])
1022
if test x$xmltoman = xyes ; then
1023
AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
1026
if test x$have_xmltoman = xno -o x$xmltoman = xno; then
1027
if ! test -e man/pulseaudio.1 ; then
1028
AC_MSG_ERROR([*** xmltoman was not found or was disabled, it is required to build the manpages as they have not been pre-built, install xmltoman, pass --disable-manpages or dont pass --disable-xmltoman])
1031
AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
1035
AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
1036
1012
AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
1038
1014
#### PulseAudio system group & user #####
1077
1053
per_user_esound_socket,
1078
AS_HELP_STRING([--disable-per-user-esound-socket], [Use per-user esound socket directory, like /tmp/.esd-UID/socket.]),
1054
AS_HELP_STRING([--disable-per-user-esound-socket], [Use global esound socket directory /tmp/.esd/socket.]),
1080
1056
case "${enableval}" in
1081
1057
yes) per_user_esound_socket=1 ;;
1092
1068
#### PulseAudio system runtime dir ####
1093
1069
PA_SYSTEM_RUNTIME_PATH="${localstatedir}/run/pulse"
1094
1070
AC_SUBST(PA_SYSTEM_RUNTIME_PATH)
1071
PA_SYSTEM_CONFIG_PATH="${localstatedir}/lib/pulse"
1072
AC_SUBST(PA_SYSTEM_CONFIG_PATH)
1073
PA_SYSTEM_STATE_PATH="${localstatedir}/lib/pulse"
1074
AC_SUBST(PA_SYSTEM_STATE_PATH)
1096
1076
###################################
1102
AC_HELP_STRING([--enable-static-bins],[Statically link executables.]),
1082
AS_HELP_STRING([--enable-static-bins],[Statically link executables.]),
1103
1083
[STATIC_BINS=1], [STATIC_BINS=0])
1104
1084
AM_CONDITIONAL([STATIC_BINS], [test "x$STATIC_BINS" = "x1"])
1107
1087
[preopen-mods],
1108
AC_HELP_STRING([--with-preopen-mods],[Modules to preopen in daemon (default: all).]),
1088
AS_HELP_STRING([--with-preopen-mods],[Modules to preopen in daemon (default: all).]),
1109
1089
[PREOPEN_MODS=$withval], [PREOPEN_MODS="all"])
1110
1090
AM_CONDITIONAL([PREOPEN_MODS], [test "x$PREOPEN_MODS" != "xall"])
1111
1091
if test "x$PREOPEN_MODS" != "xall" ; then
1122
AC_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulse-${PA_MAJORMINOR}/modules/]),
1102
AS_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/pulse-${PA_MAJORMINOR}/modules/]),
1123
1103
[modlibexecdir=$withval], [modlibexecdir="${libdir}/pulse-${PA_MAJORMINOR}/modules/"])
1125
1105
AC_SUBST(modlibexecdir)
1128
1108
[force-preopen],
1129
AC_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
1109
AS_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
1130
1110
[FORCE_PREOPEN=1], [FORCE_PREOPEN=0])
1131
1111
AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "x1"])
1232
1213
sysconfdir: ${sysconfdir}
1233
1214
localstatedir: ${localstatedir}
1234
1215
System Runtime Path: ${PA_SYSTEM_RUNTIME_PATH}
1216
System State Path: ${PA_SYSTEM_STATE_PATH}
1217
System Config Path: ${PA_SYSTEM_CONFIG_PATH}
1235
1218
Compiler: ${CC}
1236
1219
CFLAGS: ${CFLAGS}
1237
1220
Have X11: ${ENABLE_X11}