[Mesa-dev] [PATCH] meson: Add Haiku platform support
Alexander von Gluck IV
kallisti5 at unixzen.com
Fri Feb 16 00:04:37 UTC 2018
February 15, 2018 5:37 PM, "Dylan Baker" <dylan at pnwbakers.com> wrote:
> Quoting Alexander von Gluck IV (2018-02-15 13:12:40)
>
>> ---
>> include/meson.build | 8 +++++
>> meson.build | 18 +++++++---
>> src/egl/meson.build | 33 +++++++++++++----
>> src/gallium/meson.build | 9 +++++
>> src/gallium/state_trackers/hgl/meson.build | 41 +++++++++++++++++++++
>> src/gallium/targets/haiku-softpipe/meson.build | 50 ++++++++++++++++++++++++++
>> src/gallium/winsys/sw/hgl/meson.build | 29 +++++++++++++++
>> src/hgl/GLDispatcher.h | 2 +-
>> src/hgl/meson.build | 38 ++++++++++++++++++++
>> src/mapi/es1api/meson.build | 2 +-
>> src/mapi/es2api/meson.build | 2 +-
>> src/meson.build | 7 +++-
>> 12 files changed, 224 insertions(+), 15 deletions(-)
>> create mode 100644 src/gallium/state_trackers/hgl/meson.build
>> create mode 100644 src/gallium/targets/haiku-softpipe/meson.build
>> create mode 100644 src/gallium/winsys/sw/hgl/meson.build
>> create mode 100644 src/hgl/meson.build
>
> This doesn't feel quite right now, this code is DRI2 specific, I think this
> should go in the `if with_dri2` block, or put that in this block.
Ooops.. I agree. That else fits better in the existing with_dri2.
Fixed locally... will resubmit v3
>> diff --git a/src/gallium/targets/haiku-softpipe/meson.build
>> b/src/gallium/targets/haiku-softpipe/meson.build
>> new file mode 100644
>> index 0000000000..f805b2e69b
>> --- /dev/null
>> +++ b/src/gallium/targets/haiku-softpipe/meson.build
>> @@ -0,0 +1,50 @@
>> +# Copyright © 2017 Dylan Baker
>> +
>> +# Permission is hereby granted, free of charge, to any person obtaining a copy
>> +# of this software and associated documentation files (the "Software"), to deal
>> +# in the Software without restriction, including without limitation the rights
>> +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
>> +# copies of the Software, and to permit persons to whom the Software is
>> +# furnished to do so, subject to the following conditions:
>> +
>> +# The above copyright notice and this permission notice shall be included in
>> +# all copies or substantial portions of the Software.
>> +
>> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
>> +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
>> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
>> +# SOFTWARE.
>> +
>> +hsp_cpp_args = ['-DGALLIUM_SOFTPIPE', '-DGALLIUM_RBUG', '-DGALLIUM_TRACE']
>> +hsp_deps = []
>> +hsp_links = [libsoftpipe]
>> +
>> +if with_llvm
>> + hsp_deps += dep_llvm
>> + hsp_cpp_args += '-DGALLIUM_LLVMPIPE'
>> + hsp_links += libllvmpipe
>> +endif
>
> This is the old way we did things, now we have these handy `driver_*`
> dependencies that provide this stuff, you can replace the hsp_links, hsp_deps,
> and drop the -DGALLIUM_{SOFT,LLVM}PIPE with driver_swrast, which handles adding
> the -DGALLIUM args and has softpipe or llvmpipe if it's enabled.
>
> You can look at src/gallium/targets/dri/meson.build if you want to see how that
> works.
Will fix.
>> +libswhgl = static_library(
>> + 'swhgl',
>> + files('hgl_sw_winsys.c', 'hgl_sw_winsys.h'),
>
> It doesn't matter, but you don't need to add the .h file, meson will figure that
> out.
I was following some patterns I was seeing. Fixed locally :-)
>> +libgl = shared_library(
>> + 'GL',
>> + files(
>> + 'GLView.cpp', 'GLRenderer.cpp', 'GLRendererRoster.cpp', 'GLDispatcher.cpp',
>> + ),
>> + link_args : [ld_args_bsymbolic, ld_args_gc_sections],
>> + include_directories : [
>> + inc_src, inc_mapi, inc_mesa, inc_include, inc_glapi, inc_haikugl,
>> + inc_gl_internal, include_directories('/system/develop/headers/private')
>> + ],
>> + link_with : [libglapi_static, libglapi],
>
> this seems odd, why do you need both shared and static glapi? In SCons only
> static glapi is used here.
I'm actually not 100% sure here. I have missing symbols at link without both
included. More investigation needed on my part.
>> + dependencies : cpp.find_library('be'),
>> + install : true,
>> +)
>> +
>> +#if with_tests
>> +# subdir('tests')
>> +#endif
>
> I'd prefer not to have the commented code, let's either implement the tests or
> delete this and ad a TODO
Fixed locally in v3.
Thanks!
-- Alex
More information about the mesa-dev
mailing list