File: configure.ac

package info (click to toggle)
grilo 0.3.2-2
  • links: PTS
  • area: main
  • in suites:
  • size: 6,032 kB
  • ctags: 3,834
  • sloc: ansic: 18,286; sh: 4,094; xml: 2,235; makefile: 498; python: 200
file content (327 lines) | stat: -rw-r--r-- 9,398 bytes parent folder | download
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
#
# configure.ac
# 
# Author: Iago Toral Quiroga <itoral@igalia.com>
#
# Copyright (C) 2010, 2011 Igalia S.L.. All rights reserved.

m4_define([prj_name],    [grilo])
m4_define([prj_gir_name], [Grilo])
m4_define([grl_major_version], [0])
m4_define([grl_minor_version], [3])
m4_define([grl_micro_version], [2])
m4_define([prj_version], grl_major_version.grl_minor_version.grl_micro_version)

AC_INIT([prj_name],
        [prj_version],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=grilo;component=core],
        [prj_name],
        [https://wiki.gnome.org/Projects/Grilo])

AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz no-dist-gzip])

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/grilo.h])

AC_CONFIG_HEADERS([config.h])

AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL

LT_PREREQ([2.2.6])
LT_INIT

AM_PROG_CC_C_O

AC_HEADER_STDC

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

# Grilo Net library

GRLNET_VERSION=grl_major_version.grl_minor_version.grl_micro_version
AC_SUBST(GRLNET_VERSION)
AC_DEFINE_UNQUOTED(GRLNET_VERSION, "$GRLNET_VERSION", [Grilo Net library version])

# Grilo Pls library

GRLPLS_VERSION=grl_major_version.grl_minor_version.grl_micro_version
AC_SUBST(GRLPLS_VERSION)
AC_DEFINE_UNQUOTED(GRLPLS_VERSION, "$GRLPLS_VERSION", [Grilo Pls library version])

# ----------------------------------------------------------
# LIBTOOL VERSIONING
# ----------------------------------------------------------

# Libtool library version, not to confuse with API version
# see http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html

GRL_LT_VERSION=1:1:1
GRLNET_LT_VERSION=0:2:0
GRLPLS_LT_VERSION=0:0:0

AC_SUBST([GRL_LT_VERSION])
AC_SUBST([GRLNET_LT_VERSION])
AC_SUBST([GRLPLS_LT_VERSION])

# ----------------------------------------------------------
# ENVIRONMENT CONFIGURATION
# ----------------------------------------------------------

AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS],[yes])
CFLAGS+=" ${WARN_CFLAGS} -Wmissing-declarations -std=c99 "

# ----------------------------------------------------------
# DEFINITIONS
# ----------------------------------------------------------

# API version

GRL_MAJORMINOR=grl_major_version.grl_minor_version
GRL_MAJORMINOR_NORM=grl_major_version[_]grl_minor_version
AC_SUBST(GRL_MAJORMINOR)
AC_SUBST(GRL_MAJORMINOR_NORM)
AC_DEFINE_UNQUOTED(GRL_MAJORMINOR, "$GRL_MAJORMINOR", [library major.minor version])

# Framework name (contains API version)

GRL_NAME="${PACKAGE_NAME}-${GRL_MAJORMINOR}"
AC_SUBST(GRL_NAME)
AC_DEFINE_UNQUOTED(GRL_NAME, "$GRL_NAME", [framework name])

# Give parameters a default value

if test "x${prefix}" = "xNONE" ; then
   prefix="${ac_default_prefix}"
fi

if test "x${exec_prefix}" = "xNONE" ; then
   exec_prefix="${prefix}"
fi

# Plugins directory

GRL_PLUGINS_DIR=`eval echo ${libdir}/${GRL_NAME}`
AC_SUBST(GRL_PLUGINS_DIR)
AC_DEFINE_UNQUOTED(GRL_PLUGINS_DIR, "$GRL_PLUGINS_DIR", [Plugins directory])

# ----------------------------------------------------------
# DEPENDENCIES
# ----------------------------------------------------------

PKG_CHECK_MODULES(DEPS, glib-2.0 >= 2.34 \
			gobject-2.0 \
			gmodule-2.0 \
			gio-2.0 >= 2.44\
			libxml-2.0)


GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
AC_SUBST(GLIB_MKENUMS)

# ----------------------------------------------------------
# UI Tool
# ----------------------------------------------------------

PKG_CHECK_MODULES([GTU], [ gtk+-3.0 >= 3.0 ],
                       [ HAVE_GTK=yes ],
                       [ HAVE_GTK=no ])

PKG_CHECK_MODULES(OAUTH, oauth, [HAVE_OAUTH=yes], [HAVE_OAUTH=no])

AM_CONDITIONAL(HAVE_OAUTH, test "x$HAVE_OAUTH" = "xyes")

if test "x$HAVE_OAUTH" = "xyes"; then
   AC_DEFINE(HAVE_OAUTH, 1, [OAuth available])
else
   AC_MSG_WARN([oauth missing, unable to configure Flickr personal accounts])
fi

AC_ARG_ENABLE(test-ui,
        AS_HELP_STRING([--enable-test-ui],
                [Build Test UI (default: auto)]),
        [
                case "$enableval" in
                     yes)
                        if test "x$HAVE_GTK" = "xno"; then
                           AC_MSG_ERROR([gtk+-3.0 >= 3.0 not found, install it or use --disable-test-ui])
                        fi
                        ;;
                     no)
                        HAVE_GTK=no
                        ;;
                esac
        ])

AM_CONDITIONAL(BUILD_GRILO_TEST_UI, test "x$HAVE_GTK" = "xyes")

# ----------------------------------------------------------
# NET LIBRARY
# ----------------------------------------------------------

PKG_CHECK_MODULES(NET, libsoup-2.4 >= 2.41.3,
			HAVE_LIBSOUP=yes,
			HAVE_LIBSOUP=no)

AC_ARG_ENABLE([grl_net],
        AS_HELP_STRING([--enable-grl-net],
                [Enable Grilo Net library (default: auto)]),
        [
                case "$enableval" in
                     yes | auto)
                        if test "x$HAVE_LIBSOUP" = "xno"; then
                           AC_MSG_ERROR([libsoup-2.4 not found, install it or use --disable-grl-net])
                        fi
                        ;;
                     no)
                        HAVE_LIBSOUP=no
                        ;;
                esac
        ])

AM_CONDITIONAL(BUILD_GRILO_NET, test "x$HAVE_LIBSOUP" = "xyes")

# ----------------------------------------------------------
# PLS LIBRARY
# ----------------------------------------------------------

PKG_CHECK_MODULES(TOTEM_PL_PARSER, totem-plparser >= 3.4.1, HAVE_TOTEM_PL_PARSER=yes, HAVE_TOTEM_PL_PARSER=no)

AC_ARG_ENABLE([grl_pls],
        AS_HELP_STRING([--enable-grl-pls],
                [Enable Grilo Pls library (default: auto)]),
        [
                case "$enableval" in
                     yes | auto)
                        if test "x$HAVE_TOTEM_PL_PARSER" = "xno"; then
                           AC_MSG_ERROR([totem-pl-parser not found, install it or use --disable-grl-pls])
                        fi
                        ;;
                     no)
                        HAVE_TOTEM_PL_PARSER=no
                        ;;
                esac
        ])

AM_CONDITIONAL(BUILD_GRILO_PLS, test "x$HAVE_TOTEM_PL_PARSER" = "xyes")

# ----------------------------------------------------------
# DEBUG SUPPORT
# ----------------------------------------------------------

AC_ARG_ENABLE(debug,
        [  --enable-debug include debug symbols],,
        enable_debug=yes)
if test "x$enable_debug" = "xyes"; then
        AC_MSG_WARN("Configuring with debugging options enabled!")
	CFLAGS="$CFLAGS -g3 -O0"
fi

# ----------------------------------------------------------
# TESTS SUPPORT
# ----------------------------------------------------------

AC_ARG_ENABLE([tests],
        AS_HELP_STRING([--enable-tests],[build unit tests]),
        enable_tests=yes,
        enable_tests=no)

AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "xyes")

# ----------------------------------------------------------
# GTK-DOC
# ----------------------------------------------------------

GTK_DOC_CHECK([1.10],[--flavour no-tmpl])

# ----------------------------------------------------------
# GOBJECT-INTROSPECTION
# ----------------------------------------------------------

GOBJECT_INTROSPECTION_CHECK([0.9])

# ----------------------------------------------------------
# VALA BINDINGS
# ----------------------------------------------------------

VAPIGEN_CHECK([0.27])

# ----------------------------------------------------------
# GETTEXT/INTLTOOL
# ----------------------------------------------------------

IT_PROG_INTLTOOL([0.40.0])
GETTEXT_PACKAGE=grilo
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The domain to use with gettext])

# ----------------------------------------------------------
# WORKAROUNDS
# ----------------------------------------------------------

AC_SUBST([abs_top_builddir])
AC_SUBST([builddir])

# ----------------------------------------------------------
# OUTPUT
# ----------------------------------------------------------

if test "x$HAVE_LIBSOUP" = "xyes"; then
   AC_CONFIG_FILES([grilo-net-uninstalled.pc grilo-net-${GRL_MAJORMINOR}.pc])
fi

if test "x$HAVE_TOTEM_PL_PARSER" = "xyes"; then
   AC_CONFIG_FILES([grilo-pls-uninstalled.pc grilo-pls-${GRL_MAJORMINOR}.pc])
fi

AC_CONFIG_FILES([
  Makefile
  grilo-uninstalled.pc
  grilo-${GRL_MAJORMINOR}.pc
  src/Makefile
  src/data/Makefile
  po/Makefile.in
  po/Makefile
  tests/Makefile
  tests/python/Makefile
  tests/python/util.py
  libs/Makefile
  libs/net/Makefile
  libs/pls/Makefile
  tools/Makefile
  tools/grilo-test-ui/Makefile
  tools/grilo-inspect/Makefile
  tools/grilo-launch/Makefile
  bindings/Makefile
  bindings/vala/Makefile
  doc/Makefile
  doc/grilo/Makefile
  examples/Makefile
])

AC_OUTPUT

echo "

Configuration
        Version               : ${VERSION}
        Prefix                : ${prefix}
        Compiler              : ${CC}

        Enable debug          : ${enable_debug}
        Enable tests          : ${enable_tests}

        Enable docs           : ${enable_gtk_doc}

        Introspection support : ${found_introspection}
        Vala support          : ${enable_vala}

        Enable Test UI        : ${HAVE_GTK}

        GrlNet support        : ${HAVE_LIBSOUP}
        GrlPls support        : ${HAVE_TOTEM_PL_PARSER}

"