[pypy-svn] r71966 - in pypy/trunk/pypy/translator/platform: . test
arigo at codespeak.net
arigo at codespeak.net
Tue Mar 9 16:58:26 CET 2010
Author: arigo
Date: Tue Mar 9 16:58:25 2010
New Revision: 71966
Modified:
pypy/trunk/pypy/translator/platform/posix.py
pypy/trunk/pypy/translator/platform/test/test_posix.py
Log:
Test and fix: mirror eci.link_files into the Makefile.
Modified: pypy/trunk/pypy/translator/platform/posix.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/posix.py (original)
+++ pypy/trunk/pypy/translator/platform/posix.py Tue Mar 9 16:58:25 2010
@@ -91,13 +91,14 @@
('LDFLAGS', self.link_flags + list(eci.link_extra)),
('CC', self.cc),
('CC_LINK', eci.use_cpp_linker and 'g++' or '$(CC)'),
+ ('LINKFILES', eci.link_files),
]
for args in definitions:
m.definition(*args)
rules = [
('all', '$(DEFAULT_TARGET)', []),
- ('$(TARGET)', '$(OBJECTS)', '$(CC_LINK) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBDIRS) $(LIBS)'),
+ ('$(TARGET)', '$(OBJECTS)', '$(CC_LINK) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBDIRS) $(LIBS) $(LINKFILES)'),
('%.o', '%.c', '$(CC) $(CFLAGS) -o $@ -c $< $(INCLUDEDIRS)'),
]
Modified: pypy/trunk/pypy/translator/platform/test/test_posix.py
==============================================================================
--- pypy/trunk/pypy/translator/platform/test/test_posix.py (original)
+++ pypy/trunk/pypy/translator/platform/test/test_posix.py Tue Mar 9 16:58:25 2010
@@ -41,7 +41,14 @@
if self.strict_on_stderr:
assert res.err == ''
assert res.returncode == 0
-
+
+ def test_link_files(self):
+ tmpdir = udir.join('link_files' + self.__class__.__name__).ensure(dir=1)
+ eci = ExternalCompilationInfo(link_files=['/foo/bar.a'])
+ mk = self.platform.gen_makefile(['blip.c'], eci, path=tmpdir)
+ mk.write()
+ assert 'LINKFILES = /foo/bar.a' in tmpdir.join('Makefile').read()
+
class TestMaemo(TestMakefile):
strict_on_stderr = False
More information about the Pypy-commit
mailing list