-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
68 lines (55 loc) · 2.32 KB
/
configure.ac
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
AC_PREREQ([2.69])
AC_INIT([Sample of a native Python extension module with Rust.], [0.1.0], [https://chiselapp.com/user/FomalhautWeisszwerg/repository/fibonacci_sequence/ticket])
AC_CONFIG_MACRO_DIR([./m4])
# Checks for programs.
AC_PROG_CC
AC_CHECK_PROGS(CARGO, ["cargo" "${HOME}/.cargo/bin/cargo" "/usr/bin/cargo"], "no")
if test "${CARGO}" = "no"; then
AC_MSG_RESULT([FATAL: `cargo` not found.])
AC_MSG_RESULT([Please install Rust and re-run configure.])
AC_MSG_RESULT([To install Rust, see https://www.rust-lang.org/tools/install])
exit -1;
fi
AC_CHECK_PROGS(RUSTC, ["rustc" "${HOME}/.cargo/bin/rustc" "/usr/bin/rustc"], "no")
if test "${RUSTC}" = "no"; then
AC_MSG_RESULT([FATAL: `rustc` not found.])
AC_MSG_RESULT([Please install Rust and re-run configure.])
AC_MSG_RESULT([To install Rust, see https://www.rust-lang.org/tools/install])
exit -1;
fi
AC_CHECK_PROGS(PYTHON, ["python3" "python" "/usr/local/bin/python3" "/usr/bin/python3"], "no")
if test "${PYTHON}" = "no"; then
AC_MSG_RESULT([FATAL: Python not found.])
exit -1;
fi
PYTHON_MAJOR_VERSION=`${PYTHON} -c "print(__import__('sys').version_info.major)"`
PYTHON_MINOR_VERSION=`${PYTHON} -c "print(__import__('sys').version_info.minor)"`
PYTHON_MICRO_VERSION=`${PYTHON} -c "print(__import__('sys').version_info.micro)"`
if test ${PYTHON_MAJOR_VERSION} -lt 3; then
AC_MSG_RESULT([FATAL: Python 3 required.])
exit -1;
else
if test ${PYTHON_MINOR_VERSION} -lt 6; then
AC_MSG_RESULT([FATAL: Python 3.6 or later required.])
exit -1;
else
AC_MSG_RESULT([checking for python3 version... ${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION}.${PYTHON_MICRO_VERSION}])
fi
fi
AC_CHECK_PROGS(PIP, ["pip3" "pip" "${HOME}/.local/bin/pip3" "${HOME}/.local/bin/pip" "/usr/local/bin/pip3" "/usr/local/bin/pip" "/usr/bin/pip3" "/usr/bin/pip"], "no")
if test ${PIP} = "no"; then
AC_MSG_RESULT([FATAL: `pip` not found.])
exit -1;
fi
AC_CHECK_PROGS(MATURIN, ["maturin" "${HOME}/.local/bin/maturin" "/usr/local/bin/maturin" "/usr/bin/maturin"], "no")
if test ${MATURIN} = "no"; then
AC_MSG_RESULT([FATAL: `maturin` not found.])
AC_MSG_RESULT([Please install `maturin` with `pip` and re-run configure.])
exit -1;
fi
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile])
AC_OUTPUT