blob: 542f40478bb02eb6f423253655d43b75bec25a10 (
plain)
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
|
.TH PYTHON\-CONFIG 1 "November 27, 2011"
.SH NAME
python\-config \- output build options for python C/C++ extensions or embedding
.SH SYNOPSIS
.BI "python\-config"
[
.BI "\-\-prefix"
]
[
.BI "\-\-exec\-prefix"
]
[
.BI "\-\-includes"
]
[
.BI "\-\-libs"
]
[
.BI "\-\-cflags"
]
[
.BI "\-\-ldflags"
]
[
.BI "\-\-help"
]
.SH DESCRIPTION
.B python\-config
helps compiling and linking programs, which embed the Python interpreter, or
extension modules that can be loaded dynamically (at run time) into
the interpreter.
.SH OPTIONS
.TP
.BI "\-\-cflags"
print the C compiler flags.
.TP
.BI "\-\-ldflags"
print the flags that should be passed to the linker.
.TP
.BI "\-\-includes"
similar to \fI\-\-cflags\fP but only with \-I options (path to python header files).
.TP
.BI "\-\-libs"
similar to \fI\-\-ldflags\fP but only with \-l options (used libraries).
.TP
.BI "\-\-prefix"
prints the prefix (base directory) under which python can be found.
.TP
.BI "\-\-exec\-prefix"
print the prefix used for executable program directories (such as bin, sbin, etc).
.TP
.BI "\-\-help"
print the usage message.
.PP
.SH EXAMPLES
To build the singe\-file c program \fIprog\fP against the python library, use
.PP
.RS
gcc $(python\-config \-\-cflags \-\-ldflags) progr.cpp \-o progr.cpp
.RE
.PP
The same in a makefile:
.PP
.RS
CFLAGS+=$(shell python\-config \-\-cflags)
.RE
.RS
LDFLAGS+=$(shell python\-config \-\-ldflags)
.RE
.RS
all: progr
.RE
To build a dynamically loadable python module, use
.PP
.RS
gcc $(python\-config \-\-cflags \-\-ldflags) \-shared \-fPIC progr.cpp \-o progr.so
.RE
.SH "SEE ALSO"
python (1)
.br
http://docs.python.org/extending/extending.html
.br
/usr/share/doc/python/faq/extending.html
.SH AUTHORS
This manual page was written by Johann Felix Soden <johfel@gmx.de>
for the Debian project (and may be used by others).
|