diff options
author | Alexander von Gluck IV <kallisti5@unixzen.com> | 2018-02-16 16:56:31 -0600 |
---|---|---|
committer | Alexander von Gluck IV <kallisti5@unixzen.com> | 2018-02-16 16:56:34 -0600 |
commit | 834d221512fae8dd290d347fec071c4adbe140ed (patch) | |
tree | fc12d7bd18f90dd2909e9c9399081f92701804b5 /src | |
parent | 7b283544dc76efe5216120b178574ff561605e23 (diff) |
meson: Add Haiku platform support v4
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/egl/meson.build | 36 | ||||
-rw-r--r-- | src/gallium/meson.build | 9 | ||||
-rw-r--r-- | src/gallium/state_trackers/hgl/meson.build | 41 | ||||
-rw-r--r-- | src/gallium/targets/haiku-softpipe/meson.build | 40 | ||||
-rw-r--r-- | src/gallium/winsys/sw/hgl/meson.build | 29 | ||||
-rw-r--r-- | src/hgl/meson.build | 36 | ||||
-rw-r--r-- | src/mapi/es1api/meson.build | 2 | ||||
-rw-r--r-- | src/mapi/es2api/meson.build | 2 | ||||
-rw-r--r-- | src/meson.build | 7 |
9 files changed, 189 insertions, 13 deletions
diff --git a/src/egl/meson.build b/src/egl/meson.build index cd51ad308f6..cf9320aecb2 100644 --- a/src/egl/meson.build +++ b/src/egl/meson.build @@ -21,9 +21,8 @@ c_args_for_egl = [] link_for_egl = [] deps_for_egl = [] -incs_for_egl = [ - inc_include, inc_src, inc_loader, inc_gbm, include_directories('main'), -] +incs_for_egl = [inc_include, inc_src, include_directories('main')] + files_egl = files( 'main/eglapi.c', 'main/eglapi.h', @@ -53,9 +52,6 @@ files_egl = files( 'main/eglsync.h', 'main/eglentrypoint.h', 'main/egltypedefs.h', - 'drivers/dri2/egl_dri2.c', - 'drivers/dri2/egl_dri2.h', - 'drivers/dri2/egl_dri2_fallbacks.h', ) g_egldispatchstubs_c = custom_target( @@ -86,6 +82,18 @@ g_egldispatchstubs_h = custom_target( capture : true, ) +if with_dri2 + files_egl += files( + 'drivers/dri2/egl_dri2.c', + 'drivers/dri2/egl_dri2.h', + 'drivers/dri2/egl_dri2_fallbacks.h', + ) + c_args_for_egl += [ + '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path), + '-D_EGL_BUILT_IN_DRIVER_DRI2', + ] +endif + if with_platform_x11 files_egl += files('drivers/dri2/platform_x11.c') if with_dri3 @@ -96,8 +104,9 @@ if with_platform_x11 endif if with_platform_drm files_egl += files('drivers/dri2/platform_drm.c') - link_for_egl += libgbm - incs_for_egl += include_directories('../gbm/main') + link_for_egl += [libloader, libgbm, libxmlconfig] + incs_for_egl += [inc_loader, inc_gbm, include_directories('../gbm/main')] + deps_for_egl += dep_libdrm endif if with_platform_surfaceless files_egl += files('drivers/dri2/platform_surfaceless.c') @@ -119,6 +128,15 @@ if with_platform_android deps_for_egl += dep_android files_egl += files('drivers/dri2/platform_android.c') endif +if with_platform_haiku + incs_for_egl += inc_haikugl + c_args_for_egl += [ + '-D_EGL_BUILT_IN_DRIVER_HAIKU', + ] + files_egl += files('drivers/haiku/egl_haiku.cpp') + link_for_egl += libgl + deps_for_egl += cpp.find_library('be') +endif # TODO: glvnd @@ -146,8 +164,6 @@ libegl = shared_library( c_args : [ c_vis_args, c_args_for_egl, - '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path), - '-D_EGL_BUILT_IN_DRIVER_DRI2', '-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_@0@'.format(egl_native_platform.to_upper()), ], include_directories : incs_for_egl, diff --git a/src/gallium/meson.build b/src/gallium/meson.build index d05e67630c6..320fc0176e9 100644 --- a/src/gallium/meson.build +++ b/src/gallium/meson.build @@ -40,6 +40,9 @@ else libswkmsdri = [] endif subdir('winsys/sw/wrapper') +if with_platform_haiku + subdir('winsys/sw/hgl') +endif if with_gallium_swr if meson.version().version_compare('< 0.44.0') error('SWR requires meson 0.44.0 or greater.') @@ -153,6 +156,9 @@ endif if with_gallium_st_nine subdir('state_trackers/nine') endif +if with_platform_haiku + subdir('state_trackers/hgl') +endif if with_gallium_opencl # TODO: this isn't really clover specific, but ATM clover is the only # consumer @@ -192,6 +198,9 @@ endif if with_gallium_xa subdir('targets/xa') endif +if with_platform_haiku + subdir('targets/haiku-softpipe') +endif if with_gallium_st_nine subdir('targets/d3dadapter9') endif diff --git a/src/gallium/state_trackers/hgl/meson.build b/src/gallium/state_trackers/hgl/meson.build new file mode 100644 index 00000000000..3c5870fe101 --- /dev/null +++ b/src/gallium/state_trackers/hgl/meson.build @@ -0,0 +1,41 @@ +# 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. + +files_libsthgl = files( + 'bitmap_wrapper.cpp', + 'bitmap_wrapper.h', + 'hgl_context.h', + 'hgl.c', +) + +libsthgl_c_args = [] +if with_gallium_softpipe + libsthgl_c_args += '-DGALLIUM_SOFTPIPE' +endif + +libsthgl = static_library( + 'sthgl', + files_libsthgl, + include_directories : [ + inc_include, inc_haikugl, inc_util, inc_mesa, inc_mapi, inc_src, + inc_gallium, inc_gallium_aux + ], + c_args : [c_vis_args, libsthgl_c_args], +) diff --git a/src/gallium/targets/haiku-softpipe/meson.build b/src/gallium/targets/haiku-softpipe/meson.build new file mode 100644 index 00000000000..84bcea4bbf2 --- /dev/null +++ b/src/gallium/targets/haiku-softpipe/meson.build @@ -0,0 +1,40 @@ +# 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. + +libswpipe = shared_library( + 'swpipe', + files('SoftwareRenderer.cpp', 'GalliumContext.cpp'), + include_directories : [ + inc_common, inc_util, inc_haikugl, inc_gallium_drivers, inc_gallium_winsys, + include_directories('../../state_trackers/hgl'), + include_directories('/boot/system/develop/headers/private') + ], + c_args : [c_vis_args], + cpp_args : [cpp_vis_args], + link_args : [ld_args_bsymbolic, ld_args_gc_sections], + link_with : [ + libglapi, libswhgl, libsthgl, libtrace, librbug, libmesa_util, libcompiler, + libmesa_gallium, libglsl, libnir, libgallium, libgl + ], + dependencies : [ + driver_swrast, cpp.find_library('be'), cpp.find_library('translation'), + cpp.find_library('network'), dep_unwind + ] +) diff --git a/src/gallium/winsys/sw/hgl/meson.build b/src/gallium/winsys/sw/hgl/meson.build new file mode 100644 index 00000000000..8901096bd12 --- /dev/null +++ b/src/gallium/winsys/sw/hgl/meson.build @@ -0,0 +1,29 @@ +# 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. + +libswhgl = static_library( + 'swhgl', + files('hgl_sw_winsys.c'), + c_args : c_vis_args, + include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux, + include_directories('../../../state_trackers/hgl') + ], + build_by_default : false, +) diff --git a/src/hgl/meson.build b/src/hgl/meson.build new file mode 100644 index 00000000000..ec06272eda2 --- /dev/null +++ b/src/hgl/meson.build @@ -0,0 +1,36 @@ +# Copyright © 2017 Intel Corporation + +# 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. + +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], + dependencies : cpp.find_library('be'), + install : true, +) + +# TODO: We need some tests here diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build index ea14654d2c4..38a5747e9a0 100644 --- a/src/mapi/es1api/meson.build +++ b/src/mapi/es1api/meson.build @@ -48,7 +48,7 @@ pkg.generate( description : 'Mesa OpenGL ES 1.1 CM library', version : meson.project_version(), libraries : libglesv1_cm, - libraries_private : '-lm -ldl -lpthread -pthread', + libraries_private : gl_priv_libs, ) if with_tests diff --git a/src/mapi/es2api/meson.build b/src/mapi/es2api/meson.build index de8a29bb6be..9f4770a7386 100644 --- a/src/mapi/es2api/meson.build +++ b/src/mapi/es2api/meson.build @@ -48,7 +48,7 @@ pkg.generate( description : 'Mesa OpenGL ES 2.0 library', version : meson.project_version(), libraries : libgles2, - libraries_private : '-lm -ldl -lpthread -pthread', + libraries_private : gl_priv_libs, ) if with_tests diff --git a/src/meson.build b/src/meson.build index 730b2ff6e41..4d5637f0aaf 100644 --- a/src/meson.build +++ b/src/meson.build @@ -64,7 +64,12 @@ if with_dri_i965 or with_intel_vk endif subdir('mesa') subdir('loader') -subdir('glx') +if with_platform_haiku + subdir('hgl') +endif +if with_glx != 'disabled' + subdir('glx') +endif if with_gbm subdir('gbm') else |