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