The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/config/always-python.m4

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 dnl #
    2 dnl # The majority of the python scripts are written to be compatible
    3 dnl # with Python 3.6. This option is intended to
    4 dnl # to provide a method to specify the default system version, and
    5 dnl # set the PYTHON environment variable accordingly.
    6 dnl #
    7 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [
    8         AC_ARG_WITH([python],
    9                 AS_HELP_STRING([--with-python[=VERSION]],
   10                 [default system python version @<:@default=check@:>@]),
   11                 [with_python=$withval],
   12                 [with_python=check])
   13 
   14         AS_CASE([$with_python],
   15                 [check], [AC_CHECK_PROGS([PYTHON], [python3], [:])],
   16                 [3*], [PYTHON="python${with_python}"],
   17                 [*python3*], [PYTHON="${with_python}"],
   18                 [no], [PYTHON=":"],
   19                 [AC_MSG_ERROR([Unknown --with-python value '$with_python'])]
   20         )
   21 
   22         dnl #
   23         dnl # Minimum supported Python versions for utilities: Python 3.6
   24         dnl #
   25         AM_PATH_PYTHON([], [], [:])
   26         AS_IF([test -z "$PYTHON_VERSION"], [
   27                 PYTHON_VERSION=$(echo ${PYTHON##*/} | tr -cd 0-9.)
   28         ])
   29         PYTHON_MINOR=${PYTHON_VERSION#*\.}
   30 
   31         AS_CASE([$PYTHON_VERSION],
   32                 [3.*], [
   33                         AS_IF([test $PYTHON_MINOR -lt 6],
   34                                 [AC_MSG_ERROR("Python >= 3.6 is required")])
   35                 ],
   36                 [:|2|3], [],
   37                 [PYTHON_VERSION=3]
   38         )
   39 
   40         AM_CONDITIONAL([USING_PYTHON], [test "$PYTHON" != :])
   41         AC_SUBST([PYTHON_SHEBANG], [python3])
   42 
   43         dnl #
   44         dnl # Request that packages be built for a specific Python version.
   45         dnl #
   46         AS_IF([test "x$with_python" != xcheck], [
   47                 PYTHON_PKG_VERSION=$(echo $PYTHON_VERSION | tr -d .)
   48                 DEFINE_PYTHON_PKG_VERSION='--define "__use_python_pkg_version '${PYTHON_PKG_VERSION}'"'
   49                 DEFINE_PYTHON_VERSION='--define "__use_python '${PYTHON}'"'
   50         ], [
   51                 DEFINE_PYTHON_VERSION=''
   52                 DEFINE_PYTHON_PKG_VERSION=''
   53         ])
   54 
   55         AC_SUBST(DEFINE_PYTHON_VERSION)
   56         AC_SUBST(DEFINE_PYTHON_PKG_VERSION)
   57 ])

Cache object: 4703c4b06d50dad80be8393628e5aa2b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.