Fix meson.build on FreeBSD
cover Fix meson.build on FreeBSD
There are a few small nits needed to make the meson build script work properly on FreeBSD. In short: sys/sysctl.h needs sys/types.h Use sh if bash isn't around.
Also fix a typo while I'm here.
[ please CC me, I'm not subscribed to dri-devel@ ]
Niclas Zeising (2):
meson.build: Fix typo
meson.build: Fix meson script on FreeBSD
meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 6 lines
2.21.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/2 meson.build: Fix typo
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
@@ -248,7 +248,7 @@ if prog_xslt.found() endif with_man_pages = with_man_pages != 'false' and prog_xslt.found() and prog_sed.found() -# Used for tets +# Used for tests prog_bash = find_program('bash') config.set10('HAVE_VISIBILITY',
Signature · 6 lines
2.21.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 meson.build: Fix meson script on FreeBSD
In reply to Niclas ZeisingFreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the includes when checking for headers.
Instead of splitting out the check for sys/sysctl.h from the other header checks, just add sys/types.h to all header checks.
FreeBSD doesn't normally ship bash, try regular sh instead if we can't find bash.
--- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
meson.build +2 -2
@@ -181,7 +181,7 @@ endif dep_m = cc.find_library('m', required : false) foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h'] config.set('HAVE_' + header.underscorify().to_upper(), - cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header))) + cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header))) endforeach if cc.has_header_symbol('sys/sysmacros.h', 'major') config.set10('MAJOR_IN_SYSMACROS', true)
@@ -249,7 +249,7 @@ endif with_man_pages = with_man_pages != 'false' and prog_xslt.found() and prog_sed.found() # Used for tests -prog_bash = find_program('bash') +prog_bash = find_program('bash', 'sh') config.set10('HAVE_VISIBILITY', cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''',
Signature · 6 lines
2.21.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm 2/2] meson.build: Fix meson script on FreeBSD
Quoted 6 lines · Niclas Zeising
FreeBSD requires
sys/types.hforsys/sysctl.h, add it as part of the includes when checking for headers.
Instead of splitting out the check forsys/sysctl.hfrom the other header checks, just addsys/types.hto all header checks.
If header X depends on Y, then the former should include Y. Can you please file a FreeBSD bug?
That said, the workaround is safe, so I'll split it out + add a comment. I'll send v2 in a second.
Quoted 2 lines
FreeBSD doesn't normally ship bash, try regular sh instead if we can't find bash.
Actually not sure why we're looking for bash. The lot works fine with bash, zsh, dash, ksh you-name it.
Will include those with v2.
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm 2/2] meson.build: Fix meson script on FreeBSD
Quoted 9 lines · Emil Velikov
Quoted 6 lines · Niclas Zeising
FreeBSD requires
sys/types.hforsys/sysctl.h, add it as part of the includes when checking for headers.
Instead of splitting out the check forsys/sysctl.hfrom the other header checks, just addsys/types.hto all header checks.If header X depends on Y, then the former should include Y. Can you please file a FreeBSD bug?
This is how it's documented in the sysctl(3) manual on FreeBSD. I will ask around why that is, but I don't expect it to change.
Quoted 10 lines
That said, the workaround is safe, so I'll split it out + add a comment. I'll send v2 in a second.
Quoted 2 lines
FreeBSD doesn't normally ship bash, try regular sh instead if we can't find bash.
Actually not sure why we're looking for bash. The lot works fine with bash, zsh, dash, ksh you-name it.
Will include those with v2.
As long as it's only using posix stuff, FreeBSD /bin/sh should work fine, as should those others, I think. I had no problems running the tests with FreeBSD /bin/sh when I tried, at least.
Regards
Signature · 5 lines
Niclas Zeising _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel