1dnl libsidplay2
2
3AC_ARG_WITH(sidplay2, AS_HELP_STRING([--without-sidplay2],
4                                     [Compile without libsidplay2]))
5
6if test "x$with_sidplay2" != "xno"
7then
8	PKG_CHECK_MODULES(sidplay2, libsidplay2 >= 2.1.1,
9			   [sidplay2_OK="yes"],
10			   [true])
11
12	PKG_CHECK_MODULES(sidutils, libsidutils >= 1.0.4,
13			   [sidutils_OK="yes"],
14			   [true])
15dnl This is a rather ugly hack to find the builder
16dnl as libsidplay2 works fine without it but the
17dnl decoder uses it...
18	if test "x$sidplay2_OK" = "xyes"; then
19		if test "x$sidutils_OK" = "xyes"; then
20			s2lib=`$PKG_CONFIG --variable=builders libsidplay2 2>/dev/null`
21			if test "x$s2lib" != "x"; then
22				sidplay2_LDFLAGS="-L$s2lib -lresid-builder"
23				AC_SUBST(sidplay2_LDFLAGS)
24				AC_SUBST(sidplay2_LIBS)
25				AC_SUBST(sidplay2_CFLAGS)
26				AC_SUBST(sidutils_LIBS)
27				AC_SUBST(sidutils_CFLAGS)
28				want_sidplay2="yes"
29				DECODER_PLUGINS="$DECODER_PLUGINS sidplay2"
30			fi
31		fi
32	fi
33fi
34
35AM_CONDITIONAL([BUILD_sidplay2], [test "$want_sidplay2"])
36AC_CONFIG_FILES([decoder_plugins/sidplay2/Makefile])
37