File: ac_python_devel.html

package info (click to toggle)
autoconf-archive 20041123-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,336 kB
  • ctags: 2
  • sloc: makefile: 29
file content (119 lines) | stat: -rw-r--r-- 3,884 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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
  <title>Autoconf Macro: ac_python_devel</title>
  <link rel="stylesheet" type="text/css" href="ac-archive.css">
</head>

<body>
  <table summary="web navigation" style="width:100%;">
    <tbody>
      <tr>
        <td style="width:50%;" align="center">[<a href="index.html">Macro Index
        Page</a>]</td>

        <td style="width:50%;" align="center">[<a href=
        "../m4source/ac_python_devel.m4">Download M4 Source</a>]</td>
      </tr>
    </tbody>
  </table>
  <hr>

  <h1>ac_python_devel</h1>

  <h2>Synopsis</h2>

  <div class="indent">
    <p style="text-align:left; white-space:nowrap;">
    <code>AC_PYTHON_DEVEL</code></p>
  </div>

  <h2>Description</h2>

  <div class="indent">
    <p>Checks for Python and tries to get the include path to 'Python.h'. It
    provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) output variable.</p>
  </div>

  <h2>Version</h2>

  <div class="indent">
    <p>1.2 (last modified: 2004-07-14)</p>
  </div>

  <h2>Author</h2>

  <div class="indent">
    <p>Sebastian Huber &lt;sebastian-huber@web.de&gt;, Alan W. Irwin
    &lt;irwin@beluga.phys.uvic.ca&gt;, Rafael Laboissiere
    &lt;laboissiere@psy.mpg.de&gt; and Andrew Collier
    &lt;colliera@nu.ac.za&gt;.</p>
  </div>

  <h2>M4 Source Code</h2>

  <div class="indent">
    <pre class="m4source">
AC_DEFUN([AC_PYTHON_DEVEL],[
        #
        # should allow for checking of python version here...
        #
        AC_REQUIRE([AM_PATH_PYTHON])

        # Check for Python include path
        AC_MSG_CHECKING([for Python include path])
        python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
        for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" "$python_path/" ; do
                python_path=`find $i -type f -name Python.h -print | sed "1q"`
                if test -n "$python_path" ; then
                        break
                fi
        done
        python_path=`echo $python_path | sed "s,/Python.h$,,"`
        AC_MSG_RESULT([$python_path])
        if test -z "$python_path" ; then
                AC_MSG_ERROR([cannot find Python include path])
        fi
        AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path])

        # Check for Python library path
        AC_MSG_CHECKING([for Python library path])
        python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
        for i in "$python_path/lib/python$PYTHON_VERSION/config/" "$python_path/lib/python$PYTHON_VERSION/" "$python_path/lib/python/config/" "$python_path/lib/python/" "$python_path/" ; do
                python_path=`find $i -type f -name libpython$PYTHON_VERSION.* -print | sed "1q"`
                if test -n "$python_path" ; then
                        break
                fi
        done
        python_path=`echo $python_path | sed "s,/libpython.*$,,"`
        AC_MSG_RESULT([$python_path])
        if test -z "$python_path" ; then
                AC_MSG_ERROR([cannot find Python library path])
        fi
        AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"])
        #
        python_site=`echo $python_path | sed "s/config/site-packages/"`
        AC_SUBST([PYTHON_SITE_PKG],[$python_site])
        #
        # libraries which must be linked in when embedding
        #
        AC_MSG_CHECKING(python extra libraries)
        PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \
                conf = distutils.sysconfig.get_config_var; \
                print conf('LOCALMODLIBS')+' '+conf('LIBS')"
        AC_MSG_RESULT($PYTHON_EXTRA_LIBS)`
        AC_SUBST(PYTHON_EXTRA_LIBS)
])
</pre>
  </div>

  <h2>Copyright</h2>

  <div class="indent">
    <a href="COPYING.html">GNU General Public License</a> with this special
    <a href="COPYING-Exception.html">exception</a>.
  </div>
</body>
</html>