X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=meson.build;h=bf61511d292075eafa75e2a44ae0d77e0096effe;hb=b45eb2775ea180fde01d0abe50f6ccf8ddb5b84d;hp=5cce7eb018a3231811a73fbf49f9a38bc2b549f6;hpb=20294dceebc23236e33b22578245f7e6f41b6997;p=mesa.git diff --git a/meson.build b/meson.build index 5cce7eb018a..bf61511d292 100644 --- a/meson.build +++ b/meson.build @@ -25,8 +25,8 @@ project( [find_program('python', 'python2', 'python3'), 'bin/meson_get_version.py'] ).stdout(), license : 'MIT', - meson_version : '>= 0.45', - default_options : ['buildtype=debugoptimized', 'b_ndebug=if-release', 'c_std=c99', 'cpp_std=c++11'] + meson_version : '>= 0.46', + default_options : ['buildtype=debugoptimized', 'b_ndebug=if-release', 'c_std=c99', 'cpp_std=c++14'] ) cc = meson.get_compiler('c') @@ -55,7 +55,18 @@ with_osmesa = get_option('osmesa') with_swr_arches = get_option('swr-arches') with_tools = get_option('tools') if with_tools.contains('all') - with_tools = ['etnaviv', 'freedreno', 'glsl', 'intel', 'nir', 'nouveau', 'xvmc'] + with_tools = [ + 'drm-shim', + 'etnaviv', + 'freedreno', + 'glsl', + 'intel', + 'intel-ui', + 'lima', + 'nir', + 'nouveau', + 'xvmc', + ] endif dri_drivers_path = get_option('dri-drivers-path') @@ -149,7 +160,7 @@ if gallium_drivers.contains('auto') elif ['arm', 'aarch64'].contains(host_machine.cpu_family()) gallium_drivers = [ 'kmsro', 'v3d', 'vc4', 'freedreno', 'etnaviv', 'nouveau', - 'tegra', 'virgl', 'lima', 'swrast' + 'tegra', 'virgl', 'lima', 'panfrost', 'swrast' ] else error('Unknown architecture @0@. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.'.format( @@ -243,6 +254,7 @@ endif if host_machine.system() == 'darwin' with_dri_platform = 'apple' + pre_args += '-DBUILDING_MESA' elif ['windows', 'cygwin'].contains(host_machine.system()) with_dri_platform = 'windows' elif system_has_kms_drm @@ -315,7 +327,7 @@ if with_glx == 'dri' endif endif -if not (with_dri or with_gallium or with_glx == 'xlib' or with_glx == 'gallium-xlib') +if not (with_dri or with_gallium or with_glx != 'disabled') with_gles1 = false with_gles2 = false with_opengl = false @@ -365,7 +377,11 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless or with_plat endif endif -pre_args += '-DGLX_USE_TLS' +# Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS. +if not with_platform_android or get_option('platform-sdk-version') >= 29 + pre_args += '-DUSE_ELF_TLS' +endif + if with_glx != 'disabled' if not (with_platform_x11 and with_any_opengl) error('Cannot build GLX support without X11 platform support and at least one OpenGL API') @@ -382,9 +398,7 @@ if with_glx != 'disabled' error('xlib conflicts with any dri driver') endif elif with_glx == 'dri' - if not with_dri - error('dri based GLX requires at least one DRI driver') - elif not with_shared_glapi + if not with_shared_glapi error('dri based GLX requires shared-glapi') endif endif @@ -765,6 +779,11 @@ if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.4.6') error('When using GCC, version 4.4.6 or later is required.') endif +# Support systems without ETIME (e.g. FreeBSD) +if cc.get_define('ETIME', prefix : '#include ') == '' + pre_args += '-DETIME=ETIMEDOUT' +endif + # Define DEBUG for debug builds only (debugoptimized is not included on this one) if get_option('buildtype') == 'debug' pre_args += '-DDEBUG' @@ -1016,18 +1035,25 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major') pre_args += '-DMAJOR_IN_MKDEV' endif -foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h'] +foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h', 'cet.h'] if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h)) pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify()) endif endforeach -foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create'] +foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r'] if cc.has_function(f) pre_args += '-DHAVE_@0@'.format(f.to_upper()) endif endforeach +if cc.has_header_symbol('errno.h', 'program_invocation_name', + args : '-D_GNU_SOURCE') + pre_args += '-DHAVE_PROGRAM_INVOCATION_NAME' +elif with_tools.contains('intel') + error('Intel tools require the program_invocation_name variable') +endif + # strtod locale support if cc.links(''' #define _GNU_SOURCE @@ -1118,6 +1144,12 @@ if dep_thread.found() and host_machine.system() != 'windows' args : '-D_GNU_SOURCE') pre_args += '-DHAVE_PTHREAD_SETAFFINITY' endif + if cc.has_function( + 'pthread_setaffinity_np', + dependencies : dep_thread, + prefix : '#include ') + pre_args += '-DPTHREAD_SETAFFINITY_IN_NP_HEADER' + endif endif dep_expat = dependency('expat') # this only exists on linux so either this is linux and it will be found, or @@ -1133,7 +1165,7 @@ dep_libdrm_radeon = null_dep dep_libdrm_nouveau = null_dep dep_libdrm_intel = null_dep -_drm_amdgpu_ver = '2.4.97' +_drm_amdgpu_ver = '2.4.99' _drm_radeon_ver = '2.4.71' _drm_nouveau_ver = '2.4.66' _drm_intel_ver = '2.4.75' @@ -1310,9 +1342,6 @@ else endif if with_osmesa != 'none' - if with_osmesa == 'classic' and not with_dri_swrast - error('OSMesa classic requires dri (classic) swrast.') - endif if with_osmesa == 'gallium' and not with_gallium_softpipe error('OSMesa gallium requires gallium softpipe or llvmpipe.') endif @@ -1482,10 +1511,6 @@ endif pkg = import('pkgconfig') prog_nm = find_program('nm', required : false) -env_test = environment() -if prog_nm.found() - env_test.set('NM', prog_nm.path()) -endif # This quirk needs to be applied to sources with functions defined in assembly # as GCC LTO drops them. See: https://bugs.freedesktop.org/show_bug.cgi?id=109391