AC_PREREQ(2.63)
-m4_define(pa_major, [0])
-m4_define(pa_minor, [9])
-m4_define(pa_micro, [15])
-
-AC_INIT([pulseaudio],[pa_major.pa_minor.pa_micro-test3],[mzchyfrnhqvb (at) 0pointer (dot) net])
+AC_INIT([pulseaudio], m4_esyscmd([./git-version-gen .tarball-version]),
+ [mzchyfrnhqvb (at) 0pointer (dot) net])
AC_CONFIG_SRCDIR([src/daemon/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign 1.10 -Wall -Wno-portability])
+m4_define(pa_major, `echo $VERSION | cut -d. -f 1`)
+m4_define(pa_minor, `echo $VERSION | cut -d. -f 2`)
+m4_define(pa_micro, `echo $VERSION | cut -d. -f 3`)
+
AC_SUBST(PA_MAJOR, pa_major)
AC_SUBST(PA_MINOR, pa_minor)
AC_SUBST(PA_MICRO, pa_micro)
AC_MSG_ERROR([m4 missing])
fi
-# Linker
-
-AC_PROG_LD
-AC_PROG_LD_GNU
-
-AC_SUBST(HAVE_GNU_LD)
-AM_CONDITIONAL([HAVE_GNU_LD], [test "x$HAVE_GNU_LD" = x1])
-
-
dnl Compiler flags
DESIRED_FLAGS="-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option"
CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"])
done
+dnl Linker flags.
+dnl Check whether the linker supports the -version-script option.
+
+dnl This variable is used to make sure ${srcdir} is expanded and not
+dnl passed to the CC_CHECK_LDFLAGS macro as a name.
+tmp_ldflag="-Wl,-version-script=${srcdir}/src/map-file"
+
+CC_CHECK_LDFLAGS([${tmp_ldflag}],
+ [VERSIONING_LDFLAGS='-Wl,-version-script=$(srcdir)/map-file'])
+AC_SUBST([VERSIONING_LDFLAGS])
+
dnl Check whether to build tests by default (as compile-test) or not
AC_ARG_ENABLE([default-build-tests],
AS_HELP_STRING([--disable-default-build-tests], [Build test programs only during make check]))
# build, disabling its ability to make dlls.
AC_CHECK_FUNCS([getopt_long], [], [AC_CHECK_LIB([iberty], [getopt_long])])
-AC_CHECK_LIB(gdbm, gdbm_open)
-AC_CHECK_HEADERS(gdbm.h, [], [AC_MSG_ERROR([gdbm.h not found])])
-
#### Check for functions ####
# ISO
AC_SUBST(HAVE_LIBSAMPLERATE)
AM_CONDITIONAL([HAVE_LIBSAMPLERATE], [test "x$HAVE_LIBSAMPLERATE" = x1])
+#### Database support ####
+
+HAVE_TDB=0
+HAVE_GDBM=0
+
+AC_ARG_WITH(
+ [database],
+ AS_HELP_STRING([--with-database=auto|tdb|gdbm],[Choose database backend.]),[],[with_database=auto])
+
+if test "x${with_database}" = "xauto" -o "x${with_database}" = "xtdb" ; then
+ PKG_CHECK_MODULES(TDB, [ tdb ],
+ [
+ HAVE_TDB=1
+ with_database=tdb
+ ], [
+ if test "x${with_database}" = "xtdb" ; then
+ AC_MSG_ERROR([*** tdb not found])
+ fi
+ ])
+fi
+
+if test "x${with_database}" = "xauto" -o "x${with_database}" = "xgdbm" ; then
+ have_gdbm=yes
+
+ AC_CHECK_LIB(gdbm, gdbm_open, [], [have_gdbm=no])
+ AC_CHECK_HEADERS(gdbm.h, [], [have_gdbm=no])
+
+ if test "x${have_gdbm}" = "xyes" ; then
+ HAVE_GDBM=1
+ GDBM_CFLAGS=
+ GDBM_LIBS=-lgdbm
+ with_database=gdbm
+ elif test "x${with_database}" = "xgdbm"; then
+ AC_MSG_ERROR([*** gdbm not found])
+ fi
+fi
+
+if test "x${HAVE_TDB}" != x1 -a "x${HAVE_GDBM}" != x1; then
+ AC_MSG_ERROR([*** missing database backend])
+fi
+
+if test "x${HAVE_TDB}" = x1 ; then
+ AC_DEFINE([HAVE_TDB], 1, [Have tdb?])
+fi
+
+if test "x${HAVE_GDBM}" = x1 ; then
+ AC_DEFINE([HAVE_GDBM], 1, [Have gdbm?])
+fi
+
+AC_SUBST(TDB_CFLAGS)
+AC_SUBST(TDB_LIBS)
+AC_SUBST(HAVE_TDB)
+AM_CONDITIONAL([HAVE_TDB], [test "x$HAVE_TDB" = x1])
+
+AC_SUBST(GDBM_CFLAGS)
+AC_SUBST(GDBM_LIBS)
+AC_SUBST(HAVE_GDBM)
+AM_CONDITIONAL([HAVE_GDBM], [test "x$HAVE_GDBM" = x1])
+
#### OSS support (optional) ####
AC_ARG_ENABLE([oss],
SHAVE_INIT
AC_OUTPUT
-SHAVE_OUTPUT
# ==========================================================================
ENABLE_X11=no
ENABLE_POLKIT=yes
fi
+ENABLE_GDBM=no
+if test "x${HAVE_GDBM}" = "x1" ; then
+ ENABLE_GDBM=yes
+fi
+
+ENABLE_TDB=no
+if test "x${HAVE_TDB}" = "x1" ; then
+ ENABLE_TDB=yes
+fi
+
ENABLE_OPENSSL=no
if test "x${HAVE_OPENSSL}" = "x1" ; then
ENABLE_OPENSSL=yes
Enable PolicyKit: ${ENABLE_POLKIT}
Enable IPv6: ${ENABLE_IPV6}
Enable OpenSSL (for Airtunes): ${ENABLE_OPENSSL}
+ Enable tdb: ${ENABLE_TDB}
+ Enable gdbm: ${ENABLE_GDBM}
System User: ${PA_SYSTEM_USER}
System Group: ${PA_SYSTEM_GROUP}