pkgsrc/devel/meson/patches/patch-mesonbuild_compilers_compilers.py
prlw1 70907fa28b Add meson 0.51.2
The intention is to replace py-meson with meson to allow the possibility
of a python 3 meson to build a python 2 package.

No release notes, but
$ git log --oneline 0.51.1..0.51.2
6857936c (tag: 0.51.2, origin/0.51) Bump versions to 0.51.2 for release
267a69b1 Fix packaging.
0a460903 Fix tests for 0.51.2.
550a03ee gnome: Handle overriden g-ir-scanner
173facd4 cmake: fix missing -lpthread (fixes #5821)
ac2d69bd Pass optimization flags to rustc properly. Closes: #5788.
f2bd0812 Revert "gnome: Use find_program() to get glib-compile-resources"
acdcd736 Put native file before cross file in options list
524280db environment: simplify powerpc conditionals
51d1612d environment: simplify CPU logic via hw.machine_arch on BSDs
6b43e66e Canonicalize 'i86pc' return from platform.machine() for Solaris
bb63fe8e gnome: Use find_program() to get glib-compile-resources
c9524472 Made build. options alias basic ones when native building.
69a01dae Made set_option kwargs named-only.
5c7ff27e Do not print build and host settings when compiling natively.
949accb1 Do not print build compiler info when not cross compiling. It is confusing.
7aadc3aa vs backend: commandrunner.py takes source dir first
46c2a051 Update MSI creator script to newest VS on Win 7. [skip ci]
1a5c121f Fix cross compilation on OSX
c5f99542 coredata: Ignore directories when searching for machine files
85270dce mintro: Fix crash related to the sources kwarg (fixes #5741)
b48e1fcc docs: Add missing closing ` in reference manual
6f18ab18 interpreter: Fix permitted kwargs in dependency.get_variable
7f390e6a docs: correct key in dep.get_variable
58a6ab32 run_unitests: Skip the native_file_is_pipe test on cygwin
2640cd7e unit tests: Check whether pytest-xdist is available
be16f4cf Use pytest parallelisation if available.
5b02f88b ci/cygwin: Install pytest-xdist for unit tests
f7684ec5 ci/cygwin: Don't need a special step to install cmake
6e18169e tests/122 shared module: More verbose logging
87dee156 .travis.yml: Fix cross-mingw test failures
e7990883 cmake: 0.51 backport of #5665
750a7dc0 unit tests: Don't keep builddirs inside source tree on Cygwin
b591f3e7 Keep all build dirs inside the source tree.
bac86f25 meson: handle nested disabler
46d43b29 cmake: added test case for environment variables
e8421b24 meson: Use CMAKE_PREFIX_PATH environment variable
fd3384ca ValaCompiler: only emit '--debug' in debug build.
1e305e60 mintro: Fix section key in buildoptions
81e81209 BUGFIX: Fortran module regex handle more edge cases
d198d50c Fix missing return statements that are seen with -Werror=return-type.
f9211b75 No need to reserve build_ because we use build. instead.
41e9ac35 run_unitests: Add a unit test for native files that are pipes
4e2adb82 coredata: Correctly handle receiving a pipe for native/cross files
0e25505f Do not fail on passing `-Werror=unused-parameter` from environment
3beb2737 Return zero in cross_sizeof
58441054 cmake: Handle disabling subprojects
2019-10-04 14:06:18 +00:00

77 lines
3.1 KiB
Python

$NetBSD: patch-mesonbuild_compilers_compilers.py,v 1.1 2019/10/04 14:06:19 prlw1 Exp $
Support SunOS-specific GCC behaviour.
Limit GNU ld options correctly.
--- mesonbuild/compilers/compilers.py.orig 2019-06-16 18:54:18.000000000 +0000
+++ mesonbuild/compilers/compilers.py
@@ -198,6 +198,14 @@ apple_buildtype_linker_args = {'plain':
'custom': [],
}
+sunos_buildtype_linker_args = {'plain': [],
+ 'debug': [],
+ 'debugoptimized': [],
+ 'release': [],
+ 'minsize': [],
+ 'custom': [],
+ }
+
gnulike_buildtype_linker_args = {'plain': [],
'debug': [],
'debugoptimized': [],
@@ -1304,7 +1312,7 @@ class Compiler:
if mesonlib.is_sunos():
return args
- if get_compiler_is_linuxlike(self):
+ if get_compiler_uses_gnuld(self):
# Rpaths to use while linking must be absolute. These are not
# written to the binary. Needed only with GNU ld:
# https://sourceware.org/bugzilla/show_bug.cgi?id=16936
@@ -1395,6 +1403,7 @@ class CompilerType(enum.Enum):
GCC_OSX = 1
GCC_MINGW = 2
GCC_CYGWIN = 3
+ GCC_SUNOS = 4
CLANG_STANDARD = 10
CLANG_OSX = 11
@@ -1422,6 +1431,10 @@ class CompilerType(enum.Enum):
return self.name in ('GCC_OSX', 'CLANG_OSX', 'ICC_OSX', 'PGI_OSX')
@property
+ def is_sunos_compiler(self):
+ return self.name in ('GCC_SUNOS')
+
+ @property
def is_windows_compiler(self):
return self.name in ('GCC_MINGW', 'GCC_CYGWIN', 'CLANG_MINGW', 'ICC_WIN', 'ARM_WIN', 'CCRX_WIN', 'PGI_WIN')
@@ -1434,7 +1447,7 @@ def get_macos_dylib_install_name(prefix,
return '@rpath/' + install_name
def get_gcc_soname_args(compiler_type, prefix, shlib_name, suffix, soversion, darwin_versions, is_shared_module):
- if compiler_type.is_standard_compiler:
+ if compiler_type.is_standard_compiler or compiler_type.is_sunos_compiler:
sostr = '' if soversion is None else '.' + soversion
return ['-Wl,-soname,%s%s.%s%s' % (prefix, shlib_name, suffix, sostr)]
elif compiler_type.is_windows_compiler:
@@ -1912,6 +1925,8 @@ class GnuLikeCompiler(abc.ABC):
def get_buildtype_linker_args(self, buildtype):
if self.compiler_type.is_osx_compiler:
return apple_buildtype_linker_args[buildtype]
+ elif self.compiler_type.is_sunos_compiler:
+ return sunos_buildtype_linker_args[buildtype]
return gnulike_buildtype_linker_args[buildtype]
@abc.abstractmethod
@@ -1976,6 +1991,8 @@ class GnuLikeCompiler(abc.ABC):
if self.compiler_type.is_osx_compiler:
# Apple ld
return ['-Wl,-undefined,dynamic_lookup']
+ elif self.compiler_type.is_sunos_compiler:
+ return []
elif self.compiler_type.is_windows_compiler:
# For PE/COFF this is impossible
return []