Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | Do not compute platform, this does not work in cross compile environment |
| 2 | since it pokes at the system for getting architecture values |
| 3 | |
| 4 | Upstream-Status: Inappropriate |
| 5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 6 | |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 7 | --- a/setup.py |
| 8 | +++ b/setup.py |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 9 | @@ -169,24 +169,6 @@ class _M2CryptoBuildExt(build_ext.build_ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | log.debug('self.include_dirs = %s', self.include_dirs) |
| 11 | log.debug('self.library_dirs = %s', self.library_dirs) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 13 | - if platform.system() == "Linux": |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 14 | - # For RedHat-based distros, the '-D__{arch}__' option for |
| 15 | - # Swig needs to be normalized, particularly on i386. |
| 16 | - mach = platform.machine().lower() |
| 17 | - if mach in ('i386', 'i486', 'i586', 'i686'): |
| 18 | - arch = '__i386__' |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 19 | - elif mach in ('ppc64', 'powerpc64', 'ppc64le', 'ppc64el'): |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | - arch = '__powerpc64__' |
| 21 | - elif mach in ('ppc', 'powerpc'): |
| 22 | - arch = '__powerpc__' |
| 23 | - else: |
| 24 | - arch = '__%s__' % mach |
| 25 | - self.swig_opts.append('-D%s' % arch) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 26 | - if mach in ('ppc64le', 'ppc64el'): |
| 27 | - self.swig_opts.append('-D_CALL_ELF=2') |
Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 28 | - if mach in ('arm64_be'): |
| 29 | - self.swig_opts.append('-D__AARCH64EB__') |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | - |
| 31 | self.swig_opts.extend(['-I%s' % i for i in self.include_dirs]) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 32 | |
| 33 | # Some Linux distributor has added the following line in |