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