~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/distutils/unixccompiler.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
  * link shared library handled by 'cc -shared'
14
14
"""
15
15
 
16
 
__revision__ = "$Id: unixccompiler.py 74729 2009-09-09 08:34:06Z tarek.ziade $"
 
16
__revision__ = "$Id: unixccompiler.py 77378 2010-01-08 23:48:37Z tarek.ziade $"
17
17
 
18
18
import os, sys
19
19
from types import StringType, NoneType
266
266
    def library_dir_option(self, dir):
267
267
        return "-L" + dir
268
268
 
 
269
    def _is_gcc(self, compiler_name):
 
270
        return "gcc" in compiler_name or "g++" in compiler_name
 
271
 
269
272
    def runtime_library_dir_option(self, dir):
270
273
        # XXX Hackish, at the very least.  See Python bug #445902:
271
274
        # http://sourceforge.net/tracker/index.php
284
287
            # MacOSX's linker doesn't understand the -R flag at all
285
288
            return "-L" + dir
286
289
        elif sys.platform[:5] == "hp-ux":
287
 
            if "gcc" in compiler or "g++" in compiler:
 
290
            if self._is_gcc(compiler):
288
291
                return ["-Wl,+s", "-L" + dir]
289
292
            return ["+s", "-L" + dir]
290
293
        elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5":
291
294
            return ["-rpath", dir]
292
 
        elif compiler[:3] == "gcc" or compiler[:3] == "g++":
 
295
        elif self._is_gcc(compiler):
293
296
            return "-Wl,-R" + dir
294
297
        else:
295
298
            return "-R" + dir