configure.ac: enable automake silent rules
[gst-am7xxxsink.git] / configure.ac
1 dnl required version of autoconf
2 AC_PREREQ([2.53])
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 ], [
41   AC_SUBST(GST_CFLAGS)
42   AC_SUBST(GST_LIBS)
43 ], [
44   AC_MSG_ERROR([
45       You need to install or upgrade the GStreamer development
46       packages on your system. On debian-based systems these are
47       libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev.
48       on RPM-based systems gstreamer1.0-devel, libgstreamer1.0-devel
49       or similar. The minimum version required is $GST_REQUIRED.
50   ])
51 ])
52
53 dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS)
54 AC_MSG_CHECKING([to see if compiler understands -Wall])
55 save_CFLAGS="$CFLAGS"
56 CFLAGS="$CFLAGS -Wall"
57 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [
58   GST_CFLAGS="$GST_CFLAGS -Wall"
59   AC_MSG_RESULT([yes])
60 ], [
61   AC_MSG_RESULT([no])
62 ])
63
64 dnl set the plugindir where plugins should be installed (for src/Makefile.am)
65 if test "x${prefix}" = "x$HOME"; then
66   plugindir="$HOME/.gstreamer-1.0/plugins"
67 else
68   plugindir="\$(libdir)/gstreamer-1.0"
69 fi
70 AC_SUBST(plugindir)
71
72 dnl set proper LDFLAGS for plugins
73 GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
74 AC_SUBST(GST_PLUGIN_LDFLAGS)
75
76 AC_CONFIG_FILES([Makefile src/Makefile])
77 AC_OUTPUT
78