File: sidplay2.m4

package info (click to toggle)
moc 1%3A2.6.0~svn-r3005-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,656 kB
  • sloc: ansic: 31,749; sh: 929; cpp: 487; makefile: 240
file content (44 lines) | stat: -rw-r--r-- 1,343 bytes parent folder | download | duplicates (5)
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
dnl libsidplay2

AC_ARG_WITH(sidplay2, AS_HELP_STRING([--without-sidplay2],
                                     [Compile without libsidplay2]))

if test "x$with_sidplay2" != "xno"
then
	PKG_CHECK_MODULES(sidplay2, libsidplay2 >= 2.1.1,
			   [sidplay2_OK="yes"],
			   [true])

	PKG_CHECK_MODULES(sidutils, libsidutils >= 1.0.4,
			   [sidutils_OK="yes"],
			   [true])
dnl This is a rather ugly hack to find the builder
dnl as libsidplay2 works fine without it but the
dnl decoder uses it...
	if test "x$sidplay2_OK" = "xyes"; then
		if test "x$sidutils_OK" = "xyes"; then
			s2lib=`$PKG_CONFIG --variable=builders libsidplay2 2>/dev/null`
			if test "x$s2lib" != "x"; then
				AC_LANG_PUSH([C++])
				save_CXXFLAGS="$CXXFLAGS"
				CXXFLAGS="$CXXFLAGS $sidplay2_CFLAGS"
				AC_CHECK_HEADER([sidplay/builders/resid.h], [resid_OK="yes"])
				CXXFLAGS="$save_CXXFLAGS"
				AC_LANG_POP([C++])
				if test "x$resid_OK" = "xyes"; then
					sidplay2_LDFLAGS="-L$s2lib -lresid-builder"
					AC_SUBST(sidplay2_LDFLAGS)
					AC_SUBST(sidplay2_LIBS)
					AC_SUBST(sidplay2_CFLAGS)
					AC_SUBST(sidutils_LIBS)
					AC_SUBST(sidutils_CFLAGS)
					want_sidplay2="yes"
					DECODER_PLUGINS="$DECODER_PLUGINS sidplay2"
				fi
			fi
		fi
	fi
fi

AM_CONDITIONAL([BUILD_sidplay2], [test "$want_sidplay2"])
AC_CONFIG_FILES([decoder_plugins/sidplay2/Makefile])