Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
cf567c1b
Kaydet (Commit)
cf567c1b
authored
Mar 08, 2006
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Changes to build the _ctypes extension module.
Based on a patch from Hye-Shik Chang.
üst
d4c93204
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
1 deletion
+59
-1
Makefile.pre.in
Makefile.pre.in
+1
-1
setup.py
setup.py
+58
-0
No files found.
Makefile.pre.in
Dosyayı görüntüle @
cf567c1b
...
...
@@ -677,7 +677,7 @@ PLATMACPATH=:plat-mac:plat-mac/lib-scriptpackages
LIBSUBDIRS
=
lib-old lib-tk site-packages
test test
/output
test
/data
\
test
/decimaltestdata
\
encodings email email/test email/test/data compiler hotshot
\
logging bsddb bsddb/test csv idlelib idlelib/Icons
\
logging bsddb bsddb/test csv
ctypes
idlelib idlelib/Icons
\
distutils distutils/command distutils/tests
$(XMLLIBSUBDIRS)
\
curses
$(MACHDEPS)
libinstall
:
$(BUILDPYTHON) $(srcdir)/Lib/$(PLATDIR)
...
...
setup.py
Dosyayı görüntüle @
cf567c1b
...
...
@@ -888,6 +888,9 @@ class PyBuildExt(build_ext):
if
(
dl_inc
is
not
None
)
and
(
platform
not
in
[
'atheos'
,
'darwin'
]):
exts
.
append
(
Extension
(
'dl'
,
[
'dlmodule.c'
])
)
# Thomas Heller's _ctypes module
self
.
detect_ctypes
()
# Platform-specific libraries
if
platform
==
'linux2'
:
# Linux-specific modules
...
...
@@ -1180,6 +1183,61 @@ class PyBuildExt(build_ext):
# *** Uncomment these for TOGL extension only:
# -lGL -lGLU -lXext -lXmu \
def
detect_ctypes
(
self
):
(
srcdir
,)
=
sysconfig
.
get_config_vars
(
'srcdir'
)
ffi_builddir
=
os
.
path
.
join
(
self
.
build_temp
,
'libffi'
)
ffi_srcdir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
srcdir
,
'Modules'
,
'_ctypes'
,
'libffi'
))
ffi_configfile
=
os
.
path
.
join
(
ffi_builddir
,
'fficonfig.py'
)
if
self
.
force
or
not
os
.
path
.
exists
(
ffi_configfile
):
from
distutils.dir_util
import
mkpath
mkpath
(
ffi_builddir
)
config_args
=
[]
# Pass empty CFLAGS because we'll just append the resulting CFLAGS
# to Python's; -g or -O2 is to be avoided.
cmd
=
"cd
%
s && env CFLAGS='' '
%
s/configure'
%
s"
\
%
(
ffi_builddir
,
ffi_srcdir
,
" "
.
join
(
config_args
))
res
=
os
.
system
(
cmd
)
if
res
or
not
os
.
path
.
exists
(
ffi_configfile
):
print
"Failed to configure _ctypes module"
return
fficonfig
=
{}
execfile
(
ffi_configfile
,
globals
(),
fficonfig
)
ffi_srcdir
=
os
.
path
.
join
(
fficonfig
[
'ffi_srcdir'
],
'src'
)
# Add .S (preprocessed assembly) to C compiler source extensions.
self
.
compiler
.
src_extensions
.
append
(
'.S'
)
include_dirs
=
[
os
.
path
.
join
(
ffi_builddir
,
'include'
),
ffi_builddir
,
ffi_srcdir
]
extra_compile_args
=
fficonfig
[
'ffi_cflags'
]
.
split
()
sources
=
[
'_ctypes/_ctypes.c'
,
'_ctypes/callbacks.c'
,
'_ctypes/callproc.c'
,
'_ctypes/stgdict.c'
,
'_ctypes/cfield.c'
,
'_ctypes/malloc_closure.c'
]
+
fficonfig
[
'ffi_sources'
]
depends
=
[
'_ctypes/ctypes.h'
]
if
sys
.
platform
==
'darwin'
:
sources
.
append
(
'_ctypes/darwin/dlfcn_simple.c'
)
include_dirs
.
append
(
'_ctypes/darwin'
)
# XXX Is this still needed?
## extra_link_args.extend(['-read_only_relocs', 'warning'])
ext
=
Extension
(
'_ctypes'
,
include_dirs
=
include_dirs
,
extra_compile_args
=
extra_compile_args
,
sources
=
sources
,
depends
=
depends
)
ext_test
=
Extension
(
'_ctypes_test'
,
sources
=
[
'_ctypes/_ctypes_test.c'
])
self
.
extensions
.
extend
([
ext
,
ext_test
])
class
PyBuildInstall
(
install
):
# Suppress the warning about installation into the lib_dynload
# directory, which is not in sys.path when running Python during
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment