Merge branch 'master' of ssh://rootserver/home/lennart/git/public/libflashsupport
[libflashsupport-jack.git] / configure.ac
blobd4a815ec318122edccb0c036cc6b0785c4b2111d
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 # This file is part of libflashsupport-pulse.
6 # libflashsupport-pulse is free software; you can redistribute it
7 # and/or modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either version
9 # 2 of the License, or (at your option) any later version.
11 # libflashsupport-pulse is distributed in the hope that it will be
12 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with libflashsupport-pulse; if not, write to the Free
18 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 # 02111-1307 USA.
21 AC_PREREQ(2.57)
23 AC_INIT([libflashsupport-pulse], 000, [mzcbylcnhqvb (at) 0pointer (dot) de])
24 AC_CONFIG_SRCDIR([flashsupport.c])
25 AC_CONFIG_HEADERS([config.h])
26 AM_INIT_AUTOMAKE([foreign -Wall])
28 AC_PROG_CC
29 AM_PROG_CC_C_O
30 AC_PROG_GCC_TRADITIONAL
31 AC_GNU_SOURCE
33 # GCC flags
35 test_gcc_flag() {
36     AC_LANG_CONFTEST([int main() {}])
37     $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null
38     ret=$?
39     rm -f conftest.o
40     return $ret
43 # If using GCC specify some additional parameters
44 if test "x$GCC" = "xyes" ; then
46     # We use gnu99 instead of c99 because many have interpreted the standard
47     # in a way that int64_t isn't defined on non-64 bit platforms.
48     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"
50     for flag in $DESIRED_FLAGS ; do
51         AC_MSG_CHECKING([whether $CC accepts $flag])
52         if test_gcc_flag $flag ; then 
53            CFLAGS="$CFLAGS $flag"
54            AC_MSG_RESULT([yes])
55         else
56            AC_MSG_RESULT([no])
57         fi
58     done 
61 AM_DISABLE_STATIC
62 AC_PROG_LIBTOOL
64 AC_HEADER_STDC
66 AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
68 if test x"$have_pkg_config" = "xno"; then
69     AC_MSG_ERROR(pkg-config is required to install this program)
72 PKG_PROG_PKG_CONFIG
74 if test x"$PULSEAUDIO_SOURCES" != x ; then
75    PULSE_CFLAGS="-I${PULSEAUDIO_SOURCES}/src"
76    PULSE_LIBS="-L${PULSEAUDIO_SOURCES}/src/.libs -lpulse"
77    echo "*** Using manually configured PA instance in ${PULSEAUDIO_SOURCES} ***"
78 elif test -d ../pulseaudio ; then
79    PULSE_CFLAGS='-I$(top_srcdir)/../pulseaudio/src'
80    PULSE_LIBS='-L$(top_srcdir)/../pulseaudio/src/.libs -lpulse'
81    echo "*** Found pulseaudio in ../pulseaudio, using that version ***"
82 else
83    PKG_CHECK_MODULES(PULSE, [ libpulse >= 0.9.7 ])
86 AC_SUBST(PULSE_LIBS)
87 AC_SUBST(PULSE_CFLAGS)
89 PKG_CHECK_MODULES(LIBSSL, [ libssl ])
91 AC_SUBST(LIBSSL_LIBS)
92 AC_SUBST(LIBSSL_CFLAGS)
94 AC_CONFIG_FILES([Makefile])
96 AC_OUTPUT