[Mesa-dev] [PATCH] meson: Add Haiku platform support v3

Dylan Baker dylan at pnwbakers.com
Fri Feb 16 17:58:35 UTC 2018


Emil,

If meson is going to work for their needs it seems silly to merge autotools
support, when the plan is to drop autotools from mesa in the coming year.

Dylan

Quoting Emil Velikov (2018-02-16 09:49:37)
> Hi Alexander,
> 
> Did you drop the ball on the autotools patches? I could re-spin them
> but have no way to test.
> 
> There's a couple of comments inline, but nothing major.
> 
> On 16 February 2018 at 00:32, Alexander von Gluck IV
> <kallisti5 at unixzen.com> wrote:
> 
> 
> > --- a/meson.build
> > +++ b/meson.build
> 
> >  gl_priv_libs = []
> > -if dep_thread.found()
> > +if dep_thread.found() and host_machine.system() != 'haiku'
> >    gl_priv_libs += ['-lpthread', '-pthread']
> >  endif
> There's a bug report/fix in Meson for this one right?
> Please mention the ticket number of Meson version where the fix
> landed. Thus way one can drop this when we bump the Meson requirement.
> 
> 
> >  if dep_m.found()
> > diff --git a/src/egl/meson.build b/src/egl/meson.build
> > index 6cd04567b0..09c28e9f83 100644
> > --- a/src/egl/meson.build
> > +++ b/src/egl/meson.build
> There are three unrelated things happening here:
> 
> > @@ -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')]
> > +
> a) inc_gbm should be moved in the with_platform_drm hunk
> 
> >  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',
> >  )
> >
> >  linux_dmabuf_unstable_v1_protocol_c = custom_target(
> > @@ -100,6 +96,21 @@ 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',
> > +  )
> > +  incs_for_egl += [inc_loader, inc_gbm]
> > +  c_args_for_egl += [
> > +    '-DDEFAULT_DRIVER_DIR="@0@"'.format(dri_search_path),
> > +    '-D_EGL_BUILT_IN_DRIVER_DRI2',
> > +  ]
> > +  link_for_egl += [libloader, libxmlconfig]
> > +  deps_for_egl += dep_libdrm
> > +endif
> > +
> b) This should be within the with_platform_x11 hunk
> 
> >  if with_platform_x11
> >    files_egl += files('drivers/dri2/platform_x11.c')
> >    if with_dri3
> > @@ -133,6 +144,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
> >
> c) this is the patch introducing haiku support
> 
> 
> > --- /dev/null
> > +++ b/src/gallium/targets/haiku-softpipe/meson.build
> 
> > +libswpipe = shared_library(
> 
> > +  dependencies : [
> > +    driver_swrast, cpp.find_library('be'), cpp.find_library('translation'),
> > +    cpp.find_library('network'), dep_unwind
> Some of these find_library calls are duplicated throughout. It would
> be more efficient and robust to have it done once.
> Say in the top level meson.build?
> 
> 
> > index 8aaf58a623..7a4bcd3329 100644
> > --- a/src/hgl/GLDispatcher.h
> > +++ b/src/hgl/GLDispatcher.h
> > @@ -15,7 +15,7 @@
> >  #include <GL/gl.h>
> >  #include <SupportDefs.h>
> >
> > -#include "glheader.h"
> > +#include "main/glheader.h"
> >
> Please keep source changes separate from build system bits.
> 
> 
> > diff --git a/src/mapi/es1api/meson.build b/src/mapi/es1api/meson.build
> > index ea14654d2c..38a5747e9a 100644
> > --- a/src/mapi/es1api/meson.build
> > +++ b/src/mapi/es1api/meson.build
> 
> > --- 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,
> >  )
> >
> Unrelated fixes - make that a separate patch.
> 
> > diff --git a/src/meson.build b/src/meson.build
> > index 730b2ff6e4..4d5637f0aa 100644
> > --- a/src/meson.build
> > +++ b/src/meson.build
> 
> > +if with_glx != 'disabled'
> > +  subdir('glx')
> > +endif
> 
> Another unrelated fix?
> 
> Last but not least, please add a meson.build to the respective
> Makefile.ams' EXTRA_DIST.
> 
> Thanks
> Emil
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180216/2de8e720/attachment.sig>


More information about the mesa-dev mailing list