]> code.delx.au - pulseaudio/blob - configure.ac
gcc 2.95 compatibility, take 2
[pulseaudio] / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 # $Id$
5
6 # This file is part of polypaudio.
7 #
8 # polypaudio is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # polypaudio is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with polypaudio; if not, write to the Free Software Foundation,
20 # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21
22 AC_PREREQ(2.57)
23 AC_INIT([polypaudio],[0.5],[mzcbylcnhqvb (at) 0pointer (dot) de])
24 AC_CONFIG_SRCDIR([polyp/main.c])
25 AC_CONFIG_HEADERS([config.h])
26 AM_INIT_AUTOMAKE([foreign -Wall])
27
28 AC_SUBST(PA_MAJORMINOR, "$PACKAGE_VERSION")
29 AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/polypaudio/])
30
31 if type -p stow > /dev/null && test -d /usr/local/stow ; then
32 AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
33 ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
34 fi
35
36 # Checks for programs.
37 AC_PROG_CC
38 AC_LIBLTDL_INSTALLABLE
39 AC_SUBST(INCLTDL)
40 AC_SUBST(LIBLTDL)
41 AC_LIBTOOL_DLOPEN
42 AC_PROG_LIBTOOL
43
44 # Checks for header files.
45 AC_HEADER_STDC
46 AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h syslog.h])
47
48 ACX_PTHREAD
49 AC_PATH_XTRA
50
51 HAVE_X11=0
52 test "x$no_x" != "xyes" && HAVE_X11=1
53 AC_SUBST(HAVE_X11)
54 AM_CONDITIONAL(HAVE_X11, test "x$no_x" != "xyes")
55
56 # Checks for typedefs, structures, and compiler characteristics.
57 AC_C_CONST
58 AC_TYPE_PID_T
59 AC_TYPE_SIZE_T
60 AC_TYPE_OFF_T
61 AC_HEADER_TIME
62
63 # Checks for library functions.
64 AC_FUNC_FORK
65 AC_PROG_GCC_TRADITIONAL
66 AC_FUNC_LSTAT
67 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
68 AC_FUNC_MALLOC
69 AC_FUNC_MEMCMP
70 AC_FUNC_MMAP
71 AC_FUNC_REALLOC
72 AC_FUNC_SETPGRP
73 AC_FUNC_VPRINTF
74 AC_TYPE_SIGNAL
75 AC_CHECK_FUNCS([gethostname gettimeofday memchr memmove memset mkdir mkfifo munmap rmdir socket strcspn strerror strrchr strspn strstr strtol strtoul pow strcasecmp])
76 AC_FUNC_STAT
77 AC_HEADER_SYS_WAIT
78
79 AC_C_BIGENDIAN
80
81 PKG_CHECK_MODULES(LIBSAMPLERATE, [ samplerate >= 0.1.0 ])
82 AC_SUBST(LIBSAMPLERATE_CFLAGS)
83 AC_SUBST(LIBSAMPLERATE_LIBS)
84
85 PKG_CHECK_MODULES(LIBSNDFILE, [ sndfile >= 1.0.0 ])
86 AC_SUBST(LIBSNDFILE_CFLAGS)
87 AC_SUBST(LIBSNDFILE_LIBS)
88
89 PKG_CHECK_MODULES(ASOUNDLIB, [ alsa >= 1.0.0 ], [HAVE_ALSA=1], [HAVE_ALSA=0])
90 AC_SUBST(ASOUNDLIB_CFLAGS)
91 AC_SUBST(ASOUNDLIB_LIBS)
92 AC_SUBST(HAVE_ALSA)
93 AM_CONDITIONAL([HAVE_ALSA], [test "x$HAVE_ALSA" = x1])
94
95 PKG_CHECK_MODULES(GLIB20, [ glib-2.0 >= 2.4.0 ], HAVE_GLIB20=1, HAVE_GLIB20=0)
96 AC_SUBST(GLIB20_CFLAGS)
97 AC_SUBST(GLIB20_LIBS)
98 AC_SUBST(HAVE_GLIB20)
99 AM_CONDITIONAL([HAVE_GLIB20], [test "x$HAVE_GLIB20" = x1])
100
101 PKG_CHECK_MODULES(GLIB12, [ glib >= 1.2.0 ], HAVE_GLIB12=1, HAVE_GLIB12=0)
102 AC_SUBST(GLIB12_CFLAGS)
103 AC_SUBST(GLIB12_LIBS)
104 AC_SUBST(HAVE_GLIB12)
105 AM_CONDITIONAL([HAVE_GLIB12], [test "x$HAVE_GLIB12" = x1])
106
107 # If using GCC specify some additional parameters
108 if test "x$GCC" = "xyes" ; then
109 CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
110
111 AC_LANG_CONFTEST([int main() {}])
112 $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
113 rm -f conftest.o
114 fi
115
116 # LYNX documentation generation
117 AC_ARG_ENABLE(lynx,
118 AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation),
119 [case "${enableval}" in
120 yes) lynx=yes ;;
121 no) lynx=no ;;
122 *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
123 esac],[lynx=yes])
124
125 if test x$lynx = xyes ; then
126 AC_CHECK_PROG(have_lynx, lynx, yes, no)
127
128 if test x$have_lynx = xno ; then
129 AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***])
130 fi
131 fi
132
133 AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes])
134
135 AM_CONDITIONAL(BUILD_LIBPOLYPCORE, false)
136
137 AC_CONFIG_FILES([Makefile polyp/Makefile polyplib.pc polyplib-simple.pc polyplib-mainloop.pc polyplib-error.pc polyplib-glib-mainloop.pc polyplib-glib12-mainloop.pc doc/Makefile doc/README.html doc/cli.html doc/daemon.html doc/modules.html doxygen/Makefile doxygen/doxygen.conf polyp/polyplib-version.h doc/FAQ.html])
138 AC_OUTPUT