]> code.delx.au - pulseaudio/blobdiff - configure.ac
Add missing include directory path for OSS modules.
[pulseaudio] / configure.ac
index 77d777d76fb3c7e71d0fd49b4926aa5ff96d6dd2..37b9fc52aa802d6f06523daf1a7058687a9f8cb9 100644 (file)
 
 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)
@@ -70,8 +71,7 @@ fi
 
 case $host in
    *-*-solaris* )
-      AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
-      AC_DEFINE(_XOPEN_SOURCE,          2, Needed to get declarations for msg_control and msg_controllen on Solaris)
+      AC_DEFINE(_XOPEN_SOURCE,        600, Needed to get declarations for msg_control and msg_controllen on Solaris)
       AC_DEFINE(__EXTENSIONS__,         1, Needed to get declarations for msg_control and msg_controllen on Solaris)
       ;;
 esac
@@ -92,7 +92,7 @@ AC_USE_SYSTEM_EXTENSIONS
 
 # M4
 
-AC_PATH_PROG([M4], [m4 gm4], [no])
+AC_CHECK_PROGS([M4], gm4 m4, no)
 if test "x$M4" = xno ; then
    AC_MSG_ERROR([m4 missing])
 fi
@@ -104,6 +104,17 @@ for flag in $DESIRED_FLAGS ; do
   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]))
@@ -381,9 +392,6 @@ AC_SEARCH_LIBS([connect], [socket])
 # 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
@@ -591,6 +599,65 @@ AC_SUBST(LIBSAMPLERATE_LIBS)
 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],
@@ -1059,7 +1126,7 @@ if test "x$HAVE_HAL" = x1 ; then
    dbus=yes
 fi
 
-if test "x${dbus}" != xno || test "x${bluez}" != xno || "x${hal}" != xno ; then
+if test "x${dbus}" != xno || test "x${bluez}" != xno || test "x${hal}" != xno ; then
 
     PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.0.0 ],
         [
@@ -1312,7 +1379,6 @@ po/Makefile.in
 
 SHAVE_INIT
 AC_OUTPUT
-SHAVE_OUTPUT
 
 # ==========================================================================
 ENABLE_X11=no
@@ -1400,6 +1466,16 @@ if test "x${HAVE_POLKIT}" = "x1" ; then
    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
@@ -1446,6 +1522,8 @@ echo "
     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}