[PATCH rendercheck 2/5 v2] Add a meson build system.
Eric Anholt
eric at anholt.net
Mon Mar 27 17:04:09 UTC 2017
Meson allows the configure step to be run faster (.3 seconds compared to
autogen.sh's 3.9 seconds on my system) and a full rebuild (touch
rendercheck.h; make) to run faster (.05s instead of .07s).
Rendercheck is pretty much the best case scenario for autotools, with
limited configure-time autodetection, non-recursive make, and no
libtool, so it seems like an interesting test-case to start with for
meson conversion.
v2: Add missing check for err.h
---
.gitignore | 1 +
main.c | 7 +++++++
meson.build | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 68 insertions(+)
create mode 100644 meson.build
diff --git a/.gitignore b/.gitignore
index 0c428075e54f..009669fbff0e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -77,3 +77,4 @@ core
# For example, !report.pc overrides *.pc. See 'man gitignore'
#
rendercheck
+version.h
diff --git a/main.c b/main.c
index 0d3d14637aaa..9ace44dc9a67 100644
--- a/main.c
+++ b/main.c
@@ -26,6 +26,9 @@
#include <string.h>
#include <strings.h>
#include <getopt.h>
+#ifdef HAVE_VERSION_H
+#include "version.h"
+#endif
bool is_verbose = false, minimalrendering = false;
int enabled_tests = ~0; /* Enable all tests by default */
@@ -289,7 +292,11 @@ int main(int argc, char **argv)
/* Print the version string. Bail out if --version was requested and
* continue otherwise.
*/
+#ifdef HAVE_VERSION_H
+ printf("rendercheck %s", VERSION);
+#else
puts(PACKAGE_STRING);
+#endif
if (print_version)
return 0;
diff --git a/meson.build b/meson.build
new file mode 100644
index 000000000000..ae3c25463157
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,60 @@
+project('rendercheck', 'c')
+project_version = '1.5'
+cc = meson.get_compiler('c')
+
+if cc.has_header('err.h')
+ add_project_arguments('-DHAVE_ERR_H', language: 'c')
+endif
+
+add_project_arguments('-D_GNU_SOURCE', language: 'c')
+add_project_arguments('-DHAVE_VERSION_H', language: 'c')
+
+srcs = [
+ 'main.c',
+ 'ops.c',
+ 'tests.c',
+ 't_blend.c',
+ 't_bug7366.c',
+ 't_composite.c',
+ 't_dstcoords.c',
+ 't_fill.c',
+ 't_gradient.c',
+ 't_gtk_argb_xbgr.c',
+ 't_libreoffice_xrgb.c',
+ 't_repeat.c',
+ 't_shmblend.c',
+ 't_srccoords.c',
+ 't_tsrccoords.c',
+ 't_tsrccoords2.c',
+ 't_triangles.c',
+]
+
+version_config = configuration_data()
+version_config.set_quoted('VERSION', project_version)
+
+configure_file(
+ output: 'version.h',
+ configuration: version_config,
+)
+
+executable(
+ 'rendercheck',
+ srcs,
+ dependencies: [
+ dependency('xrender'),
+ dependency('xext'),
+ dependency('x11'),
+ dependency('xproto', version: '>= 7.0.17'),
+ ],
+ install: true,
+)
+
+man_config = configuration_data()
+man_config.set_quoted('__xorg_version__', project_version)
+rendercheck_man = configure_file(
+ output: 'rendercheck.1',
+ input: 'man/rendercheck.man',
+ configuration: man_config,
+)
+
+install_man(join_paths(meson.current_build_dir(), 'rendercheck.1'))
--
2.11.0
More information about the xorg-devel
mailing list