summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 4a238332cef750839d204c403c0c86ec3dce901b (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
AC_PREREQ(2.52)

dnl initialize autoconf
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, cvs and prerelease does Werror too
AC_INIT(GStreamer Python Bindings, 0.10.7,
    http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
    gst-python)

dnl initialize automake
AM_INIT_AUTOMAKE

dnl define PACKAGE_VERSION_* variables
AS_VERSION

dnl check if this is a release version
AS_NANO(GST_CVS="no", GST_CVS="yes")

dnl can autoconf find the source ?
AC_CONFIG_SRCDIR([gst/gstmodule.c])

dnl define the output header for config
AM_CONFIG_HEADER([config.h])

dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
AM_MAINTAINER_MODE

AC_DEFINE_UNQUOTED(PYGST_MAJOR_VERSION, $PACKAGE_VERSION_MAJOR, [PyGst major version])
AC_DEFINE_UNQUOTED(PYGST_MINOR_VERSION, $PACKAGE_VERSION_MINOR, [PyGst minor version])
AC_DEFINE_UNQUOTED(PYGST_MICRO_VERSION, $PACKAGE_VERSION_MICRO, [PyGst micro version])
AC_DEFINE_UNQUOTED(PYGST_NANO_VERSION, $PACKAGE_VERSION_NANO, [PyGst nano version])

dnl Add parameters for aclocal
AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4")

dnl required versions of other packages
AC_SUBST(PYGTK_REQ, 2.6.3)
AC_SUBST(PYGOBJECT_REQ, 2.11.2)
AC_SUBST(GLIB_REQ,  2.8.0)
AC_SUBST(GTK_REQ,   2.6.0)
AC_SUBST(GST_REQ,   0.10.2)
AC_SUBST(GSTPB_REQ, 0.10.0.2)

AC_DISABLE_STATIC
AC_PROG_LIBTOOL

GST_ARG_GCOV

dnl check for python
dnl AM_PATH_PYTHON(2.2)
AM_PATH_PYTHON
AC_MSG_CHECKING(for python >= 2.3)
prog="
import sys, string
minver = (2,3,0,'final',0)
if sys.version_info < minver:
  sys.exit(1)
sys.exit(0)"

if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
  AC_MSG_RESULT(okay)
else
  AC_MSG_ERROR(too old)
fi
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])

dnl check for GStreamer
GST_MAJORMINOR=0.10
AC_SUBST(GST_MAJORMINOR)
PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ)
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)

dnl get the installed GStreamer core version
GST_MINOR_VERSION=`$PKG_CONFIG --modversion gstreamer-$GST_MAJORMINOR | cut -f 3 -d.`
GST_PB_MINOR_VERSION=`$PKG_CONFIG --modversion gstreamer-plugins-base-$GST_MAJORMINOR | cut -f 3 -d.`
GST_CVS_VERSION=`$PKG_CONFIG --modversion gstreamer-$GST_MAJORMINOR | cut -f 4 -d.`

echo "Building against GStreamer core 0.10.$GST_MINOR_VERSION , ignoring API additions if needed"

dnl Magic for allowing new API additions without forcing dependency on new core
dnl release. The lines do the magic so that new API additions are ignored at
dnl compile time.
dnl * Also see gst/gstversion.override.in and gst-0.10.*.override
dnl The following lines should be updated whenever:
dnl _ GST_REQ is up-ed (remove obsolete lines + gst-0.10.MINOR.ignore)
dnl _ new core/base is released (add lines + gst-0.10.MINOR.ignore)

if test "x$GST_CVS_VERSION" = "x"
then
  if test $GST_MINOR_VERSION -lt "3"
  then
    IGNORE_GST_0_10_3="gst-0.10.3.ignore"
  else
    IGNORE_GST_0_10_3=""
  fi

  if test $GST_MINOR_VERSION -lt "4"
  then
    IGNORE_GST_0_10_4="gst-0.10.4.ignore"
  else
    IGNORE_GST_0_10_4=""
  fi
  
  if test $GST_MINOR_VERSION -lt "5"
  then
    IGNORE_GST_0_10_5="gst-0.10.5.ignore"
  else
    IGNORE_GST_0_10_5=""
  fi

  if test $GST_MINOR_VERSION -lt "6"
  then
    IGNORE_GST_0_10_6="gst-0.10.6.ignore"
  else
    IGNORE_GST_0_10_6=""
  fi

  dnl 0.10.8 was a brown paperbag release

  if test $GST_MINOR_VERSION -lt "8"
  then
    IGNORE_GST_0_10_7="gst-0.10.7.ignore"
  else
    IGNORE_GST_0_10_7=""
  fi

  dnl 0.10.9 didn't bring any new wrappable API

  if test $GST_MINOR_VERSION -lt "10"
  then
    IGNORE_GST_0_10_10="gst-0.10.10.ignore"
  else
    IGNORE_GST_0_10_10=""
  fi

  if test $GST_MINOR_VERSION -lt "11"
  then
    IGNORE_GST_0_10_11="gst-0.10.11.ignore"
  else
    IGNORE_GST_0_10_11=""
  fi

  if test $GST_MINOR_VERSION -lt "12"
  then
    IGNORE_GST_0_10_12="gst-0.10.12.ignore"
  else
    IGNORE_GST_0_10_12=""
  fi

  dnl plugins base 
  if test $GST_PB_MINOR_VERSION -lt "11"
  then
    IGNORE_GST_PB_0_10_11="gst-pb-0.10.11.ignore"
  else
    IGNORE_GST_PB_0_10_11=""
    AC_DEFINE_UNQUOTED(HAVE_VIDEO_ORIENTATION_INTERFACE, 1, [We can use the videoorientation interface])
  fi


else
  IGNORE_GST_0_10_3=""
  IGNORE_GST_0_10_4=""
  IGNORE_GST_0_10_5=""
  IGNORE_GST_0_10_6=""
  IGNORE_GST_0_10_7=""
  IGNORE_GST_0_10_10=""
  IGNORE_GST_0_10_11=""
  IGNORE_GST_0_10_12=""
  IGNORE_GST_PB_0_10_11=""
  AC_DEFINE_UNQUOTED(HAVE_VIDEO_ORIENTATION_INTERFACE, 1, [We can use the videoorientation interface])
fi
AC_SUBST(IGNORE_GST_0_10_3)
AC_SUBST(IGNORE_GST_0_10_4)
AC_SUBST(IGNORE_GST_0_10_5)
AC_SUBST(IGNORE_GST_0_10_6)
AC_SUBST(IGNORE_GST_0_10_7)
AC_SUBST(IGNORE_GST_0_10_10)
AC_SUBST(IGNORE_GST_0_10_11)
AC_SUBST(IGNORE_GST_0_10_12)
AC_SUBST(IGNORE_GST_PB_0_10_11)
AC_SUBST(HAVE_VIDEO_ORIENTATION)

dnl check for gstreamer-base; uninstalled is selected preferentially
PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
  HAVE_GST_BASE="yes", HAVE_GST_BASE="no")

if test "x$HAVE_GST_BASE" = "xno"; then
  AC_MSG_ERROR(no GStreamer Base Libs found)
fi

AC_SUBST(GST_BASE_LIBS)
AC_SUBST(GST_BASE_CFLAGS)

dnl check for gstreamer-controller
PKG_CHECK_MODULES(GST_CONTROLLER, gstreamer-controller-$GST_MAJORMINOR >= $GST_REQ,
  HAVE_GST_CONTROLLER="yes", HAVE_GST_CONTROLLER="no")

if test "x$HAVE_GST_CONTROLLER" = "xno"; then
  AC_MSG_ERROR(no GStreamer Controller Libs found)
fi

AC_SUBST(GST_CONTROLLER_LIBS)
AC_SUBST(GST_CONTROLLER_CFLAGS)

dnl check for gstreamer-net
PKG_CHECK_MODULES(GST_NET, gstreamer-net-$GST_MAJORMINOR >= $GST_REQ,
  HAVE_GST_NET="yes", HAVE_GST_NET="no")

if test "x$HAVE_GST_NET" = "xno"; then
  AC_MSG_ERROR(no GStreamer Networking Libs found)
fi

AC_SUBST(GST_NET_LIBS)
AC_SUBST(GST_NET_CFLAGS)

dnl check for gstreamer-dataprotocol
PKG_CHECK_MODULES(GST_DP, gstreamer-dataprotocol-$GST_MAJORMINOR >= $GST_REQ,
  HAVE_GST_DP="yes", HAVE_GST_DP="no")

if test "x$HAVE_GST_DP" = "xno"; then
  AC_MSG_ERROR(no GStreamer Data Protocol Libs found)
fi

AC_SUBST(GST_DP_LIBS)
AC_SUBST(GST_DP_CFLAGS)


dnl check for gst-plugins-base
PKG_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPB_REQ,
  HAVE_GST_PLUGINS_BASE="yes", HAVE_GST_PLUGINS_BASE="no")

if test "x$HAVE_GST_PLUGINS_BASE" = "xno"; then
  AC_MSG_ERROR(no gst-plugins-base found)
fi

AC_SUBST(GST_PLUGINS_BASE_LIBS)
AC_SUBST(GST_PLUGINS_BASE_CFLAGS)


dnl check for pygobject
PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= $PYGOBJECT_REQ,
  [
    HAVE_PYGOBJECT="yes"
    AC_MSG_RESULT([yes])
  ], HAVE_PYGOBJECT="no")

if test "x$HAVE_PYGOBJECT" = "xno"; then
  dnl If we don't have pygobject, then check for pygtk
  dnl check for pygtk
  PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= $PYGTK_REQ)
  AC_SUBST(PYGTK_CFLAGS)
  PYGOBJECT_CFLAGS="\$(PYGTK_CFLAGS)"
fi
AC_SUBST(PYGOBJECT_CFLAGS)

dnl FIXME: check for a pygobject with a correct pyg_param_gvalue_from_pyobject
PKG_CHECK_MODULES(PYGOBJECT_2_12, pygobject-2.0 >= 2.11.1,
  [
    HAVE_PYGOBJECT_2_12="yes"
    AC_MSG_RESULT([yes])
    AC_DEFINE_UNQUOTED(HAVE_PYGOBJECT_2_12, 1,
      [Defined if we have a 2.12 series pygobject])
  ], HAVE_PYGOBJECT_2_12="no")

dnl define an ERROR_CFLAGS Makefile variable
GST_SET_ERROR_CFLAGS($GST_CVS)

GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(GCOV_CFLAGS)"
AC_SUBST(GST_OPTION_CFLAGS)
GST_OPTION_LIBS="\$(GCOV_LIBS)"
AC_SUBST(GST_OPTION_LIBS)

dnl full installation path
AS_AC_EXPAND(PYTHONDIR, $pythondir)
AS_AC_EXPAND(PYEXECDIR, $pyexecdir)

dnl add debugging options ...
# changequote(,)dnl
# if test "x$GCC" = xyes; then
#   case " $CFLAGS " in
#   *[\	\ ]-Wall[\	\ ]*) ;;
#   *) CFLAGS="$CFLAGS -Wall" ;;
#   esac

#   case " $CFLAGS " in
#   *[\	\ ]-std=c9x[\	\ ]*) ;;
#   *) CFLAGS="$CFLAGS -std=c9x" ;;
#   esac
# fi
# changequote([,])dnl

GST_VALGRIND_CHECK()

AC_OUTPUT([
  Makefile
  codegen/Makefile
  gst/Makefile
  gst/gstversion.override
  gst/extend/Makefile
  examples/Makefile
  pkgconfig/Makefile
  pkgconfig/gst-python.pc
  pkgconfig/gst-python-uninstalled.pc
  testsuite/Makefile
  gst-python.spec
])