xuesong.jiang | ae1548e | 2022-05-06 16:38:46 +0800 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
| 2 | |
| 3 | dnl initialize autoconf |
| 4 | dnl releases only do -Wall, git and prerelease does -Werror too |
| 5 | dnl use a three digit version number for releases, and four for git/pre |
| 6 | AC_INIT([aml-v4l2-plugin-package],[1.0.0]) |
| 7 | |
| 8 | GST_REQUIRED=1.0.0 |
| 9 | |
guoping.li | 5fb0e60 | 2024-05-08 17:50:34 +0800 | [diff] [blame] | 10 | AC_CONFIG_AUX_DIR([build-aux]) |
| 11 | AC_CONFIG_MACRO_DIR([m4]) |
| 12 | |
xuesong.jiang | ae1548e | 2022-05-06 16:38:46 +0800 | [diff] [blame] | 13 | AC_CONFIG_SRCDIR([src]) |
| 14 | |
| 15 | dnl define the output header for config |
| 16 | AC_CONFIG_HEADERS([config.h]) |
| 17 | |
| 18 | dnl required version of automake |
| 19 | AM_INIT_AUTOMAKE([1.10]) |
| 20 | |
| 21 | dnl enable mainainer mode by default |
| 22 | AM_MAINTAINER_MODE([enable]) |
| 23 | |
| 24 | dnl check for tools (compiler etc.) |
| 25 | AC_PROG_CC |
| 26 | |
| 27 | dnl required version of libtool |
| 28 | LT_PREREQ([2.2.6]) |
| 29 | LT_INIT |
| 30 | |
| 31 | dnl check for pthreads |
| 32 | AX_PTHREAD |
| 33 | |
| 34 | dnl give error and exit if we don't have pkgconfig |
| 35 | AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, [ ], [ |
| 36 | AC_MSG_ERROR([You need to have pkg-config installed!]) |
| 37 | ]) |
| 38 | |
| 39 | AC_DEFINE(GST_V4L2_ENABLE_PROBE, 1, [Define if Video4Linux probe shall be run at plugin load]) |
| 40 | # AC_DEFINE(HAVE_LIBV4L2, 1, [Define if Video4Linux probe shall be run at plugin load]) |
| 41 | |
| 42 | dnl Check for the required version of GStreamer core (and gst-plugins-base) |
| 43 | dnl This will export GST_CFLAGS and GST_LIBS variables for use in Makefile.am |
| 44 | dnl |
| 45 | dnl If you need libraries from gst-plugins-base here, also add: |
| 46 | dnl for libgstaudio-1.0: gstreamer-audio-1.0 >= $GST_REQUIRED |
| 47 | dnl for libgstvideo-1.0: gstreamer-video-1.0 >= $GST_REQUIRED |
| 48 | dnl for libgsttag-1.0: gstreamer-tag-1.0 >= $GST_REQUIRED |
| 49 | dnl for libgstpbutils-1.0: gstreamer-pbutils-1.0 >= $GST_REQUIRED |
| 50 | dnl for libgstfft-1.0: gstreamer-fft-1.0 >= $GST_REQUIRED |
| 51 | dnl for libgstinterfaces-1.0: gstreamer-interfaces-1.0 >= $GST_REQUIRED |
| 52 | dnl for libgstrtp-1.0: gstreamer-rtp-1.0 >= $GST_REQUIRED |
| 53 | dnl for libgstrtsp-1.0: gstreamer-rtsp-1.0 >= $GST_REQUIRED |
| 54 | dnl etc. |
| 55 | |
| 56 | PKG_CHECK_MODULES(GST, [ |
| 57 | gstreamer-1.0 >= $GST_REQUIRED |
| 58 | gstreamer-base-1.0 >= $GST_REQUIRED |
| 59 | gstreamer-allocators-1.0 >= $GST_REQUIRED |
| 60 | gstreamer-video-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 | |
| 97 | AC_CONFIG_FILES([Makefile |
| 98 | src/Makefile |
| 99 | ]) |
| 100 | AC_OUTPUT |