[Mesa-dev] [RFC PATCH mesa 5/5] WIP - meson: add a message block at the end of the configuration stage

Eric Engestrom eric.engestrom at imgtec.com
Tue Feb 27 12:12:37 UTC 2018


On Friday, 2018-02-23 16:49:14 -0800, Dylan Baker wrote:
> Quoting Eric Engestrom (2018-02-23 10:08:48)
> > The messages are basically the same as the ones in configure.ac
> > 
> > Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> > ---
> > Sent out because it's as much as I could do before the weekend, and
> > before I try to figure out the last bits I'd love some confirmation that
> > this is what we want :)
> > ---
> >  meson.build             | 128 ++++++++++++++++++++++++++++++++++++++++++++++++
> >  src/gallium/meson.build |  13 +++++
> >  2 files changed, 141 insertions(+)
> > 
> > diff --git a/meson.build b/meson.build
> > index 770fdc7e50653bcfa7c2..0c84d09c02322ed7a80b 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -1263,3 +1263,131 @@ env_test.set('NM', find_program('nm').path())
> >  subdir('include')
> >  subdir('bin')
> >  subdir('src')
> > +
> > +
> > +#
> > +# Output some configuration info for the user
> > +#
> > +message('')
> > +message('        prefix:          ' + get_option('prefix'))
> > +message('        libdir:          ' + join_paths(get_option('prefix'), get_option('libdir')))
> > +message('        includedir:      ' + join_paths(get_option('prefix'), get_option('includedir')))
> 
> I'd really like to avoid having millions of message() calls, what about:
> messsage('''
> 
>         prefix:             @0@
>         libdir:             @1@
>         includedir:         @2@
> 
>         ...
> 
> '''.format(
>  ...
> ))

I'll group where possible, but there's a lot of logic that can't be
cleanly put into .format()

I'll apply all your other comments and send the actual patches when I'm
done; thanks for the feedback :)

> 
> Dylan
> 
> > +
> > +# API info
> > +message('')
> > +message('        OpenGL:          @0@ (ES1: @1@ ES2: @2@)'.format(with_opengl, with_gles1, with_gles2))
> > +
> > +# Driver info
> > +message('')
> > +if with_osmesa == 'gallium'
> > +  message('        OSMesa:          lib at 0@ (Gallium)'.format(osmesa_lib_name))
> > +elif with_osmesa == 'classic'
> > +  message('        OSMesa:          lib at 0@'.format(osmesa_lib_name))
> > +elif with_osmesa == 'none'
> > +  message('        OSMesa:          no')
> > +endif
> > +
> > +message('')
> > +if with_dri
> > +  message('        DRI platform:    ' + with_dri_platform)
> > +  if false #DRI_DIRS
> > +    message('        DRI drivers:     no')
> > +  else
> > +    message('        DRI drivers:     ' + _dri_drivers)
> > +  endif
> > +  message('        DRI driver dir:  ' + join_paths(get_option('prefix'), dri_drivers_path))
> > +endif
> > +
> > +if with_glx == 'dri'
> > +    message('        GLX:             DRI-based')
> > +elif with_glx == 'xlib'
> > +    message('        GLX:             Xlib-based')
> > +elif with_glx == 'gallium-xlib'
> > +    message('        GLX:             Xlib-based (Gallium)')
> > +else
> > +    message('        GLX:             @0@'.format(with_glx))
> > +endif
> > +
> > +# EGL
> > +message('')
> > +message('        EGL:             @0@'.format(with_egl))
> > +if with_egl
> > +  #message('        EGL drivers:     @0@ @1@'.format(
> > +                                    #with_dri  ? 'builtin:egl_dri2' : '',
> > +                                    #with_dri3 ? 'builtin:egl_dri3' : ''))
> > +endif
> > +message('        GBM:             @0@'.format(with_gbm))
> > +
> > +message('        EGL/Vulkan/VL platforms:   @0@'.format(_platforms))
> > +
> > +# Vulkan
> > +message('')
> > +if with_any_vk
> > +  message('        Vulkan drivers:  ' + _vulkan_drivers)
> > +  message('        Vulkan ICD dir:  ' + join_paths(get_option('prefix'), with_vulkan_icd_dir))
> > +else
> > +  message('        Vulkan drivers:  no')
> > +endif
> > +
> > +message('')
> > +if with_llvm
> > +  message('        llvm:            yes')
> > +# message('        llvm-config:     ' + _llvm_config) #TODO
> > +  message('        llvm-version:    ' + '.'.join(_llvm_version))
> > +else
> > +  message('        llvm:            no')
> > +endif
> > +
> > +message('')
> > +if with_gallium
> > +  message('        Gallium drivers: ' + _gallium_drivers)
> > +  message('        Gallium st:      ' + ','.join(with_st))
> > +else
> > +  message('        Gallium:         no')
> > +endif
> > +
> > +message('')
> > +message('        HUD extra stats: @0@'.format(with_gallium_extra_hud))
> > +message('        HUD lmsensors:   @0@'.format(with_lmsensors))
> > +
> > +if with_gallium_swr
> > +  message('')
> > +  if false # TODO: with_swr_builtin
> > +    message('        SWR archs:       @0@ (builtin)'.format(get_option('swr-arches')))
> > +  else
> > +    message('        SWR archs:       @0@'.format(get_option('swr-arches')))
> > +  endif
> > +endif
> > +
> > +# Libraries
> > +message('')
> > +#message('        Shared libs:     @0@'.format(with_shared)) #TODO
> > +#message('        Static libs:     @0@'.format(with_static)) #TODO
> > +message('        Shared-glapi:    @0@'.format(with_shared_glapi))
> > +
> > +# Compiler options
> > +message('')
> > +message('        CFLAGS:          ' + ' '.join(c_args))
> > +message('        CXXFLAGS:        ' + ' '.join(cpp_args))
> > +#message('        LDFLAGS:         ' + ' '.join(c_link_args)) #XXX: doesn't really make sense in meson
> > +message('        Macros:          ' + ' '.join(pre_args))
> > +message('')
> > +
> > +if with_llvm and false #TODO
> > +  message('        LLVM_CFLAGS:     $LLVM_CFLAGS')
> > +  message('        LLVM_CXXFLAGS:   $LLVM_CXXFLAGS')
> > +  message('        LLVM_CPPFLAGS:   $LLVM_CPPFLAGS')
> > +  message('        LLVM_LDFLAGS:    $LLVM_LDFLAGS')
> > +  message('')
> > +endif
> > +
> > +message('        PYTHON2:         @0@'.format(prog_python2.path()))
> > +
> > +message('')
> > +if meson.backend() == 'ninja'
> > +  message('        Run `ninja` to build Mesa')
> > +else
> > +  message('        You can now build Mesa using @0@'.format(meson.backend()))
> > +endif
> > +
> > +message('')
> > diff --git a/src/gallium/meson.build b/src/gallium/meson.build
> > index 320fc0176e9ab6f95322..d0d542fd526a76c5d0f0 100644
> > --- a/src/gallium/meson.build
> > +++ b/src/gallium/meson.build
> > @@ -22,6 +22,8 @@
> >  inc_gallium_drivers = include_directories('drivers')
> >  inc_gallium_winsys = include_directories('winsys')
> >  
> > +with_st = []
> > +
> >  subdir('auxiliary')
> >  subdir('auxiliary/pipe-loader')
> >  subdir('drivers/ddebug')
> > @@ -140,24 +142,31 @@ else
> >  endif
> >  if with_gallium_vdpau
> >    subdir('state_trackers/vdpau')
> > +  with_st += 'vdpau'
> >  endif
> >  if with_gallium_xvmc
> >    subdir('state_trackers/xvmc')
> > +  with_st += 'xvmc'
> >  endif
> >  if with_gallium_omx
> >    subdir('state_trackers/omx_bellagio')
> > +  with_st += 'omx_bellagio'
> >  endif
> >  if with_gallium_va
> >    subdir('state_trackers/va')
> > +  with_st += 'va'
> >  endif
> >  if with_gallium_xa
> >    subdir('state_trackers/xa')
> > +  with_st += 'xa'
> >  endif
> >  if with_gallium_st_nine
> >    subdir('state_trackers/nine')
> > +  with_st += 'nine'
> >  endif
> >  if with_platform_haiku
> >    subdir('state_trackers/hgl')
> > +  with_st += 'hgl'
> >  endif
> >  if with_gallium_opencl
> >    # TODO: this isn't really clover specific, but ATM clover is the only
> > @@ -168,19 +177,23 @@ if with_gallium_opencl
> >      error('OpenCL requires meson 0.44.0 or greater.')
> >    endif
> >    subdir('state_trackers/clover')
> > +  with_st += 'clover'
> >    subdir('targets/opencl')
> >  endif
> >  if with_dri
> >    subdir('state_trackers/dri')
> > +  with_st += 'dri'
> >    subdir('targets/dri')
> >  endif
> >  if with_osmesa == 'gallium'
> >    subdir('state_trackers/osmesa')
> > +  with_st += 'osmesa'
> >    subdir('targets/osmesa')
> >  endif
> >  if with_glx == 'gallium-xlib'
> >    subdir('winsys/sw/xlib')
> >    subdir('state_trackers/glx/xlib')
> > +  with_st += 'glx/xlib'
> >    subdir('targets/libgl-xlib')
> >  endif
> >  if with_gallium_vdpau
> > -- 
> > Cheers,
> >   Eric
> > 


More information about the mesa-dev mailing list