summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 5c65591b2a11ca2e752131483b24be2335984bf3 (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
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
328
329
330
331
332
333
334
335
336
337
338
339
# clutter package version number, (as distinct from shared library version)
# An odd micro number indicates in-progress developmen
# An even micro number indicates a released version.
m4_define(clutter_gst_major_version, 3)
m4_define(clutter_gst_minor_version, 0)
m4_define(clutter_gst_micro_version, 0)

m4_define(clutter_api_version, 1.0)
m4_define([clutter_gst_api_version], [3.0])

m4_define([clutter_gst_version],
          [clutter_gst_major_version.clutter_gst_minor_version.clutter_gst_micro_version])

# increase the interface age for each release; if the API changes, set to 0
m4_define([clutter_gst_interface_age], [0])
m4_define([clutter_gst_binary_age],
          [m4_eval(100 * clutter_gst_minor_version + clutter_gst_micro_version)])

AC_PREREQ(2.53)

AC_INIT([clutter-gst], [clutter_gst_version],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=clutter-gst])
AC_CONFIG_MACRO_DIR([build/autotools])
AC_CONFIG_AUX_DIR([build/autotools])
AC_CONFIG_SRCDIR([clutter-gst/clutter-gst.h])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([1.9 -Wno-portability foreign no-dist-gzip dist-xz tar-ustar])

echo \#buildapi-variable-no-builddir >/dev/null

CLUTTER_GST_MAJOR_VERSION=clutter_gst_major_version
CLUTTER_GST_MINOR_VERSION=clutter_gst_minor_version
CLUTTER_GST_MICRO_VERSION=clutter_gst_micro_version
CLUTTER_GST_VERSION=clutter_gst_version
CLUTTER_GST_API_VERSION=clutter_gst_api_version
CLUTTER_GST_MAJORMINOR=clutter_gst_api_version
CLUTTER_API_VERSION=clutter_api_version
AC_SUBST(CLUTTER_GST_MAJOR_VERSION)
AC_SUBST(CLUTTER_GST_MINOR_VERSION)
AC_SUBST(CLUTTER_GST_MICRO_VERSION)
AC_SUBST(CLUTTER_GST_VERSION)
AC_SUBST(CLUTTER_GST_API_VERSION)
AC_SUBST(CLUTTER_GST_MAJORMINOR)
AC_SUBST(CLUTTER_API_VERSION)

m4_define([lt_current],
          [m4_eval(100 * clutter_gst_minor_version + clutter_gst_micro_version - clutter_gst_interface_age)])
m4_define([lt_revision], [clutter_gst_interface_age])
m4_define([lt_age], [m4_eval(clutter_gst_binary_age - clutter_gst_interface_age)])

CLUTTER_GST_LT_CURRENT=lt_current
CLUTTER_GST_LT_REV=lt_revision
CLUTTER_GST_LT_AGE=lt_age
CLUTTER_GST_LT_VERSION="$CLUTTER_GST_LT_CURRENT:$CLUTTER_GST_LT_REV:$CLUTTER_GST_LT_AGE"
CLUTTER_GST_LT_LDFLAGS="-version-info $CLUTTER_GST_LT_VERSION"

AC_CANONICAL_HOST
AC_MSG_CHECKING([if building for some Win32 platform])
AS_CASE([$host],
        [*-*-mingw*|*-*-cygwin*],
        [
          CLUTTER_GST_LT_LDFLAGS="$CLUTTER_GST_LT_LDFLAGS -no-undefined"
          platform_win32=yes
        ],

        [platform_win32=no]
)
AC_MSG_RESULT([$platform_win32])

AC_SUBST(CLUTTER_GST_LT_VERSION)
AC_SUBST(CLUTTER_GST_LT_LDFLAGS)

m4_define([clutter_gst_release_status],
          [m4_if(m4_eval(clutter_gst_micro_version % 2), [1], [git],
                 [m4_if(m4_eval(clutter_gst_minor_version % 2), [1], [snapshot],
                       [release])])])
AC_SUBST([CLUTTER_GST_RELEASE_STATUS], [clutter_gst_release_status])

# pkg-config requirements
GLIB_REQ_VERSION=2.18.0
COGL_REQ_VERSION=1.10.0
COGL_GST_REQ_VERSION=1.99.0
CLUTTER_REQ_VERSION=1.6.0
GSTREAMER_REQ_VERSION=1.0.0
GST_PLUGINS_BAD_REQ_VERSION=1.0.0

AC_SUBST(GLIB_REQ_VERSION)
AC_SUBST(CLUTTER_REQ_VERSION)
AC_SUBST(GSTREAMER_REQ_VERSION)

dnl ========================================================================

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

dnl ========================================================================

# require libtool >= 2.2
LT_PREREQ([2.2.6])
LT_INIT([disable-static])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_SED
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([memset munmap strcasecmp strdup])

dnl ========================================================================

AC_CHECK_PROG(CGC, [cgc], [cgc], [no])
have_cgc="no"
if test "x$CGC" = "xcgc"; then
        have_cgc="yes"
fi
AM_CONDITIONAL([HAVE_CGC], [test "x$have_cgc" = "xyes"])

dnl ========================================================================
dnl check for python (pso2h.py needs it)

AC_CHECK_PROG(PYTHON, [python], [python], [no])
have_python="no"
if test "x$PYTHON" = "xpython"; then
        have_python="yes"
fi
AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])

dnl ========================================================================

PKG_CHECK_MODULES(CLUTTER_GST,
                  [clutter-1.0 >= $CLUTTER_REQ_VERSION
                   cogl-1.0 >= $COGL_REQ_VERSION
                   cogl-gst >= $COGL_GST_REQ_VERSION
                   gio-2.0 >= $GLIB_REQ_VERSION])

dnl ========================================================================

GST_MAJORMINOR=1.0

PKG_CHECK_MODULES(GST,
                  [gstreamer-$GST_MAJORMINOR >= $GSTREAMER_REQ_VERSION
                   gstreamer-plugins-base-$GST_MAJORMINOR
                   gstreamer-base-$GST_MAJORMINOR
                   gstreamer-pbutils-$GST_MAJORMINOR
                   gstreamer-video-$GST_MAJORMINOR
                   gstreamer-audio-$GST_MAJORMINOR
                   gstreamer-tag-$GST_MAJORMINOR])

dnl libs used by the plugin
PKG_CHECK_MODULES([PLUGIN],
                  [clutter-1.0 >= $CLUTTER_REQ_VERSION
                   gstreamer-$GST_MAJORMINOR >= $GSTREAMER_REQ_VERSION
                   gstreamer-base-$GST_MAJORMINOR
                   gstreamer-video-$GST_MAJORMINOR
                   gstreamer-audio-$GST_MAJORMINOR])

dnl define location of gstreamer plugin directory
plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
AC_SUBST(plugindir)

dnl ========================================================================
dnl GL inclusion and link. We depend on GL for the single glGetIntegerv()
dnl call. The end goal is to get rid of it, but we can't just yet.

dnl For now, we assume Clutter/Cogl includes the GL headers (whatever they
dnl are). By the time they don't do that, we'll hopefully won't have any
dnl direct GL dependency.

dnl As for linking against -lGL, I believe Clutter always end up puttin libGL
dnl in its exported CFLAGS, except when compiling against the NVidia library
dnl (which does not have the 'gl' .pc file. For now, let's just add -lGL when
dnl we are using the glx flavour, That should fix the vast majority of the
dnl issues

dnl Why don't we "just" link against GL? check the cogl/clutter configure.ac :)
dnl Hopefully this will be enough for the time being.

dnl With Cogl 1.8.0 all of the above is moot because we can use
dnl cogl_renderer_get_n_fragment_texture_units() and never depend on GL/GLES
dnl directly. However let's not hard depend on cogl 1.8.0 just yet.
dnl Well, obviously just a little detail remaining, it's not possible to grab
dnl the CoglContext on OS X yet.

PKG_CHECK_EXISTS([clutter-osx-1.0],
                 [
                   AC_DEFINE([HAVE_CLUTTER_OSX], [1],
                             ["Defined if building Clutter for OS X"])
                   have_cogl_osx=yes
                 ])

AS_IF([test "x$have_cogl_osx" = xyes],
      [
        clutter_soname=`$PKG_CONFIG --variable soname_infix clutter-1.0`
        AS_CASE([$clutter_soname],
                [glx],
                [AC_CHECK_LIB([GL], [glGetIntegerv], [GL_LDFLAGS="-lGL"])])
        AC_SUBST([GL_LDFLAGS])
      ])

PKG_CHECK_MODULES(GUDEV,
                 [gudev-1.0],
                 [
                   have_gudev=yes
                   AC_DEFINE([HAVE_GUDEV], [1],
                             ["Defined if gudev is available"])
                 ],[ have_gudev=no ])

dnl ========================================================================
dnl Experimental support for hardware accelerated decoders.
dnl Temporarily disabling for GStreamer 1.0 since it's causing too many issues
dnl and the API for hw support isn't yet put in stone
have_hw_decoder_support=no
# PKG_CHECK_MODULES(HW,
#                  [gstreamer-basevideo-$GST_MAJORMINOR >= $GST_PLUGINS_BAD_REQ_VERSION],
#                  [
#                    have_hw_decoder_support=yes
#                    AC_DEFINE([HAVE_HW_DECODER_SUPPORT], [1],
#                              ["Defined if building Clutter with HW decoder support"])
#                  ],[ have_hw_decoder_support=no ])

dnl ========================================================================

m4_define([maintainer_default], [m4_if(clutter_gst_release_status,
                                       [git], [yes], [no])])
AC_ARG_ENABLE([maintainer-flags],
              [AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],
                              [Use strict compiler flags @<:@default=]maintainer_default[@:>@])],
              [],
              enable_maintainer_flags=maintainer_default)

AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
      [
        AS_COMPILER_FLAGS([MAINTAINER_CFLAGS],
                          ["-Wall -Wshadow -Wcast-align -Wno-uninitialized
                            -Wno-strict-aliasing -Wempty-body -Wformat-security
                            -Winit-self -Wsign-compare"])
      ]
)

AC_SUBST(MAINTAINER_CFLAGS)

dnl === Enable debug level ====================================================

m4_define([debug_default], [m4_if(clutter_gst_release_status,
                                  [git], [yes], [minimum])])
AC_ARG_ENABLE([debug],
              [AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
                              [Control Clutter-Gst debugging level @<:@default=]debug_default[@:>@])],
              [],
              enable_debug=debug_default)

AS_CASE([$enable_debug],

        [yes],
        [
          test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
          CLUTTER_GST_DEBUG_CFLAGS="-DCLUTTER_GST_ENABLE_DEBUG"
        ],

        [minimum],
        [CLUTTER_GST_DEBUG_CFLAGS="-DCLUTTER_GST_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],

        [no],
        [CLUTTER_GST_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],

        [AC_MSG_ERROR([Unknown argument for --enable-debug])]
)

AC_SUBST(CLUTTER_GST_DEBUG_CFLAGS)

dnl ========================================================================

GTK_DOC_CHECK([1.8])

AM_CONDITIONAL([BUILD_GTK_DOC],
               [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])

dnl ========================================================================

GOBJECT_INTROSPECTION_CHECK([0.6.8])

dnl ========================================================================

AC_SUBST(GCC_FLAGS)
GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)

AC_SUBST(CLUTTER_GST_CFLAGS)
AC_SUBST(CLUTTER_GST_LIBS)

AC_OUTPUT([
        Makefile
        build/Makefile
        build/autotools/Makefile
        scripts/Makefile
        clutter-gst/Makefile
        clutter-gst/clutter-gst-version.h
        clutter-gst/shaders/Makefile
        tests/Makefile
        examples/Makefile
        doc/Makefile
        doc/reference/Makefile
        doc/reference/version.xml
        clutter-gst.pc
])

dnl ========================================================================

echo ""
echo "Clutter-GST $VERSION (${CLUTTER_GST_RELEASE_STATUS})"
echo ""
echo " • Global:"
echo "        Prefix     : ${prefix}"
echo "        Cg compiler: ${have_cgc}"
echo ""
echo " • Compiler options:"
echo "        Compiler flags:${MAINTAINER_CFLAGS} ${CPPFLAGS}"
echo "        Debug level   : ${enable_debug}"
echo ""
echo " • Extra:"
echo "        API documentation : ${enable_gtk_doc}"
echo "        Introspection data: ${enable_introspection}"
echo "        HW Decoder support: ${have_hw_decoder_support}"
echo "        UDEV support      : ${have_gudev}"
echo ""