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 | |
guoping.li | 575a5b6 | 2024-05-08 16:34:04 +0800 | [diff] [blame] | 11 | #get OUT_DIR |
| 12 | AC_ARG_WITH([path], [AS_HELP_STRING([--with-path=PATH], [specify path])]) |
| 13 | if test "x$with_path" != "x"; then |
| 14 | OUT_DIR=$with_path |
| 15 | else |
| 16 | OUT_DIR=. |
| 17 | fi |
| 18 | echo "OUT_DIR = $OUT_DIR" |
| 19 | |
| 20 | #check aml_version.h file, if not exist, copy from aml_version.h.in |
| 21 | if test -e "$OUT_DIR/src/aml_version.h"; then |
| 22 | AC_MSG_RESULT([$OUT_DIR/src/aml_version.h file already exist]) |
| 23 | else |
| 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 |
| 29 | fi |
| 30 | |
| 31 | AC_CONFIG_AUX_DIR([build-aux]) |
| 32 | AC_CONFIG_MACRO_DIR([m4]) |
| 33 | |
xuesong.jiang | 1801e17 | 2021-10-11 10:56:41 +0800 | [diff] [blame] | 34 | AC_CONFIG_SRCDIR([src]) |
| 35 | AC_CONFIG_HEADERS([config.h]) |
| 36 | |
| 37 | dnl required version of automake |
| 38 | AM_INIT_AUTOMAKE([1.10]) |
| 39 | |
| 40 | dnl enable mainainer mode by default |
| 41 | AM_MAINTAINER_MODE([enable]) |
| 42 | |
| 43 | dnl check for tools (compiler etc.) |
| 44 | AC_PROG_CC |
| 45 | |
| 46 | dnl required version of libtool |
| 47 | LT_PREREQ([2.2.6]) |
| 48 | LT_INIT |
| 49 | |
| 50 | dnl give error and exit if we don't have pkgconfig |
| 51 | AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [ |
| 52 | AC_MSG_ERROR([You need to have pkg-config installed!]) |
| 53 | ]) |
| 54 | |
| 55 | PKG_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 | |
| 64 | dnl Check for the required version of GStreamer core (and gst-plugins-base) |
| 65 | dnl This will export GST_CFLAGS and GST_LIBS variables for use in Makefile.am |
| 66 | dnl |
| 67 | dnl If you need libraries from gst-plugins-base here, also add: |
| 68 | dnl for libgstaudio-1.0: gstreamer-audio-1.0 >= $GST_REQUIRED |
| 69 | dnl for libgstvideo-1.0: gstreamer-video-1.0 >= $GST_REQUIRED |
| 70 | dnl for libgsttag-1.0: gstreamer-tag-1.0 >= $GST_REQUIRED |
| 71 | dnl for libgstpbutils-1.0: gstreamer-pbutils-1.0 >= $GST_REQUIRED |
| 72 | dnl for libgstfft-1.0: gstreamer-fft-1.0 >= $GST_REQUIRED |
| 73 | dnl for libgstinterfaces-1.0: gstreamer-interfaces-1.0 >= $GST_REQUIRED |
| 74 | dnl for libgstrtp-1.0: gstreamer-rtp-1.0 >= $GST_REQUIRED |
| 75 | dnl for libgstrtsp-1.0: gstreamer-rtsp-1.0 >= $GST_REQUIRED |
| 76 | dnl etc. |
| 77 | |
| 78 | PKG_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 | |
| 95 | dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS) |
| 96 | AC_MSG_CHECKING([to see if compiler understands -Wall]) |
| 97 | save_CFLAGS="$CFLAGS" |
| 98 | CFLAGS="$CFLAGS -Wall" |
| 99 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [ |
| 100 | GST_CFLAGS="$GST_CFLAGS -Wall" |
| 101 | AC_MSG_RESULT([yes]) |
| 102 | ], [ |
| 103 | AC_MSG_RESULT([no]) |
| 104 | ]) |
| 105 | |
| 106 | dnl set the plugindir where plugins should be installed (for src/Makefile.am) |
| 107 | if test "x${prefix}" = "x$HOME"; then |
| 108 | plugindir="$HOME/.gstreamer-1.0/plugins" |
| 109 | else |
| 110 | plugindir="\$(libdir)/gstreamer-1.0" |
| 111 | fi |
| 112 | AC_SUBST(plugindir) |
| 113 | |
| 114 | dnl set proper LDFLAGS for plugins |
| 115 | GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*' |
| 116 | AC_SUBST(GST_PLUGIN_LDFLAGS) |
| 117 | |
| 118 | AC_CONFIG_FILES([Makefile |
| 119 | src/Makefile |
| 120 | ]) |
| 121 | AC_OUTPUT |