Update AC_PREREQ as suggested by autoupdate
[gst-am7xxxsink.git] / configure.ac
1 dnl required version of autoconf
2 AC_PREREQ([2.69])
3
4 AC_INIT([gst-am7xxxsink],[0.1.0],[http://ao2.it],[gst-am7xxxsink])
5
6 dnl required versions of gstreamer and plugins-base
7 GST_REQUIRED=1.0.0
8 GSTPB_REQUIRED=1.0.0
9
10 AC_CONFIG_SRCDIR([src/gstam7xxxsink.c])
11 AC_CONFIG_HEADERS([config.h])
12
13 dnl required version of automake
14 AM_INIT_AUTOMAKE([1.10])
15
16 dnl enable mainainer mode by default
17 AM_MAINTAINER_MODE([enable])
18
19 dnl use pretty build output with automake >= 1.11
20 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
21   [AM_DEFAULT_VERBOSITY=1
22    AC_SUBST(AM_DEFAULT_VERBOSITY)])
23
24 dnl check for tools (compiler etc.)
25 AC_PROG_CC
26
27 dnl required version of libtool
28 LT_PREREQ([2.2.6])
29 LT_INIT
30
31 dnl give error and exit if we don't have pkgconfig
32 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [
33   AC_MSG_ERROR([You need to have pkg-config installed!])
34 ])
35
36 PKG_CHECK_MODULES(GST, [
37   gstreamer-1.0 >= $GST_REQUIRED
38   gstreamer-base-1.0 >= $GST_REQUIRED
39   gstreamer-controller-1.0 >= $GST_REQUIRED
40   gstreamer-video-1.0 >= $GST_REQUIRED
41 ], [
42   AC_SUBST(GST_CFLAGS)
43   AC_SUBST(GST_LIBS)
44 ], [
45   AC_MSG_ERROR([
46       You need to install or upgrade the GStreamer development
47       packages on your system. On debian-based systems these are
48       libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev.
49       on RPM-based systems gstreamer1.0-devel, libgstreamer1.0-devel
50       or similar. The minimum version required is $GST_REQUIRED.
51   ])
52 ])
53
54 PKG_CHECK_MODULES(LIBAM7XXX, [
55   libam7xxx >= 0.1
56 ], [
57   AC_SUBST(LIBAM7XXX_CFLAGS)
58   AC_SUBST(LIBAM7XXX_LIBS)
59 ], [
60   AC_MSG_ERROR([
61       libam7xxx not found.
62   ])
63 ])
64
65 dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS)
66 AC_MSG_CHECKING([to see if compiler understands -Wall])
67 save_CFLAGS="$CFLAGS"
68 CFLAGS="$CFLAGS -Wall"
69 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [
70   GST_CFLAGS="$GST_CFLAGS -Wall"
71   AC_MSG_RESULT([yes])
72 ], [
73   AC_MSG_RESULT([no])
74 ])
75
76 dnl set the plugindir where plugins should be installed (for src/Makefile.am)
77 if test "x${prefix}" = "x$HOME"; then
78   plugindir="$HOME/.gstreamer-1.0/plugins"
79 else
80   plugindir="\$(libdir)/gstreamer-1.0"
81 fi
82 AC_SUBST(plugindir)
83
84 dnl set proper LDFLAGS for plugins
85 GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
86 AC_SUBST(GST_PLUGIN_LDFLAGS)
87
88 AC_CONFIG_FILES([Makefile src/Makefile])
89 AC_OUTPUT
90