blob: 1e1094787b414f1397f8a3309a2d57e72d749b63 [file] [log] [blame]
xuesong.jiang1801e172021-10-11 10:56:41 +08001dnl required version of autoconf
2AC_PREREQ([2.69])
3
4dnl TODO: fill in your package name and package version here
5AC_INIT([aml-video-sink-plugin-package],[1.0.0])
6
7dnl required versions of gstreamer and plugins-base
8GST_REQUIRED=1.0.0
9DRM_REQUIRED=2.4
10
11AC_CONFIG_SRCDIR([src])
12AC_CONFIG_HEADERS([config.h])
13
14dnl required version of automake
15AM_INIT_AUTOMAKE([1.10])
16
17dnl enable mainainer mode by default
18AM_MAINTAINER_MODE([enable])
19
20dnl check for tools (compiler etc.)
21AC_PROG_CC
22
23dnl required version of libtool
24LT_PREREQ([2.2.6])
25LT_INIT
26
27dnl give error and exit if we don't have pkgconfig
28AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [
29 AC_MSG_ERROR([You need to have pkg-config installed!])
30])
31
32PKG_CHECK_MODULES(DRM, [
33 libdrm >= $DRM_REQUIRED
34], [
35 AC_SUBST(DRM_CFLAGS)
36 AC_SUBST(DRM_LIBS)
37], [
38 AC_MSG_ERROR([Wrong libDRM version])
39])
40
41dnl Check for the required version of GStreamer core (and gst-plugins-base)
42dnl This will export GST_CFLAGS and GST_LIBS variables for use in Makefile.am
43dnl
44dnl If you need libraries from gst-plugins-base here, also add:
45dnl for libgstaudio-1.0: gstreamer-audio-1.0 >= $GST_REQUIRED
46dnl for libgstvideo-1.0: gstreamer-video-1.0 >= $GST_REQUIRED
47dnl for libgsttag-1.0: gstreamer-tag-1.0 >= $GST_REQUIRED
48dnl for libgstpbutils-1.0: gstreamer-pbutils-1.0 >= $GST_REQUIRED
49dnl for libgstfft-1.0: gstreamer-fft-1.0 >= $GST_REQUIRED
50dnl for libgstinterfaces-1.0: gstreamer-interfaces-1.0 >= $GST_REQUIRED
51dnl for libgstrtp-1.0: gstreamer-rtp-1.0 >= $GST_REQUIRED
52dnl for libgstrtsp-1.0: gstreamer-rtsp-1.0 >= $GST_REQUIRED
53dnl etc.
54
55PKG_CHECK_MODULES(GST, [
56 gstreamer-1.0 >= $GST_REQUIRED
57 gstreamer-base-1.0 >= $GST_REQUIRED
58 gstreamer-allocators-1.0 >= $GST_REQUIRED
59], [
60 AC_SUBST(GST_CFLAGS)
61 AC_SUBST(GST_LIBS)
62], [
63 AC_MSG_ERROR([
64 You need to install or upgrade the GStreamer development
65 packages on your system. On debian-based systems these are
66 libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev.
67 on RPM-based systems gstreamer1.0-devel, libgstreamer1.0-devel
68 or similar. The minimum version required is $GST_REQUIRED.
69 ])
70])
71
72dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS)
73AC_MSG_CHECKING([to see if compiler understands -Wall])
74save_CFLAGS="$CFLAGS"
75CFLAGS="$CFLAGS -Wall"
76AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [
77 GST_CFLAGS="$GST_CFLAGS -Wall"
78 AC_MSG_RESULT([yes])
79], [
80 AC_MSG_RESULT([no])
81])
82
83dnl set the plugindir where plugins should be installed (for src/Makefile.am)
84if test "x${prefix}" = "x$HOME"; then
85 plugindir="$HOME/.gstreamer-1.0/plugins"
86else
87 plugindir="\$(libdir)/gstreamer-1.0"
88fi
89AC_SUBST(plugindir)
90
91dnl set proper LDFLAGS for plugins
92GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
93AC_SUBST(GST_PLUGIN_LDFLAGS)
94
95AC_CONFIG_FILES([Makefile
96 src/Makefile
97])
98AC_OUTPUT