Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r59869:2dd6e756b754
Date: 2013-01-08 00:10 +0100
http://bitbucket.org/pypy/pypy/changeset/2dd6e756b754/

Log:    merge heads

diff --git a/pypy/doc/conf.py b/pypy/doc/conf.py
--- a/pypy/doc/conf.py
+++ b/pypy/doc/conf.py
@@ -38,7 +38,7 @@
 
 # General information about the project.
 project = u'PyPy'
-copyright = u'2011, The PyPy Project'
+copyright = u'2013, The PyPy Project'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
diff --git a/pypy/translator/platform/test/test_distutils.py 
b/pypy/translator/platform/test/test_distutils.py
--- a/pypy/translator/platform/test/test_distutils.py
+++ b/pypy/translator/platform/test/test_distutils.py
@@ -8,3 +8,6 @@
 
     def test_nice_errors(self):
         py.test.skip("Unsupported")
+
+    def test_900_files(self):
+        py.test.skip('Makefiles not suppoerted')
diff --git a/pypy/translator/platform/test/test_platform.py 
b/pypy/translator/platform/test/test_platform.py
--- a/pypy/translator/platform/test/test_platform.py
+++ b/pypy/translator/platform/test/test_platform.py
@@ -59,6 +59,34 @@
         res = self.platform.execute(executable)
         self.check_res(res)
 
+    def test_900_files(self):
+        txt = '#include <stdio.h>\n'
+        for i in range(900):
+            txt += 'int func%03d();\n' % i
+        txt += 'int main() {\n    int j=0;'    
+        for i in range(900):
+            txt += '    j += func%03d();\n' % i
+        txt += '    printf("%d\\n", j);\n'
+        txt += '    return 0;};\n'
+        cfile = udir.join('test_900_files.c')
+        cfile.write(txt)
+        cfiles = [cfile]
+        for i in range(900):
+            cfile2 = udir.join('implement%03d.c' %i)
+            cfile2.write('''
+                int func%03d()
+            {
+                return %d;
+            }
+            ''' % (i, i))
+            cfiles.append(cfile2)
+        mk = self.platform.gen_makefile(cfiles, ExternalCompilationInfo(), 
path=udir)
+        mk.write()
+        self.platform.execute_makefile(mk)
+        res = self.platform.execute(udir.join('test_900_files'))
+        self.check_res(res, '%d\n' %sum(range(900)))
+
+
     def test_nice_errors(self):
         cfile = udir.join('test_nice_errors.c')
         cfile.write('')
diff --git a/pypy/translator/platform/windows.py 
b/pypy/translator/platform/windows.py
--- a/pypy/translator/platform/windows.py
+++ b/pypy/translator/platform/windows.py
@@ -326,17 +326,33 @@
 
         for rule in rules:
             m.rule(*rule)
-
+        
+        objects = ' $(OBJECTS)'
+        create_obj_response_file = []
+        if len(' '.join(rel_ofiles)) > 4000:
+            # cmd.exe has a limit of ~4000 characters before a command line is 
too long.
+            # Use a response file instead, at the cost of making the Makefile 
very ugly.
+            for i in range(len(rel_ofiles) - 1):
+                create_obj_response_file.append('echo %s >> obj_names.rsp' % \
+                                                rel_ofiles[i])
+            # use cmd /c for the last one so that the file is flushed 
+            create_obj_response_file.append('cmd /c echo %s >> obj_names.rsp' 
% \
+                                            rel_ofiles[-1])
+            objects = ' @obj_names.rsp'
         if self.version < 80:
             m.rule('$(TARGET)', '$(OBJECTS)',
-                   '$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA) $(OBJECTS) 
/out:$@ $(LIBDIRS) $(LIBS)')
+                    create_obj_response_file + [\
+                   '$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA)' + objects + 
' /out:$@ $(LIBDIRS) $(LIBS)',
+                   ])
         else:
             m.rule('$(TARGET)', '$(OBJECTS)',
-                   ['$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA) $(OBJECTS) 
$(LINKFILES) /out:$@ $(LIBDIRS) $(LIBS) /MANIFEST /MANIFESTFILE:$*.manifest',
+                    create_obj_response_file + [\
+                    '$(CC_LINK) /nologo $(LDFLAGS) $(LDFLAGSEXTRA)' + objects 
+ ' $(LINKFILES) /out:$@ $(LIBDIRS) $(LIBS) /MANIFEST 
/MANIFESTFILE:$*.manifest',
                     'mt.exe -nologo -manifest $*.manifest 
-outputresource:$@;1',
                     ])
         m.rule('debugmode_$(TARGET)', '$(OBJECTS)',
-               ['$(CC_LINK) /nologo /DEBUG $(LDFLAGS) $(LDFLAGSEXTRA) 
$(OBJECTS) $(LINKFILES) /out:$@ $(LIBDIRS) $(LIBS)',
+                create_obj_response_file + [\
+               '$(CC_LINK) /nologo /DEBUG $(LDFLAGS) $(LDFLAGSEXTRA)' + 
objects + ' $(LINKFILES) /out:$@ $(LIBDIRS) $(LIBS)',
                 ])
 
         if shared:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to