summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: 8e62c78e0c6f1469033e95cb1a40baae11f3bf99 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
AC_PREREQ(2.59)
AC_INIT(oss/pcm_oss.c)
AM_INIT_AUTOMAKE(alsa-plugins, 1.0.16rc1)
AC_PREFIX_DEFAULT(/usr)

AC_CONFIG_HEADERS(config.h)

AC_PROG_CC
AC_PROG_INSTALL
AC_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_HEADER_STDC

PKG_CHECK_MODULES(ALSA, alsa >= 1.0.11)
AC_CHECK_LIB(asound, snd_pcm_ioplug_create,,
	     AC_ERROR([*** libasound has no external plugin SDK]), -ldl)

PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no])
AM_CONDITIONAL(HAVE_JACK, test x$HAVE_JACK = xyes)

PKG_CHECK_MODULES(pulseaudio, [libpulse >= 0.9.2], [HAVE_PULSE=yes], [HAVE_PULSE=no])
AM_CONDITIONAL(HAVE_PULSE, test x$HAVE_PULSE = xyes)

PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no])
AM_CONDITIONAL(HAVE_SAMPLERATE, test x$HAVE_SAMPLERATE = xyes)

PKG_CHECK_MODULES(DBUS, [dbus-1], [HAVE_DBUS=yes], [HAVE_DBUS=no])
AM_CONDITIONAL(HAVE_DBUS, test x$HAVE_DBUS = xyes)

if test "$HAVE_DBUS" = "yes"; then
        AC_DEFINE(USE_RESOURCE_MANAGER, 1,"Use dbus server as a resouce manager")
fi

AC_ARG_WITH([avcodec-includedir],
	AS_HELP_STRING([--with-avcodec-includedir=dir],
		[AVcodec include directory]),
	[AVCODEC_CFLAGS="-I$withval"], [AVCODEC_CFLAGS=""])
AC_ARG_WITH([avcodec-libdir],
	AS_HELP_STRING([--with-avcodec-libdir=dir],
		[AVcodec library directory]),
	[AVCODEC_LIBS="-L$withval"], [AVCODEC_LIBS=""])
CFLAGS_saved="$CFLAGS"
LDFLAGS_saved="$LDFLAGS"
CFLAGS="$CFLAGS $AVCODEC_CFLAGS"
LDFLAGS="$LDFLAGS $AVCODEC_LIBS"
AC_SUBST(AVCODEC_CFLAGS)
AVCODEC_LIBS="$AVCODEC_LIBS -lavcodec"
AC_SUBST(AVCODEC_LIBS)
AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no])
if test x$HAVE_AVCODEC = xyes; then
  AC_CHECK_HEADER([ffmpeg/avcodec.h], [], [HAVE_AVCODEC=no])
fi
AM_CONDITIONAL(HAVE_AVCODEC, test x$HAVE_AVCODEC = xyes)
CFLAGS="$CFLAGS_saved"
LDFLAGS="$LDFLAGS_saved"

USE_LIBSPEEX=""
AC_ARG_WITH([speex],
	AS_HELP_STRING([--with-speex={builtin|lib|no}],
		[build speex resampler (built-in code, link with external lib, or no build)]),
	[PPH=$withval], [PPH="lib"])

if test "$PPH" = "lib"; then
	PKG_CHECK_MODULES(speex, [speex >= 1.2], [USE_LIBSPEEX="yes"], [USE_LIBSPEEX=""])
	if test "$USE_LIBSPEEX" = "yes"; then
		AC_CHECK_LIB([speex], [speex_resampler_init],
			[USE_LIBSPEEX="yes"], [USE_LIBSPEEX=""])
	fi
	if test "$USE_LIBSPEEX" = "yes"; then
		AC_DEFINE(USE_LIBSPEEX, 1, "Link with libspeex for resampler")
	else
		echo "No libspeex with resampler unit; use built-in code"
		PPH="builtin"
	fi
fi

AM_CONDITIONAL(HAVE_PPH, test "$PPH" = "builtin" -o "$PPH" = "lib")
AM_CONDITIONAL(USE_LIBSPEEX, test "$PPH" = "lib")

dnl ALSA plugin directory
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix=$prefix

AC_ARG_WITH(plugindir,
    AS_HELP_STRING([--with-plugindir=dir],
	[path where ALSA plugin files are stored]),
    plugindir="$withval", plugindir="")
if test -z "$plugindir"; then
    eval dir="$libdir"
    case "$dir" in
    /*) ;;
    *) dir="$dir"
    esac
    plugindir="$dir/alsa-lib"
fi
AC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir", [directory containing ALSA add-on modules])
ALSA_PLUGIN_DIR="$plugindir"
AC_SUBST(ALSA_PLUGIN_DIR)

SAVE_PLUGINS_VERSION

AC_OUTPUT([
	Makefile
	oss/Makefile
	pph/Makefile
	jack/Makefile
	pulse/Makefile
	mix/Makefile
	rate/Makefile
	a52/Makefile
	rate-lavc/Makefile
	maemo/Makefile
	doc/Makefile
])

dnl Show the build conditions

echo
echo "Plugin directory: $ALSA_PLUGIN_DIR"
echo "ALSA_CFLAGS: $ALSA_CFLAGS"
echo "ALSA_LIBS: $ALSA_LIBS"
echo "JACK plugin:        $HAVE_JACK"
if test "$HAVE_JACK" = "yes"; then
  echo "  JACK_CFLAGS: $JACK_CFLAGS"
  echo "  JACK_LIBS: $JACK_LIBS"
fi
echo "Pulseaudio plugin:  $HAVE_PULSE"
if test "$HAVE_PULSE" = "yes"; then
  echo "  pulseaudio_CFLAGS: $pulseaudio_CFLAGS"
  echo "  pulseaudio_LIBS: $pulseaudio_LIBS"
fi
echo "Samplerate plugin:  $HAVE_SAMPLERATE"
if test "$HAVE_SAMPLERATE" = "yes"; then
  echo "  samplerate_CFLAGS: $samplerate_CFLAGS"
  echo "  samplerate_LIBS: $samplerate_LIBS"
fi
echo "Maemo plugin:       $HAVE_DBUS"
if test "$HAVE_DBUS" = "yes"; then
  echo "  DBUS_CFLAGS: $DBUS_CFLAGS"
  echo "  DBUS_LIBS: $DBUS_LIBS"
fi
echo "A52, lavc plugins:  $HAVE_AVCODEC"
if test "$HAVE_AVCODEC" = "yes"; then
  echo "  AVCODEC_CFLAGS: $AVCODEC_CFLAGS"
  echo "  AVCODEC_LIBS: $AVCODEC_LIBS"
fi
echo "Speex rate plugin:  $PPH"
if test "$PPH" = "lib"; then
  echo "  speex_CFLAGS: $speex_CFLAGS"
  echo "  speex_LIBS: $speex_LIBS"
fi