configure.ac 10 KB
Newer Older
1
AC_PREREQ(2.52)
2

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

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
10 11
AG_GST_INIT

12 13
dnl initialize automake
AM_INIT_AUTOMAKE
14

15 16
dnl define PACKAGE_VERSION_* variables
AS_VERSION
David I. Lehn's avatar
David I. Lehn committed
17

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

dnl can autoconf find the source ?
22
AC_CONFIG_SRCDIR([gst/gstmodule.c])
23 24 25 26 27 28 29 30 31

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])
32 33
AC_DEFINE_UNQUOTED(PYGST_MICRO_VERSION, $PACKAGE_VERSION_MICRO, [PyGst micro version])
AC_DEFINE_UNQUOTED(PYGST_NANO_VERSION, $PACKAGE_VERSION_NANO, [PyGst nano version])
34 35 36 37
AC_SUBST(PACKAGE_VERSION_MAJOR)
AC_SUBST(PACKAGE_VERSION_MINOR)
AC_SUBST(PACKAGE_VERSION_MICRO)
AC_SUBST(PACKAGE_VERSION_NANO)
David I. Lehn's avatar
David I. Lehn committed
38

39
dnl Add parameters for aclocal
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
40
AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4")
David I. Lehn's avatar
David I. Lehn committed
41

42
dnl required versions of other packages
43
AC_SUBST(PYGTK_REQ, 2.6.3)
44
AC_SUBST(PYGOBJECT_REQ, 2.11.2)
45
AC_SUBST(GLIB_REQ,  2.8.0)
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
46
AC_SUBST(GTK_REQ,   2.6.0)
47 48
AC_SUBST(GST_REQ,   0.10.18)
AC_SUBST(GSTPB_REQ, 0.10.18)
49

David I. Lehn's avatar
David I. Lehn committed
50
AC_DISABLE_STATIC
51 52

AC_LIBTOOL_WIN32_DLL
David I. Lehn's avatar
David I. Lehn committed
53 54
AC_PROG_LIBTOOL

55 56 57 58 59 60
dnl find a compiler
AC_PROG_CC

dnl check if the compiler supports '-c' and '-o' options
AM_PROG_CC_C_O

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
61
AG_GST_ARG_GCOV
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
62

David I. Lehn's avatar
David I. Lehn committed
63 64 65
dnl check for python
dnl AM_PATH_PYTHON(2.2)
AM_PATH_PYTHON
66
AC_MSG_CHECKING(for python >= 2.3)
David I. Lehn's avatar
David I. Lehn committed
67 68
prog="
import sys, string
69
minver = (2,3,0,'final',0)
David I. Lehn's avatar
David I. Lehn committed
70 71 72
if sys.version_info < minver:
  sys.exit(1)
sys.exit(0)"
73

David I. Lehn's avatar
David I. Lehn committed
74 75 76 77 78 79 80 81
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)])

82
dnl check for GStreamer
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
83
GST_MAJORMINOR=0.10
84
AC_SUBST(GST_MAJORMINOR)
85
PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ)
86
AC_DEFINE_UNQUOTED(GST_MAJORMINOR, "$GST_MAJORMINOR", [Gst MajorMinor version])
87
AC_SUBST(GST_CFLAGS)
Johan Dahlin's avatar
Johan Dahlin committed
88
AC_SUBST(GST_LIBS)
89

90 91
dnl get the installed GStreamer core version
GST_MINOR_VERSION=`$PKG_CONFIG --modversion gstreamer-$GST_MAJORMINOR | cut -f 3 -d.`
92
GST_PB_MINOR_VERSION=`$PKG_CONFIG --modversion gstreamer-plugins-base-$GST_MAJORMINOR | cut -f 3 -d.`
93
GST_CVS_VERSION=`$PKG_CONFIG --modversion gstreamer-$GST_MAJORMINOR | cut -f 4 -d.`
94 95 96 97 98 99 100 101 102 103 104

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)

105
if test "x$GST_CVS_VERSION" = "x"
106
then
Edward Hervey's avatar
Edward Hervey committed
107 108 109 110 111 112 113
  if test $GST_MINOR_VERSION -lt "20"
  then
    IGNORE_GST_0_10_20="gst-0.10.20.ignore"
  else
    IGNORE_GST_0_10_20=""
  fi

114 115 116 117 118 119 120
  if test $GST_MINOR_VERSION -lt "21"
  then
    IGNORE_GST_0_10_21="gst-0.10.21.ignore"
  else
    IGNORE_GST_0_10_21=""
  fi

Edward Hervey's avatar
Edward Hervey committed
121 122 123 124 125 126 127
  if test $GST_MINOR_VERSION -lt "22"
  then
    IGNORE_GST_0_10_22="gst-0.10.22.ignore"
  else
    IGNORE_GST_0_10_22=""
  fi

128 129 130 131 132 133 134
  if test $GST_MINOR_VERSION -lt "23"
  then
    IGNORE_GST_0_10_23="gst-0.10.23.ignore"
  else
    IGNORE_GST_0_10_23=""
  fi

135 136 137 138 139 140 141
  if test $GST_MINOR_VERSION -lt "24"
  then
    IGNORE_GST_0_10_24="gst-0.10.24.ignore"
  else
    IGNORE_GST_0_10_24=""
  fi

142 143 144 145 146 147 148
  if test $GST_MINOR_VERSION -lt "25"
  then
    IGNORE_GST_0_10_25="gst-0.10.25.ignore"
  else
    IGNORE_GST_0_10_25=""
  fi

149 150 151 152 153 154 155
  if test $GST_MINOR_VERSION -lt "26"
  then
    IGNORE_GST_0_10_26="gst-0.10.26.ignore"
  else
    IGNORE_GST_0_10_26=""
  fi

156
  dnl plugins base
157 158 159
  if test $GST_PB_MINOR_VERSION -ge "22"
  then
    AC_DEFINE_UNQUOTED(HAVE_GST_AUDIO, 1, [We can use the gst-audio library])
160
    AC_DEFINE_UNQUOTED(HAVE_GST_VIDEO, 1, [We can use the gst-video library])
161
    AC_DEFINE_UNQUOTED(HAVE_GST_TAG, 1, [We can use the gst-tag library])
162 163
  fi

164 165 166 167 168 169
  if test $GST_PB_MINOR_VERSION -lt "23"
  then
    IGNORE_GST_PB_0_10_23="gst-pb-0.10.23.ignore"
  else
    IGNORE_GST_PB_0_10_23=""
  fi
170 171 172 173 174 175 176

  if test $GST_PB_MINOR_VERSION -lt "25"
  then
    IGNORE_GST_PB_0_10_25="gst-pb-0.10.25.ignore"
  else
    IGNORE_GST_PB_0_10_25=""
    AC_DEFINE_UNQUOTED(HAVE_STREAM_VOLUME_INTERFACE, 1, [We can use the streamvolume interface])
177 178 179 180 181 182 183
  fi 

  if test $GST_PB_MINOR_VERSION -lt "26"
  then
    IGNORE_GST_PB_0_10_26="gst-pb-0.10.26.ignore"
  else
    IGNORE_GST_PB_0_10_26=""
184
  fi
185
else
Edward Hervey's avatar
Edward Hervey committed
186 187
  IGNORE_GST_0_10_18=""
  IGNORE_GST_0_10_20=""
188
  IGNORE_GST_0_10_21=""
Edward Hervey's avatar
Edward Hervey committed
189
  IGNORE_GST_0_10_22=""
190
  IGNORE_GST_0_10_23=""
191
  IGNORE_GST_0_10_24=""
192
  IGNORE_GST_0_10_25=""
193
  IGNORE_GST_0_10_26=""
194
  IGNORE_GST_PB_0_10_23=""
195
  IGNORE_GST_PB_0_10_25=""
196
  IGNORE_GST_PB_0_10_26=""
197
  AC_DEFINE_UNQUOTED(HAVE_GST_AUDIO, 1, [We can use the gst-audio library])
198
  AC_DEFINE_UNQUOTED(HAVE_GST_VIDEO, 1, [We can use the gst-video library])
199
  AC_DEFINE_UNQUOTED(HAVE_GST_TAG, 1, [We can use the gst-tag library])
200
fi
201
AC_DEFINE_UNQUOTED(HAVE_STREAM_VOLUME_INTERFACE, 1, [We can use the streamvolume interface])
Edward Hervey's avatar
Edward Hervey committed
202
AC_SUBST(IGNORE_GST_0_10_20)
203
AC_SUBST(IGNORE_GST_0_10_21)
Edward Hervey's avatar
Edward Hervey committed
204
AC_SUBST(IGNORE_GST_0_10_22)
205
AC_SUBST(IGNORE_GST_0_10_23)
206
AC_SUBST(IGNORE_GST_0_10_24)
207
AC_SUBST(IGNORE_GST_0_10_25)
208
AC_SUBST(IGNORE_GST_0_10_26)
209
AC_SUBST(IGNORE_GST_PB_0_10_23)
210
AC_SUBST(IGNORE_GST_PB_0_10_25)
211
AC_SUBST(IGNORE_GST_PB_0_10_26)
212
AM_CONDITIONAL(HAVE_GST_AUDIO, $HAVE_GST_AUDIO)
213
AM_CONDITIONAL(HAVE_GST_VIDEO, $HAVE_GST_VIDEO)
214
AM_CONDITIONAL(HAVE_GST_TAG, $HAVE_GST_TAG)
215

216 217 218 219 220 221 222 223 224 225 226
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)

227 228 229 230 231 232

dnl check for gstreamer core features (subsystems)
GST_CONFIGPATH=`$PKG_CONFIG --variable=includedir gstreamer-0.10`"/gst/gstconfig.h"
AG_GST_PARSE_SUBSYSTEM_DISABLES($GST_CONFIGPATH)
if test $GST_DISABLE_LOADSAVE = "1"; then
  AC_MSG_WARN("Load/Save XML persistence disabled")
233 234 235
  IGNORE_GST_LOADSAVE="gst-disable-loadsave.ignore"
else
  IGNORE_GST_LOADSAVE=""
236
fi
237
AC_SUBST(IGNORE_GST_LOADSAVE)
238

239 240 241 242 243 244 245 246 247 248 249
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)

250 251 252 253 254 255 256 257 258 259 260
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)

261 262 263 264 265 266 267 268 269 270 271 272
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)


273
dnl check for gst-plugins-base
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
274
PKG_CHECK_MODULES(GST_PLUGINS_BASE, gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPB_REQ,
275 276 277 278 279 280 281 282 283
  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)

284

285 286
dnl check for pygobject
PKG_CHECK_MODULES(PYGOBJECT, pygobject-2.0 >= $PYGOBJECT_REQ,
287 288 289 290
  [
    HAVE_PYGOBJECT="yes"
    AC_MSG_RESULT([yes])
  ], HAVE_PYGOBJECT="no")
David I. Lehn's avatar
David I. Lehn committed
291

292 293 294 295
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)
296
  AC_SUBST(PYGTK_CFLAGS)
297
  PYGOBJECT_CFLAGS="\$(PYGTK_CFLAGS)"
298 299
fi
AC_SUBST(PYGOBJECT_CFLAGS)
300

301 302 303 304 305 306 307 308 309
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")

310 311 312 313 314 315 316 317 318 319 320
dnl FIXME: check for a pygobject which exports pyg_option_group_new
PKG_CHECK_MODULES(PYGOBJECT_2_16, pygobject-2.0 >= 2.15.0,
  [
    HAVE_PYGOBJECT_2_16="yes"
    AC_MSG_RESULT([yes])
    AC_DEFINE_UNQUOTED(HAVE_PYGOBJECT_2_16, 1,
      [Defined if we have a 2.16 series pygobject])
  ], HAVE_PYGOBJECT_2_16="no")

AM_CONDITIONAL(HAVE_PYGOBJECT_2_16, test x$HAVE_PYGOBJECT_2_16 != xno)

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
321
dnl define an ERROR_CFLAGS Makefile variable
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
322
AG_GST_SET_ERROR_CFLAGS($GST_CVS)
323

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
324 325 326 327
GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(GCOV_CFLAGS)"
AC_SUBST(GST_OPTION_CFLAGS)
GST_OPTION_LIBS="\$(GCOV_LIBS)"
AC_SUBST(GST_OPTION_LIBS)
328

329 330
dnl full installation path
AS_AC_EXPAND(PYTHONDIR, $pythondir)
331
AS_AC_EXPAND(PYEXECDIR, $pyexecdir)
332

David I. Lehn's avatar
David I. Lehn committed
333
dnl add debugging options ...
334 335 336 337 338 339 340 341 342 343 344 345 346
# 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
347

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
348
AG_GST_VALGRIND_CHECK
349

350 351 352 353 354 355
dnl Stuff needed for the python plugin loader

AM_CHECK_PYTHON_LIBS(,[AC_MSG_ERROR(could not find Python lib)])

AG_GST_SET_PLUGINDIR

356
SHAVE_INIT([common],[enable])
357

358
AC_OUTPUT([
David I. Lehn's avatar
David I. Lehn committed
359
  Makefile
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
360
  codegen/Makefile
361 362
  common/Makefile
  common/m4/Makefile
Jan Schmidt's avatar
Jan Schmidt committed
363 364
  common/shave
  common/shave-libtool
365
  gst/Makefile
366
  gst/gstversion.override
367
  gst/extend/Makefile
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
368
  examples/Makefile
David I. Lehn's avatar
David I. Lehn committed
369 370 371
  pkgconfig/Makefile
  pkgconfig/gst-python.pc
  pkgconfig/gst-python-uninstalled.pc
372
  plugin/Makefile
373
  testsuite/Makefile
Edward Hervey's avatar
Edward Hervey committed
374
  win32/common/config.h
375 376
  gst-python.spec
])