1 # ===============================================================================
2 # https://www.gnu.org/software/autoconf-archive/ax_prog_dotnetcore_version.html
3 # ===============================================================================
7 # AX_PROG_DOTNETCORE_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
11 # Makes sure that .NET Core supports the version indicated. If true the
12 # shell commands in ACTION-IF-TRUE are executed. If not the shell commands
13 # in ACTION-IF-FALSE are run. The $dotnetcore_version variable will be
14 # filled with the detected version.
16 # This macro uses the $DOTNETCORE variable to perform the check. If
17 # $DOTNETCORE is not set prior to calling this macro, the macro will fail.
21 # AC_PATH_PROG([DOTNETCORE],[dotnet])
22 # AC_PROG_DOTNETCORE_VERSION([1.0.2],[ ... ],[ ... ])
24 # Searches for .NET Core, then checks if at least version 1.0.2 is
29 # Copyright (c) 2016 Jens Geyer <jensg@apache.org>
31 # Copying and distribution of this file, with or without modification, are
32 # permitted in any medium without royalty provided the copyright notice
33 # and this notice are preserved. This file is offered as-is, without any
38 AC_DEFUN([AX_PROG_DOTNETCORE_VERSION],[
39 AC_REQUIRE([AC_PROG_SED])
41 AS_IF([test -n "$DOTNETCORE"],[
42 ax_dotnetcore_version="$1"
44 AC_MSG_CHECKING([for .NET Core version])
45 dotnetcore_version=`$DOTNETCORE --version 2>&1 | $SED -e 's/\(@<:@0-9@:>@*\.@<:@0-9@:>@*\.@<:@0-9@:>@*\)\(.*\)/\1/'`
46 AC_MSG_RESULT($dotnetcore_version)
48 AC_SUBST([DOTNETCORE_VERSION],[$dotnetcore_version])
50 AX_COMPARE_VERSION([$ax_dotnetcore_version],[le],[$dotnetcore_version],[
58 AC_MSG_WARN([could not find .NET Core])