Mercurial > libpst
annotate m4/ax_python.m4 @ 357:544d57fe6bc6
From Jeffrey Morlan:
try_fork in readpst.c doesn't check that active_children <
max_children before forking a child and adding it to the array. This can
cause a buffer overflow.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 06 Jul 2016 10:17:49 -0700 |
parents | 115b871c61a1 |
children | 1e1970f93f94 |
rev | line source |
---|---|
207
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
1 # =========================================================================== |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
2 # http://autoconf-archive.cryp.to/ax_python.html |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
3 # =========================================================================== |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
4 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
5 # SYNOPSIS |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
6 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
7 # AX_PYTHON |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
8 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
9 # DESCRIPTION |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
10 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
11 # This macro does a complete Python development environment check. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
12 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
13 # It recurses through several python versions (from 2.1 to 2.5 in this |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
14 # version), looking for an executable. When it finds an executable, it |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
15 # looks to find the header files and library. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
16 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
17 # It sets PYTHON_BIN to the name of the python executable, |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
18 # PYTHON_INCLUDE_DIR to the directory holding the header files, and |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
19 # PYTHON_LIB to the name of the Python library. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
20 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
21 # This macro calls AC_SUBST on PYTHON_BIN (via AC_CHECK_PROG), |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
22 # PYTHON_INCLUDE_DIR and PYTHON_LIB. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
23 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
24 # LAST MODIFICATION |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
25 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
26 # 2008-04-12 |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
27 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
28 # COPYLEFT |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
29 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
30 # Copyright (c) 2008 Michael Tindal |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
31 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
32 # This program is free software; you can redistribute it and/or modify it |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
33 # under the terms of the GNU General Public License as published by the |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
34 # Free Software Foundation; either version 2 of the License, or (at your |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
35 # option) any later version. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
36 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
37 # This program is distributed in the hope that it will be useful, but |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
38 # WITHOUT ANY WARRANTY; without even the implied warranty of |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
39 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
40 # Public License for more details. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
41 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
42 # You should have received a copy of the GNU General Public License along |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
43 # with this program. If not, see <http://www.gnu.org/licenses/>. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
44 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
45 # As a special exception, the respective Autoconf Macro's copyright owner |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
46 # gives unlimited permission to copy, distribute and modify the configure |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
47 # scripts that are the output of Autoconf when processing the Macro. You |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
48 # need not follow the terms of the GNU General Public License when using |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
49 # or distributing such scripts, even though portions of the text of the |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
50 # Macro appear in them. The GNU General Public License (GPL) does govern |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
51 # all other use of the material that constitutes the Autoconf Macro. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
52 # |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
53 # This special exception to the GPL applies to versions of the Autoconf |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
54 # Macro released by the Autoconf Macro Archive. When you make and |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
55 # distribute a modified version of the Autoconf Macro, you may extend this |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
56 # special exception to the GPL to apply to your modified version as well. |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
57 |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
58 AC_DEFUN([AX_PYTHON], |
226
bfc35fd55254
fix python autoconf macros
Carl Byington <carl@five-ten-sg.com>
parents:
224
diff
changeset
|
59 [ |
bfc35fd55254
fix python autoconf macros
Carl Byington <carl@five-ten-sg.com>
parents:
224
diff
changeset
|
60 AC_MSG_CHECKING(for python build information) |
207
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
61 AC_MSG_RESULT([]) |
253
115b871c61a1
fixes from fedora for python 2.7
Carl Byington <carl@five-ten-sg.com>
parents:
226
diff
changeset
|
62 for python in python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do |
224
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
63 AC_CHECK_PROGS(PYTHON_BIN, [$python]) |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
64 ax_python_bin=$PYTHON_BIN |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
65 if test x$ax_python_bin != x; then |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
66 AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no) |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
67 AC_CHECK_HEADER([$ax_python_bin/Python.h], |
226
bfc35fd55254
fix python autoconf macros
Carl Byington <carl@five-ten-sg.com>
parents:
224
diff
changeset
|
68 ax_python_header=yes, |
224
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
69 ax_python_header=no) |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
70 if test $ax_python_lib != no; then |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
71 if test $ax_python_header != no; then |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
72 break; |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
73 fi |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
74 fi |
d9ba8fa961e7
fix ax_python as done in libtorrent
Carl Byington <carl@five-ten-sg.com>
parents:
221
diff
changeset
|
75 fi |
207
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
76 done |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
77 if test x$ax_python_bin = x; then |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
78 ax_python_bin=no |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
79 fi |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
80 if test x$ax_python_header = x; then |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
81 ax_python_header=no |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
82 fi |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
83 if test x$ax_python_lib = x; then |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
84 ax_python_lib=no |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
85 fi |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
86 |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
87 AC_MSG_RESULT([ results of the Python check:]) |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
88 AC_MSG_RESULT([ Binary: $ax_python_bin]) |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
89 AC_MSG_RESULT([ Library: $ax_python_lib]) |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
90 |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
91 if test x$ax_python_lib != xno; then |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
92 PYTHON_LIB=$ax_python_lib |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
93 AC_SUBST(PYTHON_LIB) |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
94 fi |
17d2d6a7587f
add missing m4 macros to source control
Carl Byington <carl@five-ten-sg.com>
parents:
diff
changeset
|
95 ])dnl |