xuesong.jiang | 1801e17 | 2021-10-11 10:56:41 +0800 | [diff] [blame^] | 1 | dnl required version of autoconf |
| 2 | AC_PREREQ([2.69]) |
| 3 | |
| 4 | dnl TODO: fill in your package name and package version here |
| 5 | AC_INIT([aml-video-sink-plugin-package],[1.0.0]) |
| 6 | |
| 7 | dnl required versions of gstreamer and plugins-base |
| 8 | GST_REQUIRED=1.0.0 |
| 9 | DRM_REQUIRED=2.4 |
| 10 | |
| 11 | AC_CONFIG_SRCDIR([src]) |
| 12 | AC_CONFIG_HEADERS([config.h]) |
| 13 | |
| 14 | dnl required version of automake |
| 15 | AM_INIT_AUTOMAKE([1.10]) |
| 16 | |
| 17 | dnl enable mainainer mode by default |
| 18 | AM_MAINTAINER_MODE([enable]) |
| 19 | |
| 20 | dnl check for tools (compiler etc.) |
| 21 | AC_PROG_CC |
| 22 | |
| 23 | dnl required version of libtool |
| 24 | LT_PREREQ([2.2.6]) |
| 25 | LT_INIT |
| 26 | |
| 27 | dnl give error and exit if we don't have pkgconfig |
| 28 | AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [ |
| 29 | AC_MSG_ERROR([You need to have pkg-config installed!]) |
| 30 | ]) |
| 31 | |
| 32 | PKG_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 | |
| 41 | dnl Check for the required version of GStreamer core (and gst-plugins-base) |
| 42 | dnl This will export GST_CFLAGS and GST_LIBS variables for use in Makefile.am |
| 43 | dnl |
| 44 | dnl If you need libraries from gst-plugins-base here, also add: |
| 45 | dnl for libgstaudio-1.0: gstreamer-audio-1.0 >= $GST_REQUIRED |
| 46 | dnl for libgstvideo-1.0: gstreamer-video-1.0 >= $GST_REQUIRED |
| 47 | dnl for libgsttag-1.0: gstreamer-tag-1.0 >= $GST_REQUIRED |
| 48 | dnl for libgstpbutils-1.0: gstreamer-pbutils-1.0 >= $GST_REQUIRED |
| 49 | dnl for libgstfft-1.0: gstreamer-fft-1.0 >= $GST_REQUIRED |
| 50 | dnl for libgstinterfaces-1.0: gstreamer-interfaces-1.0 >= $GST_REQUIRED |
| 51 | dnl for libgstrtp-1.0: gstreamer-rtp-1.0 >= $GST_REQUIRED |
| 52 | dnl for libgstrtsp-1.0: gstreamer-rtsp-1.0 >= $GST_REQUIRED |
| 53 | dnl etc. |
| 54 | |
| 55 | PKG_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 | |
| 72 | dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS) |
| 73 | AC_MSG_CHECKING([to see if compiler understands -Wall]) |
| 74 | save_CFLAGS="$CFLAGS" |
| 75 | CFLAGS="$CFLAGS -Wall" |
| 76 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [ |
| 77 | GST_CFLAGS="$GST_CFLAGS -Wall" |
| 78 | AC_MSG_RESULT([yes]) |
| 79 | ], [ |
| 80 | AC_MSG_RESULT([no]) |
| 81 | ]) |
| 82 | |
| 83 | dnl set the plugindir where plugins should be installed (for src/Makefile.am) |
| 84 | if test "x${prefix}" = "x$HOME"; then |
| 85 | plugindir="$HOME/.gstreamer-1.0/plugins" |
| 86 | else |
| 87 | plugindir="\$(libdir)/gstreamer-1.0" |
| 88 | fi |
| 89 | AC_SUBST(plugindir) |
| 90 | |
| 91 | dnl set proper LDFLAGS for plugins |
| 92 | GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*' |
| 93 | AC_SUBST(GST_PLUGIN_LDFLAGS) |
| 94 | |
| 95 | AC_CONFIG_FILES([Makefile |
| 96 | src/Makefile |
| 97 | ]) |
| 98 | AC_OUTPUT |