annotate m4/ax_python_devel.m4 @ 409:1c458f13d1d3 stable-0-6-76

fix template issue to build with gcc 11
author Carl Byington <carl@five-ten-sg.com>
date Sat, 27 Mar 2021 17:06:30 -0700
parents 1e1970f93f94
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
380
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
1 # ===========================================================================
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
2 # https://www.gnu.org/software/autoconf-archive/ax_python_devel.html
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
3 # ===========================================================================
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
4 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
5 # SYNOPSIS
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
6 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
7 # AX_PYTHON_DEVEL([version])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
8 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
9 # DESCRIPTION
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
10 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
11 # Note: Defines as a precious variable "PYTHON_VERSION". Don't override it
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
12 # in your configure.ac.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
13 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
14 # This macro checks for Python and tries to get the include path to
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
15 # 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LIBS) output
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
16 # variables. It also exports $(PYTHON_EXTRA_LIBS) and
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
17 # $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
18 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
19 # You can search for some particular version of Python by passing a
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
20 # parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
21 # note that you *have* to pass also an operator along with the version to
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
22 # match, and pay special attention to the single quotes surrounding the
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
23 # version number. Don't use "PYTHON_VERSION" for this: that environment
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
24 # variable is declared as precious and thus reserved for the end-user.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
25 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
26 # This macro should work for all versions of Python >= 2.1.0. As an end
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
27 # user, you can disable the check for the python version by setting the
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
28 # PYTHON_NOVERSIONCHECK environment variable to something else than the
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
29 # empty string.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
30 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
31 # If you need to use this macro for an older Python version, please
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
32 # contact the authors. We're always open for feedback.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
33 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
34 # LICENSE
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
35 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
36 # Copyright (c) 2009 Sebastian Huber <sebastian-huber@web.de>
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
37 # Copyright (c) 2009 Alan W. Irwin
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
38 # Copyright (c) 2009 Rafael Laboissiere <rafael@laboissiere.net>
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
39 # Copyright (c) 2009 Andrew Collier
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
40 # Copyright (c) 2009 Matteo Settenvini <matteo@member.fsf.org>
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
41 # Copyright (c) 2009 Horst Knorr <hk_classes@knoda.org>
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
42 # Copyright (c) 2013 Daniel Mullner <muellner@math.stanford.edu>
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
43 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
44 # This program is free software: you can redistribute it and/or modify it
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
45 # under the terms of the GNU General Public License as published by the
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
46 # Free Software Foundation, either version 3 of the License, or (at your
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
47 # option) any later version.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
48 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
49 # This program is distributed in the hope that it will be useful, but
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
50 # WITHOUT ANY WARRANTY; without even the implied warranty of
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
51 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
52 # Public License for more details.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
53 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
54 # You should have received a copy of the GNU General Public License along
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
55 # with this program. If not, see <https://www.gnu.org/licenses/>.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
56 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
57 # As a special exception, the respective Autoconf Macro's copyright owner
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
58 # gives unlimited permission to copy, distribute and modify the configure
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
59 # scripts that are the output of Autoconf when processing the Macro. You
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
60 # need not follow the terms of the GNU General Public License when using
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
61 # or distributing such scripts, even though portions of the text of the
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
62 # Macro appear in them. The GNU General Public License (GPL) does govern
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
63 # all other use of the material that constitutes the Autoconf Macro.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
64 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
65 # This special exception to the GPL applies to versions of the Autoconf
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
66 # Macro released by the Autoconf Archive. When you make and distribute a
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
67 # modified version of the Autoconf Macro, you may extend this special
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
68 # exception to the GPL to apply to your modified version as well.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
69
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
70 #serial 21
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
71
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
72 AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
73 AC_DEFUN([AX_PYTHON_DEVEL],[
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
74 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
75 # Allow the use of a (user set) custom python version
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
76 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
77 AC_ARG_VAR([PYTHON_VERSION],[The installed Python
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
78 version to use, for example '2.3'. This string
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
79 will be appended to the Python interpreter
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
80 canonical name.])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
81
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
82 AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
83 if test -z "$PYTHON"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
84 AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
85 PYTHON_VERSION=""
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
86 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
87
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
88 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
89 # Check for a version of Python >= 2.1.0
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
90 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
91 AC_MSG_CHECKING([for a version of Python >= '2.1.0'])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
92 ac_supports_python_ver=`$PYTHON -c "import sys; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
93 ver = sys.version.split ()[[0]]; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
94 print (ver >= '2.1.0')"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
95 if test "$ac_supports_python_ver" != "True"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
96 if test -z "$PYTHON_NOVERSIONCHECK"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
97 AC_MSG_RESULT([no])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
98 AC_MSG_FAILURE([
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
99 This version of the AC@&t@_PYTHON_DEVEL macro
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
100 doesn't work properly with versions of Python before
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
101 2.1.0. You may need to re-run configure, setting the
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
102 variables PYTHON_CPPFLAGS, PYTHON_LIBS, PYTHON_SITE_PKG,
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
103 PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
104 Moreover, to disable this check, set PYTHON_NOVERSIONCHECK
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
105 to something else than an empty string.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
106 ])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
107 else
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
108 AC_MSG_RESULT([skip at user request])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
109 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
110 else
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
111 AC_MSG_RESULT([yes])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
112 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
113
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
114 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
115 # if the macro parameter ``version'' is set, honour it
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
116 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
117 if test -n "$1"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
118 AC_MSG_CHECKING([for a version of Python $1])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
119 ac_supports_python_ver=`$PYTHON -c "import sys; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
120 ver = '.'.join(sys.version.split('.')[[:2]]); \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
121 print (ver == '$1')"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
122 if test "$ac_supports_python_ver" = "True"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
123 AC_MSG_RESULT([yes])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
124 else
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
125 AC_MSG_RESULT([no])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
126 AC_MSG_ERROR([this package requires Python $1.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
127 If you have it installed, but it isn't the default Python
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
128 interpreter in your system path, please pass the PYTHON_VERSION
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
129 variable to configure. See ``configure --help'' for reference.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
130 ])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
131 PYTHON_VERSION=""
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
132 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
133 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
134
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
135 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
136 # Check if you have distutils, else fail
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
137 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
138 AC_MSG_CHECKING([for the distutils Python package])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
139 ac_distutils_result=`$PYTHON -c "import distutils" 2>&1`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
140 if test $? -eq 0; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
141 AC_MSG_RESULT([yes])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
142 else
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
143 AC_MSG_RESULT([no])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
144 AC_MSG_ERROR([cannot import Python module "distutils".
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
145 Please check your Python installation. The error was:
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
146 $ac_distutils_result])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
147 PYTHON_VERSION=""
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
148 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
149
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
150 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
151 # Check for Python include path
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
152 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
153 AC_MSG_CHECKING([for Python include path])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
154 if test -z "$PYTHON_CPPFLAGS"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
155 python_path=`$PYTHON -c "import distutils.sysconfig; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
156 print (distutils.sysconfig.get_python_inc ());"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
157 plat_python_path=`$PYTHON -c "import distutils.sysconfig; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
158 print (distutils.sysconfig.get_python_inc (plat_specific=1));"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
159 if test -n "${python_path}"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
160 if test "${plat_python_path}" != "${python_path}"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
161 python_path="-I$python_path -I$plat_python_path"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
162 else
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
163 python_path="-I$python_path"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
164 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
165 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
166 PYTHON_CPPFLAGS=$python_path
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
167 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
168 AC_MSG_RESULT([$PYTHON_CPPFLAGS])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
169 AC_SUBST([PYTHON_CPPFLAGS])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
170
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
171 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
172 # Check for Python library path
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
173 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
174 AC_MSG_CHECKING([for Python library path])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
175 if test -z "$PYTHON_LIBS"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
176 # (makes two attempts to ensure we've got a version number
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
177 # from the interpreter)
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
178 ac_python_version=`cat<<EOD | $PYTHON -
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
179
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
180 # join all versioning strings, on some systems
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
181 # major/minor numbers could be in different list elements
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
182 from distutils.sysconfig import *
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
183 e = get_config_var('VERSION')
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
184 if e is not None:
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
185 print(e)
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
186 EOD`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
187
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
188 if test -z "$ac_python_version"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
189 if test -n "$PYTHON_VERSION"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
190 ac_python_version=$PYTHON_VERSION
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
191 else
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
192 ac_python_version=`$PYTHON -c "import sys; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
193 print (sys.version[[:3]])"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
194 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
195 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
196
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
197 # Make the versioning information available to the compiler
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
198 AC_DEFINE_UNQUOTED([HAVE_PYTHON], ["$ac_python_version"],
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
199 [If available, contains the Python version number currently in use.])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
200
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
201 # First, the library directory:
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
202 ac_python_libdir=`cat<<EOD | $PYTHON -
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
203
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
204 # There should be only one
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
205 import distutils.sysconfig
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
206 e = distutils.sysconfig.get_config_var('LIBDIR')
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
207 if e is not None:
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
208 print (e)
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
209 EOD`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
210
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
211 # Now, for the library:
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
212 ac_python_library=`cat<<EOD | $PYTHON -
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
213
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
214 import distutils.sysconfig
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
215 c = distutils.sysconfig.get_config_vars()
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
216 if 'LDVERSION' in c:
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
217 print ('python'+c[['LDVERSION']])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
218 else:
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
219 print ('python'+c[['VERSION']])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
220 EOD`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
221
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
222 # This small piece shamelessly adapted from PostgreSQL python macro;
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
223 # credits goes to momjian, I think. I'd like to put the right name
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
224 # in the credits, if someone can point me in the right direction... ?
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
225 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
226 if test -n "$ac_python_libdir" -a -n "$ac_python_library"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
227 then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
228 # use the official shared library
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
229 ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
230 PYTHON_LIBS="-L$ac_python_libdir -l$ac_python_library"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
231 else
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
232 # old way: use libpython from python_configdir
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
233 ac_python_libdir=`$PYTHON -c \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
234 "from distutils.sysconfig import get_python_lib as f; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
235 import os; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
236 print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
237 PYTHON_LIBS="-L$ac_python_libdir -lpython$ac_python_version"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
238 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
239
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
240 if test -z "PYTHON_LIBS"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
241 AC_MSG_ERROR([
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
242 Cannot determine location of your Python DSO. Please check it was installed with
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
243 dynamic libraries enabled, or try setting PYTHON_LIBS by hand.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
244 ])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
245 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
246 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
247 AC_MSG_RESULT([$PYTHON_LIBS])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
248 AC_SUBST([PYTHON_LIBS])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
249
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
250 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
251 # Check for site packages
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
252 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
253 AC_MSG_CHECKING([for Python site-packages path])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
254 if test -z "$PYTHON_SITE_PKG"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
255 PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
256 print (distutils.sysconfig.get_python_lib(0,0));"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
257 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
258 AC_MSG_RESULT([$PYTHON_SITE_PKG])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
259 AC_SUBST([PYTHON_SITE_PKG])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
260
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
261 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
262 # libraries which must be linked in when embedding
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
263 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
264 AC_MSG_CHECKING(python extra libraries)
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
265 if test -z "$PYTHON_EXTRA_LIBS"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
266 PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
267 conf = distutils.sysconfig.get_config_var; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
268 print (conf('LIBS') + ' ' + conf('SYSLIBS'))"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
269 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
270 AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
271 AC_SUBST(PYTHON_EXTRA_LIBS)
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
272
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
273 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
274 # linking flags needed when embedding
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
275 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
276 AC_MSG_CHECKING(python extra linking flags)
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
277 if test -z "$PYTHON_EXTRA_LDFLAGS"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
278 PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
279 conf = distutils.sysconfig.get_config_var; \
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
280 print (conf('LINKFORSHARED'))"`
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
281 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
282 AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
283 AC_SUBST(PYTHON_EXTRA_LDFLAGS)
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
284
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
285 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
286 # final check to see if everything compiles alright
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
287 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
288 AC_MSG_CHECKING([consistency of all components of python development environment])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
289 # save current global flags
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
290 ac_save_LIBS="$LIBS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
291 ac_save_LDFLAGS="$LDFLAGS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
292 ac_save_CPPFLAGS="$CPPFLAGS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
293 LIBS="$ac_save_LIBS $PYTHON_LIBS $PYTHON_EXTRA_LIBS $PYTHON_EXTRA_LIBS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
294 LDFLAGS="$ac_save_LDFLAGS $PYTHON_EXTRA_LDFLAGS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
295 CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
296 AC_LANG_PUSH([C])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
297 AC_LINK_IFELSE([
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
298 AC_LANG_PROGRAM([[#include <Python.h>]],
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
299 [[Py_Initialize();]])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
300 ],[pythonexists=yes],[pythonexists=no])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
301 AC_LANG_POP([C])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
302 # turn back to default flags
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
303 CPPFLAGS="$ac_save_CPPFLAGS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
304 LIBS="$ac_save_LIBS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
305 LDFLAGS="$ac_save_LDFLAGS"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
306
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
307 AC_MSG_RESULT([$pythonexists])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
308
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
309 if test ! "x$pythonexists" = "xyes"; then
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
310 AC_MSG_FAILURE([
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
311 Could not link test program to Python. Maybe the main Python library has been
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
312 installed in some non-standard library path. If so, pass it to configure,
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
313 via the LIBS environment variable.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
314 Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
315 ============================================================================
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
316 ERROR!
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
317 You probably have to install the development version of the Python package
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
318 for your distribution. The exact name of this package varies among them.
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
319 ============================================================================
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
320 ])
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
321 PYTHON_VERSION=""
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
322 fi
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
323
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
324 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
325 # all done!
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
326 #
1e1970f93f94 allow all 7 days in bydays recurring appointment, update for fedora python packaging
Carl Byington <carl@five-ten-sg.com>
parents:
diff changeset
327 ])