head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.13
	netbsd-11-0-RC3:1.1.1.13
	netbsd-11-0-RC2:1.1.1.13
	netbsd-11-0-RC1:1.1.1.13
	netbsd-11:1.1.1.13.0.2
	netbsd-11-base:1.1.1.13
	libdrm-2-4-124:1.1.1.13
	netbsd-10-1-RELEASE:1.1.1.11
	libdrm-2-4-122:1.1.1.12
	netbsd-9-4-RELEASE:1.1.1.4
	netbsd-10-0-RELEASE:1.1.1.11
	netbsd-10-0-RC6:1.1.1.11
	netbsd-10-0-RC5:1.1.1.11
	netbsd-10-0-RC4:1.1.1.11
	netbsd-10-0-RC3:1.1.1.11
	netbsd-10-0-RC2:1.1.1.11
	netbsd-10-0-RC1:1.1.1.11
	netbsd-10:1.1.1.11.0.2
	netbsd-10-base:1.1.1.11
	libdrm-2-4-114:1.1.1.11
	netbsd-9-3-RELEASE:1.1.1.4
	libdrm-2-4-112:1.1.1.10
	libdrm-2-4-109:1.1.1.9
	libdrm-2-4-107:1.1.1.8
	netbsd-9-2-RELEASE:1.1.1.4
	libdrm-2-4-105:1.1.1.7
	libdrm-2-4-102:1.1.1.6
	netbsd-9-1-RELEASE:1.1.1.4
	libdrm-2-4-100:1.1.1.5
	netbsd-9-0-RELEASE:1.1.1.4
	netbsd-9-0-RC2:1.1.1.4
	netbsd-9-0-RC1:1.1.1.4
	netbsd-9:1.1.1.4.0.2
	netbsd-9-base:1.1.1.4
	libdrm-2-4-99:1.1.1.4
	libdrm-2-4-97:1.1.1.3
	libdrm-2-4-96:1.1.1.2
	libdrm-2-4-91:1.1.1.1
	xorg:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2018.03.14.07.18.35;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	vKK7pL0psl9szouA;

1.1.1.1
date	2018.03.14.07.18.35;	author mrg;	state Exp;
branches;
next	1.1.1.2;
commitid	vKK7pL0psl9szouA;

1.1.1.2
date	2019.01.10.08.49.52;	author mrg;	state Exp;
branches;
next	1.1.1.3;
commitid	XNB5UWAmSCOUmd7B;

1.1.1.3
date	2019.03.04.08.20.57;	author mrg;	state Exp;
branches;
next	1.1.1.4;
commitid	8yixCTrntx4nv1eB;

1.1.1.4
date	2019.07.15.05.42.02;	author mrg;	state Exp;
branches;
next	1.1.1.5;
commitid	fTEuGipA3XuNl6vB;

1.1.1.5
date	2020.02.23.09.57.41;	author mrg;	state Exp;
branches;
next	1.1.1.6;
commitid	t5o6MGTQnHc5BMXB;

1.1.1.6
date	2020.11.01.09.51.24;	author mrg;	state Exp;
branches;
next	1.1.1.7;
commitid	af86gKDNccMIsauC;

1.1.1.7
date	2021.04.27.03.01.48;	author mrg;	state Exp;
branches;
next	1.1.1.8;
commitid	bnhxFHsntjvsvSQC;

1.1.1.8
date	2021.07.11.00.27.20;	author mrg;	state Exp;
branches;
next	1.1.1.9;
commitid	ssF6uXIaLv20fv0D;

1.1.1.9
date	2022.01.09.09.01.58;	author mrg;	state Exp;
branches;
next	1.1.1.10;
commitid	xHtQ0cQ8fvcQeWnD;

1.1.1.10
date	2022.07.11.19.19.22;	author mrg;	state Exp;
branches;
next	1.1.1.11;
commitid	wjQfX0qND1IWLvLD;

1.1.1.11
date	2022.11.12.02.04.41;	author mrg;	state Exp;
branches;
next	1.1.1.12;
commitid	fMjFZZt1HqTR3m1E;

1.1.1.12
date	2024.07.04.09.21.31;	author mrg;	state Exp;
branches;
next	1.1.1.13;
commitid	yumHpHqYfO9ZbvgF;

1.1.1.13
date	2025.03.09.08.50.16;	author mrg;	state Exp;
branches;
next	;
commitid	B7EgqkX38oL13nMF;


desc
@@


1.1
log
@Initial revision
@
text
@# Copyright © 2017-2018 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.

project(
  'libdrm',
  ['c'],
  version : '2.4.91',
  license : 'MIT',
  meson_version : '>= 0.43',
  default_options : ['buildtype=debugoptimized', 'c_std=gnu99'],
)

pkg = import('pkgconfig')

with_udev = get_option('udev')
with_freedreno_kgsl = get_option('freedreno-kgsl')
with_install_tests = get_option('install-test-programs')

config = configuration_data()

if ['freebsd', 'dragonfly', 'netbsd'].contains(host_machine.system())
  dep_pthread_stubs = dependency('pthread-stubs', version : '>= 0.4')
else
  dep_pthread_stubs = []
endif
dep_threads = dependency('threads')

cc = meson.get_compiler('c')

# Check for atomics
intel_atomics = false
lib_atomics = false

if cc.compiles('''
    int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); }
    int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); }
    ''',
    name : 'Intel Atomics')
  intel_atomics = true
  with_atomics = true
elif cc.has_header('atomic_ops.h')
  lib_atomics = true
  with_atomics = true
elif cc.has_function('atomic_cas_uint')
  with_atomics = true
else
  with_atomics = false
endif

config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)

with_intel = false
_intel = get_option('intel')
if _intel != 'false'
  if _intel == 'true' and not with_atomics
    error('libdrm_intel requires atomics.')
  else
    with_intel = _intel == 'true' or host_machine.cpu_family().startswith('x86')
  endif
endif

with_radeon = false
_radeon = get_option('radeon')
if _radeon != 'false'
  if _radeon == 'true' and not with_atomics
    error('libdrm_radeon requires atomics.')
  endif
  with_radeon = true
endif

with_amdgpu = false
_amdgpu = get_option('amdgpu')
if _amdgpu != 'false'
  if _amdgpu == 'true' and not with_atomics
    error('libdrm_amdgpu requires atomics.')
  endif
  with_amdgpu = true
endif

with_nouveau = false
_nouveau = get_option('nouveau')
if _nouveau != 'false'
  if _nouveau == 'true' and not with_atomics
    error('libdrm_nouveau requires atomics.')
  endif
  with_nouveau = true
endif

with_vmwgfx = false
_vmwgfx = get_option('vmwgfx')
if _vmwgfx != 'false'
  with_vmwgfx = true
endif

with_omap = false
_omap = get_option('omap')
if _omap == 'true'
  if not with_atomics
    error('libdrm_omap requires atomics.')
  endif
  with_omap = true
endif

with_freedreno = false
_freedreno = get_option('freedreno')
if _freedreno != 'false'
  if _freedreno == 'true' and not with_atomics
    error('libdrm_freedreno requires atomics.')
  else
    with_freedreno = _freedreno == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
  endif
endif

with_tegra = false
_tegra = get_option('tegra')
if _tegra == 'true'
  if not with_atomics
    error('libdrm_tegra requires atomics.')
  endif
  with_tegra = true
endif

with_etnaviv = false
_etnaviv = get_option('etnaviv')
if _etnaviv == 'true'
  if not with_atomics
    error('libdrm_etnaviv requires atomics.')
  endif
  with_etnaviv = true
endif

with_exynos = get_option('exynos') == 'true'

with_vc4 = false
_vc4 = get_option('vc4')
if _vc4 != 'false'
  with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
endif

# XXX: Aparently only freebsd and dragonfly bsd actually need this (and
# gnu/kfreebsd), not openbsd and netbsd
with_libkms = false
_libkms = get_option('libkms')
if _libkms != 'false'
  with_libkms = _libkms == 'true' or ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system())
endif

if with_udev
  dep_udev = dependency('udev')
  config.set10('UDEV', true)
else
  dep_udev = []
endif

# Among others FreeBSD does not have a separate dl library.
if not cc.has_function('dlsym')
  dep_dl = cc.find_library('dl', required : with_nouveau)
else
  dep_dl = []
endif
# clock_gettime might require -rt, or it might not. find out
if not cc.has_function('clock_gettime', prefix : '#define _GNU_SOURCE\n#include <time.h>')
  # XXX: untested
  dep_rt = cc.find_library('rt')
else
  dep_rt = []
endif
dep_m = cc.find_library('m', required : false)
if cc.has_header('sys/sysctl.h')
  config.set10('HAVE_SYS_SYSCTL_H', true)
endif
if cc.has_header('sys/select.h')
  config.set10('HAVE_SYS_SELECT_H', true)
endif
if cc.has_header_symbol('sys/sysmacros.h', 'major')
  config.set10('MAJOR_IN_SYSMACROS', true)
elif cc.has_header_symbol('sys/mkdev.h', 'major')
  config.set10('MAJOR_IN_MKDEV', true)
endif
if cc.has_function('open_memstream')
  config.set10('HAVE_OPEN_MEMSTREAM', true)
endif

warn_c_args = []
foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef',
             '-Werror-implicit-function-declaration', '-Wpointer-arith',
             '-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes',
             '-Wmissing-declarations', '-Wnested-externs', '-Wpacked',
             '-Wswitch-enum', '-Wmissing-format-attribute',
             '-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow',
             '-Wdeclaration-after-statement', '-Wold-style-definition']
  if cc.has_argument(a)
    warn_c_args += a
  endif
endforeach
# GCC will never error for -Wno-*, so check for -W* then add -Wno-* to the list
# of options
foreach a : ['unused-parameter', 'attributes', 'long-long',
             'missing-field-initializers']
  if cc.has_argument('-W@@0@@'.format(a))
    warn_c_args += '-Wno-@@0@@'.format(a)
  endif
endforeach


dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : with_intel)
dep_cunit = dependency('cunit', version : '>= 2.1', required : false)
_cairo_tests = get_option('cairo-tests')
if _cairo_tests != 'false'
  dep_cairo = dependency('cairo', required : _cairo_tests == 'true')
  with_cairo_tests = dep_cairo.found()
else
  dep_cairo = []
  with_cairo_tests = false
endif
_valgrind = get_option('valgrind')
if _valgrind != 'false'
  dep_valgrind = dependency('valgrind', required : _valgrind == 'true')
  with_valgrind = dep_valgrind.found()
else
  dep_valgrind = []
  with_valgrind = false
endif

with_man_pages = get_option('man-pages')
prog_xslt = find_program('xsltproc', required : with_man_pages == 'true')
prog_sed = find_program('sed', required : with_man_pages == 'true')
manpage_style = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
if prog_xslt.found()
  if run_command(prog_xslt, '--nonet', manpage_style).returncode() != 0
    if with_man_pages == 'true'
      error('Manpage style sheet cannot be found')
    endif
    with_man_pages = 'false'
  endif
endif
with_man_pages = with_man_pages != 'false' and prog_xslt.found() and prog_sed.found()

# Used for tets
prog_bash = find_program('bash')

if cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''',
               name : 'compiler supports __attribute__(("hidden"))')
  config.set10('HAVE_VISIBILITY', true)
endif

foreach t : [
             [with_exynos, 'EXYNOS'],
             [with_freedreno_kgsl, 'FREEDRENO_KGSL'],
             [with_intel, 'INTEL'],
             [with_nouveau, 'NOUVEAU'],
             [with_radeon, 'RADEON'],
             [with_vc4, 'VC4'],
             [with_vmwgfx, 'VMWGFX'],
             [with_cairo_tests, 'CAIRO'],
             [with_valgrind, 'VALGRIND'],
            ]
  config.set10('HAVE_@@0@@'.format(t[1]), t[0])
endforeach
if with_freedreno_kgsl and not with_freedreno
  error('cannot enable freedreno-kgsl without freedreno support')
endif
config.set10('_GNU_SOURCE', true)
config_file = configure_file(
  configuration : config,
  output : 'config.h',
)
add_project_arguments('-DHAVE_CONFIG_H', language : 'c')

inc_root = include_directories('.')
inc_drm = include_directories('include/drm')

libdrm = shared_library(
  'drm',
  [files(
     'xf86drm.c', 'xf86drmHash.c', 'xf86drmRandom.c', 'xf86drmSL.c',
     'xf86drmMode.c'
   ),
   config_file,
  ],
  c_args : warn_c_args,
  dependencies : [dep_udev, dep_valgrind, dep_rt, dep_m],
  include_directories : inc_drm,
  version : '2.4.0',
  install : true,
)

ext_libdrm = declare_dependency(
  link_with : libdrm,
  include_directories : [inc_root, inc_drm],
)

install_headers('libsync.h', 'xf86drm.h', 'xf86drmMode.h')
install_headers(
  'include/drm/drm.h', 'include/drm/drm_fourcc.h', 'include/drm/drm_mode.h',
  'include/drm/drm_sarea.h', 'include/drm/i915_drm.h',
  'include/drm/mach64_drm.h', 'include/drm/mga_drm.h',
  'include/drm/nouveau_drm.h', 'include/drm/qxl_drm.h',
  'include/drm/r128_drm.h', 'include/drm/radeon_drm.h',
  'include/drm/amdgpu_drm.h', 'include/drm/savage_drm.h',
  'include/drm/sis_drm.h', 'include/drm/tegra_drm.h', 'include/drm/vc4_drm.h',
  'include/drm/via_drm.h', 'include/drm/virtgpu_drm.h',
  subdir : 'libdrm',
)
if with_vmwgfx
  install_headers('include/drm/vmwgfx_drm.h', subdir : 'libdrm')
endif

pkg.generate(
  name : 'libdrm',
  libraries : libdrm,
  subdirs : ['.', 'libdrm'],
  version : meson.project_version(),
  description : 'Userspace interface to kernel DRM services',
)

env_test = environment()
env_test.set('NM', find_program('nm').path())

if with_libkms
  subdir('libkms')
endif
if with_intel
  subdir('intel')
endif
if with_nouveau
  subdir('nouveau')
endif
if with_radeon
  subdir('radeon')
endif
if with_amdgpu
  subdir('amdgpu')
endif
if with_omap
  subdir('omap')
endif
if with_exynos
  subdir('exynos')
endif
if with_freedreno
  subdir('freedreno')
endif
if with_tegra
  subdir('tegra')
endif
if with_vc4
  subdir('vc4')
endif
if with_etnaviv
  subdir('etnaviv')
endif
if with_man_pages
  subdir('man')
endif
subdir('data')
subdir('tests')

message('')
message('@@0@@ will be compiled with:'.format(meson.project_name()))
message('')
message('  libkms         @@0@@'.format(with_libkms))
message('  Intel API      @@0@@'.format(with_intel))
message('  vmwgfx API     @@0@@'.format(with_vmwgfx))
message('  Radeon API     @@0@@'.format(with_radeon))
message('  AMDGPU API     @@0@@'.format(with_amdgpu))
message('  Nouveau API    @@0@@'.format(with_nouveau))
message('  OMAP API       @@0@@'.format(with_omap))
message('  EXYNOS API     @@0@@'.format(with_exynos))
message('  Freedreno API  @@0@@ (kgsl: @@1@@)'.format(with_freedreno, with_freedreno_kgsl))
message('  Tegra API      @@0@@'.format(with_tegra))
message('  VC4 API        @@0@@'.format(with_vc4))
message('  Etnaviv API    @@0@@'.format(with_etnaviv))
message('')
@


1.1.1.1
log
@initial import of libdrm-2.4.91
@
text
@@


1.1.1.2
log
@initial import of libdrm-2.4.96
@
text
@d24 1
a24 1
  version : '2.4.96',
d32 1
a32 3
config = configuration_data()

config.set10('UDEV', get_option('udev'))
d36 2
a50 1
dep_atomic_ops = dependency('atomic_ops', required : false)
d58 1
a58 2
  dep_atomic_ops = []
elif dep_atomic_ops.found()
d166 7
d187 6
a192 4
foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
  config.set('HAVE_' + header.underscorify().to_upper(),
    cc.compiles('#include <@@0@@>'.format(header), name : '@@0@@ works'.format(header)))
endforeach
d198 3
a200 1
config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
a222 3
# all c args:
libdrm_c_args = warn_c_args + ['-fvisibility=hidden']

d260 4
a263 3
config.set10('HAVE_VISIBILITY',
  cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''',
              name : 'compiler supports __attribute__(("hidden"))'))
d286 1
a286 1
add_project_arguments('-include', 'config.h', language : 'c')
d299 2
a300 2
  c_args : libdrm_c_args,
  dependencies : [dep_valgrind, dep_rt, dep_m],
d316 4
a319 5
  'include/drm/msm_drm.h', 'include/drm/nouveau_drm.h',
  'include/drm/qxl_drm.h', 'include/drm/r128_drm.h',
  'include/drm/radeon_drm.h', 'include/drm/amdgpu_drm.h',
  'include/drm/savage_drm.h', 'include/drm/sis_drm.h',
  'include/drm/tegra_drm.h', 'include/drm/vc4_drm.h',
@


1.1.1.3
log
@initial import of libdrm-2.4.97
@
text
@d24 1
a24 1
  version : '2.4.97',
d195 1
a195 1
             '-Werror=implicit-function-declaration', '-Wpointer-arith',
@


1.1.1.4
log
@initial import of libdrm-2.4.99
@
text
@d24 1
a24 1
  version : '2.4.99',
d160 1
a160 1
# XXX: Apparently only freebsd and dragonfly bsd actually need this (and
@


1.1.1.5
log
@initial import of libdrm-2.4.100
@
text
@d24 1
a24 1
  version : '2.4.100',
a181 3
# From Niclas Zeising:
# FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
# includes when checking for headers.
d184 1
a184 1
    cc.compiles('#include <sys/types.h>\n#include <@@0@@>'.format(header), name : '@@0@@ works'.format(header)))
d186 1
a186 3
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
  cc.has_header_symbol('sys/sysmacros.h', 'minor') and
  cc.has_header_symbol('sys/sysmacros.h', 'makedev'))
d188 1
a188 4
endif
if (cc.has_header_symbol('sys/mkdev.h', 'major') and
  cc.has_header_symbol('sys/mkdev.h', 'minor') and
  cc.has_header_symbol('sys/mkdev.h', 'makedev'))
d251 3
@


1.1.1.6
log
@initial import of libdrm-2.4.102
@
text
@d24 1
a24 1
  version : '2.4.102',
a46 3
symbols_check = find_program('symbols-check.py')
prog_nm = find_program('nm')

d52 1
a52 1
if cc.links('''
a54 1
    int main() { }
d182 6
a187 15

# The header is not required on Linux, and is in fact deprecated in glibc 2.30+
if ['linux'].contains(host_machine.system())
  config.set10('HAVE_SYS_SYSCTL_H', false)
else
  # From Niclas Zeising:
  # FreeBSD requires sys/types.h for sys/sysctl.h, so add it as part of
  # the includes when checking for headers.
  config.set10('HAVE_SYS_SYSCTL_H',
    cc.compiles('#include <sys/types.h>\n#include <sys/sysctl.h>', name : 'sys/sysctl.h works'))
endif

foreach header : ['sys/select.h', 'alloca.h']
  config.set10('HAVE_' + header.underscorify().to_upper(),
    cc.compiles('#include <@@0@@>'.format(header), name : '@@0@@ works'.format(header)))
a188 1

d238 1
a238 5
  if with_freedreno
    dep_valgrind = dependency('valgrind', required : _valgrind == 'true', version : '>=3.10.0')
  else
    dep_valgrind = dependency('valgrind', required : _valgrind == 'true')
  endif
d284 1
a284 1
add_project_arguments('-include', '@@0@@'.format(config_file), language : 'c')
a303 10
test(
  'core-symbols-check',
  symbols_check,
  args : [
    '--lib', libdrm,
    '--symbols-file', files('core-symbols.txt'),
    '--nm', prog_nm.path(),
  ],
)

d334 3
@


1.1.1.7
log
@initial import of libdrm-2.4.105
@
text
@d24 1
a24 1
  version : '2.4.105',
d264 12
a275 2
prog_rst2man = find_program('rst2man', 'rst2man.py', required: with_man_pages == 'true')
with_man_pages = with_man_pages != 'false' and prog_rst2man.found()
d307 1
a307 1
libdrm = library(
@


1.1.1.8
log
@initial import of libdrm-2.4.107
@
text
@d24 1
a24 1
  version : '2.4.107',
d26 1
a26 1
  meson_version : '>= 0.46',
a53 5
python3 = import('python').find_installation()
format_mod_static_table = custom_target('format_mod_static_table',
  output : 'generated_static_table_fourcc.h', input: 'include/drm/drm_fourcc.h',
  command : [python3, files('gen_table_fourcc.py'), '@@INPUT@@', '@@OUTPUT@@'])

d303 1
a303 1
   config_file, format_mod_static_table
@


1.1.1.9
log
@initial import of libdrm-2.4.109
@
text
@d24 1
a24 1
  version : '2.4.109',
a46 2
android = cc.compiles('''int func() { return __ANDROID__; }''')

d174 1
a174 1
  with_libkms = _libkms == 'true' or (['linux', 'freebsd', 'dragonfly'].contains(host_machine.system()) and not android)
d302 14
a315 23
libdrm_files = [files(
   'xf86drm.c', 'xf86drmHash.c', 'xf86drmRandom.c', 'xf86drmSL.c',
   'xf86drmMode.c'
  ),
  config_file, format_mod_static_table
]

if android
  libdrm = library('drm', libdrm_files,
    c_args : libdrm_c_args,
    dependencies : [dep_valgrind, dep_rt, dep_m],
    include_directories : inc_drm,
    install : true,
  )
else
  libdrm = library('drm', libdrm_files,
    c_args : libdrm_c_args,
    dependencies : [dep_valgrind, dep_rt, dep_m],
    include_directories : inc_drm,
    install : true,
    version: '2.4.0'
  )
endif
@


1.1.1.10
log
@initial import of libdrm-2.4.112
@
text
@d24 1
a24 1
  version : '2.4.112',
d26 2
a27 2
  meson_version : '>= 0.53',
  default_options : ['buildtype=debugoptimized', 'c_std=c99'],
d57 2
a58 4
format_mod_static_table = custom_target(
  'format_mod_static_table',
  output : 'generated_static_table_fourcc.h',
  input : 'include/drm/drm_fourcc.h',
a91 1
summary('Intel', with_intel)
a100 1
summary('Radeon', with_radeon)
a109 1
summary('AMDGPU', with_amdgpu)
a118 1
summary('Nouveau', with_nouveau)
a124 1
summary('vmwgfx', with_vmwgfx)
a133 1
summary('OMAP', with_omap)
a143 2
summary('Freedreno', with_freedreno)
summary('Freedreon-kgsl', with_freedreno_kgsl)
a152 1
summary('Tegra', with_tegra)
a161 1
summary('Etnaviv', with_etnaviv)
a163 1
summary('EXYNOS', with_exynos)
d170 8
a177 1
summary('VC4', with_vc4)
d206 2
a207 1
  config.set10('HAVE_' + header.underscorify().to_upper(), cc.check_header(header))
d222 24
a245 9
libdrm_c_args = cc.get_supported_arguments([
  '-Wsign-compare', '-Werror=undef', '-Werror=implicit-function-declaration',
  '-Wpointer-arith', '-Wwrite-strings', '-Wstrict-prototypes',
  '-Wmissing-prototypes', '-Wmissing-declarations', '-Wnested-externs',
  '-Wpacked', '-Wswitch-enum', '-Wmissing-format-attribute',
  '-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow',
  '-Wdeclaration-after-statement', '-Wold-style-definition',
  '-Wno-unused-parameter', '-Wno-attributes', '-Wno-long-long',
  '-Wno-missing-field-initializers'])
d274 3
a276 1
config.set10('HAVE_VISIBILITY', cc.has_function_attribute('visibility:hidden'))
a310 1
# Build an unversioned so on android
d312 6
a317 1
  libdrm_kw = {}
d319 7
a325 1
  libdrm_kw = {'version' : '2.4.0'}
a327 11
libdrm = library(
  'drm',
  libdrm_files,
  c_args : libdrm_c_args,
  dependencies : [dep_valgrind, dep_rt, dep_m],
  include_directories : inc_drm,
  install : true,
  kwargs : libdrm_kw,
  gnu_symbol_visibility : 'hidden',
)

a342 4
if meson.version().version_compare('>= 0.54.0')
  meson.override_dependency('libdrm', ext_libdrm)
endif

a360 1
  libdrm,
d362 1
d364 1
d368 3
d406 17
@


1.1.1.11
log
@initial import of libdrm-2.4.114
@
text
@d24 1
a24 1
  version : '2.4.114',
d27 1
a27 1
  default_options : ['buildtype=debugoptimized', 'c_std=c11'],
a29 4
if ['windows', 'darwin'].contains(host_machine.system())
  error('unsupported OS: @@0@@'.format(host_machine.system()))
endif

a36 1
with_tests = get_option('tests')
a84 2
dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : get_option('intel'))

d87 2
a88 2
if not _intel.disabled()
  if _intel.enabled() and not with_atomics
d91 1
a91 1
    with_intel = (_intel.enabled() or host_machine.cpu_family().startswith('x86')) and with_atomics and dep_pciaccess.found()
d98 2
a99 2
if not _radeon.disabled()
  if _radeon.enabled() and not with_atomics
d102 1
a102 1
  with_radeon = with_atomics
d108 2
a109 2
if not _amdgpu.disabled()
  if _amdgpu.enabled() and not with_atomics
d112 1
a112 1
  with_amdgpu = with_atomics
d118 2
a119 2
if not _nouveau.disabled()
  if _nouveau.enabled() and not with_atomics
d122 1
a122 1
  with_nouveau = with_atomics
d128 1
a128 1
if not _vmwgfx.disabled()
d135 1
a135 1
if _omap.enabled()
d145 2
a146 2
if not _freedreno.disabled()
  if _freedreno.enabled() and not with_atomics
d149 1
a149 1
    with_freedreno = (_freedreno.enabled() or ['arm', 'aarch64'].contains(host_machine.cpu_family())) and with_atomics
d157 1
a157 1
if _tegra.enabled()
d167 2
a168 2
if not _etnaviv.disabled()
  if _etnaviv.enabled() and not with_atomics
d171 1
a171 6
  with_etnaviv = _etnaviv.enabled() or (
    with_atomics and [
      'loongarch64', 'mips', 'mips64',
      'arm', 'aarch64', 'arc',
    ].contains(host_machine.cpu_family())
  )
d175 1
a175 1
with_exynos = get_option('exynos').enabled()
d180 2
a181 2
if not _vc4.disabled()
  with_vc4 = _vc4.enabled() or ['arm', 'aarch64'].contains(host_machine.cpu_family())
d237 1
d239 19
a257 6
dep_cairo = dependency('cairo', required : get_option('cairo-tests'))
with_cairo_tests = dep_cairo.found()

valgrind_version = []
if with_freedreno
  valgrind_version = '>=3.10.0'
a258 2
dep_valgrind = dependency('valgrind', required : get_option('valgrind'), version : valgrind_version)
with_valgrind = dep_valgrind.found()
d260 3
a262 2
prog_rst2man = find_program('rst2man', 'rst2man.py', required: get_option('man-pages'))
with_man_pages = prog_rst2man.found()
d394 1
a394 3
if with_tests
  subdir('tests')
endif
@


1.1.1.12
log
@initial import of libdrm-2.4.122
@
text
@d24 1
a24 1
  version : '2.4.122',
d26 1
a26 1
  meson_version : '>= 0.59',
d43 5
d92 9
a100 5
with_intel = get_option('intel') \
  .require(with_atomics, error_message : 'libdrm_intel requires atomics') \
  .require(dep_pciaccess.found(), error_message : 'libdrm_intel requires libpciaccess') \
  .disable_auto_if(not host_machine.cpu_family().startswith('x86')) \
  .allowed()
d103 8
a110 3
with_radeon = get_option('radeon') \
  .require(with_atomics, error_message : 'libdrm_radeon requires atomics') \
  .allowed()
d113 8
a120 3
with_amdgpu = get_option('amdgpu') \
  .require(with_atomics, error_message : 'libdrm_amdgpu requires atomics') \
  .allowed()
d123 8
a130 3
with_nouveau = get_option('nouveau') \
  .require(with_atomics, error_message : 'libdrm_nouveau requires atomics') \
  .allowed()
d133 5
a137 1
with_vmwgfx = get_option('vmwgfx').allowed()
d140 8
a147 3
with_omap = get_option('omap') \
  .require(with_atomics, error_message : 'libdrm_omap requires atomics') \
  .enabled()
d150 9
a158 4
with_freedreno = get_option('freedreno') \
  .require(with_atomics, error_message : 'libdrm_freedreno requires atomics') \
  .disable_auto_if(not ['arm', 'aarch64'].contains(host_machine.cpu_family())) \
  .allowed()
d162 8
a169 4
with_tegra = get_option('tegra') \
  .require(with_atomics, error_message : 'libdrm_tegra requires atomics') \
  .disable_auto_if(not ['arm', 'aarch64'].contains(host_machine.cpu_family())) \
  .enabled()
d172 13
a184 4
with_etnaviv = get_option('etnaviv') \
  .require(with_atomics, error_message : 'libdrm_etnaviv requires atomics') \
  .disable_auto_if(not ['arm', 'aarch64', 'arc', 'mips', 'mips64', 'loongarch64'].contains(host_machine.cpu_family())) \
  .allowed()
d190 5
a194 3
with_vc4 = get_option('vc4') \
  .disable_auto_if(not ['arm', 'aarch64'].contains(host_machine.cpu_family())) \
  .allowed()
d210 1
a281 5

if target_machine.endian() == 'big'
  config.set('HAVE_BIG_ENDIAN', 1)
endif

d286 1
a286 1
add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
d309 1
a309 1
  dependencies : [dep_valgrind, dep_rt],
d322 1
a322 1
    '--nm', prog_nm.full_path(),
@


1.1.1.13
log
@initial import of libdrm-2.4.124
@
text
@a20 5
# The versioning should always stay at 2.4.x. If bumping away from this,
# you must ensure that all users of patch_ver are changed such that DSO versions
# continuously increment (e.g. blindly bumping from 2.4.122 to 2.5.0 would
# roll the libdrm DSO versioning from libdrm.so.2.122.0 back to libdrm.so.2.0.0
# which would be bad)
d24 1
a24 1
  version : '2.4.124',
a29 2
patch_ver = meson.project_version().split('.')[2]

a48 6
# Solaris / Illumos
if host_machine.system() == 'sunos'
  add_global_arguments('-D__EXTENSIONS__', language : 'c')
  add_global_arguments('-D_POSIX_C_SOURCE=3', language : 'c')
endif

d159 1
a159 1
if host_machine.system() == 'linux'
a232 4
if android
  config.set('BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD', 1)
endif

d253 1
a253 1
  libdrm_kw = { 'version' : '2.@@0@@.0'.format(patch_ver) }
@


