From 57ce89668864ddad881de84e2780b5db301d12f2 Mon Sep 17 00:00:00 2001 From: sghctoma Date: Wed, 26 Sep 2018 18:13:28 +0200 Subject: [PATCH 1/4] Add b_lundef=false Meson option on FreeBSD The Meson option "b_lundef" need to be set to false on FreeBSD, because the symbol "environ" is in crt1.o, which is not linked with shared libraries. With Meson >=0.48.0 it is possible to set this option only for FreeBSD. This patch changes meson.build to do that. --- meson.build | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meson.build b/meson.build index ff4e5e5f..bd6f1891 100644 --- a/meson.build +++ b/meson.build @@ -111,6 +111,12 @@ wlr_deps += [ math, ] +if host_machine.system().startswith('freebsd') + override_options = ['b_lundef=false'] +else + override_options = [] +endif + symbols_file = 'wlroots.syms' symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbols_file) lib_wlr = library( @@ -122,6 +128,7 @@ lib_wlr = library( install: true, link_args : symbols_flag, link_depends: symbols_file, + override_options: override_options, ) wlroots = declare_dependency( From aacf0c427f7c2ade34c0ba28984c3a61efb6afc7 Mon Sep 17 00:00:00 2001 From: sghctoma Date: Wed, 26 Sep 2018 19:36:48 +0200 Subject: [PATCH 2/4] Adjust README to reflect change regarding b_lundef With Meson >=0.48.0 it is no longer necessary to pass the flag "-D b_lundef=false" on FreeBSD. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08844313..11a3b381 100644 --- a/README.md +++ b/README.md @@ -74,8 +74,8 @@ Run these commands: meson build ninja -C build -On FreeBSD, you need to pass an extra flag to prevent a linking error: -`meson build -D b_lundef=false`. +If you use Meson older than 0.48.0 on FreeBSD, you need to pass an extra flag +to prevent a linking error: `meson build -D b_lundef=false`. Install like so: From 1d017c1cc153623e34987920eca90011ae2d9288 Mon Sep 17 00:00:00 2001 From: sghctoma Date: Fri, 28 Sep 2018 14:40:15 +0200 Subject: [PATCH 3/4] Set minimum Meson version to 0.48.0 This commit sets the required Meson version to >=0.48.0, and removes the comment about building on FreeBSD requires an extra flag. --- README.md | 3 --- meson.build | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 11a3b381..22ad7328 100644 --- a/README.md +++ b/README.md @@ -74,9 +74,6 @@ Run these commands: meson build ninja -C build -If you use Meson older than 0.48.0 on FreeBSD, you need to pass an extra flag -to prevent a linking error: `meson build -D b_lundef=false`. - Install like so: sudo ninja -C build install diff --git a/meson.build b/meson.build index bd6f1891..38a7364f 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'c', version: '0.0.1', license: 'MIT', - meson_version: '>=0.47.1', + meson_version: '>=0.48.0', default_options: [ 'c_std=c11', 'warning_level=2', From 65359718c49d7d9b0afb97a519c812a998533600 Mon Sep 17 00:00:00 2001 From: sghctoma Date: Fri, 28 Sep 2018 15:35:33 +0200 Subject: [PATCH 4/4] Use == to check system instead of a prefix match --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 38a7364f..9bd71191 100644 --- a/meson.build +++ b/meson.build @@ -111,7 +111,7 @@ wlr_deps += [ math, ] -if host_machine.system().startswith('freebsd') +if host_machine.system() == 'freebsd' override_options = ['b_lundef=false'] else override_options = []