summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 2e929585a406b67dd125310886404ead48f3c6b6 (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
# pa-sink-ctl - NCurses based Pulseaudio control client
# Copyright (C) 2011  Benjamin Franzke <benjaminfranzke@googlemail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

#AC_PREREQ([2.65])
AC_INIT([pa-sink-ctl], [3], [benjaminfranzke@googlemail.com])
AM_INIT_AUTOMAKE([1.11 foreign dist-xz])
AM_SILENT_RULES([yes])

AC_CONFIG_SRCDIR([src/pa-sink-ctl.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile src/Makefile data/Makefile])

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET

AC_CHECK_HEADERS([sys/ioctl.h sys/signalfd.h unistd.h signal.h])

AC_CHECK_FUNCS([signalfd])

glib_version=2.0
if test "x$ac_cv_func_signalfd" = "xno" -o "x$ac_cv_header_sys_signalfd_h" = "xno"; then
	# If signalfd() is not available, we want to use g_unix_signal_add()
	# which is supported for SIGWINCH as of 2.54, see
	# https://github.com/GNOME/glib/commit/47a02c85610f4036681c9728b7339d
	glib_version=2.54
fi

# Checks for libraries.
PKG_CHECK_MODULES(PULSE, [libpulse], [], AC_MSG_ERROR([libpulse required]))
PKG_CHECK_MODULES(PULSE_MAINLOOP, [libpulse-mainloop-glib], [], AC_MSG_ERROR([libpulse-mainloop-glib required]))
PKG_CHECK_MODULES(GLIB, [glib-2.0 >= $glib_version], [], AC_MSG_ERROR([glib >= $glib_version required]))
PKG_CHECK_MODULES(CURSES, [ncursesw], [],
	AC_CHECK_LIB([curses], [newwin], [CURSES_LIBS=-lcurses], AC_MSG_ERROR([ncursesw or curses required]))
	AC_CHECK_HEADERS([curses.h])
	AC_SUBST(CURSES_LIBS)
)

if test "x$GCC" = "xyes"; then
	GCC_CFLAGS="-Wall -pedantic -std=c99 -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 -fvisibility=hidden"
fi
AC_SUBST(GCC_CFLAGS)

AC_DEFINE([_POSIX_C_SOURCE], [1], [Enable POSIX.1-1990 definitions])

AC_C_INLINE

AC_OUTPUT