| 1 |
"""Support for Cygwin.""" |
| 2 |
|
| 3 |
import os |
| 4 |
import sys |
| 5 |
from rpython.translator.platform.posix import BasePosix |
| 6 |
|
| 7 |
class BaseCygwin(BasePosix): |
| 8 |
name = "cygwin" |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
link_flags = tuple( |
| 14 |
[] |
| 15 |
+ os.environ.get('LDFLAGS', '').split()) |
| 16 |
extra_libs = ('-lrt',) |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
cflags = tuple( |
| 22 |
['-O3', '-fomit-frame-pointer', |
| 23 |
'-Wall', '-Wno-unused'] |
| 24 |
+ os.environ.get('CFLAGS', '').split()) |
| 25 |
standalone_only = () |
| 26 |
shared_only = ('-fPIC',) |
| 27 |
so_ext = 'dll' |
| 28 |
exe_ext = 'exe' |
| 29 |
|
| 30 |
def _args_for_shared(self, args, **kwds): |
| 31 |
return ['-shared'] + args |
| 32 |
|
| 33 |
def _include_dirs_for_libffi(self): |
| 34 |
return self._pkg_config("libffi", "--cflags-only-I", |
| 35 |
['/usr/include/libffi']) |
| 36 |
|
| 37 |
def _library_dirs_for_libffi(self): |
| 38 |
return self._pkg_config("libffi", "--libs-only-L", |
| 39 |
['/usr/lib/libffi']) |
| 40 |
|
| 41 |
|
| 42 |
class Cygwin(BaseCygwin): |
| 43 |
shared_only = () |
| 44 |
|
| 45 |
|
| 46 |
class Cygwin64(BaseCygwin): |
| 47 |
pass |