(self,*args,**kwds)
| 27 | } |
| 28 | |
| 29 | def get_version(self,*args,**kwds): |
| 30 | version = FCompiler.get_version(self,*args,**kwds) |
| 31 | |
| 32 | if version is None and sys.platform.startswith('aix'): |
| 33 | # use lslpp to find out xlf version |
| 34 | lslpp = find_executable('lslpp') |
| 35 | xlf = find_executable('xlf') |
| 36 | if os.path.exists(xlf) and os.path.exists(lslpp): |
| 37 | try: |
| 38 | o = subprocess.check_output([lslpp, '-Lc', 'xlfcmp']) |
| 39 | except (OSError, subprocess.CalledProcessError): |
| 40 | pass |
| 41 | else: |
| 42 | m = re.search(r'xlfcmp:(?P<version>\d+([.]\d+)+)', o) |
| 43 | if m: version = m.group('version') |
| 44 | |
| 45 | xlf_dir = '/etc/opt/ibmcmp/xlf' |
| 46 | if version is None and os.path.isdir(xlf_dir): |
| 47 | # linux: |
| 48 | # If the output of xlf does not contain version info |
| 49 | # (that's the case with xlf 8.1, for instance) then |
| 50 | # let's try another method: |
| 51 | l = sorted(os.listdir(xlf_dir)) |
| 52 | l.reverse() |
| 53 | l = [d for d in l if os.path.isfile(os.path.join(xlf_dir, d, 'xlf.cfg'))] |
| 54 | if l: |
| 55 | from distutils.version import LooseVersion |
| 56 | self.version = version = LooseVersion(l[0]) |
| 57 | return version |
| 58 | |
| 59 | def get_flags(self): |
| 60 | return ['-qextname'] |
no test coverage detected