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