configure.ac 4.19 KB
Newer Older
1
AC_PREREQ([2.68])
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
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
6
AC_INIT(GStreamer GObject Introspection overrides for Python , 1.12.5,
7 8
    http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
    gst-python)
9

10 11
AG_GST_INIT

12
dnl initialize automake
13
AM_INIT_AUTOMAKE([-Wno-portability 1.11 no-dist-gzip dist-xz tar-ustar subdir-objects])
14

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

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

dnl can autoconf find the source ?
22 23
# FIXME Port testsuite to 1.0
# AC_CONFIG_SRCDIR([testsuite/common.py])
24 25

dnl define the output header for config
26
AC_CONFIG_HEADERS([config.h])
27 28

dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
29
AM_MAINTAINER_MODE([enable])
30

31 32 33 34 35
dnl use pretty build output with automake >= 1.11
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
  [AM_DEFAULT_VERBOSITY=1
   AC_SUBST(AM_DEFAULT_VERBOSITY)])

36
dnl Add parameters for aclocal
37
AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
David I. Lehn's avatar
David I. Lehn committed
38

39
dnl required versions of other packages
40
dnl Note that they are runtime requirements
Sebastian Dröge's avatar
Sebastian Dröge committed
41
AC_SUBST(GST_REQ, 1.12.0)
42 43 44 45
AC_SUBST(PYGOBJECT_REQ, 3.0)

AC_DISABLE_STATIC

46 47
LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])
48 49 50 51 52 53 54

dnl find a compiler
AC_PROG_CC
AC_PROG_CC_STDC

dnl check if the compiler supports '-c' and '-o' options
AM_PROG_CC_C_O
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
55

David I. Lehn's avatar
David I. Lehn committed
56
dnl check for python
57
dnl AM_PATH_PYTHON(2.7)
David I. Lehn's avatar
David I. Lehn committed
58
AM_PATH_PYTHON
59
AC_MSG_CHECKING(for python >= 2.7)
David I. Lehn's avatar
David I. Lehn committed
60 61
prog="
import sys, string
62
minver = (2,7,0,'final',0)
David I. Lehn's avatar
David I. Lehn committed
63 64 65
if sys.version_info < minver:
  sys.exit(1)
sys.exit(0)"
66

67 68 69 70 71 72 73 74
dnl check for GStreamer
GST_API_VERSION=1.0
AC_SUBST(GST_API_VERSION)
PKG_CHECK_MODULES(GST, gstreamer-$GST_API_VERSION >= $GST_REQ)
AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION", [Gst API version])
GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS"
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
75

76 77 78 79 80 81

dnl check for pygobject
PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= $PYGOBJECT_REQ)
AC_SUBST(PYGOBJECT_CFLAGS)

dnl check for python
David I. Lehn's avatar
David I. Lehn committed
82 83 84 85 86 87
if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
then
  AC_MSG_RESULT(okay)
else
  AC_MSG_ERROR(too old)
fi
88 89 90 91 92 93 94

# - 'SO' for PyPy, CPython 2.7-3.2
# - 'EXT_SUFFIX' for CPython3.3+ (http://bugs.python.org/issue16754)
# - fallback to '.so'
PYTHON_SO=`$PYTHON -c "import distutils.sysconfig, sys; get = distutils.sysconfig.get_config_var; sys.stdout.write(get('EXT_SUFFIX') or get('SO') or '.so');"`
AC_SUBST(PYTHON_SO)

95
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
AS_AC_EXPAND(PYTHONDIR, $pythondir)
AS_AC_EXPAND(PYEXECDIR, $pyexecdir)

AC_ARG_WITH([pygi_overrides_dir],
            AC_HELP_STRING([--with-pygi-overrides-dir], [Path to pygobject overrides directory]))

AC_MSG_CHECKING(for pygobject overrides directory)
if test "x$with_pygi_overrides_dir" = "x" ; then
        overrides_dir="${pyexecdir}/gi/overrides"
else
        overrides_dir="$with_pygi_overrides_dir"
fi

PYGI_OVERRIDES_DIR="$overrides_dir"
AC_SUBST(PYGI_OVERRIDES_DIR)
AC_MSG_RESULT($PYGI_OVERRIDES_DIR)

113 114 115 116 117 118 119 120 121
dnl check for GStreamer
GST_API_VERSION=1.0
AC_SUBST(GST_API_VERSION)
PKG_CHECK_MODULES(GST, gstreamer-$GST_API_VERSION >= $GST_REQ)
AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION", [Gst API version])
GST_CFLAGS="$GST_CFLAGS $GLIB_EXTRA_CFLAGS"
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)

122 123
AG_GST_SET_PLUGINDIR

124
dnl check for pygobject
125
PKG_CHECK_MODULES(PYGOBJECT, pygobject-3.0 >= $PYGOBJECT_REQ)
126 127
AC_SUBST(PYGOBJECT_CFLAGS)

128 129 130
dnl and set the override directory
AC_ARG_WITH([pygi_overrides_dir],
            AC_HELP_STRING([--with-pygi-overrides-dir], [Path to pygobject overrides directory]))
131

132 133
AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.]))

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
134
AG_GST_VALGRIND_CHECK
135

136
dnl set release date/time
137 138 139
#AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
  #["${srcdir}/gst-python.doap"],
  #[$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
140

141 142 143 144
# Examples and testsuite need to be ported to 1.0
# examples/Makefile
# testsuite/Makefile

145
AC_OUTPUT([
David I. Lehn's avatar
David I. Lehn committed
146
  Makefile
147 148
  common/Makefile
  common/m4/Makefile
149
  gi/Makefile
150
  plugin/Makefile
151
  testsuite/Makefile
152
  gi/overrides/Makefile
153
])