comparison m4/ax_python.m4 @ 380:1e1970f93f94 stable-0-6-72

allow all 7 days in bydays recurring appointment, update for fedora python packaging
author Carl Byington <carl@five-ten-sg.com>
date Wed, 01 Aug 2018 08:15:34 -0700
parents 115b871c61a1
children 7eab29e13e61
comparison
equal deleted inserted replaced
379:bbd198da4033 380:1e1970f93f94
1 # =========================================================================== 1 # ===========================================================================
2 # http://autoconf-archive.cryp.to/ax_python.html 2 # https://www.gnu.org/software/autoconf-archive/ax_python.html
3 # =========================================================================== 3 # ===========================================================================
4 # 4 #
5 # SYNOPSIS 5 # SYNOPSIS
6 # 6 #
7 # AX_PYTHON 7 # AX_PYTHON
8 # 8 #
9 # DESCRIPTION 9 # DESCRIPTION
10 # 10 #
11 # This macro does a complete Python development environment check. 11 # This macro does a complete Python development environment check.
12 # 12 #
13 # It recurses through several python versions (from 2.1 to 2.5 in this 13 # It checks for all known versions. When it finds an executable, it looks
14 # version), looking for an executable. When it finds an executable, it 14 # to find the header files and library.
15 # looks to find the header files and library.
16 # 15 #
17 # It sets PYTHON_BIN to the name of the python executable, 16 # It sets PYTHON_BIN to the name of the python executable,
18 # PYTHON_INCLUDE_DIR to the directory holding the header files, and 17 # PYTHON_INCLUDE_DIR to the directory holding the header files, and
19 # PYTHON_LIB to the name of the Python library. 18 # PYTHON_LIB to the name of the Python library.
20 # 19 #
21 # This macro calls AC_SUBST on PYTHON_BIN (via AC_CHECK_PROG), 20 # This macro calls AC_SUBST on PYTHON_BIN (via AC_CHECK_PROG),
22 # PYTHON_INCLUDE_DIR and PYTHON_LIB. 21 # PYTHON_INCLUDE_DIR and PYTHON_LIB.
23 # 22 #
24 # LAST MODIFICATION 23 # LICENSE
25 #
26 # 2008-04-12
27 #
28 # COPYLEFT
29 # 24 #
30 # Copyright (c) 2008 Michael Tindal 25 # Copyright (c) 2008 Michael Tindal
31 # 26 #
32 # This program is free software; you can redistribute it and/or modify it 27 # This program is free software; you can redistribute it and/or modify it
33 # under the terms of the GNU General Public License as published by the 28 # under the terms of the GNU General Public License as published by the
38 # WITHOUT ANY WARRANTY; without even the implied warranty of 33 # WITHOUT ANY WARRANTY; without even the implied warranty of
39 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 34 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40 # Public License for more details. 35 # Public License for more details.
41 # 36 #
42 # You should have received a copy of the GNU General Public License along 37 # You should have received a copy of the GNU General Public License along
43 # with this program. If not, see <http://www.gnu.org/licenses/>. 38 # with this program. If not, see <https://www.gnu.org/licenses/>.
44 # 39 #
45 # As a special exception, the respective Autoconf Macro's copyright owner 40 # As a special exception, the respective Autoconf Macro's copyright owner
46 # gives unlimited permission to copy, distribute and modify the configure 41 # gives unlimited permission to copy, distribute and modify the configure
47 # scripts that are the output of Autoconf when processing the Macro. You 42 # scripts that are the output of Autoconf when processing the Macro. You
48 # need not follow the terms of the GNU General Public License when using 43 # need not follow the terms of the GNU General Public License when using
49 # or distributing such scripts, even though portions of the text of the 44 # or distributing such scripts, even though portions of the text of the
50 # Macro appear in them. The GNU General Public License (GPL) does govern 45 # Macro appear in them. The GNU General Public License (GPL) does govern
51 # all other use of the material that constitutes the Autoconf Macro. 46 # all other use of the material that constitutes the Autoconf Macro.
52 # 47 #
53 # This special exception to the GPL applies to versions of the Autoconf 48 # This special exception to the GPL applies to versions of the Autoconf
54 # Macro released by the Autoconf Macro Archive. When you make and 49 # Macro released by the Autoconf Archive. When you make and distribute a
55 # distribute a modified version of the Autoconf Macro, you may extend this 50 # modified version of the Autoconf Macro, you may extend this special
56 # special exception to the GPL to apply to your modified version as well. 51 # exception to the GPL to apply to your modified version as well.
52
53 #serial 18
57 54
58 AC_DEFUN([AX_PYTHON], 55 AC_DEFUN([AX_PYTHON],
59 [ 56 [AC_MSG_CHECKING(for python build information)
60 AC_MSG_CHECKING(for python build information)
61 AC_MSG_RESULT([]) 57 AC_MSG_RESULT([])
62 for python in python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do 58 for python in python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
63 AC_CHECK_PROGS(PYTHON_BIN, [$python]) 59 AC_CHECK_PROGS(PYTHON_BIN, [$python])
64 ax_python_bin=$PYTHON_BIN 60 ax_python_bin=$PYTHON_BIN
65 if test x$ax_python_bin != x; then 61 if test x$ax_python_bin != x; then
66 AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no) 62 AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no)
67 AC_CHECK_HEADER([$ax_python_bin/Python.h], 63 if test x$ax_python_lib == xno; then
68 ax_python_header=yes, 64 AC_CHECK_LIB(${ax_python_bin}m, main, ax_python_lib=${ax_python_bin}m, ax_python_lib=no)
69 ax_python_header=no) 65 fi
70 if test $ax_python_lib != no; then 66 if test x$ax_python_lib != xno; then
71 if test $ax_python_header != no; then 67 ax_python_header=`$ax_python_bin -c "from distutils.sysconfig import *; print(get_config_var('CONFINCLUDEPY'))"`
72 break; 68 if test x$ax_python_header != x; then
73 fi 69 break;
74 fi 70 fi
75 fi 71 fi
72 fi
76 done 73 done
77 if test x$ax_python_bin = x; then 74 if test x$ax_python_bin = x; then
78 ax_python_bin=no 75 ax_python_bin=no
79 fi 76 fi
80 if test x$ax_python_header = x; then 77 if test x$ax_python_header = x; then
85 fi 82 fi
86 83
87 AC_MSG_RESULT([ results of the Python check:]) 84 AC_MSG_RESULT([ results of the Python check:])
88 AC_MSG_RESULT([ Binary: $ax_python_bin]) 85 AC_MSG_RESULT([ Binary: $ax_python_bin])
89 AC_MSG_RESULT([ Library: $ax_python_lib]) 86 AC_MSG_RESULT([ Library: $ax_python_lib])
87 AC_MSG_RESULT([ Include Dir: $ax_python_header])
90 88
89 if test x$ax_python_header != xno; then
90 PYTHON_INCLUDE_DIR=$ax_python_header
91 AC_SUBST(PYTHON_INCLUDE_DIR)
92 fi
91 if test x$ax_python_lib != xno; then 93 if test x$ax_python_lib != xno; then
92 PYTHON_LIB=$ax_python_lib 94 PYTHON_LIB=$ax_python_lib
93 AC_SUBST(PYTHON_LIB) 95 AC_SUBST(PYTHON_LIB)
94 fi 96 fi
95 ])dnl 97 ])dnl