[pypy-svn] r54745 - in pypy/dist/pypy/translator/tool: . test
afa at codespeak.net
afa at codespeak.net
Thu May 15 11:03:48 CEST 2008
Author: afa
Date: Thu May 15 11:03:47 2008
New Revision: 54745
Modified:
pypy/dist/pypy/translator/tool/cbuild.py
pypy/dist/pypy/translator/tool/test/test_cbuild.py
Log:
Add the eventual eci.separate_module_files when compiling a standalone executable,
so that rffi_platform.configure may compile configuration tests with
separate_module_sources and separate_module_files.
Used by the libffi module.
Also, better detection of debug mode on windows: Purify renames the original python.exe program.
And let test_cbuild pass on win32.
Modified: pypy/dist/pypy/translator/tool/cbuild.py
==============================================================================
--- pypy/dist/pypy/translator/tool/cbuild.py (original)
+++ pypy/dist/pypy/translator/tool/cbuild.py Thu May 15 11:03:47 2008
@@ -317,7 +317,8 @@
cmdobj = build_shared_library(dist)
cmdobj.inplace = True
cmdobj.force = True
- if sys.platform == 'win32' and sys.executable.endswith('_d.exe'):
+ if (sys.platform == 'win32'
+ and sys.executable.lower().endswith('_d.exe')):
cmdobj.debug = True
dist.command_obj["build_ext"] = cmdobj
dist.have_run["build_ext"] = 0
@@ -479,8 +480,10 @@
linker_exe linker_so'''.split():
compiler.executables[c][0] = self.compiler_exe
compiler.spawn = log_spawned_cmd(compiler.spawn)
+ self.eci = self.eci.convert_sources_to_files()
+ filenames = self.cfilenames + list(self.eci.separate_module_files)
objects = []
- for cfile in self.cfilenames:
+ for cfile in filenames:
cfile = py.path.local(cfile)
old = cfile.dirpath().chdir()
try:
Modified: pypy/dist/pypy/translator/tool/test/test_cbuild.py
==============================================================================
--- pypy/dist/pypy/translator/tool/test/test_cbuild.py (original)
+++ pypy/dist/pypy/translator/tool/test/test_cbuild.py Thu May 15 11:03:47 2008
@@ -45,9 +45,12 @@
{
printf("%f\\n", pow(2.0, 2.0));
}''')
- eci = ExternalCompilationInfo(
- libraries = ['m'],
- )
+ if sys.platform != 'win32':
+ eci = ExternalCompilationInfo(
+ libraries = ['m'],
+ )
+ else:
+ eci = ExternalCompilationInfo()
output = build_executable([c_file], eci)
p = Popen(output, stdout=PIPE, stderr=STDOUT)
p.wait()
@@ -109,7 +112,8 @@
int get()
{
return 42;
- }''']
+ }'''],
+ export_symbols = ['get']
)
neweci = eci.compile_shared_lib()
assert len(neweci.libraries) == 1
More information about the Pypy-commit
mailing list