blob: b5eb7c8426b47f5f9420b08f098dcf543c4f5356 [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
guoping.li575a5b62024-05-08 16:34:04 +080011#get OUT_DIR
12AC_ARG_WITH([path], [AS_HELP_STRING([--with-path=PATH], [specify path])])
13if test "x$with_path" != "x"; then
14 OUT_DIR=$with_path
15else
16 OUT_DIR=.
17fi
18echo "OUT_DIR = $OUT_DIR"
19
20#check aml_version.h file, if not exist, copy from aml_version.h.in
21if test -e "$OUT_DIR/src/aml_version.h"; then
22 AC_MSG_RESULT([$OUT_DIR/src/aml_version.h file already exist])
23else
24 AC_MSG_RESULT(create [$OUT_DIR/src/aml_version.h from $srcdir/src/aml_version.h.in])
25 AC_MSG_NOTICE([Source directory: $srcdir])
26 AC_MSG_NOTICE([OUT_DIR directory: $OUT_DIR])
27 mkdir -p $OUT_DIR/src/
28 cp $srcdir/src/aml_version.h.in $OUT_DIR/src/aml_version.h
29fi
30
31AC_CONFIG_AUX_DIR([build-aux])
32AC_CONFIG_MACRO_DIR([m4])
33
xuesong.jiang1801e172021-10-11 10:56:41 +080034AC_CONFIG_SRCDIR([src])
35AC_CONFIG_HEADERS([config.h])
36
37dnl required version of automake
38AM_INIT_AUTOMAKE([1.10])
39
40dnl enable mainainer mode by default
41AM_MAINTAINER_MODE([enable])
42
43dnl check for tools (compiler etc.)
44AC_PROG_CC
45
46dnl required version of libtool
47LT_PREREQ([2.2.6])
48LT_INIT
49
50dnl give error and exit if we don't have pkgconfig
51AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [
52 AC_MSG_ERROR([You need to have pkg-config installed!])
53])
54
55PKG_CHECK_MODULES(DRM, [
56 libdrm >= $DRM_REQUIRED
57], [
58 AC_SUBST(DRM_CFLAGS)
59 AC_SUBST(DRM_LIBS)
60], [
61 AC_MSG_ERROR([Wrong libDRM version])
62])
63
64dnl Check for the required version of GStreamer core (and gst-plugins-base)
65dnl This will export GST_CFLAGS and GST_LIBS variables for use in Makefile.am
66dnl
67dnl If you need libraries from gst-plugins-base here, also add:
68dnl for libgstaudio-1.0: gstreamer-audio-1.0 >= $GST_REQUIRED
69dnl for libgstvideo-1.0: gstreamer-video-1.0 >= $GST_REQUIRED
70dnl for libgsttag-1.0: gstreamer-tag-1.0 >= $GST_REQUIRED
71dnl for libgstpbutils-1.0: gstreamer-pbutils-1.0 >= $GST_REQUIRED
72dnl for libgstfft-1.0: gstreamer-fft-1.0 >= $GST_REQUIRED
73dnl for libgstinterfaces-1.0: gstreamer-interfaces-1.0 >= $GST_REQUIRED
74dnl for libgstrtp-1.0: gstreamer-rtp-1.0 >= $GST_REQUIRED
75dnl for libgstrtsp-1.0: gstreamer-rtsp-1.0 >= $GST_REQUIRED
76dnl etc.
77
78PKG_CHECK_MODULES(GST, [
79 gstreamer-1.0 >= $GST_REQUIRED
80 gstreamer-base-1.0 >= $GST_REQUIRED
81 gstreamer-allocators-1.0 >= $GST_REQUIRED
82], [
83 AC_SUBST(GST_CFLAGS)
84 AC_SUBST(GST_LIBS)
85], [
86 AC_MSG_ERROR([
87 You need to install or upgrade the GStreamer development
88 packages on your system. On debian-based systems these are
89 libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev.
90 on RPM-based systems gstreamer1.0-devel, libgstreamer1.0-devel
91 or similar. The minimum version required is $GST_REQUIRED.
92 ])
93])
94
95dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS)
96AC_MSG_CHECKING([to see if compiler understands -Wall])
97save_CFLAGS="$CFLAGS"
98CFLAGS="$CFLAGS -Wall"
99AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [
100 GST_CFLAGS="$GST_CFLAGS -Wall"
101 AC_MSG_RESULT([yes])
102], [
103 AC_MSG_RESULT([no])
104])
105
106dnl set the plugindir where plugins should be installed (for src/Makefile.am)
107if test "x${prefix}" = "x$HOME"; then
108 plugindir="$HOME/.gstreamer-1.0/plugins"
109else
110 plugindir="\$(libdir)/gstreamer-1.0"
111fi
112AC_SUBST(plugindir)
113
114dnl set proper LDFLAGS for plugins
115GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*'
116AC_SUBST(GST_PLUGIN_LDFLAGS)
117
118AC_CONFIG_FILES([Makefile
119 src/Makefile
120])
121AC_OUTPUT