ctypes-commit Mailing List for ctypes (Page 103)
Brought to you by:
theller
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(90) |
Jun
(143) |
Jul
(106) |
Aug
(94) |
Sep
(84) |
Oct
(163) |
Nov
(60) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(128) |
Feb
(79) |
Mar
(227) |
Apr
(192) |
May
(179) |
Jun
(41) |
Jul
(53) |
Aug
(103) |
Sep
(28) |
Oct
(38) |
Nov
(81) |
Dec
(17) |
2006 |
Jan
(184) |
Feb
(111) |
Mar
(188) |
Apr
(67) |
May
(58) |
Jun
(123) |
Jul
(73) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Thomas H. <th...@us...> - 2004-06-29 09:59:49
|
Update of /cvsroot/ctypes/ctypes/win32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9580 Modified Files: __init__.py Log Message: Suppress printing traceback in non-__debug__ mode when calling CoUninitialize. COM methods can return results which cannot be passed to hex(). Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/__init__.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** __init__.py 23 Apr 2004 18:42:49 -0000 1.33 --- __init__.py 29 Jun 2004 09:59:28 -0000 1.34 *************** *** 17,21 **** class _Cleaner(object): def __del__(self, func=ole32.CoUninitialize): ! func() __cleaner = _Cleaner() --- 17,27 ---- class _Cleaner(object): def __del__(self, func=ole32.CoUninitialize): ! # Sometimes, CoUnititialize, running at Python shutdown, raises an exception. ! # We suppress this when __debug__ is False. ! if __debug__: ! func() ! else: ! try: func() ! except WindowsError: pass __cleaner = _Cleaner() *************** *** 225,229 **** result = func(self, *args) dprint("<method call> %s.%s -> %s" % \ ! (itfclass.__name__, name, hex(result))) return result return wrapped --- 231,235 ---- result = func(self, *args) dprint("<method call> %s.%s -> %s" % \ ! (itfclass.__name__, name, result)) return result return wrapped |
From: Thomas H. <th...@us...> - 2004-06-29 09:42:00
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5990 Modified Files: setup.py Log Message: More platform hacks. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** setup.py 25 Jun 2004 11:14:32 -0000 1.82 --- setup.py 29 Jun 2004 09:41:46 -0000 1.83 *************** *** 24,27 **** --- 24,28 ---- from distutils.command import build_py, build_ext, clean from distutils.dir_util import mkpath + from distutils.util import get_platform kw = {} *************** *** 86,90 **** ] ################################################################ ! # This section copied from the PyObjC project if sys.platform == 'darwin': # Apple has used build options that don't work with a 'normal' system. --- 87,91 ---- ] ################################################################ ! # Parts of this section copied from the PyObjC project if sys.platform == 'darwin': # Apple has used build options that don't work with a 'normal' system. *************** *** 106,109 **** --- 107,115 ---- LIBFFI_SOURCES=None + platform = get_platform() + + if platform in ["solaris-2.9-sun4u"]: + os.environ["CFLAGS"] = "-fPIC" + ################################################################ |
From: Thomas H. <th...@us...> - 2004-06-29 09:31:49
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3641 Modified Files: callbacks.c Log Message: Add a missing Py_XDECREF, and remove unneeded forward declaration. Index: callbacks.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callbacks.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** callbacks.c 11 Jun 2004 15:12:13 -0000 1.53 --- callbacks.c 29 Jun 2004 09:31:29 -0000 1.54 *************** *** 41,56 **** #endif - /******************************************************************************** - * - * callback objects: definition - */ - - THUNK AllocFunctionCallback(PyObject *callable, - int nArgBytes, - PyObject *converters, - PyObject *restype, - int is_cdecl); - - static void PrintError(char *msg, ...) --- 41,44 ---- *************** *** 167,170 **** --- 155,159 ---- } } + Py_XDECREF(result); Done: Py_XDECREF(arglist); |
From: Thomas H. <th...@us...> - 2004-06-25 11:14:41
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22692 Modified Files: setup.py Log Message: Search libffi in the lib and lib64 directories. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** setup.py 25 Jun 2004 11:09:35 -0000 1.81 --- setup.py 25 Jun 2004 11:14:32 -0000 1.82 *************** *** 350,354 **** if not incdir: return 0 ! libdir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") if not libdir: return 0 --- 350,355 ---- if not incdir: return 0 ! libdir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") or \ ! find_file_in_subdir(os.path.join(inst_dir, "lib64"), "libffi.a") if not libdir: return 0 |
From: Thomas H. <th...@us...> - 2004-06-25 11:13:18
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22436 Modified Files: MANIFEST.in Log Message: New MANIFEST file, include libffi sources. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/ctypes/ctypes/MANIFEST.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MANIFEST.in 15 Jan 2004 20:42:49 -0000 1.9 --- MANIFEST.in 25 Jun 2004 11:13:10 -0000 1.10 *************** *** 2,9 **** include source/*.c source/*.h include source/darwin/*.c source/darwin/*.h include unittests/*.py ! include docs/*.html docs/*.css docs/*.stx ! include samples/rt samples/rt.bat recursive-include samples *.py ! recursive-include win32 *.py *.idl *.html *.cpp --- 2,14 ---- include source/*.c source/*.h include source/darwin/*.c source/darwin/*.h + include ctypes/.CTYPES_DEVEL + recursive-include source/gcc * include unittests/*.py ! include docs/*.html ! include docs/*.css ! include docs/*.stx ! ! include samples/rt recursive-include samples *.py ! prune samples/Windows |
From: Thomas H. <th...@us...> - 2004-06-25 11:09:46
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21376 Modified Files: setup.py Log Message: Adjust PYTHONPATH before running the tests. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** setup.py 25 Jun 2004 09:28:16 -0000 1.80 --- setup.py 25 Jun 2004 11:09:35 -0000 1.81 *************** *** 127,139 **** ################################################################ - # We must add the current directory to $PYTHONPATH for the unittests - # running as separate processes - pypath = os.environ.get("PYTHONPATH") - if pypath: - pypath = pypath.split(os.pathsep) + [os.getcwd()] - else: - pypath = [os.getcwd()] - os.environ["PYTHONPATH"] = os.pathsep.join(pypath) - class test(Command): # Original version of this class posted --- 127,130 ---- *************** *** 172,175 **** --- 163,178 ---- # finalize_options() + def extend_path(self): + # We must add the current directory to $PYTHONPATH for the unittests + # running as separate processes + pypath = os.environ.get("PYTHONPATH") + if pypath: + pypath = pypath.split(os.pathsep) + [] + else: + pypath = [] + if os.getcwd() in pypath: + return + os.environ["PYTHONPATH"] = os.pathsep.join(pypath) + def run(self): import glob, unittest, time *************** *** 180,183 **** --- 183,187 ---- self.announce("testing") + self.extend_path() self.testcases = [] |
From: Thomas H. <th...@us...> - 2004-06-25 09:28:25
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1694 Modified Files: setup.py Log Message: Always build our own libffi, even if another one is installed. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** setup.py 25 Jun 2004 09:27:21 -0000 1.79 --- setup.py 25 Jun 2004 09:28:16 -0000 1.80 *************** *** 98,105 **** distutils.sysconfig._config_vars['LDSHARED'] = y ! if sys.platform != 'darwin' and os.path.exists('/usr/include/ffi.h') \ ! or os.path.exists('/usr/local/include/ffi.h'): ! # A system with a pre-existing libffi. ! LIBFFI_SOURCES=None if sys.platform == 'win32': --- 98,105 ---- distutils.sysconfig._config_vars['LDSHARED'] = y ! ##if sys.platform != 'darwin' and os.path.exists('/usr/include/ffi.h') \ ! ## or os.path.exists('/usr/local/include/ffi.h'): ! ## # A system with a pre-existing libffi. ! ## LIBFFI_SOURCES=None if sys.platform == 'win32': |
From: Thomas H. <th...@us...> - 2004-06-25 09:27:31
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1486 Modified Files: setup.py Log Message: Make sure that libffi is found after building it. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** setup.py 25 Jun 2004 07:40:47 -0000 1.78 --- setup.py 25 Jun 2004 09:27:21 -0000 1.79 *************** *** 391,395 **** sys.exit(res) ! self.fix_extension(inst_dir) # Since we mangle the build_temp dir, we must also do this in the clean command. --- 391,395 ---- sys.exit(res) ! assert self.fix_extension(inst_dir), "Could not find libffi after building it" # Since we mangle the build_temp dir, we must also do this in the clean command. |
From: Thomas H. <th...@us...> - 2004-06-25 07:40:55
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12094 Modified Files: setup.py Log Message: Add ctypes directory to PYTHONPATH for the unittests. Move code around. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** setup.py 24 Jun 2004 19:02:29 -0000 1.77 --- setup.py 25 Jun 2004 07:40:47 -0000 1.78 *************** *** 13,17 **** # XXX explain LIBFFI_SOURCES - ##LIBFFI_SOURCES='../libffi-src' LIBFFI_SOURCES='source/gcc/libffi' --- 13,16 ---- *************** *** 20,56 **** import os, sys - try: - walk = os.walk - except AttributeError: - def walk(top): - # Python 2.3's os.walk generator, without the large docstring ;-) - # And without the topdown and onerror arguments. - from os.path import join, isdir, islink - - # We may not have read permission for top, in which case we can't - # get a list of the files the directory contains. os.path.walk - # always suppressed the exception then, rather than blow up for a - # minor reason when (say) a thousand readable directories are still - # left to visit. That logic is copied here. - try: - names = os.listdir(top) - except OSError, err: - return - - dirs, nondirs = [], [] - for name in names: - if isdir(join(top, name)): - dirs.append(name) - else: - nondirs.append(name) - - yield top, dirs, nondirs - for name in dirs: - path = join(top, name) - if not islink(path): - for x in walk(path): - yield x - - from distutils.core import setup, Extension, Command import distutils.core --- 19,22 ---- *************** *** 161,164 **** --- 127,139 ---- ################################################################ + # We must add the current directory to $PYTHONPATH for the unittests + # running as separate processes + pypath = os.environ.get("PYTHONPATH") + if pypath: + pypath = pypath.split(os.pathsep) + [os.getcwd()] + else: + pypath = [os.getcwd()] + os.environ["PYTHONPATH"] = os.pathsep.join(pypath) + class test(Command): # Original version of this class posted *************** *** 320,323 **** --- 295,332 ---- return result + ################################################################ + + try: + walk = os.walk + except AttributeError: + def walk(top): + # Python 2.3's os.walk generator, without the large docstring ;-) + # And without the topdown and onerror arguments. + from os.path import join, isdir, islink + + # We may not have read permission for top, in which case we can't + # get a list of the files the directory contains. os.path.walk + # always suppressed the exception then, rather than blow up for a + # minor reason when (say) a thousand readable directories are still + # left to visit. That logic is copied here. + try: + names = os.listdir(top) + except OSError, err: + return + + dirs, nondirs = [], [] + for name in names: + if isdir(join(top, name)): + dirs.append(name) + else: + nondirs.append(name) + + yield top, dirs, nondirs + for name in dirs: + path = join(top, name) + if not islink(path): + for x in walk(path): + yield x + def find_file_in_subdir(dirname, filename): # if <filename> is in <dirname> or any subdirectory thereof, |
From: Thomas H. <th...@us...> - 2004-06-24 19:47:36
|
Update of /cvsroot/ctypes/ctypes/source/gcc/gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30179/source/gcc/gcc Added Files: version.c Log Message: This file also needed. --- NEW FILE: version.c --- #include "version.h" /* This is the string reported as the version number by all components of the compiler. If you distribute a modified version of GCC, please modify this string to indicate that, e.g. by putting your organization's name in parentheses at the end of the string. */ const char version_string[] = "3.5.0 20040624 (experimental)"; /* This is the location of the online document giving instructions for reporting bugs. If you distribute a modified version of GCC, please change this to refer to a document giving instructions for reporting bugs to you, not us. (You are of course welcome to forward us bugs reported to you, if you determine that they are not bugs in your modifications.) */ const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>"; |
From: Thomas H. <th...@us...> - 2004-06-24 19:44:02
|
Update of /cvsroot/ctypes/ctypes/source/gcc/gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29066/source/gcc/gcc Log Message: Directory /cvsroot/ctypes/ctypes/source/gcc/gcc added to the repository |
From: Thomas H. <th...@us...> - 2004-06-24 19:12:08
|
Update of /cvsroot/ctypes/ctypes/build/lib.win32-2.3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21504 Modified Files: _ctypes_test.pyd _ctypes.pyd Log Message: Recompiled. Index: _ctypes_test.pyd =================================================================== RCS file: /cvsroot/ctypes/ctypes/build/lib.win32-2.3/_ctypes_test.pyd,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvsquvcke and /tmp/cvsQemzlv differ Index: _ctypes.pyd =================================================================== RCS file: /cvsroot/ctypes/ctypes/build/lib.win32-2.3/_ctypes.pyd,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvszMeBAe and /tmp/cvscpre9w differ |
From: Thomas H. <th...@us...> - 2004-06-24 19:11:40
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21417 Modified Files: test_numbers.py Log Message: Comment out the non-test stuff. Index: test_numbers.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_numbers.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_numbers.py 4 May 2004 09:15:19 -0000 1.17 --- test_numbers.py 24 Jun 2004 19:11:31 -0000 1.18 *************** *** 236,239 **** if __name__ == '__main__': ! check_perf() unittest.main() --- 236,239 ---- if __name__ == '__main__': ! ## check_perf() unittest.main() |
From: Thomas H. <th...@us...> - 2004-06-24 19:02:48
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19534 Modified Files: setup.py Log Message: Yay! builds and works on FreeBSD Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** setup.py 24 Jun 2004 18:55:57 -0000 1.76 --- setup.py 24 Jun 2004 19:02:29 -0000 1.77 *************** *** 336,346 **** incdir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") if not incdir: ! return None libdir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") if not libdir: ! return None incdir_2 = find_file_in_subdir(os.path.join(inst_dir, "lib"), "ffitarget.h") if not incdir_2: ! return None for ext in self.extensions: if ext.name == "_ctypes": --- 336,346 ---- incdir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") if not incdir: ! return 0 libdir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") if not libdir: ! return 0 incdir_2 = find_file_in_subdir(os.path.join(inst_dir, "lib"), "ffitarget.h") if not incdir_2: ! return 0 for ext in self.extensions: if ext.name == "_ctypes": *************** *** 349,352 **** --- 349,353 ---- ext.include_dirs.append(incdir_2) ext.library_dirs.append(libdir) + return 1 def build_libffi_static(self): *************** *** 361,365 **** inst_dir = os.path.abspath(self.build_temp) ! if not self.force and self.fix_extension(inc_dir): return --- 362,366 ---- inst_dir = os.path.abspath(self.build_temp) ! if not self.force and self.fix_extension(inst_dir): return *************** *** 381,389 **** sys.exit(res) ! libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") ! incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") ! # if not libffi_dir or not incffi_dir: raise some error ! ! self.fix_extension(libffi_dir, incffi_dir) # Since we mangle the build_temp dir, we must also do this in the clean command. --- 382,386 ---- sys.exit(res) ! self.fix_extension(inst_dir) # Since we mangle the build_temp dir, we must also do this in the clean command. |
From: Thomas H. <th...@us...> - 2004-06-24 18:56:06
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17831 Modified Files: setup.py Log Message: Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** setup.py 24 Jun 2004 18:40:55 -0000 1.75 --- setup.py 24 Jun 2004 18:55:57 -0000 1.76 *************** *** 333,346 **** build_ext.build_ext.run(self) ! def fix_extension(self, libdir, incdir): for ext in self.extensions: if ext.name == "_ctypes": print "INCDIR", incdir ext.include_dirs.append(incdir) ! print "LIBDIR", libdir ext.library_dirs.append(libdir) - # Newer libffi is broken: it doesn't install ffitarget.h in the right directory (IMO) - ## print "INCDIR", os.path.join(libdir, "../gcc/include/libffi") - ## ext.include_dirs.append(os.path.join(libdir, "gcc/include/libffi")) def build_libffi_static(self): --- 333,352 ---- build_ext.build_ext.run(self) ! def fix_extension(self, inst_dir): ! incdir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") ! if not incdir: ! return None ! libdir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") ! if not libdir: ! return None ! incdir_2 = find_file_in_subdir(os.path.join(inst_dir, "lib"), "ffitarget.h") ! if not incdir_2: ! return None for ext in self.extensions: if ext.name == "_ctypes": print "INCDIR", incdir ext.include_dirs.append(incdir) ! ext.include_dirs.append(incdir_2) ext.library_dirs.append(libdir) def build_libffi_static(self): *************** *** 355,367 **** inst_dir = os.path.abspath(self.build_temp) ! libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") ! incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") ! if libffi_dir and incffi_dir: ! self.fix_extension(libffi_dir, incffi_dir) ! if not self.force: ! return mkpath(build_dir) - config_args = ["--disable-shared", "--enable-static", --- 361,368 ---- inst_dir = os.path.abspath(self.build_temp) ! if not self.force and self.fix_extension(inc_dir): ! return mkpath(build_dir) config_args = ["--disable-shared", "--enable-static", |
From: Thomas H. <th...@us...> - 2004-06-24 18:41:06
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14816 Modified Files: setup.py Log Message: Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** setup.py 23 Jun 2004 20:29:04 -0000 1.74 --- setup.py 24 Jun 2004 18:40:55 -0000 1.75 *************** *** 13,18 **** # XXX explain LIBFFI_SOURCES ! LIBFFI_SOURCES='../libffi-src' ! ##LIBFFI_SOURCES='source/gcc/libffi' ################################################################ --- 13,18 ---- # XXX explain LIBFFI_SOURCES ! ##LIBFFI_SOURCES='../libffi-src' ! LIBFFI_SOURCES='source/gcc/libffi' ################################################################ *************** *** 336,343 **** for ext in self.extensions: if ext.name == "_ctypes": ext.include_dirs.append(incdir) ext.library_dirs.append(libdir) # Newer libffi is broken: it doesn't install ffitarget.h in the right directory (IMO) ! ext.include_dirs.append(os.path.join(libdir, "gcc/include/libffi")) def build_libffi_static(self): --- 336,346 ---- for ext in self.extensions: if ext.name == "_ctypes": + print "INCDIR", incdir ext.include_dirs.append(incdir) + print "LIBDIR", libdir ext.library_dirs.append(libdir) # Newer libffi is broken: it doesn't install ffitarget.h in the right directory (IMO) ! ## print "INCDIR", os.path.join(libdir, "../gcc/include/libffi") ! ## ext.include_dirs.append(os.path.join(libdir, "gcc/include/libffi")) def build_libffi_static(self): *************** *** 352,356 **** inst_dir = os.path.abspath(self.build_temp) ! libffi_dir = find_file_in_subdir(inst_dir, "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") if libffi_dir and incffi_dir: --- 355,359 ---- inst_dir = os.path.abspath(self.build_temp) ! libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") if libffi_dir and incffi_dir: *************** *** 361,366 **** mkpath(build_dir) ! cmd = "cd %s && '%s/configure' --prefix='%s' --disable-shared --enable-static && make install" \ ! % (build_dir, src_dir, inst_dir) print 'Building static FFI library:' --- 364,375 ---- mkpath(build_dir) ! config_args = ["--disable-shared", ! "--enable-static", ! "--enable-multilib=no", ! "--prefix='%s'" % inst_dir, ! ] ! ! cmd = "cd %s && '%s/configure' %s && make install" \ ! % (build_dir, src_dir, " ".join(config_args)) print 'Building static FFI library:' *************** *** 371,375 **** sys.exit(res) ! libffi_dir = find_file_in_subdir(inst_dir, "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") # if not libffi_dir or not incffi_dir: raise some error --- 380,384 ---- sys.exit(res) ! libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") # if not libffi_dir or not incffi_dir: raise some error |
From: Thomas H. <th...@us...> - 2004-06-23 20:29:13
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25139 Modified Files: setup.py Log Message: make walk really work Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** setup.py 23 Jun 2004 20:06:28 -0000 1.73 --- setup.py 23 Jun 2004 20:29:04 -0000 1.74 *************** *** 10,16 **** """ # XXX explain LIBFFI_SOURCES ! ##LIBFFI_SOURCES='../libffi-src' ! LIBFFI_SOURCES='source/gcc/libffi' ################################################################ --- 10,18 ---- """ + from __future__ import generators + # XXX explain LIBFFI_SOURCES ! LIBFFI_SOURCES='../libffi-src' ! ##LIBFFI_SOURCES='source/gcc/libffi' ################################################################ *************** *** 20,24 **** try: walk = os.walk ! except NameError: def walk(top): # Python 2.3's os.walk generator, without the large docstring ;-) --- 22,26 ---- try: walk = os.walk ! except AttributeError: def walk(top): # Python 2.3's os.walk generator, without the large docstring ;-) *************** *** 32,38 **** # left to visit. That logic is copied here. try: ! # Note that listdir and error are globals in this module due ! # to earlier import-*. ! names = listdir(top) except OSError, err: return --- 34,38 ---- # left to visit. That logic is copied here. try: ! names = os.listdir(top) except OSError, err: return *************** *** 352,356 **** inst_dir = os.path.abspath(self.build_temp) ! libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") if libffi_dir and incffi_dir: --- 352,356 ---- inst_dir = os.path.abspath(self.build_temp) ! libffi_dir = find_file_in_subdir(inst_dir, "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") if libffi_dir and incffi_dir: *************** *** 371,375 **** sys.exit(res) ! libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") # if not libffi_dir or not incffi_dir: raise some error --- 371,375 ---- sys.exit(res) ! libffi_dir = find_file_in_subdir(inst_dir, "libffi.a") incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") # if not libffi_dir or not incffi_dir: raise some error |
From: Thomas H. <th...@us...> - 2004-06-23 20:06:37
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21013 Modified Files: setup.py Log Message: Python 2.2 doesn't have os.walk - provide a substitute. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** setup.py 23 Jun 2004 19:59:18 -0000 1.72 --- setup.py 23 Jun 2004 20:06:28 -0000 1.73 *************** *** 18,21 **** --- 18,55 ---- import os, sys + try: + walk = os.walk + except NameError: + def walk(top): + # Python 2.3's os.walk generator, without the large docstring ;-) + # And without the topdown and onerror arguments. + from os.path import join, isdir, islink + + # We may not have read permission for top, in which case we can't + # get a list of the files the directory contains. os.path.walk + # always suppressed the exception then, rather than blow up for a + # minor reason when (say) a thousand readable directories are still + # left to visit. That logic is copied here. + try: + # Note that listdir and error are globals in this module due + # to earlier import-*. + names = listdir(top) + except OSError, err: + return + + dirs, nondirs = [], [] + for name in names: + if isdir(join(top, name)): + dirs.append(name) + else: + nondirs.append(name) + + yield top, dirs, nondirs + for name in dirs: + path = join(top, name) + if not islink(path): + for x in walk(path): + yield x + from distutils.core import setup, Extension, Command *************** *** 289,293 **** # if <filename> is in <dirname> or any subdirectory thereof, # return the directory name, else None ! for d, _, names in os.walk(dirname): if filename in names: return d --- 323,327 ---- # if <filename> is in <dirname> or any subdirectory thereof, # return the directory name, else None ! for d, _, names in walk(dirname): if filename in names: return d |
From: Thomas H. <th...@us...> - 2004-06-23 19:59:26
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19364 Modified Files: setup.py Log Message: Locate the include and lib directories after building libffi. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** setup.py 23 Jun 2004 19:01:39 -0000 1.71 --- setup.py 23 Jun 2004 19:59:18 -0000 1.72 *************** *** 11,15 **** # XXX explain LIBFFI_SOURCES ! ##LIBFFI_SOURCES='libffi-src' LIBFFI_SOURCES='source/gcc/libffi' --- 11,15 ---- # XXX explain LIBFFI_SOURCES ! ##LIBFFI_SOURCES='../libffi-src' LIBFFI_SOURCES='source/gcc/libffi' *************** *** 237,240 **** --- 237,241 ---- else: #? self.errors += 1 + self.tracebacks.append([line, "Crashed"]) elif line == "=" * 70: # failure or error *************** *** 272,276 **** ] - class my_build_py(build_py.build_py): def find_package_modules (self, package, package_dir): --- 273,276 ---- *************** *** 286,289 **** --- 286,297 ---- return result + def find_file_in_subdir(dirname, filename): + # if <filename> is in <dirname> or any subdirectory thereof, + # return the directory name, else None + for d, _, names in os.walk(dirname): + if filename in names: + return d + return None + class my_build_ext(build_ext.build_ext): def run(self): *************** *** 291,294 **** --- 299,310 ---- build_ext.build_ext.run(self) + def fix_extension(self, libdir, incdir): + for ext in self.extensions: + if ext.name == "_ctypes": + ext.include_dirs.append(incdir) + ext.library_dirs.append(libdir) + # Newer libffi is broken: it doesn't install ffitarget.h in the right directory (IMO) + ext.include_dirs.append(os.path.join(libdir, "gcc/include/libffi")) + def build_libffi_static(self): if LIBFFI_SOURCES == None: *************** *** 301,316 **** build_dir = os.path.join(self.build_temp, 'libffi') inst_dir = os.path.abspath(self.build_temp) - lib_dir = os.path.abspath(os.path.join(inst_dir, 'lib')) - inc_dir = os.path.abspath(os.path.join(inst_dir, 'include')) ! for ext in self.extensions: ! ext.include_dirs.append(inc_dir) ! ext.include_dirs.append(os.path.join(lib_dir, "gcc/include/libffi")) ! ext.library_dirs.append(lib_dir) ! # guesswork, for 64-bit platforms ! ext.library_dirs.append(lib_dir + '64') ! ! if not self.force and os.path.isfile(os.path.join(lib_dir, "libffi.a")): ! return mkpath(build_dir) --- 317,327 ---- build_dir = os.path.join(self.build_temp, 'libffi') inst_dir = os.path.abspath(self.build_temp) ! libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") ! incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") ! if libffi_dir and incffi_dir: ! self.fix_extension(libffi_dir, incffi_dir) ! if not self.force: ! return mkpath(build_dir) *************** *** 326,329 **** --- 337,346 ---- sys.exit(res) + libffi_dir = find_file_in_subdir(os.path.join(inst_dir, "lib"), "libffi.a") + incffi_dir = find_file_in_subdir(os.path.join(inst_dir, "include"), "ffi.h") + # if not libffi_dir or not incffi_dir: raise some error + + self.fix_extension(libffi_dir, incffi_dir) + # Since we mangle the build_temp dir, we must also do this in the clean command. class my_clean(clean.clean): |
From: Thomas H. <th...@us...> - 2004-06-23 19:48:46
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17416 Modified Files: _ctypes_test.c Log Message: Remove unused variable. Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** _ctypes_test.c 23 Jun 2004 16:31:35 -0000 1.22 --- _ctypes_test.c 23 Jun 2004 19:48:38 -0000 1.23 *************** *** 182,186 **** EXPORT(int) _testfunc_byval(point in, point *pout) { - static point buf; if (pout) { pout->x = in.x; --- 182,185 ---- |
From: Thomas H. <th...@us...> - 2004-06-23 19:01:50
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7538 Modified Files: setup.py Log Message: - ohne Worte - Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** setup.py 23 Jun 2004 18:43:29 -0000 1.70 --- setup.py 23 Jun 2004 19:01:39 -0000 1.71 *************** *** 304,308 **** inc_dir = os.path.abspath(os.path.join(inst_dir, 'include')) ! 1 for ext in self.extensions: ext.include_dirs.append(inc_dir) ext.include_dirs.append(os.path.join(lib_dir, "gcc/include/libffi")) --- 304,308 ---- inc_dir = os.path.abspath(os.path.join(inst_dir, 'include')) ! for ext in self.extensions: ext.include_dirs.append(inc_dir) ext.include_dirs.append(os.path.join(lib_dir, "gcc/include/libffi")) |
From: Thomas H. <th...@us...> - 2004-06-23 18:43:43
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3899 Modified Files: setup.py Log Message: Fix the clean command. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** setup.py 23 Jun 2004 16:26:03 -0000 1.69 --- setup.py 23 Jun 2004 18:43:29 -0000 1.70 *************** *** 22,26 **** import distutils.core from distutils.errors import DistutilsOptionError ! from distutils.command import build_py, build_ext from distutils.dir_util import mkpath --- 22,26 ---- import distutils.core from distutils.errors import DistutilsOptionError ! from distutils.command import build_py, build_ext, clean from distutils.dir_util import mkpath *************** *** 296,299 **** --- 296,300 ---- src_dir = os.path.abspath(LIBFFI_SOURCES) + # Building libffi in a path containing spaces doesn't work: self.build_temp = self.build_temp.replace(" ", "") *************** *** 303,307 **** inc_dir = os.path.abspath(os.path.join(inst_dir, 'include')) ! for ext in self.extensions: ext.include_dirs.append(inc_dir) ext.include_dirs.append(os.path.join(lib_dir, "gcc/include/libffi")) --- 304,308 ---- inc_dir = os.path.abspath(os.path.join(inst_dir, 'include')) ! 1 for ext in self.extensions: ext.include_dirs.append(inc_dir) ext.include_dirs.append(os.path.join(lib_dir, "gcc/include/libffi")) *************** *** 325,328 **** --- 326,334 ---- sys.exit(res) + # Since we mangle the build_temp dir, we must also do this in the clean command. + class my_clean(clean.clean): + def run(self): + self.build_temp = self.build_temp.replace(" ", "") + clean.clean.run(self) if __name__ == '__main__': *************** *** 341,345 **** platforms=["windows", "Linux", "MacOS X", "Solaris"], ! cmdclass = {'test': test, 'build_py': my_build_py, 'build_ext': my_build_ext}, **options ) --- 347,351 ---- platforms=["windows", "Linux", "MacOS X", "Solaris"], ! cmdclass = {'test': test, 'build_py': my_build_py, 'build_ext': my_build_ext, 'clean': my_clean}, **options ) |
From: Thomas H. <th...@us...> - 2004-06-23 16:31:43
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9421 Modified Files: _ctypes_test.c Log Message: Python 2.2 compatibility. Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** _ctypes_test.c 23 Jun 2004 16:26:13 -0000 1.21 --- _ctypes_test.c 23 Jun 2004 16:31:35 -0000 1.22 *************** *** 1,4 **** --- 1,12 ---- #include <Python.h> + /* + Backwards compatibility: + Python2.2 used LONG_LONG instead of PY_LONG_LONG + */ + #if defined(HAVE_LONG_LONG) && !defined(PY_LONG_LONG) + #define PY_LONG_LONG LONG_LONG + #endif + #ifdef MS_WIN32 #include <windows.h> |
From: Thomas H. <th...@us...> - 2004-06-23 16:26:23
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7933 Modified Files: ctypes.h callproc.c _ctypes_test.c _ctypes.c Log Message: Remove the CAN_PASS_BY_VALUE symbol - it is now supported everywhere. Index: ctypes.h =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/ctypes.h,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** ctypes.h 11 Jun 2004 15:12:12 -0000 1.46 --- ctypes.h 23 Jun 2004 16:26:13 -0000 1.47 *************** *** 226,232 **** } value; PyObject *obj; - #ifdef CAN_PASS_BY_VALUE int size; /* for the 'V' tag */ - #endif } PyCArgObject; --- 226,230 ---- Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** callproc.c 14 Jun 2004 08:32:42 -0000 1.86 --- callproc.c 23 Jun 2004 16:26:13 -0000 1.87 *************** *** 536,540 **** a PyCArgObject? */ - #ifdef CAN_PASS_BY_VALUE if (CDataObject_Check(arg)) { CDataObject *mem = (CDataObject *)arg; --- 536,539 ---- *************** *** 547,551 **** } #endif - #endif Py_DECREF(arg); PyErr_Format(PyExc_TypeError, --- 546,549 ---- Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** _ctypes.c 11 Jun 2004 15:05:16 -0000 1.147 --- _ctypes.c 23 Jun 2004 16:26:13 -0000 1.148 *************** *** 2592,2596 **** } - #ifdef CAN_PASS_BY_VALUE static PyObject * Struct_as_parameter(CDataObject *self) --- 2592,2595 ---- *************** *** 2616,2620 **** return (PyObject *)parg; } - #endif static int --- 2615,2618 ---- *************** *** 2684,2692 **** static PyGetSetDef Struct_getsets[] = { - #ifdef CAN_PASS_BY_VALUE { "_as_parameter_", (getter)Struct_as_parameter, NULL, "return a magic value so that this can be converted to a C parameter (readonly)", NULL }, - #endif { NULL, NULL } }; --- 2682,2688 ---- Index: _ctypes_test.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes_test.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** _ctypes_test.c 23 Jun 2004 16:19:43 -0000 1.20 --- _ctypes_test.c 23 Jun 2004 16:26:13 -0000 1.21 *************** *** 167,171 **** } - #ifdef CAN_PASS_BY_VALUE typedef struct tagpoint { int x; --- 167,170 ---- *************** *** 183,188 **** } - #endif - EXPORT (int) an_integer = 42; --- 182,185 ---- |
From: Thomas H. <th...@us...> - 2004-06-23 16:26:12
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7850 Modified Files: setup.py Log Message: Remove the CAN_PASS_BY_VALUE symbol - it is now supported everywhere. Index: setup.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/setup.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** setup.py 22 Jun 2004 09:54:27 -0000 1.68 --- setup.py 23 Jun 2004 16:26:03 -0000 1.69 *************** *** 50,54 **** ]) extensions = [Extension("_ctypes", - define_macros=[("CAN_PASS_BY_VALUE", "1")], export_symbols=["DllGetClassObject,PRIVATE", "DllCanUnloadNow,PRIVATE", --- 50,53 ---- *************** *** 78,82 **** extensions = [Extension("_ctypes", - define_macros=[("CAN_PASS_BY_VALUE", "1")], libraries=["ffi"], include_dirs=include_dirs, --- 77,80 ---- *************** *** 85,91 **** **kw), Extension("_ctypes_test", ! sources=["source/_ctypes_test.c"], ! include_dirs=include_dirs, ! ) ] ################################################################ --- 83,87 ---- **kw), Extension("_ctypes_test", ! sources=["source/_ctypes_test.c"]) ] ################################################################ |