~ubuntu-branches/ubuntu/quantal/totem-pl-parser/quantal

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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
AC_PREREQ(2.62)

m4_define(totem_version_major, 2)
m4_define(totem_version_minor, 32)
m4_define(totem_version_micro, 5)

AC_INIT([totem-pl-parser],
        [totem_version_major.totem_version_minor.totem_version_micro],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=totem-pl-parser&component=General])

AM_MAINTAINER_MODE
AC_CONFIG_SRCDIR([plparse/totem-pl-parser.c])
AC_CONFIG_HEADERS([config.h])
AC_GNU_SOURCE

AM_INIT_AUTOMAKE([1.9 dist-bzip2 no-dist-gzip check-news subdir-objects])

# Enable silent build when available (Automake 1.11)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])

dnl Add the languages which your application supports to po/LINGUAS
GETTEXT_PACKAGE=totem-pl-parser
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], [Define to the Gettext package name])
AC_SUBST(GETTEXT_PACKAGE)
IT_PROG_INTLTOOL([0.35.0])

AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_LIBTOOL()
PKG_PROG_PKG_CONFIG

dnl Use local version of asprintf when not on the current system.
AC_CHECK_FUNCS(asprintf)
AC_CONFIG_LIBOBJ_DIR([lib])
AC_REPLACE_FUNCS([asprintf])

AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])

# Requirements
GLIB_REQS=2.21.6
GIO_REQS=2.24.0
QUVI_REQS=0.2.15
LIBARCHIVE_REQS=2.8.4

# Before making a release, the PLPARSER_LT_VERSION string should be modified.
# The string is of the form C:R:A.
# - If interfaces have been changed or added, but binary compatibility has
#   been preserved, change to C+1:0:A+1
# - If binary compatibility has been broken (eg removed or changed interfaces)
#   change to C+1:0:0
# - If the interface is the same as the previous version, change to C:R+1:A
PLPARSER_LT_VERSION=17:1:0
AC_SUBST(PLPARSER_LT_VERSION)

TOTEM_PL_PARSER_VERSION_MAJOR=totem_version_major
TOTEM_PL_PARSER_VERSION_MINOR=totem_version_minor
TOTEM_PL_PARSER_VERSION_MICRO=totem_version_micro
AC_SUBST(TOTEM_PL_PARSER_VERSION_MAJOR)
AC_SUBST(TOTEM_PL_PARSER_VERSION_MINOR)
AC_SUBST(TOTEM_PL_PARSER_VERSION_MICRO)

pkg_modules="glib-2.0 >= $GLIB_REQS libxml-2.0 gthread-2.0 gio-2.0 >= $GIO_REQS libsoup-gnome-2.4"

##################################
# Checking libgmime dependency
##################################
gmime_message=""

AC_ARG_ENABLE(gmime-i-know-what-im-doing,
	      AS_HELP_STRING([--disable-gmime-i-know-what-im-doing],
			     [Disable libgmime (Unsupported, breaks Podcast support).]),
			     [enable_gmime=no],
			     [enable_gmime=yes])

if test "x$enable_gmime" = "xyes" ; then
   PKG_CHECK_MODULES(GMIME,  
		     gmime-2.4,
                     [have_gmime=yes GMIME=gmime-2.4], 
                     [have_gmime=no])
   if test "x$have_gmime" != "xyes" ; then
     PKG_CHECK_MODULES(GMIME,  
		       gmime-2.6,
		       [have_gmime=yes GMIME=gmime-2.6], 
		       [have_gmime=no])
   fi

   if test "x$have_gmime" = "xyes" ; then
      AC_SUBST(GMIME, $GMIME)
      AC_SUBST(USEGMIME, yes)
      AC_DEFINE(HAVE_GMIME, 1, [GMime available in the system])
      pkg_modules="$pkg_modules $GMIME"
   else
      AC_MSG_ERROR([libgmime is required to compile totem-pl-parser.])
   fi
else
   AC_SUBST(USEGMIME, no)
   gmime_message="
 **************************************************************
 Compiling totem-pl-parser without libgmime.
 This will break podcast support and is completely unsupported.
 **************************************************************"
fi

##################################
# Checking quvi dependency
##################################

QUVI=""
AC_ARG_ENABLE(quvi,
	      AS_HELP_STRING([--enable-quvi],
			     [Enable libquvi support (default is auto).]),
			     [],
			     [enable_quvi=auto])
if test "x$enable_quvi" != "xno" ; then
	PKG_CHECK_MODULES(QUVI,
			  libquvi >= $QUVI_REQS,
			  [have_quvi=yes], [have_quvi=no])
	if test "x$enable_quvi" = "xyes" -a "x$have_quvi" = "xno" ; then
		AC_MSG_ERROR([Quvi support requested but not available.])
	fi
	if test "x$have_quvi" = "xyes" ; then
		pkg_modules="$pkg_modules libquvi"
		QUVI="libquvi"
		AC_DEFINE(HAVE_QUVI, 1, [libquvi available in the system])
	fi
fi
AC_SUBST(QUVI, $QUVI)

##################################
# Checking libarchive dependency
##################################

ARCHIVE=""
AC_ARG_ENABLE(libarchive,
	      AS_HELP_STRING([--enable-libarchive],
			     [Enable libarchive support (default is auto).]),
			     [],
			     [enable_libarchive=auto])
if test "x$enable_libarchive" != "xno" ; then
	PKG_CHECK_MODULES(ARCHIVE,
			  libarchive >= $LIBARCHIVE_REQS,
			  [have_libarchive=yes], [have_libarchive=no])
	if test "x$enable_libarchive" = "xyes" -a "x$have_libarchive" = "xno" ; then
		AC_MSG_ERROR([Libarchive support requested but not available.])
	fi
	if test "x$have_libarchive" = "xyes" ; then
		pkg_modules="$pkg_modules libarchive"
		ARCHIVE="libarchive"
		AC_DEFINE(HAVE_LIBARCHIVE, 1, [libarchive available in the system])
	fi
fi
AC_SUBST(ARCHIVE, $ARCHIVE)

dnl Check for packages for building libtotem-plparser.la
PKG_CHECK_MODULES(TOTEM_PLPARSER, [$pkg_modules])
AC_SUBST(TOTEM_PLPARSER_CFLAGS)
AC_SUBST(TOTEM_PLPARSER_LIBS)

PKG_CHECK_MODULES([TOTEM_PLPARSER_MINI], [gio-2.0 $QUVI])

GNOME_COMMON_INIT
GNOME_DEBUG_CHECK
GNOME_COMPILE_WARNINGS([maximum])
GNOME_CXX_WARNINGS
GNOME_MAINTAINER_MODE_DEFINES

if test "$GCC" = "yes" ; then
	CFLAGS="\
	-Wall \
	-Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \
	-Wnested-externs -Wpointer-arith \
	-Wcast-align -Wsign-compare \
	-fno-strict-aliasing \
	$CFLAGS"
fi

AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])

GTK_DOC_CHECK(1.11)
GOBJECT_INTROSPECTION_CHECK([0.9.5])

AC_CONFIG_FILES([
Makefile
totem-plparser.pc
totem-plparser-uninstalled.pc
totem-plparser-mini.pc
totem-plparser-mini-uninstalled.pc
totem-pl-parser.spec
lib/Makefile
plparse/Makefile
plparse/tests/Makefile
plparse/totem-pl-parser-features.h
po/Makefile.in
docs/Makefile
docs/reference/Makefile
docs/reference/version.xml
])


AC_OUTPUT

if test "x$have_quvi" = "xyes"; then
	AC_MSG_NOTICE([** Quvi video link parsing enabled])
else
	AC_MSG_NOTICE([   Quvi video link parsing disabled])
fi
if test "x$have_libarchive" = "xyes"; then
	AC_MSG_NOTICE([** ISO detection with libarchive enabled])
else
	AC_MSG_NOTICE([   ISO detection with libarchive disabled])
fi

echo "
$gmime_message
"