summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am5
-rw-r--r--meson.build106
2 files changed, 110 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index b07aa31..4e885eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,4 +43,7 @@ lint:
(cd src && $(MAKE) $(MFLAGS) lint)
endif LINT
-EXTRA_DIST = README.md
+EXTRA_DIST = \
+ meson.build \
+ README.md
+
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..a39d9a3
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,106 @@
+# SPDX-License-Identifier: MIT
+# Copyright © 2022 Intel Corporation
+
+project(
+ 'libXvMC',
+ 'c',
+ version : '1.0.12',
+ meson_version : '>= 0.58',
+ default_options : ['default_library=both'],
+)
+
+cc = meson.get_compiler('c')
+
+dep_dl = dependency('dl', required : false)
+if not dep_dl.found()
+ dep_dl = cc.find_library('dl', required : false)
+endif
+
+deps = [
+ dependency('x11', version : '>= 1.6'),
+ dependency('xext'),
+ dependency('xv'),
+ dependency('xextproto'),
+ dependency('videoproto'),
+ dep_dl,
+]
+
+conf = configuration_data()
+
+if cc.has_function('shmat')
+ conf.set('HAVE_SHAMT', true)
+endif
+
+configure_file(
+ configuration : conf,
+ output : 'config.h',
+)
+
+install_headers(
+ 'include/X11/extensions/vldXvMC.h',
+ 'include/X11/extensions/XvMClib.h',
+ subdir : 'X11/extensions',
+)
+
+install_data(
+ 'XvMC_API.txt',
+ install_dir : get_option('datadir') / 'doc',
+)
+
+pkg = import('pkgconfig')
+
+inc = include_directories('include')
+
+libXvMC = library(
+ 'XvMC',
+ 'src/XvMC.c',
+ c_args : ['-DHAVE_CONFIG_H'],
+ include_directories : inc,
+ dependencies : deps,
+ version : '1.0.0',
+ install : true,
+)
+
+pkg.generate(
+ libXvMC,
+ filebase : 'xvmc',
+ description : 'The XvMC Library',
+ version : meson.project_version(),
+)
+
+ext_libXvMC = declare_dependency(
+ link_with : libXvMC,
+ include_directories : inc,
+)
+
+meson.override_dependency('xvmc', ext_libXvMC)
+
+libXvMCW = library(
+ 'XvMCW',
+ 'wrapper/XvMCWrapper.c',
+ include_directories : inc,
+ c_args : [
+ '-DXVMC_CONFIGDIR=@0@/X11'.format(get_option('sysconfdir')),
+ '-DXVMC_SOVERSION=".1.0"',
+ '-DXV_SOVERSION=".1.0"',
+ ],
+ dependencies : deps,
+ version : '1.0.0',
+ install : true,
+)
+
+ext_libXvMCW = declare_dependency(
+ link_with : libXvMCW,
+ include_directories : inc,
+)
+
+pkg.generate(
+ libXvMCW,
+ name : 'XvMCWrapper',
+ filebase : 'xvmc-wrapper',
+ description : 'XvMC wrapper library',
+ version : meson.project_version(),
+)
+
+meson.override_dependency('xvmc-wrapper', ext_libXvMCW)
+