summaryrefslogtreecommitdiffstats
path: root/juk/configure.in.in
blob: b74c6d9f46873175820527cfd2dcc8de0d38aef4 (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
#MIN_CONFIG(3)

AM_INIT_AUTOMAKE(juk,1.0)

AC_ARG_WITH(musicbrainz,
  	[AC_HELP_STRING(--with-musicbrainz,
	[enable support for MusicBrainz @<:@default=check@:>@])],
	[], with_musicbrainz=check)

have_musicbrainz=no

if test "x$with_musicbrainz" != xno; then
  	KDE_CHECK_HEADER(tunepimp-0.5/tp_c.h, have_musicbrainz=yes)

  	if test "x$with_musicbrainz" != xcheck && test "x$have_musicbrainz" != xyes; then
    		AC_MSG_ERROR([--with-musicbrainz was given, but test for MusicBrainz failed])
  	fi
fi

if test "x$have_musicbrainz" = xyes; then
	v=1
  	KDE_CHECK_LIB(tunepimp, tp_SetFileNameEncoding,
		[v=4])
	case "$v" in
	4) KDE_CHECK_LIB(tunepimp, tp_SetTRMCollisionThreshold,
		AC_DEFINE(HAVE_MUSICBRAINZ, 4, [have MusicBrainz 0.4.x]),
		[AC_MSG_WARN([Tunepimp 0.5 detected - disabled.])
		AC_DEFINE(HAVE_MUSICBRAINZ, 0, [have MusicBrainz 0.5.x - disabled])
		])
		;;
	*) AC_DEFINE(HAVE_MUSICBRAINZ, 1, [have MusicBrainz]) ;;
	esac
else
  	AC_DEFINE(HAVE_MUSICBRAINZ, 0, [have MusicBrainz])
fi

AM_CONDITIONAL(link_lib_MB, test "x$have_musicbrainz" = xyes)

AC_ARG_WITH(gstreamer,
  	[AC_HELP_STRING(--with-gstreamer,
    	[enable support for GStreamer @<:@default=check@:>@])],
	[], with_gstreamer=check)

have_gst=no

if test "x$with_gstreamer" != xno; then
	# pkg-config seems to have a bug where it masks needed -L entries when it
	# shouldn't, so disable that.

	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
	export PKG_CONFIG_ALLOW_SYSTEM_LIBS

	GST_MAJORMINOR=1.0
	GST_REQ=1.0.0
	PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ, have_gst=yes, have_gst=no)

	if test "x$have_gst" != xyes; then
		AC_MSG_RESULT(no)

		GST_MAJORMINOR=0.10
		GST_REQ=0.10.0
		PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ, have_gst=yes, have_gst=no)

		if test "x$have_gst" != xyes; then
			AC_MSG_RESULT(no)

			GST_MAJORMINOR=0.8
			GST_REQ=0.8.0
			PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ, have_gst=yes, have_gst=no)

			if test "x$have_gst" != xyes; then
				AC_MSG_RESULT(no)
			fi
		fi
	fi

	if test "x$with_gstreamer" != xcheck && test "x$have_gst" != xyes; then
		AC_MSG_ERROR([--with-gstreamer was given, but test for GStreamer failed])
	fi
fi

if test "x$have_gst" = "xno"; then
	GST_CFLAGS=""
	LDADD_GST=""
	LDFLAGS_GST=""
	AC_DEFINE(HAVE_GSTREAMER, 0, [have GStreamer])
else
	LDADD_GST=`$PKG_CONFIG --libs-only-l gstreamer-$GST_MAJORMINOR`
	LDFLAGS_GST=`$PKG_CONFIG --libs-only-other gstreamer-$GST_MAJORMINOR`

	# Append -L entries, since they are masked by --libs-only-l and
	# --libs-only-other
	LIBDIRS_GST=`$PKG_CONFIG --libs-only-L gstreamer-$GST_MAJORMINOR`
	LDADD_GST="$LDADD_GST $LIBDIRS_GST"

	AC_MSG_NOTICE([GStreamer version >= $GST_REQ found.])
	AC_DEFINE(HAVE_GSTREAMER, 1, [have GStreamer])
fi

AC_SUBST(GST_CFLAGS)
AC_SUBST(LDADD_GST)
AC_SUBST(LDFLAGS_GST)

if test "x$have_taglib" != xyes || ( test "x$build_arts" = "xno" && test "x$have_gst" = "xno" && test "x$have_akode" = "xno") ; then
	DO_NOT_COMPILE="$DO_NOT_COMPILE juk"
fi