File: aclocal_misc.m4

package info (click to toggle)
mpich 5.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 251,828 kB
  • sloc: ansic: 1,323,147; cpp: 82,869; f90: 72,420; javascript: 40,763; perl: 28,296; sh: 19,399; python: 16,191; xml: 14,418; makefile: 9,468; fortran: 8,046; java: 4,635; pascal: 352; asm: 324; ruby: 176; awk: 27; lisp: 19; php: 8; sed: 4
file content (40 lines) | stat: -rw-r--r-- 1,420 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
dnl PAC_CHECK_PYTHON check for python 3, sets PYTHON variable or abort
dnl
AC_DEFUN([PAC_CHECK_PYTHON],[
    AC_ARG_VAR([PYTHON], [set to Python 3])
    python_one_liner="import sys; print(sys.version_info[[0]])"
    if test -z "$PYTHON" ; then
        PYTHON=

        dnl check command 'python'
        PYTHON_PATH=
        AC_PATH_PROG(PYTHON_PATH, python)
        if test "x$PYTHON_PATH" != x ; then
            py_version=`$PYTHON_PATH -c "$python_one_liner"`
            if test "x$py_version" = x3 ; then
                PYTHON=$PYTHON_PATH
            fi
        fi
        dnl PYTHON is still not set, check command 'python3'
        if test "x$PYTHON" = x ; then
            PYTHON3_PATH=
            AC_PATH_PROG(PYTHON3_PATH, python3)
            if test "x$PYTHON3_PATH" != x ; then
                py3_version=`$PYTHON3_PATH -c "$python_one_liner"`
                if test "x$py3_version" = x3 ; then
                    PYTHON=$PYTHON3_PATH
                fi
            fi
        fi
        if test -z "$PYTHON" ; then
            AC_MSG_WARN([Python version 3 not found! Bindings need to be generated before configure.])
        else
            AC_MSG_NOTICE([Python version 3 is $PYTHON])
        fi
    else
        py_version=`$PYTHON -c "$python_one_liner"`
        if test "x$py_version" != x3 ; then
            AC_MSG_ERROR([PYTHON=$PYTHON is not a Python 3 interpreter])
        fi
    fi
])