rendercheck: 4 commits - autogen.sh configure.ac .gitignore main.c Makefile.am man/Makefile.am man/rendercheck.man meson.build README

Eric Anholt anholt at kemper.freedesktop.org
Fri Mar 31 20:29:00 UTC 2017


 .gitignore          |   80 ----------------------------------------------------
 Makefile.am         |   43 ---------------------------
 README              |    8 +++++
 autogen.sh          |   17 -----------
 configure.ac        |   29 ------------------
 main.c              |    3 +
 man/Makefile.am     |   38 ------------------------
 man/rendercheck.man |    2 -
 meson.build         |   59 ++++++++++++++++++++++++++++++++++++++
 9 files changed, 71 insertions(+), 208 deletions(-)

New commits:
commit c0ab77ba31ed63f525dd4ecf80529bd8b790f3a9
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Mar 24 12:57:09 2017 -0700

    Explain how to build using meson in the README.
    
    v2: Call the build directory 'build/' to clarify that it's a
        directory, not a target (suggestion by Eric Engestrom)
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Daniel Stone <daniels at collabora.com> (v1)
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net> (v1)
    Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

diff --git a/README b/README
index f5af0b0..3bf515c 100644
--- a/README
+++ b/README
@@ -10,3 +10,11 @@ Tests currently include:
 - Linear gradients
 - Repeating sources/masks at POT and non-POT sizes
 - Some regression tests for bugs from freedesktop.org bugzilla.
+
+rendercheck uses the Meson build system, which uses the "ninja" build
+backend on Linux.  The three commands to configure (building into the
+build/ directory), build, and install are:
+
+    meson build/
+    ninja -C build/
+    sudo ninja -C build/ install
commit 253948b8d731b34a339aad8d42369c73644abec9
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Mar 24 12:49:32 2017 -0700

    Simplify manpage variable substitution for Meson.
    
    The previous code was contorting itself to do the substitution in the
    same source format as the xorg automake macros.  Now that automake is
    gone, we can simplify it.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Daniel Stone <daniels at collabora.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

diff --git a/man/rendercheck.man b/man/rendercheck.man
index b7be417..3d0e16f 100644
--- a/man/rendercheck.man
+++ b/man/rendercheck.man
@@ -1,5 +1,5 @@
 .ds q \N'34'
-.TH rendercheck 1 __xorgversion__
+.TH rendercheck 1 "rendercheck @version@" "X Version 11"
 .SH NAME
 rendercheck \- simple tests of the X Render extension.
 .SH SYNOPSIS
diff --git a/meson.build b/meson.build
index 25b8e43..e9f5bf4 100644
--- a/meson.build
+++ b/meson.build
@@ -48,19 +48,12 @@ executable(
     install: true,
 )
 
-man_xorgversion = '"rendercheck @0@" "X Version 11"'.format(project_version)
-
-custom_target(
-    'manpage',
+man_config = configuration_data()
+man_config.set('version', project_version)
+rendercheck_man = configure_file(
     input: 'man/rendercheck.man',
     output: 'rendercheck.1',
-    command: [
-        'sed',
-        '-e',
-	's/__xorgversion__/@0@/'.format(man_xorgversion),
-	'@INPUT@'
-    ],
-    capture: true,
+    configuration: man_config,
     install: true,
     install_dir: join_paths(get_option('mandir'), 'man1'),
 )
commit ad7d25fb954861fc682ab77b28b6a7dba6badb05
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Mar 24 12:31:13 2017 -0700

    Remove the autotools build system.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Daniel Stone <daniels at collabora.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

diff --git a/.gitignore b/.gitignore
index 009669f..6702033 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,80 +1 @@
-#
-#		X.Org module default exclusion patterns
-#		The next section if for module specific patterns
-#
-#	Do not edit the following section
-# 	GNU Build System (Autotools)
-aclocal.m4
-autom4te.cache/
-autoscan.log
-ChangeLog
-compile
-config.guess
-config.h
-config.h.in
-config.log
-config-ml.in
-config.py
-config.status
-config.status.lineno
-config.sub
-configure
-configure.scan
-depcomp
-.deps/
-INSTALL
-install-sh
-.libs/
-libtool
-libtool.m4
-ltmain.sh
-lt~obsolete.m4
-ltoptions.m4
-ltsugar.m4
-ltversion.m4
-Makefile
-Makefile.in
-mdate-sh
-missing
-mkinstalldirs
-*.pc
-py-compile
-stamp-h?
-symlink-tree
-texinfo.tex
-ylwrap
-
-#	Do not edit the following section
-# 	Edit Compile Debug Document Distribute
-*~
-*.[0-9]
-*.[0-9]x
-*.bak
-*.bin
-core
-*.dll
-*.exe
-*-ISO*.bdf
-*-JIS*.bdf
-*-KOI8*.bdf
-*.kld
-*.ko
-*.ko.cmd
-*.lai
-*.l[oa]
-*.[oa]
-*.obj
-*.patch
-*.so
-*.pcf.gz
-*.pdb
-*.tar.bz2
-*.tar.gz
-#
-#		Add & Override patterns for rendercheck 
-#
-#		Edit the following section as needed
-# For example, !report.pc overrides *.pc. See 'man gitignore'
-# 
-rendercheck
 version.h
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index f77cb4f..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-SUBDIRS = man
-
-bin_PROGRAMS = rendercheck
-
-rendercheck_SOURCES = \
-	main.c \
-	ops.c \
-	rendercheck.h \
-	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
-
-AM_CFLAGS = $(RC_CFLAGS) $(CWARNFLAGS)
-AM_CPPFLAGS = -D_GNU_SOURCE
-rendercheck_LDADD = $(RC_LIBS)
-
-MAINTAINERCLEANFILES = ChangeLog INSTALL
-EXTRA_DIST = \
-	doc/AddingNewTests \
-	doc/TODO \
-        autogen.sh
-
-.PHONY: ChangeLog INSTALL
-
-INSTALL:
-	$(INSTALL_CMD)
-
-ChangeLog:
-	$(CHANGELOG_CMD)
-
-dist-hook: ChangeLog INSTALL
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 5b20136..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/sh
-
-srcdir=`dirname "$0"`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd "$srcdir"
-
-autoreconf -v --install || exit 1
-cd "$ORIGDIR" || exit $?
-
-git config --local --get format.subjectPrefix ||
-    git config --local format.subjectPrefix "PATCH rendercheck"
-
-if test -z "$NOCONFIGURE"; then
-    exec "$srcdir"/configure "$@"
-fi
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 2a42793..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,29 +0,0 @@
-#                                               -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ(2.60)
-AC_INIT([rendercheck],
-        [1.5],
-        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
-        [rendercheck])
-
-AC_CONFIG_SRCDIR([Makefile.am])
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
-
-# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
-m4_ifndef([XORG_MACROS_VERSION],
-          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.8)
-XORG_DEFAULT_OPTIONS
-XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-shadow])
-
-# Checks for header files.
-AC_CHECK_HEADERS([err.h])
-
-# Checks for pkg-config packages
-PKG_CHECK_MODULES(RC, [xrender xext x11 xproto >= 7.0.17])
-
-AC_CONFIG_FILES([Makefile
-                 man/Makefile])
-
-AC_OUTPUT
diff --git a/main.c b/main.c
index 86346f0..5ec8090 100644
--- a/main.c
+++ b/main.c
@@ -26,9 +26,7 @@
 #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 */
@@ -292,11 +290,7 @@ 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\n", VERSION);
-#else
-	puts(PACKAGE_STRING);
-#endif
 	if (print_version)
 		return 0;
 
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644
index 84d1f9f..0000000
--- a/man/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
-#
-# 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 (including the next
-# paragraph) 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.
-#
-
-appmandir = $(APP_MAN_DIR)
-
-appman_PRE = rendercheck.man
-
-appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
-
-EXTRA_DIST = $(appman_PRE)
-
-CLEANFILES = $(appman_DATA)
-
-SUFFIXES = .$(APP_MAN_SUFFIX) .man
-
-# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
-.man.$(APP_MAN_SUFFIX):
-	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/meson.build b/meson.build
index bb4171d..25b8e43 100644
--- a/meson.build
+++ b/meson.build
@@ -7,7 +7,6 @@ if cc.has_header('err.h')
 endif
 
 add_project_arguments('-D_GNU_SOURCE', language: 'c')
-add_project_arguments('-DHAVE_VERSION_H', language: 'c')
 
 srcs = [
     'main.c',
commit 2702f88a1399ca29dc69adc62c2b54f96ffd814e
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Mar 24 12:22:53 2017 -0700

    Add a meson build system.
    
    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
    v3: Add a linebreak after printing the version (by Peter),
        fix manpage variable substitution (anholt).
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Daniel Stone <daniels at collabora.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

diff --git a/.gitignore b/.gitignore
index 0c42807..009669f 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 0d3d146..86346f0 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\n", VERSION);
+#else
 	puts(PACKAGE_STRING);
+#endif
 	if (print_version)
 		return 0;
 
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..bb4171d
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,67 @@
+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_xorgversion = '"rendercheck @0@" "X Version 11"'.format(project_version)
+
+custom_target(
+    'manpage',
+    input: 'man/rendercheck.man',
+    output: 'rendercheck.1',
+    command: [
+        'sed',
+        '-e',
+	's/__xorgversion__/@0@/'.format(man_xorgversion),
+	'@INPUT@'
+    ],
+    capture: true,
+    install: true,
+    install_dir: join_paths(get_option('mandir'), 'man1'),
+)


More information about the xorg-commit mailing list