configure.ac 4.37 KB
Newer Older
David I. Lehn's avatar
David I. Lehn committed
1
-*- mode: m4 -*-
2
AC_PREREQ(2.57)
3

4 5
AC_INIT
AC_CANONICAL_TARGET
David I. Lehn's avatar
David I. Lehn committed
6

7 8 9 10
dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
AM_MAINTAINER_MODE
                                                                                
dnl when going to/from release please set the nano (fourth number) right !
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
11
AS_VERSION(gst-python, PYGST_VERSION, 0, 9, 6, 1,
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
12
    GST_CVS="no", GST_CVS="yes")
13

14
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
15

16 17 18
AC_DEFINE_UNQUOTED(PYGST_MAJOR_VERSION, $PYGST_VERSION_MAJOR, [PyGst major version])
AC_DEFINE_UNQUOTED(PYGST_MINOR_VERSION, $PYGST_VERSION_MINOR, [PyGst minor version])
AC_DEFINE_UNQUOTED(PYGST_MICRO_VERSION, $PYGST_VERSION_MICRO, [PyGst macro version])
David I. Lehn's avatar
David I. Lehn committed
19

20
AC_CONFIG_SRCDIR([gst/gstmodule.c])
David I. Lehn's avatar
David I. Lehn committed
21 22
AM_CONFIG_HEADER(config.h)

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

26
dnl required versions of other packages
27
AC_SUBST(PYGTK_REQ, 2.6.3)
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
28 29
AC_SUBST(GLIB_REQ,  2.6.0)
AC_SUBST(GTK_REQ,   2.6.0)
30
AC_SUBST(GST_REQ,   0.9.0)
31

David I. Lehn's avatar
David I. Lehn committed
32 33 34 35 36 37 38

AC_DISABLE_STATIC
AC_PROG_LIBTOOL

dnl check for python
dnl AM_PATH_PYTHON(2.2)
AM_PATH_PYTHON
39
AC_MSG_CHECKING(for python >= 2.3)
David I. Lehn's avatar
David I. Lehn committed
40 41
prog="
import sys, string
42
minver = (2,3,0,'final',0)
David I. Lehn's avatar
David I. Lehn committed
43 44 45
if sys.version_info < minver:
  sys.exit(1)
sys.exit(0)"
46

David I. Lehn's avatar
David I. Lehn committed
47 48 49 50 51 52 53 54
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)])

55
dnl check for GStreamer
56
GST_MAJORMINOR=0.9
57
AC_SUBST(GST_MAJORMINOR)
58
PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ)
59
AC_SUBST(GST_CFLAGS)
Johan Dahlin's avatar
Johan Dahlin committed
60
AC_SUBST(GST_LIBS)
61

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
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)

84 85 86 87 88 89 90 91 92 93 94
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)

95

David I. Lehn's avatar
David I. Lehn committed
96
dnl check for pygtk
97
PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= $PYGTK_REQ)
98
AC_SUBST(PYGTK_CFLAGS)
David I. Lehn's avatar
David I. Lehn committed
99 100 101 102 103 104

AC_MSG_CHECKING(for pygtk defs)
PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
AC_SUBST(PYGTK_DEFSDIR)
AC_MSG_RESULT($PYGTK_DEFSDIR)

105
AC_MSG_CHECKING(for pygtk h2def)
106
PYGTK_H2DEF=`$PKG_CONFIG --variable=codegendir pygtk-2.0`/h2def.py
107 108 109
AC_SUBST(PYGTK_H2DEF)
AC_MSG_RESULT($PYGTK_H2DEF)

110 111 112
AC_MSG_CHECKING(for pygtk codegen)
PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py"
dnl PYGTK_CODEGEN="$PYTHON \$(top_srcdir)/codegen/codegen.py"
113
AC_SUBST(PYGTK_CODEGEN)
114
AC_MSG_RESULT($PYGTK_CODEGEN)
115

116
dnl Interfaces
117
AC_MSG_CHECKING(for GStreamer interfaces include dir)
118
PKG_CHECK_MODULES(GST_INTERFACES, gstreamer-plugins-base-$GST_MAJORMINOR,
119 120
                  HAVE_INTERFACES=yes,HAVE_INTERFACES=no)
AM_CONDITIONAL(BUILD_INTERFACES, test "x$HAVE_INTERFACES" = "xyes")
121
AC_SUBST(GST_INTERFACES_CFLAGS)
122
AC_SUBST(GST_INTERFACES_LIBS)
123

124 125 126 127 128 129 130 131 132 133 134 135 136
dnl decide on error flags
dnl if we support -Wall, set it unconditionally
AS_COMPILER_FLAG(-Wall,
                 PYGST_ERROR_CFLAGS="-Wall",
                 PYGST_ERROR_CFLAGS="")
dnl if we're in nano >= 1, add -Werror if supported
if test "x$GST_CVS" = "xyes"
then
  AS_COMPILER_FLAG(-Werror, PYGST_ERROR_CFLAGS="$PYGST_ERROR_CFLAGS -Werror")
fi

PYGST_CFLAGS="$PYGST_ERROR_CFLAGS"
AC_SUBST(PYGST_CFLAGS)
137

138 139 140
dnl full installation path
AS_AC_EXPAND(PYTHONDIR, $pythondir)

David I. Lehn's avatar
David I. Lehn committed
141 142 143 144 145 146 147 148 149 150 151 152 153 154
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
155

156 157
GST_VALGRIND_CHECK()

158
AC_OUTPUT([
David I. Lehn's avatar
David I. Lehn committed
159
  Makefile
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
160
  codegen/Makefile
161
  gst/Makefile
162
  gst/extend/Makefile
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
163
  examples/Makefile
David I. Lehn's avatar
David I. Lehn committed
164 165 166
  pkgconfig/Makefile
  pkgconfig/gst-python.pc
  pkgconfig/gst-python-uninstalled.pc
167
  testsuite/Makefile
168 169
  gst-python.spec
])