xuesong.jiang | 1c26548 | 2023-04-03 07:22:20 +0000 | [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 |
xuesong.jiang | 0574302 | 2023-04-03 08:25:53 +0000 | [diff] [blame] | 5 | AC_INIT([amldmx-package],[1.0.0]) |
xuesong.jiang | 1c26548 | 2023-04-03 07:22:20 +0000 | [diff] [blame] | 6 | |
| 7 | dnl required versions of gstreamer and plugins-base |
| 8 | GST_REQUIRED=1.0.0 |
| 9 | DRM_REQUIRED=2.4 |
| 10 | |
hanghang.luo | abd9a7b | 2024-08-28 17:22:19 +0800 | [diff] [blame] | 11 | AC_CONFIG_SRCDIR([aml-hwdemux]) |
zengliang.li | a6c0cdd | 2024-05-18 07:15:51 +0000 | [diff] [blame] | 12 | AC_CONFIG_SRCDIR([aml-qtdemux]) |
hanghang.luo | 9067442 | 2024-06-11 22:14:39 +0800 | [diff] [blame] | 13 | AC_CONFIG_SRCDIR([aml-tsdemux]) |
xuesong.jiang | 1c26548 | 2023-04-03 07:22:20 +0000 | [diff] [blame] | 14 | AC_CONFIG_HEADERS([config.h]) |
| 15 | |
| 16 | dnl required version of automake |
| 17 | AM_INIT_AUTOMAKE([1.10]) |
| 18 | |
| 19 | dnl enable mainainer mode by default |
| 20 | AM_MAINTAINER_MODE([enable]) |
| 21 | |
| 22 | dnl check for tools (compiler etc.) |
| 23 | AC_PROG_CC |
| 24 | |
| 25 | dnl required version of libtool |
| 26 | LT_PREREQ([2.2.6]) |
| 27 | LT_INIT |
| 28 | |
| 29 | dnl give error and exit if we don't have pkgconfig |
| 30 | AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [ |
| 31 | AC_MSG_ERROR([You need to have pkg-config installed!]) |
| 32 | ]) |
| 33 | |
| 34 | PKG_CHECK_MODULES(DRM, [ |
| 35 | libdrm >= $DRM_REQUIRED |
| 36 | ], [ |
| 37 | AC_SUBST(DRM_CFLAGS) |
| 38 | AC_SUBST(DRM_LIBS) |
| 39 | ], [ |
| 40 | AC_MSG_ERROR([Wrong libDRM version]) |
| 41 | ]) |
| 42 | |
| 43 | dnl Check for the required version of GStreamer core (and gst-plugins-base) |
| 44 | dnl This will export GST_CFLAGS and GST_LIBS variables for use in Makefile.am |
| 45 | dnl |
| 46 | dnl If you need libraries from gst-plugins-base here, also add: |
| 47 | dnl for libgstaudio-1.0: gstreamer-audio-1.0 >= $GST_REQUIRED |
| 48 | dnl for libgstvideo-1.0: gstreamer-video-1.0 >= $GST_REQUIRED |
| 49 | dnl for libgsttag-1.0: gstreamer-tag-1.0 >= $GST_REQUIRED |
| 50 | dnl for libgstpbutils-1.0: gstreamer-pbutils-1.0 >= $GST_REQUIRED |
| 51 | dnl for libgstfft-1.0: gstreamer-fft-1.0 >= $GST_REQUIRED |
| 52 | dnl for libgstinterfaces-1.0: gstreamer-interfaces-1.0 >= $GST_REQUIRED |
| 53 | dnl for libgstrtp-1.0: gstreamer-rtp-1.0 >= $GST_REQUIRED |
| 54 | dnl for libgstrtsp-1.0: gstreamer-rtsp-1.0 >= $GST_REQUIRED |
| 55 | dnl etc. |
| 56 | |
| 57 | PKG_CHECK_MODULES(GST, [ |
| 58 | gstreamer-1.0 >= $GST_REQUIRED |
| 59 | gstreamer-base-1.0 >= $GST_REQUIRED |
| 60 | gstreamer-allocators-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 | |
| 74 | dnl check if compiler understands -Wall (if yes, add -Wall to GST_CFLAGS) |
| 75 | AC_MSG_CHECKING([to see if compiler understands -Wall]) |
| 76 | save_CFLAGS="$CFLAGS" |
| 77 | CFLAGS="$CFLAGS -Wall" |
| 78 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ ], [ ])], [ |
| 79 | GST_CFLAGS="$GST_CFLAGS -Wall" |
| 80 | AC_MSG_RESULT([yes]) |
| 81 | ], [ |
| 82 | AC_MSG_RESULT([no]) |
| 83 | ]) |
| 84 | |
| 85 | dnl set the plugindir where plugins should be installed (for src/Makefile.am) |
| 86 | if test "x${prefix}" = "x$HOME"; then |
| 87 | plugindir="$HOME/.gstreamer-1.0/plugins" |
| 88 | else |
| 89 | plugindir="\$(libdir)/gstreamer-1.0" |
| 90 | fi |
| 91 | AC_SUBST(plugindir) |
| 92 | |
| 93 | dnl set proper LDFLAGS for plugins |
| 94 | GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*' |
| 95 | AC_SUBST(GST_PLUGIN_LDFLAGS) |
| 96 | |
zengliang.li | a6c0cdd | 2024-05-18 07:15:51 +0000 | [diff] [blame] | 97 | AC_ARG_ENABLE([hwdemux], |
| 98 | [ --enable-hwdemux , support hwdemux], |
| 99 | [case "${enableval}" in |
| 100 | yes) hwdemux=true ;; |
| 101 | no) hwdemux=false ;; |
| 102 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-hwdemux]) ;; |
| 103 | esac],[hwdemux=false]) |
| 104 | AM_CONDITIONAL([HWDEMUX], [test x${hwdemux} = xtrue]) |
| 105 | |
| 106 | AC_ARG_ENABLE([amlqtdemux], |
| 107 | [ --enable-amlqtdemux , support amlqtdemux], |
| 108 | [case "${enableval}" in |
| 109 | yes) amlqtdemux=true ;; |
| 110 | no) amlqtdemux=false ;; |
| 111 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-amlqtdemux]) ;; |
| 112 | esac],[amlqtdemux=false]) |
| 113 | AM_CONDITIONAL([QTDEMUX], [test x${amlqtdemux} = xtrue]) |
| 114 | |
hanghang.luo | 9067442 | 2024-06-11 22:14:39 +0800 | [diff] [blame] | 115 | AC_ARG_ENABLE([amltsdemux], |
| 116 | [ --enable-amltsdemux , support amltsdemux], |
| 117 | [case "${enableval}" in |
| 118 | yes) amltsdemux=true ;; |
| 119 | no) amltsdemux=false ;; |
| 120 | *) AC_MSG_ERROR([bad value ${enableval} for --enable-amltsdemux]) ;; |
| 121 | esac],[amltsdemux=false]) |
| 122 | AM_CONDITIONAL([TSDEMUX], [test x${amltsdemux} = xtrue]) |
| 123 | |
xuesong.jiang | 1c26548 | 2023-04-03 07:22:20 +0000 | [diff] [blame] | 124 | AC_CONFIG_FILES([Makefile |
hanghang.luo | abd9a7b | 2024-08-28 17:22:19 +0800 | [diff] [blame] | 125 | aml-hwdemux/Makefile aml-qtdemux/Makefile aml-tsdemux/Makefile |
xuesong.jiang | 1c26548 | 2023-04-03 07:22:20 +0000 | [diff] [blame] | 126 | ]) |
| 127 | AC_OUTPUT |