File: aclocal_misc.m4

package info (click to toggle)
mpich 4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 101,184 kB
  • sloc: ansic: 1,040,629; cpp: 82,270; javascript: 40,763; perl: 27,933; python: 16,041; sh: 14,676; xml: 14,418; f90: 12,916; makefile: 9,270; fortran: 8,046; java: 4,635; asm: 324; ruby: 103; awk: 27; lisp: 19; php: 8; sed: 4
file content (35 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download
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
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])
    if test -z "$PYTHON" ; then
        PYTHON=
        python_one_liner="import sys; print(sys.version_info[[0]])"

        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
    fi
])