# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
AC_PREREQ(2.57)
-AC_INIT([polypaudio],[0.8],[mzcbylcnhqvb (at) 0pointer (dot) de])
+
+m4_define(PA_MAJOR, [0])
+m4_define(PA_MINOR, [9])
+m4_define(PA_MICRO, [0])
+
+AC_INIT([polypaudio], PA_MAJOR.PA_MINOR.PA_MICRO,[mzcbylcnhqvb (at) 0pointer (dot) de])
AC_CONFIG_SRCDIR([src/daemon/main.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall])
-AC_SUBST(PA_MAJORMINOR, "$PACKAGE_VERSION")
+AC_SUBST(PA_MAJORMINOR, "PA_MAJOR.PA_MINOR")
AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/polypaudio/])
-AC_SUBST(PA_API_VERSION, 8)
-AC_SUBST(PA_PROTOCOL_VERSION, 8)
+AC_SUBST(PA_API_VERSION, 9)
+AC_SUBST(PA_PROTOCOL_VERSION, 9)
+
+AC_SUBST(LIBPOLYP_VERSION_INFO, [0:0:0])
+AC_SUBST(LIBPOLYPCORE_VERSION_INFO, [0:0:0])
+AC_SUBST(LIBPOLYP_SIMPLE_VERSION_INFO, [0:0:0])
+AC_SUBST(LIBPOLYP_BROWSE_VERSION_INFO, [0:0:0])
+AC_SUBST(LIBPOLYP_MAINLOOP_GLIB_VERSION_INFO, [0:0:0])
if type -p stow > /dev/null && test -d /usr/local/stow ; then
AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
fi
+#### Platform hacks ####
+
+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(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
+ ;;
+esac
+
#### Checks for programs. ####
# CC
# We use gnu99 instead of c99 because many have interpreted the standard
# in a way that int64_t isn't defined on non-64 bit platforms.
- 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 -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Winline -Wno-unused-parameter"
+ 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"
for flag in $DESIRED_FLAGS ; do
AC_MSG_CHECKING([whether $CC accepts $flag])
AC_HEADER_STDC
# POSIX
-AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \
+AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h iconv.h netdb.h netinet/in.h \
netinet/in_systm.h netinet/ip.h netinet/tcp.h pwd.h sched.h \
sys/resource.h sys/select.h sys/socket.h sys/wait.h \
syslog.h])
AM_CONDITIONAL([HAVE_EVDEV], [test "x$HAVE_EVDEV" = "x1"])
+# Solaris
+AC_CHECK_HEADERS([sys/filio.h])
+
# Windows
AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h])
# POSIX
AC_SEARCH_LIBS([sched_setscheduler], [rt])
+AC_SEARCH_LIBS([dlopen], [dl])
# BSD
AC_SEARCH_LIBS([connect], [socket])
AC_FUNC_FORK
AC_FUNC_GETGROUPS
AC_FUNC_SELECT_ARGTYPES
-AC_CHECK_FUNCS([getaddrinfo getgrgid_r getpwuid_r gettimeofday getuid \
- inet_ntop inet_pton nanosleep setpgid setsid sigaction sleep])
+AC_CHECK_FUNCS([chmod chown getaddrinfo getgrgid_r getpwuid_r gettimeofday \
+ getuid inet_ntop inet_pton nanosleep pipe setpgid setsid sigaction sleep])
AC_CHECK_FUNCS([mkfifo], [HAVE_MKFIFO=1], [HAVE_MKFIFO=0])
AM_CONDITIONAL(HAVE_MKFIFO, test "x$HAVE_MKFIFO" = "x1")
# SUSv2
AC_CHECK_FUNCS([ctime_r usleep])
+# SUSv3
+AC_CHECK_FUNCS([strerror_r])
+
# BSD
AC_CHECK_FUNCS([lstat])
ACX_PTHREAD
+#### Large File-Support (LFS) ####
+
+AC_SYS_LARGEFILE
+
###################################
# External libraries #
###################################
AC_SUBST(HAVE_HOWL)
AM_CONDITIONAL([HAVE_HOWL], [test "x$HAVE_HOWL" = x1])
+### LIBOIL ####
PKG_CHECK_MODULES(LIBOIL, [ liboil-0.3 >= 0.3.0 ])
AC_SUBST(LIBOIL_CFLAGS)
AC_SUBST(LIBOIL_LIBS)
+### JACK (optional) ####
+
+PKG_CHECK_MODULES(JACK, [ jack >= 0.100 ], HAVE_JACK=1, HAVE_JACK=0)
+AC_SUBST(JACK_CFLAGS)
+AC_SUBST(JACK_LIBS)
+AC_SUBST(HAVE_JACK)
+AM_CONDITIONAL([HAVE_JACK], [test "x$HAVE_JACK" = x1])
+
#### Async DNS support (optional) ####
PKG_CHECK_MODULES(LIBASYNCNS, [ libasyncns >= 0.1 ], HAVE_LIBASYNCNS=1, HAVE_LIBASYNCNS=0)
AC_SUBST(PREOPEN_MODS)
fi
+AC_ARG_WITH(
+ [module-dir],
+ AC_HELP_STRING([--with-module-dir],[Directory where to install the modules to (defaults to ${libdir}/polypaudio-${PA_MAJORMINOR}/modules/]),
+ [modlibexecdir=$withval], [modlibexecdir="${libdir}/polypaudio-${PA_MAJORMINOR}/modules/"])
+
+AC_SUBST(modlibexecdir)
+
+AC_ARG_ENABLE(
+ [force-preopen],
+ AC_HELP_STRING([--enable-force-preopen],[Preopen modules, even when dlopen() is supported.]),
+ [FORCE_PREOPEN=1], [FORCE_PREOPEN=0])
+AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "x1"])
+
AC_CONFIG_FILES([
Makefile
src/Makefile