diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-08-28 11:21:52 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-08-28 11:21:52 +0000 |
commit | e03da26e2f5829d91468bd99745bf24139cd3e2b (patch) | |
tree | 58bcfbc7e0f7092e2266aa9dc0618e92d7dd316d /app/xkbcomp | |
parent | 117398996edfa280b78e8c606358e294219cf8e9 (diff) |
Update to xkbcomp 1.2.3
Diffstat (limited to 'app/xkbcomp')
-rw-r--r-- | app/xkbcomp/ChangeLog | 146 | ||||
-rw-r--r-- | app/xkbcomp/Makefile.am | 6 | ||||
-rw-r--r-- | app/xkbcomp/Makefile.in | 21 | ||||
-rw-r--r-- | app/xkbcomp/aclocal.m4 | 275 | ||||
-rw-r--r-- | app/xkbcomp/compat.c | 9 | ||||
-rw-r--r-- | app/xkbcomp/configure | 20 | ||||
-rw-r--r-- | app/xkbcomp/configure.ac | 2 | ||||
-rw-r--r-- | app/xkbcomp/geometry.c | 4 | ||||
-rw-r--r-- | app/xkbcomp/man/Makefile.in | 6 | ||||
-rw-r--r-- | app/xkbcomp/parseutils.c | 9 | ||||
-rw-r--r-- | app/xkbcomp/parseutils.h | 4 | ||||
-rw-r--r-- | app/xkbcomp/utils.h | 63 | ||||
-rw-r--r-- | app/xkbcomp/xkbcomp.h | 1 | ||||
-rw-r--r-- | app/xkbcomp/xkbparse.y | 4 | ||||
-rw-r--r-- | app/xkbcomp/xkbscan.c | 9 |
15 files changed, 469 insertions, 110 deletions
diff --git a/app/xkbcomp/ChangeLog b/app/xkbcomp/ChangeLog index 5b33ab979..eba4470f5 100644 --- a/app/xkbcomp/ChangeLog +++ b/app/xkbcomp/ChangeLog @@ -1,3 +1,149 @@ +commit cef4ba4b8fdc9a5439f71437c08cf690a750bd6b +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jun 21 16:04:45 2011 +0100 + + Bump to 1.2.3 + + Signed-off-by: Daniel Stone <daniel@fooishbar.org> + +commit 3caab5aa37decb7b5dc1642a0452efc3e1f5100e +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jun 21 15:55:59 2011 +0100 + + Interp: Allow explicit Any/NoSymbol mappings + + Brown paper bag in full effect. + + The previous fix, while crushing the previous problem where an unknown + keysym for an interp def would lead to every key matching it, also + ignored explicit Any+AnyOfOrNone(All) mappings. + + Such as the one xkeyboard-config relied on for Control to actually + update the modifier state. + + Fix this by allowing mappings explicitly declared as Any/NoSymbol, while + ignoring only those with failed keysym lookups. Unfortunately, due to + the structure of the parser, it's a deeply inelegant fix. + + Verified with a quick check of all layouts (albeit using default + variants only) in xkeyboard-config that this results in no changes to + the output at all, compared to xkbcomp 1.1.1. + + Signed-off-by: Daniel Stone <daniel@fooishbar.org> + +commit b34af8b0aec3a1dfc58f9732996274cbf2646a53 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jun 21 15:55:28 2011 +0100 + + Constify LookupKeysym input argument + + Signed-off-by: Daniel Stone <daniel@fooishbar.org> + +commit e68a8ef1067f98056237d8067052e2a0d9896133 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jun 21 14:06:05 2011 +0100 + + Bump to 1.2.2 + + Emergency bugfix for the syminterp declarations. They've been broken + since the beginning of time, but I guess we just haven't added new + interpreted symbols since around then. + + Signed-off-by: Daniel Stone <daniel@fooishbar.org> + +commit 2a473b906943ffd807ad81960c47530ee7ae9a60 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jun 21 14:03:53 2011 +0100 + + Interp: Ignore NoSymbol definitions + + A NoSymbol syminterp leads to a Any+AnyOfOrAll(None) definition, which + is never what anyone would actually ever want in a sym interp. The + failure mode here was: + interpret XF86SomeKeysymYouDontHaveYet { + action=Something() + } + leading to: + interpret Any+AnyOfOrAll(None) { + action=Something() + } + leading to every single non-action key triggering your shiny new action + that was only supposed to come from a new keysym. + + At least you could VT switch or zap, I guess. + + Later, more invasive, revisions will bring a more useful error message. + + Signed-off-by: Daniel Stone <daniel@fooishbar.org> + +commit a2816345e58c88f5806a5c6df310c7d9c62264f0 +Author: Daniel Stone <daniel@fooishbar.org> +Date: Tue Jun 21 14:03:12 2011 +0100 + + Interp: Don't make modifier lookup failure fatal + + If we can't look up a modifier in a SymInterp declaration, don't make + that fatal enough to kill the entire file, just ignore it and move on. + + Signed-off-by: Daniel Stone <daniel@fooishbar.org> + +commit c7a42b364f0ca06d9859945fa11664d0e0ea2742 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Mar 8 08:16:35 2011 -0500 + + config: move pre-processor flags to AM_CPPFLAGS + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 7899a1f4745c8d111dab4dd3abc2b59b40ecdcbc +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Mar 8 08:02:54 2011 -0500 + + config: let Automake handle Yacc dist and cleaning + + BUILT_SOURCES and MAINTAINERCLEANFILES are already handled by Automake. + + Automake generates all the rules to handle building, + distribution and cleaning. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 137418c63d01d5db0dcaed257d7a26865efa53ae +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Tue Jun 7 23:47:32 2011 -0700 + + Replace repeated checks for gcc with _X_ATTRIBUTE_PRINTF from xproto + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Reviewed-by: Mark Kettenis <kettenis@openbsd.org> + +commit a2877e92bd9f9c1532b5cd12cc484ff3cdbc6a0a +Author: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> +Date: Fri Apr 1 20:26:30 2011 +1100 + + xkbcomp: Stop possible overflow in yyGetnumber. #31647 + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=31647 + + Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> + Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> + Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +commit 0b8527a3836cde77269461e22844857bf33e0aea +Author: Julien Cristau <jcristau@debian.org> +Date: Sun Feb 13 13:03:05 2011 +0100 + + Inline the oiText macro in the only place it's used + + Gets rid of a compiler warning: + geometry.c: In function 'HandleOverlayDef': + geometry.c:2578: warning: the address of 'ol' will always evaluate as 'true' + + X.Org bug#34219 <https://bugs.freedesktop.org/show_bug.cgi?id=34219> + + Signed-off-by: Julien Cristau <jcristau@debian.org> + Reviewed-by: Dirk Wallenstein <halsmit@t-online.de> + commit c8375bcb7eb9f86ca1534cdf1143e91372d0499e Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Feb 11 09:06:04 2011 +1000 diff --git a/app/xkbcomp/Makefile.am b/app/xkbcomp/Makefile.am index 9a41b8873..d0e991df3 100644 --- a/app/xkbcomp/Makefile.am +++ b/app/xkbcomp/Makefile.am @@ -22,7 +22,8 @@ SUBDIRS = man bin_PROGRAMS = xkbcomp -AM_CFLAGS = $(XKBCOMP_CFLAGS) -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' $(CWARNFLAGS) +AM_CPPFLAGS = -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' +AM_CFLAGS = $(XKBCOMP_CFLAGS) $(CWARNFLAGS) xkbcomp_LDADD = $(XKBCOMP_LIBS) xkbcomp_SOURCES = \ @@ -59,10 +60,7 @@ xkbcomp_SOURCES = \ xkbpath.h \ xkbscan.c - -BUILT_SOURCES = xkbparse.c MAINTAINERCLEANFILES = ChangeLog INSTALL -MAINTAINERCLEANFILES += $(BUILT_SOURCES) .PHONY: ChangeLog INSTALL diff --git a/app/xkbcomp/Makefile.in b/app/xkbcomp/Makefile.in index c0a11ee1a..45d2553db 100644 --- a/app/xkbcomp/Makefile.in +++ b/app/xkbcomp/Makefile.in @@ -44,9 +44,9 @@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : @@ -231,7 +231,8 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = man -AM_CFLAGS = $(XKBCOMP_CFLAGS) -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' $(CWARNFLAGS) +AM_CPPFLAGS = -DDFLT_XKB_CONFIG_ROOT='"$(XKBCONFIGROOT)"' +AM_CFLAGS = $(XKBCOMP_CFLAGS) $(CWARNFLAGS) xkbcomp_LDADD = $(XKBCOMP_LIBS) xkbcomp_SOURCES = \ action.c \ @@ -267,9 +268,8 @@ xkbcomp_SOURCES = \ xkbpath.h \ xkbscan.c -BUILT_SOURCES = xkbparse.c -MAINTAINERCLEANFILES = ChangeLog INSTALL $(BUILT_SOURCES) -all: $(BUILT_SOURCES) config.h +MAINTAINERCLEANFILES = ChangeLog INSTALL +all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: @@ -690,16 +690,14 @@ distcleancheck: distclean $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive +check: check-recursive all-am: Makefile $(PROGRAMS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive +install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -724,7 +722,6 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f xkbparse.c - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive diff --git a/app/xkbcomp/aclocal.m4 b/app/xkbcomp/aclocal.m4 index d24c77a27..7fbecba59 100644 --- a/app/xkbcomp/aclocal.m4 +++ b/app/xkbcomp/aclocal.m4 @@ -1022,7 +1022,7 @@ dnl DEALINGS IN THE SOFTWARE. # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.11.0]) +m4_define([vers_have], [1.13.0]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, @@ -1417,6 +1417,69 @@ AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) ]) # XORG_WITH_XMLTO +# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) +# -------------------------------------------- +# Minimum version: 1.12.0 +# Minimum version for optional DEFAULT argument: 1.12.0 +# +# XSLT (Extensible Stylesheet Language Transformations) is a declarative, +# XML-based language used for the transformation of XML documents. +# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. +# It is used under the cover by xmlto to generate html files from DocBook/XML. +# The XSLT processor is often used as a standalone tool for transformations. +# It should not be assumed that this tool is used only to work with documnetation. +# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. +# +# Interface to module: +# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation +# XSLTPROC: returns the path of the xsltproc program found +# returns the path set by the user in the environment +# --with-xsltproc: 'yes' user instructs the module to use xsltproc +# 'no' user instructs the module not to use xsltproc +# have_xsltproc: returns yes if xsltproc found in PATH or no +# +# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. +# +AC_DEFUN([XORG_WITH_XSLTPROC],[ +AC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) +m4_define([_defopt], m4_default([$2], [auto])) +AC_ARG_WITH(xsltproc, + AS_HELP_STRING([--with-xsltproc], + [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), + [use_xsltproc=$withval], [use_xsltproc=]_defopt) +m4_undefine([_defopt]) + +if test "x$use_xsltproc" = x"auto"; then + AC_PATH_PROG([XSLTPROC], [xsltproc]) + if test "x$XSLTPROC" = "x"; then + AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) + have_xsltproc=no + else + have_xsltproc=yes + fi +elif test "x$use_xsltproc" = x"yes" ; then + AC_PATH_PROG([XSLTPROC], [xsltproc]) + if test "x$XSLTPROC" = "x"; then + AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) + fi + have_xsltproc=yes +elif test "x$use_xsltproc" = x"no" ; then + if test "x$XSLTPROC" != "x"; then + AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) + fi + have_xsltproc=no +else + AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) +fi + +# Checking for minimum version is not implemented +# but we want to keep the interface consistent with other commands +m4_ifval([$1],[AC_MSG_WARN(Checking for MIN-VERSION is not implemented.)]) + +AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) +]) # XORG_WITH_XSLTPROC + + # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 @@ -1796,12 +1859,12 @@ AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DOCS],[ -m4_define([default], m4_default([$1], [yes])) +m4_define([docs_default], m4_default([$1], [yes])) AC_ARG_ENABLE(docs, AS_HELP_STRING([--enable-docs], - [Enable building the documentation (default: ]default[)]), - [build_docs=$enableval], [build_docs=]default) -m4_undefine([default]) + [Enable building the documentation (default: ]docs_default[)]), + [build_docs=$enableval], [build_docs=]docs_default) +m4_undefine([docs_default]) AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) AC_MSG_CHECKING([whether to build documentation]) AC_MSG_RESULT([$build_docs]) @@ -1873,6 +1936,194 @@ AC_MSG_CHECKING([whether to build functional specifications]) AC_MSG_RESULT([$build_specs]) ]) # XORG_ENABLE_SPECS +# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) +# ---------------------------------------------- +# Minimum version: 1.13.0 +# +# This macro enables a builder to enable/disable unit testing +# It makes no assumption about the test cases implementation +# Test cases may or may not use Automake "Support for test suites" +# They may or may not use the software utility library GLib +# +# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL +# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. +# The variable enable_unit_tests is used by other macros in this file. +# +# Interface to module: +# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests +# enable_unit_tests: used in configure.ac for additional configuration +# --enable-unit-tests: 'yes' user instructs the module to build tests +# 'no' user instructs the module not to build tests +# parm1: specify the default value, yes or no. +# +AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ +AC_BEFORE([$0], [XORG_WITH_GLIB]) +AC_BEFORE([$0], [XORG_LD_WRAP]) +m4_define([_defopt], m4_default([$1], [auto])) +AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], + [Enable building unit test cases (default: ]_defopt[)]), + [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) +m4_undefine([_defopt]) +AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) +AC_MSG_CHECKING([whether to build unit test cases]) +AC_MSG_RESULT([$enable_unit_tests]) +]) # XORG_ENABLE_UNIT_TESTS + +# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) +# ---------------------------------------- +# Minimum version: 1.13.0 +# +# GLib is a library which provides advanced data structures and functions. +# This macro enables a module to test for the presence of Glib. +# +# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. +# Otherwise the value of $enable_unit_tests is blank. +# +# Interface to module: +# HAVE_GLIB: used in makefiles to conditionally build targets +# with_glib: used in configure.ac to know if GLib has been found +# --with-glib: 'yes' user instructs the module to use glib +# 'no' user instructs the module not to use glib +# +AC_DEFUN([XORG_WITH_GLIB],[ +AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +m4_define([_defopt], m4_default([$2], [auto])) +AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], + [Use GLib library for unit testing (default: ]_defopt[)]), + [with_glib=$withval], [with_glib=]_defopt) +m4_undefine([_defopt]) + +have_glib=no +# Do not probe GLib if user explicitly disabled unit testing +if test "x$enable_unit_tests" != x"no"; then + # Do not probe GLib if user explicitly disabled it + if test "x$with_glib" != x"no"; then + m4_ifval( + [$1], + [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], + [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] + ) + fi +fi + +# Not having GLib when unit testing has been explicitly requested is an error +if test "x$enable_unit_tests" = x"yes"; then + if test "x$have_glib" = x"no"; then + AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) + fi +fi + +# Having unit testing disabled when GLib has been explicitly requested is an error +if test "x$enable_unit_tests" = x"no"; then + if test "x$with_glib" = x"yes"; then + AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) + fi +fi + +# Not having GLib when it has been explicitly requested is an error +if test "x$with_glib" = x"yes"; then + if test "x$have_glib" = x"no"; then + AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) + fi +fi + +AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) +]) # XORG_WITH_GLIB + +# XORG_LD_WRAP +# ------------ +# Minimum version: 1.13.0 +# +# Check if linker supports -wrap, passed via compiler flags +# +# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. +# Otherwise the value of $enable_unit_tests is blank. +# +AC_DEFUN([XORG_LD_WRAP],[ +XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no]) +# Not having ld wrap when unit testing has been explicitly requested is an error +if test "x$enable_unit_tests" = x"yes"; then + if test "x$have_ld_wrap" = x"no"; then + AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) + fi +fi +AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) +# +]) # XORG_LD_WRAP + +# XORG_CHECK_LINKER_FLAGS +# ----------------------- +# SYNOPSIS +# +# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE]) +# +# DESCRIPTION +# +# Check whether the given linker FLAGS work with the current language's +# linker, or whether they give an error. +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# NOTE: Based on AX_CHECK_COMPILER_FLAGS. +# +# LICENSE +# +# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> +# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2009 Matteo Frigo +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well.# +AC_DEFUN([XORG_CHECK_LINKER_FLAGS], +[AC_MSG_CHECKING([whether the linker accepts $1]) +dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: +AS_LITERAL_IF([$1], + [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ + ax_save_FLAGS=$LDFLAGS + LDFLAGS="$1" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], + AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, + AS_TR_SH(xorg_cv_linker_flags_[$1])=no) + LDFLAGS=$ax_save_FLAGS])], + [ax_save_FLAGS=$LDFLAGS + LDFLAGS="$1" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], + eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, + eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) + LDFLAGS=$ax_save_FLAGS]) +eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) +AC_MSG_RESULT($xorg_check_linker_flags) +if test "x$xorg_check_linker_flags" = xyes; then + m4_default([$2], :) +else + m4_default([$3], :) +fi +]) # XORG_CHECK_LINKER_FLAGS + # XORG_CHECK_MALLOC_ZERO # ---------------------- # Minimum version: 1.0.0 @@ -1889,18 +2140,16 @@ AC_ARG_ENABLE(malloc0returnsnull, AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then - AC_RUN_IFELSE([ -char *malloc(); -char *realloc(); -char *calloc(); -main() { + AC_RUN_IFELSE([AC_LANG_PROGRAM([ +#include <stdlib.h> +],[ char *m0, *r0, *c0, *p; m0 = malloc(0); p = malloc(10); r0 = realloc(p,0); - c0 = calloc(0); - exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); -}], + c0 = calloc(0,10); + exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); +])], [MALLOC_ZERO_RETURNS_NULL=yes], [MALLOC_ZERO_RETURNS_NULL=no], [MALLOC_ZERO_RETURNS_NULL=yes]) diff --git a/app/xkbcomp/compat.c b/app/xkbcomp/compat.c index 03c29efdc..759535a38 100644 --- a/app/xkbcomp/compat.c +++ b/app/xkbcomp/compat.c @@ -656,8 +656,15 @@ HandleInterpDef(InterpDef * def, XkbDescPtr xkb, unsigned merge, { ERROR("Couldn't determine matching modifiers\n"); ACTION("Symbol interpretation ignored\n"); - return False; + return True; } + if (def->ignore) + { + ERROR("Couldn't lookup keysym\n"); + ACTION("Symbol interpretation ignored\n"); + return True; + } + if (def->merge != MergeDefault) merge = def->merge; diff --git a/app/xkbcomp/configure b/app/xkbcomp/configure index 932528ac6..f730c061a 100644 --- a/app/xkbcomp/configure +++ b/app/xkbcomp/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.62 for xkbcomp 1.2.1. +# Generated by GNU Autoconf 2.62 for xkbcomp 1.2.3. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xkbcomp' PACKAGE_TARNAME='xkbcomp' -PACKAGE_VERSION='1.2.1' -PACKAGE_STRING='xkbcomp 1.2.1' +PACKAGE_VERSION='1.2.3' +PACKAGE_STRING='xkbcomp 1.2.3' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' # Factoring default headers for most tests. @@ -1326,7 +1326,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xkbcomp 1.2.1 to adapt to many kinds of systems. +\`configure' configures xkbcomp 1.2.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1396,7 +1396,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xkbcomp 1.2.1:";; + short | recursive ) echo "Configuration of xkbcomp 1.2.3:";; esac cat <<\_ACEOF @@ -1505,7 +1505,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xkbcomp configure 1.2.1 +xkbcomp configure 1.2.3 generated by GNU Autoconf 2.62 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1519,7 +1519,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xkbcomp $as_me 1.2.1, which was +It was created by xkbcomp $as_me 1.2.3, which was generated by GNU Autoconf 2.62. Invocation command line was $ $0 $@ @@ -2168,7 +2168,7 @@ fi # Define the identity of the package. PACKAGE='xkbcomp' - VERSION='1.2.1' + VERSION='1.2.3' cat >>confdefs.h <<_ACEOF @@ -5671,7 +5671,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xkbcomp $as_me 1.2.1, which was +This file was extended by xkbcomp $as_me 1.2.3, which was generated by GNU Autoconf 2.62. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5724,7 +5724,7 @@ Report bugs to <bug-autoconf@gnu.org>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -xkbcomp config.status 1.2.1 +xkbcomp config.status 1.2.3 configured by $0, generated by GNU Autoconf 2.62, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/app/xkbcomp/configure.ac b/app/xkbcomp/configure.ac index 98a930036..252eb1a0b 100644 --- a/app/xkbcomp/configure.ac +++ b/app/xkbcomp/configure.ac @@ -21,7 +21,7 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ([2.60]) -AC_INIT([xkbcomp], [1.2.1], +AC_INIT([xkbcomp], [1.2.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xkbcomp]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE diff --git a/app/xkbcomp/geometry.c b/app/xkbcomp/geometry.c index 6eb3fb880..6d2ca7f90 100644 --- a/app/xkbcomp/geometry.c +++ b/app/xkbcomp/geometry.c @@ -179,7 +179,6 @@ typedef struct _OverlayInfo unsigned short nKeys; OverlayKeyInfo *keys; } OverlayInfo; -#define oiText(d,o) ((o)?XkbAtomText((d),(o)->name,XkbMessage):"default") #define _GS_Default (1<<0) @@ -2575,7 +2574,8 @@ HandleOverlayDef(OverlayDef * def, { WSGO("Couldn't allocate OverlayKeyInfo\n"); ACTION2("Overlay %s for section %s will be incomplete\n", - oiText(info->dpy, &ol), scText(info->dpy, si)); + XkbAtomText(info->dpy, ol.name, XkbMessage), + scText(info->dpy, si)); return False; } strncpy(key->over, keyDef->over, XkbKeyNameLength); diff --git a/app/xkbcomp/man/Makefile.in b/app/xkbcomp/man/Makefile.in index 96e1c38da..29b1b727a 100644 --- a/app/xkbcomp/man/Makefile.in +++ b/app/xkbcomp/man/Makefile.in @@ -23,9 +23,9 @@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c +install_sh_DATA = ${SHELL} $(install_sh) -c -m 644 +install_sh_PROGRAM = ${SHELL} $(install_sh) -c +install_sh_SCRIPT = ${SHELL} $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : diff --git a/app/xkbcomp/parseutils.c b/app/xkbcomp/parseutils.c index 4aa859dbe..ca665e25a 100644 --- a/app/xkbcomp/parseutils.c +++ b/app/xkbcomp/parseutils.c @@ -220,7 +220,7 @@ BoolVarCreate(Atom nameToken, unsigned set) } InterpDef * -InterpCreate(KeySym sym, ExprDef * match) +InterpCreate(const char *sym_str, ExprDef * match) { InterpDef *def; @@ -229,7 +229,10 @@ InterpCreate(KeySym sym, ExprDef * match) { def->common.stmtType = StmtInterpDef; def->common.next = NULL; - def->sym = sym; + if (LookupKeysym(sym_str, &def->sym) == 0) + def->ignore = True; + else + def->ignore = False; def->match = match; } else @@ -622,7 +625,7 @@ AppendKeysymList(ExprDef * list, char *sym) } int -LookupKeysym(char *str, KeySym * sym_rtrn) +LookupKeysym(const char *str, KeySym * sym_rtrn) { KeySym sym; char *tmp; diff --git a/app/xkbcomp/parseutils.h b/app/xkbcomp/parseutils.h index 0d06ce92f..8b8a6c11d 100644 --- a/app/xkbcomp/parseutils.h +++ b/app/xkbcomp/parseutils.h @@ -88,7 +88,7 @@ extern VarDef *BoolVarCreate(Atom /* nameToken */ , unsigned /* set */ ); -extern InterpDef *InterpCreate(KeySym /* sym */ , +extern InterpDef *InterpCreate(const char * /* sym_str */ , ExprDef * /* match */ ); @@ -164,7 +164,7 @@ extern ExprDef *AppendKeysymList(ExprDef * /* list */ , char * /* sym */ ); -extern int LookupKeysym(char * /* str */ , +extern int LookupKeysym(const char * /* str */ , KeySym * /* sym_rtrn */ ); diff --git a/app/xkbcomp/utils.h b/app/xkbcomp/utils.h index 65e37c8a5..61a598734 100644 --- a/app/xkbcomp/utils.h +++ b/app/xkbcomp/utils.h @@ -115,12 +115,7 @@ extern Boolean uSetErrorFile(char * /* name */ extern void uInformation(const char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); #define ACTION6 uAction #define ACTION5 uAction @@ -131,12 +126,7 @@ uInformation(const char * /* s */ , ... #define ACTION uAction extern void uAction(const char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); #define WARN6 uWarning #define WARN5 uWarning @@ -147,12 +137,7 @@ uInformation(const char * /* s */ , ... #define WARN uWarning extern void uWarning(const char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); #define ERROR6 uError #define ERROR5 uError @@ -163,12 +148,7 @@ uInformation(const char * /* s */ , ... #define ERROR uError extern void uError(const char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); #define FATAL6 uFatalError #define FATAL5 uFatalError @@ -179,12 +159,7 @@ uInformation(const char * /* s */ , ... #define FATAL uFatalError extern void uFatalError(const char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); /* WSGO stands for "Weird Stuff Going On" */ #define WSGO6 uInternalError @@ -196,12 +171,7 @@ uInformation(const char * /* s */ , ... #define WSGO uInternalError extern void uInternalError(const char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); extern void uSetPreErrorMessage(char * /* msg */ ); @@ -262,21 +232,11 @@ extern unsigned int DEBUG_VAR; extern void uDebug(char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); extern void uDebugNOI( /* no indent */ char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 1, 2))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(1, 2); extern Boolean uSetDebugFile(char *name); @@ -316,12 +276,7 @@ extern extern Boolean uSetEntryFile(char *name); extern void uEntry(int /* l */ , char * /* s */ , ... - ) -#if defined(__GNUC__) && \ - ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 6))) - __attribute__ ((format(printf, 2, 3))) -#endif - ; + ) _X_ATTRIBUTE_PRINTF(2, 3); extern void uExit(int l, char *rtVal); #ifdef ENTRY_TRACKING_ON diff --git a/app/xkbcomp/xkbcomp.h b/app/xkbcomp/xkbcomp.h index d6a718541..fb4006165 100644 --- a/app/xkbcomp/xkbcomp.h +++ b/app/xkbcomp/xkbcomp.h @@ -243,6 +243,7 @@ typedef struct _InterpDef KeySym sym; ExprDef *match; VarDef *def; + Bool ignore; } InterpDef; typedef struct _IndicatorNameDef diff --git a/app/xkbcomp/xkbparse.y b/app/xkbcomp/xkbparse.y index d73b92a27..51b3bf7e9 100644 --- a/app/xkbcomp/xkbparse.y +++ b/app/xkbcomp/xkbparse.y @@ -374,9 +374,9 @@ InterpretDecl : INTERPRET InterpretMatch OBRACE ; InterpretMatch : KeySym PLUS Expr - { $$= InterpCreate(XStringToKeysym($1), $3); } + { $$= InterpCreate($1, $3); } | KeySym - { $$= InterpCreate(XStringToKeysym($1), NULL); } + { $$= InterpCreate($1, NULL); } ; VarDeclList : VarDeclList VarDecl diff --git a/app/xkbcomp/xkbscan.c b/app/xkbcomp/xkbscan.c index b355e06bb..0bc9ccef9 100644 --- a/app/xkbcomp/xkbscan.c +++ b/app/xkbcomp/xkbscan.c @@ -606,14 +606,16 @@ yyGetIdent(int first) static int yyGetNumber(int ch) { + const int nMaxBuffSize = 1024; int isFloat = 0; - char buf[1024]; + char buf[nMaxBuffSize]; int nInBuf = 0; buf[0] = ch; nInBuf = 1; while (((ch = scanchar()) != EOF) - && (isxdigit(ch) || ((nInBuf == 1) && (ch == 'x')))) + && (isxdigit(ch) || ((nInBuf == 1) && (ch == 'x'))) + && nInBuf < nMaxBuffSize) { buf[nInBuf++] = ch; } @@ -621,7 +623,8 @@ yyGetNumber(int ch) { isFloat = 1; buf[nInBuf++] = ch; - while (((ch = scanchar()) != EOF) && (isxdigit(ch))) + while (((ch = scanchar()) != EOF) && (isxdigit(ch)) + && nInBuf < nMaxBuffSize) { buf[nInBuf++] = ch; } |