* Update xkbcomp to version 1.0.2
This commit is contained in:
parent
025d2067f4
commit
bf15332ee1
|
@ -14,8 +14,9 @@ xbase-clients (1:7.0.0-6) UNRELEASED; urgency=low
|
|||
* Update xwininfo to version 1.0.2
|
||||
* Update xclock to version 1.0.2
|
||||
* Update xconsole to version 1.0.2
|
||||
* Update xkbcomp to version 1.0.2
|
||||
|
||||
-- David Nusinow <dnusinow@debian.org> Mon, 1 May 2006 23:03:21 -0400
|
||||
-- David Nusinow <dnusinow@debian.org> Mon, 1 May 2006 23:10:27 -0400
|
||||
|
||||
xbase-clients (1:7.0.0-5) unstable; urgency=low
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ Index: setxkbmap-1.0.2/setxkbmap.c
|
|||
addToList(&szInclPath,&numInclPath,&inclPath,DFLT_XKB_CONFIG_ROOT);
|
||||
for (i=1;(i<argc)&&ok;i++) {
|
||||
if (argv[i][0]!='-') {
|
||||
Index: xkbcomp-X11R7.0-1.0.1/xkbpath.c
|
||||
Index: xkbcomp/xkbpath.c
|
||||
===================================================================
|
||||
--- xkbcomp-X11R7.0-1.0.1/xkbpath.c
|
||||
+++ xkbcomp-X11R7.0-1.0.1/xkbpath.c
|
||||
--- xkbcomp/xkbpath.c
|
||||
+++ xkbcomp/xkbpath.c
|
||||
@@ -131,9 +131,14 @@
|
||||
void
|
||||
XkbAddDefaultDirectoriesToPath(void)
|
||||
|
|
|
@ -282,10 +282,10 @@ Index: setxkbmap-1.0.2/setxkbmap.man
|
|||
+for a full statement of rights and permissions.
|
||||
+.SH AUTHOR
|
||||
+Erik Fortune, Silicon Graphics
|
||||
Index: xkbcomp-X11R7.0-1.0.1/README.config
|
||||
Index: xkbcomp/README.config
|
||||
===================================================================
|
||||
--- xkbcomp-X11R7.0-1.0.1/README.config.orig 2006-05-01 22:05:38.000000000 -0400
|
||||
+++ xkbcomp-X11R7.0-1.0.1/README.config 2006-05-01 22:20:42.000000000 -0400
|
||||
--- xkbcomp/README.config.orig 2006-05-01 22:05:38.000000000 -0400
|
||||
+++ xkbcomp/README.config 2006-05-01 22:20:42.000000000 -0400
|
||||
@@ -100,7 +100,7 @@
|
||||
command loading the same keyboard mapping would look like:
|
||||
|
||||
|
@ -295,10 +295,10 @@ Index: xkbcomp-X11R7.0-1.0.1/README.config
|
|||
|
||||
2.3 Even More Advanced Configuration
|
||||
|
||||
Index: xkbcomp-X11R7.0-1.0.1/xkbcomp.man
|
||||
Index: xkbcomp/xkbcomp.man
|
||||
===================================================================
|
||||
--- xkbcomp-X11R7.0-1.0.1/xkbcomp.man.orig 2006-05-01 22:05:38.000000000 -0400
|
||||
+++ xkbcomp-X11R7.0-1.0.1/xkbcomp.man 2006-05-01 22:20:42.000000000 -0400
|
||||
--- xkbcomp/xkbcomp.man.orig 2006-05-01 22:05:38.000000000 -0400
|
||||
+++ xkbcomp/xkbcomp.man 2006-05-01 22:20:42.000000000 -0400
|
||||
@@ -5,105 +5,201 @@
|
||||
.\"
|
||||
.\" $XFree86: xc/programs/xkbcomp/xkbcomp.man,v 1.11 2003/07/28 21:57:02 herrb Exp $
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
2006-04-26 Adam Jackson <ajax@freedesktop.org>
|
||||
|
||||
* configure.ac:
|
||||
Bump to 1.0.2
|
||||
|
||||
2006-04-03 Daniel Stone <daniel@freedesktop.org>
|
||||
|
||||
* compat.c:
|
||||
Bug #4851: Fix up have-no-file test.
|
||||
|
||||
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version for X11R7 release.
|
||||
|
||||
2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version number for final X11R7 release candidate.
|
||||
|
||||
2005-12-06 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* Makefile.am:
|
||||
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
|
||||
|
||||
2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version number for X11R7 RC3 release.
|
||||
|
||||
2005-10-18 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* configure.ac:
|
||||
Update package version number for RC1 release.
|
||||
|
||||
2005-10-15 Kevin E. Martin <kem-at-freedesktop-dot-org>
|
||||
|
||||
* Makefile.am: Have generated files be cleaned by maintainer in
|
||||
order to pass check-tarball test.
|
||||
|
||||
2005-09-01 Kristian Høgsberg <krh@redhat.com>
|
||||
|
||||
* Makefile.am (AM_CFLAGS): Define DFLT_XKB_CONFIG_ROOT to
|
||||
$(datadir)/X11/xkb so we look in the right place.
|
||||
|
||||
2005-08-02 Keith Packard <keithp@keithp.com>
|
||||
|
||||
* Makefile.am:
|
||||
Mark generated files as BUILT_SOURCES and CLEANFILES
|
||||
to ensure they are regenerated after 'make clean' and
|
||||
to make parallel builds work right.
|
|
@ -0,0 +1,726 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
#
|
||||
# Copyright 2005 Red Hat, Inc.
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of Red Hat not be used in
|
||||
# advertising or publicity pertaining to distribution of the software without
|
||||
# specific, written prior permission. Red Hat makes no
|
||||
# representations about the suitability of this software for any purpose. It
|
||||
# is provided "as is" without express or implied warranty.
|
||||
#
|
||||
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
# PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
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_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
bin_PROGRAMS = xkbcomp$(EXEEXT)
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
||||
config.guess config.sub depcomp install-sh missing xkbparse.c
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_xkbcomp_OBJECTS = action.$(OBJEXT) alias.$(OBJEXT) compat.$(OBJEXT) \
|
||||
expr.$(OBJEXT) geometry.$(OBJEXT) indicators.$(OBJEXT) \
|
||||
keycodes.$(OBJEXT) keymap.$(OBJEXT) keytypes.$(OBJEXT) \
|
||||
listing.$(OBJEXT) misc.$(OBJEXT) parseutils.$(OBJEXT) \
|
||||
symbols.$(OBJEXT) utils.$(OBJEXT) vmod.$(OBJEXT) \
|
||||
xkbcomp.$(OBJEXT) xkbparse.$(OBJEXT) xkbpath.$(OBJEXT) \
|
||||
xkbscan.$(OBJEXT)
|
||||
xkbcomp_OBJECTS = $(am_xkbcomp_OBJECTS)
|
||||
am__DEPENDENCIES_1 =
|
||||
xkbcomp_DEPENDENCIES = $(am__DEPENDENCIES_1)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
|
||||
SOURCES = $(xkbcomp_SOURCES)
|
||||
DIST_SOURCES = $(xkbcomp_SOURCES)
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
appmanDATA_INSTALL = $(INSTALL_DATA)
|
||||
DATA = $(appman_DATA)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
|
||||
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
APP_MAN_DIR = @APP_MAN_DIR@
|
||||
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EXEEXT = @EXEEXT@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XKBCOMP_CFLAGS = @XKBCOMP_CFLAGS@
|
||||
XKBCOMP_LIBS = @XKBCOMP_LIBS@
|
||||
YACC = @YACC@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
AM_CFLAGS = $(XKBCOMP_CFLAGS) -DDFLT_XKB_CONFIG_ROOT='"$(datadir)/X11/xkb"'
|
||||
xkbcomp_LDADD = $(XKBCOMP_LIBS)
|
||||
xkbcomp_SOURCES = \
|
||||
action.c \
|
||||
action.h \
|
||||
alias.c \
|
||||
alias.h \
|
||||
compat.c \
|
||||
compat.h \
|
||||
expr.c \
|
||||
expr.h \
|
||||
geometry.c \
|
||||
indicators.c \
|
||||
indicators.h \
|
||||
keycodes.c \
|
||||
keycodes.h \
|
||||
keymap.c \
|
||||
keytypes.c \
|
||||
listing.c \
|
||||
misc.c \
|
||||
misc.h \
|
||||
parseutils.c \
|
||||
parseutils.h \
|
||||
symbols.c \
|
||||
tokens.h \
|
||||
utils.c \
|
||||
utils.h \
|
||||
vmod.c \
|
||||
vmod.h \
|
||||
xkbcomp.c \
|
||||
xkbcomp.h \
|
||||
xkbparse.y \
|
||||
xkbpath.c \
|
||||
xkbpath.h \
|
||||
xkbscan.c
|
||||
|
||||
appman_PRE = \
|
||||
xkbcomp.man
|
||||
|
||||
BUILT_SOURCES = xkbparse.c
|
||||
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
|
||||
EXTRA_DIST = README.config README.enhancing $(appman_PRE)
|
||||
appmandir = $(APP_MAN_DIR)
|
||||
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
|
||||
CLEANFILES = $(appman_DATA)
|
||||
SED = sed
|
||||
|
||||
# Strings to replace in man pages
|
||||
XORGRELSTRING = @PACKAGE_STRING@
|
||||
XORGMANNAME = X Version 11
|
||||
MAN_SUBSTS = \
|
||||
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
||||
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
|
||||
-e 's|__xservername__|Xorg|g' \
|
||||
-e 's|__xconfigfile__|xorg.conf|g' \
|
||||
-e 's|__projectroot__|$(prefix)|g' \
|
||||
-e 's|__apploaddir__|$(appdefaultdir)|' \
|
||||
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
|
||||
-e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
|
||||
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
|
||||
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
|
||||
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
|
||||
|
||||
SUFFIXES = .$(APP_MAN_SUFFIX) .man
|
||||
all: $(BUILT_SOURCES) config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .$(APP_MAN_SUFFIX) .man .c .o .obj .y
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --gnu \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
xkbcomp$(EXEEXT): $(xkbcomp_OBJECTS) $(xkbcomp_DEPENDENCIES)
|
||||
@rm -f xkbcomp$(EXEEXT)
|
||||
$(LINK) $(xkbcomp_LDFLAGS) $(xkbcomp_OBJECTS) $(xkbcomp_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/action.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expr.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geometry.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicators.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keycodes.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keymap.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keytypes.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listing.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parseutils.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbols.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmod.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbcomp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbparse.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbpath.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbscan.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.y.c:
|
||||
$(YACCCOMPILE) $<
|
||||
if test -f y.tab.h; then \
|
||||
to=`echo "$*_H" | sed \
|
||||
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
|
||||
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
|
||||
sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \
|
||||
y.tab.h >$*.ht; \
|
||||
rm -f y.tab.h; \
|
||||
if cmp -s $*.ht $*.h; then \
|
||||
rm -f $*.ht ;\
|
||||
else \
|
||||
mv $*.ht $*.h; \
|
||||
fi; \
|
||||
fi
|
||||
if test -f y.output; then \
|
||||
mv y.output $*.output; \
|
||||
fi
|
||||
sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@
|
||||
rm -f y.tab.c
|
||||
uninstall-info-am:
|
||||
install-appmanDATA: $(appman_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(appmandir)" || $(mkdir_p) "$(DESTDIR)$(appmandir)"
|
||||
@list='$(appman_DATA)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \
|
||||
$(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-appmanDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(appman_DATA)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(appmandir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-am
|
||||
all-am: Makefile $(PROGRAMS) $(DATA) config.h
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
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-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-appmanDATA
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \
|
||||
uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
|
||||
clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-compile distclean-generic distclean-hdr \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-appmanDATA install-binPROGRAMS install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \
|
||||
uninstall-info-am
|
||||
|
||||
|
||||
.man.$(APP_MAN_SUFFIX):
|
||||
sed $(MAN_SUBSTS) < $< > $@
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,196 @@
|
|||
The XKB Configuration Guide
|
||||
|
||||
Kamil Toman, Ivan U. Pascal
|
||||
|
||||
25 November 2002
|
||||
|
||||
Abstract
|
||||
|
||||
This document describes how to configure X11R6.8 XKB from a user's
|
||||
point a few. It converts basic configuration syntax and gives also
|
||||
a few examples.
|
||||
|
||||
1. Overview
|
||||
|
||||
The XKB configuration is decomposed into a number of components. Selecting
|
||||
proper parts and combining them back you can achieve most of configurations
|
||||
you might need. Unless you have a completely atypical keyboard you really
|
||||
don't need to touch any of xkb configuration files.
|
||||
|
||||
2. Selecting XKB Configuration
|
||||
|
||||
The easiest and the most natural way how to specify a keyboard mapping is to
|
||||
use rules component. As its name suggests it describes a number of general
|
||||
rules how to combine all bits and pieces into a valid and useful keyboard
|
||||
mapping. All you need to do is to select a suitable rules file and then to
|
||||
feed it with a few parameters that will adjust the keyboard behaviour to ful-
|
||||
fill your needs.
|
||||
|
||||
The parameters are:
|
||||
|
||||
o XkbRules - files of rules to be used for keyboard mapping composition
|
||||
|
||||
o XkbModel - name of model of your keyboard type
|
||||
|
||||
o XkbLayout - layout(s) you intend to use
|
||||
|
||||
o XkbVariant - variant(s) of layout you intend to use
|
||||
|
||||
o XkbOptions - extra xkb configuration options
|
||||
|
||||
The proper rules file depends on your vendor. In reality, the commonest file
|
||||
of rules is xorg. For each rules file there is a description file named <ven-
|
||||
dor-rules>.lst, for instance xorg.lst which is located in xkb configuration
|
||||
subdirectory rules (for example /etc/X11/xkb/rules).
|
||||
|
||||
2.1 Basic Configuration
|
||||
|
||||
Let's say you want to configure a PC style America keyboard with 104 keys as
|
||||
described in xorg.lst. It can be done by simply writing several lines from
|
||||
below to you xorg.conf configuration file (previously known as
|
||||
/etc/X11/XF86Config-4 or /etc/X11/XF86Config):
|
||||
|
||||
Section "InputDevice"
|
||||
Identifier "Keyboard1"
|
||||
Driver "kbd"
|
||||
|
||||
Option "XkbModel" "pc104"
|
||||
Option "XkbLayout" "us"
|
||||
Option "XKbOptions" ""
|
||||
EndSection
|
||||
|
||||
The values of parameters XkbModel and XkbLayout are really not surprising.
|
||||
The parameters XkbOptions has been explicitly set to empty set of parameters.
|
||||
The parameter XkbVariant has been left out. That means the default variant
|
||||
named basic is loaded.
|
||||
|
||||
Of course, this can be also done at runtime using utility setxkbmap. Shell
|
||||
command loading the same keyboard mapping would look like:
|
||||
|
||||
setxkbmap -rules xorg -model pc104 -layout us -option ""
|
||||
|
||||
The configuration and the shell command would be very analogical for most
|
||||
other layouts (internationalized mappings).
|
||||
|
||||
2.2 Advanced Configuration
|
||||
|
||||
You can use multi-layouts xkb configuration. What does it mean? Basically it
|
||||
allows to load up to four different keyboard layouts at a time. Each such
|
||||
layout would reside in its own group. The groups (unlike complete keyboard
|
||||
remapping) can be switched very fast from one to another by a combination of
|
||||
keys.
|
||||
|
||||
Let's say you want to configure your new Logitech cordless desktop keyboard,
|
||||
you intend to use three different layouts at the same time - us, czech and
|
||||
german (in this order), and that you are used to Alt-Shift combination for
|
||||
switching among them.
|
||||
|
||||
Then the configuration snippet could look like this:
|
||||
|
||||
Section "InputDevice"
|
||||
Identifier "Keyboard1"
|
||||
Driver "kbd"
|
||||
|
||||
Option "XkbModel" "logicordless"
|
||||
Option "XkbLayout" "us,cz,de"
|
||||
Option "XKbOptions" "grp:alt_shift_toggle"
|
||||
EndSection
|
||||
|
||||
Of course, this can be also done at runtime using utility setxkbmap. Shell
|
||||
command loading the same keyboard mapping would look like:
|
||||
|
||||
setxkbmap -rules xorg -model logicordless -layout "us,cz,de" \
|
||||
-option "grp:alt_shift_toggle"
|
||||
|
||||
2.3 Even More Advanced Configuration
|
||||
|
||||
Okay, let's say you are more demanding. You do like the example above but you
|
||||
want it to change a bit. Let's imagine you want the czech keyboard mapping to
|
||||
use another variant but basic. The configuration snippet then changes into:
|
||||
|
||||
Section "InputDevice"
|
||||
Identifier "Keyboard1"
|
||||
Driver "kbd"
|
||||
|
||||
Option "XkbModel" "logicordless"
|
||||
Option "XkbLayout" "us,cz,de"
|
||||
Option "XkbVariant" ",bksl,"
|
||||
Option "XKbOptions" "grp:alt_shift_toggle"
|
||||
EndSection
|
||||
|
||||
That's seems tricky but it is not. The logic for settings of variants is the
|
||||
same as for layouts, that means the first and the third variant settings are
|
||||
left out (set to basic), the second is set to bksl (a special variant with an
|
||||
enhanced definition of the backslash key).
|
||||
|
||||
Analogically, the loading runtime will change to:
|
||||
|
||||
setxkmap -rules xorg -model logicordless -layout "us,cz,de" \
|
||||
-variant ",bksl," -option "grp:alt_shift_toggle"
|
||||
|
||||
2.4 Basic Global Options
|
||||
|
||||
See rules/*.lst files.
|
||||
|
||||
3. Direct XKB Configuration
|
||||
|
||||
Generally, you can directly prescribe what configuration of each of basic xkb
|
||||
components should be used to form the resulting keyboard mapping. This
|
||||
method is rather "brute force". You precisely need to know the structure and
|
||||
the meaning of all of used configuration components.
|
||||
|
||||
This method also exposes all xkb configuration details directly into
|
||||
xorg.conf configuration file which is a not very fortunate fact. In rare
|
||||
occasions it may be needed, though. So how does it work?
|
||||
|
||||
3.1 Basic Components
|
||||
|
||||
There are five basic components used to form a keyboard mapping:
|
||||
|
||||
o key codes - a translation of the scan codes produced by the keyboard
|
||||
into a suitable symbolic form
|
||||
|
||||
o types - a specification of what various combinations of modifiers pro-
|
||||
duce
|
||||
|
||||
o key symbols - a translation of symbolic key codes into actual symbols
|
||||
|
||||
o geometry - a description of physical keyboard geometry
|
||||
|
||||
o compatibility maps - a specification of what action should each key pro-
|
||||
duce in order to preserve compatibility with XKB-unware clients
|
||||
|
||||
3.2 Example Configuration
|
||||
|
||||
Look at the following example:
|
||||
|
||||
Section "InputDevice"
|
||||
Identifier "Keyboard0"
|
||||
Driver "kbd"
|
||||
|
||||
Option "XkbKeycodes" "xorg"
|
||||
Option "XkbTypes" "default"
|
||||
Option "XkbSymbols" "en_US(pc104)+de+swapcaps"
|
||||
Option "XkbGeometry" "pc(pc104)"
|
||||
Option "XkbCompat" "basic+pc+iso9995"
|
||||
EndSection
|
||||
|
||||
This configuration sets the standard X server default interpretation of key-
|
||||
board keycodes, sets the default modificator types. The symbol table is com-
|
||||
posed of extended US keyboard layout in its variant for pc keyboards with 104
|
||||
keys plus all keys for german layout are redefined respectively. Also the
|
||||
logical meaning of Caps-lock and Control keys is swapped. The standard key-
|
||||
board geometry (physical look) is set to pc style keyboard with 104 keys. The
|
||||
compatibility map is set to allow basic shifting, to allow Alt keys to be
|
||||
interpreted and also to allow iso9995 group shifting.
|
||||
|
||||
4. Keymap XKB Configuration
|
||||
|
||||
It is the formerly used way to configure xkb. The user included a special
|
||||
keymap file which specified the direct xkb configuration. This method has
|
||||
been obsoleted by previously described rules files which are far more flexi-
|
||||
ble and allow simpler and more intuitive syntax. It is preserved merely for
|
||||
compatibility reasons. Avoid using it if it is possible.
|
||||
|
||||
|
||||
$XdotOrg: app/xkbcomp/README.config,v 1.3 2004/09/03 23:41:22 kem Exp $
|
|
@ -0,0 +1,509 @@
|
|||
How to further enhance XKB configuration
|
||||
|
||||
Kamil Toman, Ivan U. Pascal
|
||||
|
||||
25 November 2002
|
||||
|
||||
Abstract
|
||||
|
||||
This guide is aimed to relieve one's labour to create a new (inter-
|
||||
nationalized) keyboard layout. Unlike other documents this guide
|
||||
accents the keymap developer's point of view.
|
||||
|
||||
1. Overview
|
||||
|
||||
The developer of a new layout should read the xkb protocol specification (The
|
||||
X Keyboard Extension: Protocol Specification <URL:http://www.x-
|
||||
docs.org/XKB/XKBproto.pdf>) at least to clarify for himself some xkb-specific
|
||||
terms used in this document and elsewhere in xkb configuration. Also it shows
|
||||
wise to understand how the X server and a client digest their keyboard inputs
|
||||
(with and without xkb).
|
||||
|
||||
A useful source is also Ivan Pascal's text about xkb configuration
|
||||
<URL:http://www.tsu.ru/~pascal/en/xkb> often referenced throughout this docu-
|
||||
ment.
|
||||
|
||||
Note that this document covers only enhancements which are to be made to
|
||||
XFree86 version 4.3 and X11R6.7.0 and above.
|
||||
|
||||
2. The Basics
|
||||
|
||||
At the startup (or at later at user's command) X server starts its xkb key-
|
||||
board module extension and reads data from a compiled configuration file.
|
||||
|
||||
This compiled configuration file is prepared by the program xkbcomp which
|
||||
behaves altogether as an ordinary compiler (see man xkbcomp). Its input are
|
||||
human readable xkb configuration files which are verified and then composed
|
||||
into a useful xkb configuration. Users don't need to mess with xkbcomp them-
|
||||
selves, for them it is invisible. Usually, it is started upon X server
|
||||
startup.
|
||||
|
||||
As you probably already know, the xkb configuration consists of five main
|
||||
modules:
|
||||
|
||||
Keycodes
|
||||
Tables that defines translation from keyboard scan codes into
|
||||
reasonable symbolic names, maximum, minimum legal keycodes, sym-
|
||||
bolic aliases and description of physically present LED-indica-
|
||||
tors. The primary sence of this component is to allow definitions
|
||||
of maps of symbols (see below) to be independent of physical key-
|
||||
board scancodes. There are two main naming conventions for sym-
|
||||
bolic names (always four bytes long):
|
||||
|
||||
o names which express some traditional meaning like <SPCE>
|
||||
(stands for space bar) or
|
||||
|
||||
o names which express some relative positioning on a key-
|
||||
board, for example <AE01> (an exclamation mark on US key-
|
||||
boards), on the right there are keys <AE02>, <AE03> etc.
|
||||
|
||||
Types
|
||||
Types describe how the produced key is changed by active modi-
|
||||
fiers (like Shift, Control, Alt, ...). There are several prede-
|
||||
fined types which cover most of used combinations.
|
||||
|
||||
Compat
|
||||
Compatibility component defines internal behaviour of modifiers.
|
||||
Using compat component you can assign various actions (elabo-
|
||||
rately described in xkb specification) to key events. This is
|
||||
also the place where LED-indicators behaviour is defined.
|
||||
|
||||
Symbols
|
||||
For i18n purposes, this is the most important table. It defines
|
||||
what values (=symbols) are assigned to what keycodes (represented
|
||||
by their symbolic name, see above). There may be defined more
|
||||
than one value for each key and then it depends on a key type and
|
||||
on modifiers state (respective compat component) which value will
|
||||
be the resulting one.
|
||||
|
||||
Geometry
|
||||
Geometry files aren't used by xkb itself but they may be used by
|
||||
some external programs to depict a keyboard image.
|
||||
|
||||
All these components have the files located in xkb configuration tree in sub-
|
||||
directories with the same names (usually in /usr/lib/X11/xkb).
|
||||
|
||||
3. Enhancing XKB Configuration
|
||||
|
||||
Most of xkb enhancements concerns a need to define new output symbols for the
|
||||
some input key events. In other words, a need to define a new symbol map (for
|
||||
a new language, standard or just to feel more comfortable when typing text).
|
||||
|
||||
What do you need to do? Generally, you have to define following things:
|
||||
|
||||
o the map of symbols itself
|
||||
|
||||
o the rules to allow users to select the new mapping
|
||||
|
||||
o the description of the new layout
|
||||
|
||||
First of all, it is good to go through existing layouts and to examine them
|
||||
if there is something you could easily adjust to fit your needs. Even if
|
||||
there is nothing similar you may get some ideas about basic concepts and used
|
||||
tricks.
|
||||
|
||||
3.1 Levels And Groups
|
||||
|
||||
Since XFree86 4.3.0 and X11R6.7.0 you can use multi-layout concept of xkb
|
||||
configuration. Though it is still in boundaries of xkb protocol and general
|
||||
ideas, the keymap designer must obey new rules when creating new maps. In
|
||||
exchange we get a more powerful and cleaner configuration system.
|
||||
|
||||
Remember that it is the application which must decide which symbol matches
|
||||
which keycode according to effective modifier state. The X server itself
|
||||
sends only an input event message to. Of course, usually the general inter-
|
||||
pretation is processed by Xlib, Xaw, Motif, Qt, Gtk and similar libraries.
|
||||
The X server only supplies its mapping table (usually upon an application
|
||||
startup).
|
||||
|
||||
You can think of the X server's symbol table as of a irregular table where
|
||||
each keycode has its row and where each combination of modifiers determines
|
||||
exactly one column. The resulting cell then gives the proper symbolic value.
|
||||
Not all keycodes need to bind different values for different combination of
|
||||
modifiers. <ENTER> key, for instance, usually doesn't depend on any modi-
|
||||
fiers so it its row has only one column defined.
|
||||
|
||||
Note that in XKB there is no prior assumption that certain modifiers are
|
||||
bound to certain columns. By editing proper files (see refnam (section 4.2,
|
||||
page 1)) this mapping can be changed as well.
|
||||
|
||||
Unlike the original X protocol the XKB approach is far more flexible. It is
|
||||
comfortable to add one additional XKB term - group. You can think of a group
|
||||
as of a vector of columns per each keycode (naturally the dimension of this
|
||||
vector may differ for different keycodes). What is it good for? The group is
|
||||
not very useful unless you intend to use more than one logically different
|
||||
set of symbols (like more than one alphabet) defined in a single mapping
|
||||
table. But then, the group has a natural meaning - each symbol set has its
|
||||
own group and changing it means selecting a different one. XKB approach
|
||||
allows up to four different groups. The columns inside each group are called
|
||||
(shift) levels. The X server knows the current group and reports it together
|
||||
with modifier set and with a keycode in key events.
|
||||
|
||||
To sum it up:
|
||||
|
||||
o for each keycode XKB keyboard map contains up to four one-dimensional
|
||||
tables - groups (logically different symbol sets)
|
||||
|
||||
o for each group of a keycode XKB keyboard map contains some columns -
|
||||
shift levels (values reached by combinations of Shift, Ctrl, Alt, ...
|
||||
modifiers)
|
||||
|
||||
o different keycodes can have different number of groups
|
||||
|
||||
o different groups of one keycode can have different number of shift lev-
|
||||
els
|
||||
|
||||
o the current group number is tracked by X server
|
||||
|
||||
It is clear that if you sanely define levels, groups and sanely bind modi-
|
||||
fiers and associated actions you can have simultaneously loaded up to four
|
||||
different symbol sets where each of them would reside in its own group.
|
||||
|
||||
The multi-layout concept provides a facility to manipulate xkb groups and
|
||||
symbol definitions in a way that allows almost arbitrary composition of pre-
|
||||
defined symbol tables. To keep it fully functional you have to:
|
||||
|
||||
o define all symbols only in the first group
|
||||
|
||||
o (re)define any modifiers with extra care to avoid strange (anisometric)
|
||||
behaviour
|
||||
|
||||
4. Defining New Layouts
|
||||
|
||||
See Some Words About XKB internals <URL:http://www.tsu.ru/~pas-
|
||||
cal/en/xkb/internals.html> for explanation of used xkb terms and problems
|
||||
addressed by XKB extension.
|
||||
|
||||
See Common notes about XKB configuration files language
|
||||
<URL:http://www.tsu.ru/~pascal/en/xkb/gram-common.html> for more precise
|
||||
explanation of syntax of xkb configuration files.
|
||||
|
||||
4.1 Predefined XKB Symbol Sets
|
||||
|
||||
If you are about to define some European symbol map extension, you might want
|
||||
to use on of four predefined latin alphabet layouts.
|
||||
|
||||
Okay, let's assume you want extend an existing keymap and you want to over-
|
||||
ride a few keys. Let's take a simple U.K. keyboard as an example (defined in
|
||||
pc/gb):
|
||||
|
||||
partial default alphanumeric_keys
|
||||
xkb_symbols "basic" {
|
||||
include "pc/latin"
|
||||
|
||||
name[Group1]="Great Britain";
|
||||
|
||||
key <AE02> { [ 2, quotedbl, twosuperior, oneeighth ] };
|
||||
key <AE03> { [ 3, sterling, threesuperior, sterling ] };
|
||||
key <AC11> { [apostrophe, at, dead_circumflex, dead_caron] };
|
||||
key <TLDE> { [ grave, notsign, bar, bar ] };
|
||||
key <BKSL> { [numbersign, asciitilde, dead_grave, dead_breve ] };
|
||||
key <RALT> { type[Group1]="TWO_LEVEL",
|
||||
[ ISO_Level3_Shift, Multi_key ] };
|
||||
|
||||
modifier_map Mod5 { <RALT> };
|
||||
};
|
||||
|
||||
It defines a new layout in basic variant as an extension of common latin
|
||||
alphabet layout. The layout (symbol set) name is set to "Great Britain".
|
||||
Then there are redefinitions of a few keycodes and a modifiers binding. As
|
||||
you can see the number of shift levels is the same for <AE02>, <AE03>,
|
||||
<AC11>, <TLDE> and <BKSL> keys but it differs from number of shift levels of
|
||||
<RALT>.
|
||||
|
||||
Note that the <RALT> key itself is a binding key for Mod5 and that it serves
|
||||
like a shift modifier for LevelThree, together with Shift as a multi-key. It
|
||||
is a good habit to respect this rule in a new similar layout.
|
||||
|
||||
Okay, you could now define more variants of your new layout besides basic
|
||||
simply by including (augmenting/overriding/...) the basic definition and
|
||||
altering what may be needed.
|
||||
|
||||
4.2 Key Types
|
||||
|
||||
The differences in the number of columns (shift levels) are caused by a dif-
|
||||
ferent types of keys (see the types definition in section basics). Most key-
|
||||
codes have implicitly set the keytype in the included 'pc/latin' file to
|
||||
'FOUR_LEVEL_ALPHABETIC'. The only exception is <RALT> keycode which is
|
||||
explicitly set 'TWO_LEVEL' keytype.
|
||||
|
||||
All those names refer to pre-defined shift level schemes. Usually you can
|
||||
choose a suitable shift level scheme from default types scheme list in proper
|
||||
xkb component's subdirectory.
|
||||
|
||||
The most used schemes are:
|
||||
|
||||
ONE_LEVEL
|
||||
The key does not depend on any modifiers. The symbol from first
|
||||
level is always chosen.
|
||||
|
||||
TWO_LEVEL
|
||||
The key uses a modifier Shift and may have two possible values.
|
||||
The second level may be chosen by Shift modifier. If Lock modi-
|
||||
fier (usually Caps-lock) applies the symbol is further processed
|
||||
using system-specific capitalization rules. If both Shift+Lock
|
||||
modifier apply the symbol from the second level is taken and cap-
|
||||
italization rules are applied (and usually have no effect).
|
||||
|
||||
ALPHABETIC
|
||||
The key uses modifiers Shift and Lock. It may have two possible
|
||||
values. The second level may be chosen by Shift modifier. When
|
||||
Lock modifier applies, the symbol from the first level is taken
|
||||
and further processed using system-specific capitalization rules.
|
||||
If both Shift+Lock modifier apply the symbol from the first level
|
||||
is taken and no capitalization rules applied. This is often
|
||||
called shift-cancels-caps behaviour.
|
||||
|
||||
THREE_LEVEL
|
||||
Is the same as TWO_LEVEL but it considers an extra modifier -
|
||||
LevelThree which can be used to gain the symbol value from the
|
||||
third level. If both Shift+LevelThree modifiers apply the value
|
||||
from the third level is also taken. As in TWO_LEVEL, the Lock
|
||||
modifier doesn't influence the resulting level. Only Shift and
|
||||
LevelThree are taken into that consideration. If the Lock modi-
|
||||
fier is active capitalization rules are applied on the resulting
|
||||
symbol.
|
||||
|
||||
FOUR_LEVEL
|
||||
Is the same as THREE_LEVEL but unlike LEVEL_THREE if both
|
||||
Shift+LevelThree modifiers apply the symbol is taken from the
|
||||
fourth level.
|
||||
|
||||
FOUR_LEVEL_ALPHABETIC
|
||||
Is similar to FOUR_LEVEL but also defines shift-cancels-caps
|
||||
behaviour as in ALPHABETIC. If Lock+LevelThree apply the symbol
|
||||
from the third level is taken and the capitalization rules are
|
||||
applied. If Lock+Shift+LevelThree apply the symbol from the
|
||||
third level is taken and no capitalization rules are applied.
|
||||
|
||||
KEYPAD
|
||||
As the name suggest this scheme is primarily used for numeric
|
||||
keypads. The scheme considers two modifiers - Shift and NumLock.
|
||||
If none of modifiers applies the symbol from the first level is
|
||||
taken. If either Shift or NumLock modifiers apply the symbol from
|
||||
the second level is taken. If both Shift+NumLock modifiers apply
|
||||
the symbol from the first level is taken. Again, shift-cancels-
|
||||
caps variant.
|
||||
|
||||
FOUR_LEVEL_KEYPAD
|
||||
Is similar to KEYPAD scheme but considers also LevelThree modi-
|
||||
fier. If LevelThree modifier applies the symbol from the third
|
||||
level is taken. If Shift+LevelThree or NumLock+LevelThree apply
|
||||
the symbol from the fourth level is taken. If all Shift+Num-
|
||||
Lock+LevelThree modifiers apply the symbol from the third level
|
||||
is taken. This also, shift-cancels-caps variant.
|
||||
|
||||
Besides that, there are several schemes for special purposes:
|
||||
|
||||
PC_BREAK
|
||||
It is similar to TWO_LEVEL scheme but it considers the Control
|
||||
modifier rather than Shift. That means, the symbol from the sec-
|
||||
ond level is chosen by Control rather than by Shift.
|
||||
|
||||
PC_SYSRQ
|
||||
It is similar to TWO_LEVEL scheme but it considers the Alt modi-
|
||||
fier rather than Shift. That means, the symbol from the second
|
||||
level is chosen by Alt rather than by Shift.
|
||||
|
||||
CTRL+ALT
|
||||
The key uses modifiers Alt and Control. It may have two possible
|
||||
values. If only one modifier (Alt or Control) applies the symbol
|
||||
from the first level is chosen. Only if both Alt+Control modi-
|
||||
fiers apply the symbol from the second level is chosen.
|
||||
|
||||
SHIFT+ALT
|
||||
The key uses modifiers Shift and Alt. It may have two possible
|
||||
values. If only one modifier (Alt or Shift) applies the symbol
|
||||
from the first level is chosen. Only if both Alt+Shift modifiers
|
||||
apply the symbol from the second level is chosen.
|
||||
|
||||
If needed, special caps schemes may be used. They redefine the standard
|
||||
behaviour of all *ALPHABETIC types. The layouts (maps of symbols) with keys
|
||||
defined in respective types then automatically change their behaviour accord-
|
||||
ingly. Possible redefinitions are:
|
||||
|
||||
o internal
|
||||
|
||||
o internal_nocancel
|
||||
|
||||
o shift
|
||||
|
||||
o shift_nocancel
|
||||
|
||||
None of these schemes should be used directly. They are defined merely for
|
||||
'caps:' xkb options (used to globally change the layouts behaviour).
|
||||
|
||||
Don't alter any of existing key types. If you need a different behaviour cre-
|
||||
ate a new one.
|
||||
|
||||
4.2.1 More On Definitions Of Types
|
||||
|
||||
When the XKB software deals with a separate type description it gets a com-
|
||||
plete list of modifiers that should be taken into account from the 'modi-
|
||||
fiers=<list of modifiers>' list and expects that a set of 'map[<combination
|
||||
of modifiers>]=<list of modifiers>' instructions that contain the mapping for
|
||||
each combination of modifiers mentioned in that list. Modifiers that are not
|
||||
explicitly listed are NOT taken into account when the resulting shift level
|
||||
is computed. If some combination is omitted the program (subroutine) should
|
||||
choose the first level for this combination (a quite reasonable behavior).
|
||||
|
||||
Lets consider an example with two modifiers ModOne and ModTwo:
|
||||
|
||||
type "..." {
|
||||
modifiers = ModOne+ModTwo;
|
||||
map[None] = Level1;
|
||||
map[ModOne] = Level2;
|
||||
};
|
||||
|
||||
In this case the map statements for ModTwo only and ModOne+ModTwo are omit-
|
||||
ted. It means that if the ModTwo is active the subroutine can't found
|
||||
explicit mapping for such combination an will use the default level i.e.
|
||||
Level1.
|
||||
|
||||
But in the case the type described as:
|
||||
|
||||
type "..." {
|
||||
modifiers = ModOne;
|
||||
map[None] = Level1;
|
||||
map[ModOne] = Level2;
|
||||
};
|
||||
|
||||
the ModTwo will not be taken into account and the resulting level depends on
|
||||
the ModOne state only. That means, ModTwo alone produces the Level1 but the
|
||||
combination ModOne+ModTwo produces the Level2 as well as ModOne alone.
|
||||
|
||||
What does it mean if the second modifier is the Lock? It means that in the
|
||||
first case (the Lock itself is included in the list of modifiers but combina-
|
||||
tions with this modifier aren't mentioned in the map statements) the internal
|
||||
capitalization rules will be applied to the symbol from the first level. But
|
||||
in the second case the capitalization will be applied to the symbol chosen
|
||||
accordingly to he first modifier - and this can be the symbol from the first
|
||||
as well as from the second level.
|
||||
|
||||
Usually, all modifiers introduced in 'modifiers=<list of modifiers>' list are
|
||||
used for shift level calculation and then discarded. Sometimes this is not
|
||||
desirable. If you want to use a modifier for shift level calculation but you
|
||||
don't want to discard it, you may list in 'preserve[<combination of modi-
|
||||
fiers>]=<list of modifiers>'. That means, for a given combination all listed
|
||||
modifiers will be preserved. If the Lock modifier is preserved then the
|
||||
resulting symbol is passed to internal capitalization routine regardless
|
||||
whether it has been used for a shift level calculation or not.
|
||||
|
||||
Any key type description can use both real and virtual modifiers. Since real
|
||||
modifiers always have standard names it is not necessary to explicitly
|
||||
declare them. Virtual modifiers can have arbitrary names and can be declared
|
||||
(prior using them) directly in key type definition:
|
||||
|
||||
virtual_modifiers <comma-separated list of modifiers> ;
|
||||
|
||||
as seen in for example basic, pc or mousekeys key type definitions.
|
||||
|
||||
4.3 Rules
|
||||
|
||||
Once you are finished with your symbol map you need to add it to rules file.
|
||||
The rules file describes how all the five basic keycodes, types, compat, sym-
|
||||
bols and geometry components should be composed to give a sensible resulting
|
||||
xkb configuration.
|
||||
|
||||
The main advantage of rules over formerly used keymaps is a possibility to
|
||||
simply parameterize (once) fixed patterns of configurations and thus to ele-
|
||||
gantly allow substitutions of various local configurations into predefined
|
||||
templates.
|
||||
|
||||
A pattern in a rules file (often located in /usr/lib/X11/xkb/rules) can be
|
||||
parameterized with four other arguments: Model, Layout, Variant and Options.
|
||||
For most cases parameters model and layout should be sufficient for choosing
|
||||
a functional keyboard mapping.
|
||||
|
||||
The rules file itself is composed of pattern lines and lines with rules. The
|
||||
pattern line starts with an exclamation mark ('!') and describes how will the
|
||||
xkb interpret the following lines (rules). A sample rules file looks like
|
||||
this:
|
||||
|
||||
! model = keycodes
|
||||
macintosh_old = macintosh
|
||||
...
|
||||
* = xorg
|
||||
|
||||
! model = symbols
|
||||
hp = +inet(%m)
|
||||
microsoftpro = +inet(%m)
|
||||
geniuscomfy = +inet(%m)
|
||||
|
||||
! model layout[1] = symbols
|
||||
macintosh us = macintosh/us%(v[1])
|
||||
* * = pc/pc(%m)+pc/%l[1]%(v[1])
|
||||
|
||||
! model layout[2] = symbols
|
||||
macintosh us = +macintosh/us[2]%(v[2]):2
|
||||
* * = +pc/%l[2]%(v[2]):2
|
||||
|
||||
! option = types
|
||||
caps:internal = +caps(internal)
|
||||
caps:internal_nocancel = +caps(internal_nocancel)
|
||||
|
||||
Each rule defines what certain combination of values on the left side of
|
||||
equal sign ('=') results in. For example a (keyboard) model macintosh_old
|
||||
instructs xkb to take definitions of keycodes from file keycodes/macintosh
|
||||
while the rest of models (represented by a wild card '*') instructs it to
|
||||
take them from file keycodes/xorg. The wild card represents all possible val-
|
||||
ues on the left side which were not found in any of the previous rules. The
|
||||
more specialized (more complete) rules have higher precedence than general
|
||||
ones, i.e. the more general rules supply reasonable default values.
|
||||
|
||||
As you can see some lines contain substitution parameters - the parameters
|
||||
preceded by the percent sign ('%'). The first alphabetical character after
|
||||
the percent sign expands to the value which has been found on the left side.
|
||||
For example +%l%(v) expands into +cz(bksl) if the respective values on the
|
||||
left side were cz layout in its bksl variant. More, if the layout resp. vari-
|
||||
ant parameter is followed by a pair of brackets ('[', ']') it means that xkb
|
||||
should place the layout resp. variant into specified xkb group. If the brack-
|
||||
ets are omitted the first group is the default value.
|
||||
|
||||
So the second block of rules enhances symbol definitions for some particular
|
||||
keyboard models with extra keys (for internet, multimedia, ...) . Other mod-
|
||||
els are left intact. Similarly, the last block overrides some key type defi-
|
||||
nitions, so the common global behaviour ''shift cancels caps'' or ''shift
|
||||
doesn't cancel caps'' can be selected. The rest of rules produces special
|
||||
symbols for each variant us layout of macintosh keyboard and standard pc sym-
|
||||
bols in appropriate variants as a default.
|
||||
|
||||
4.4 Descriptive Files of Rules
|
||||
|
||||
Now you just need to add a detailed description to <rules>.xml description
|
||||
file so the other users (and external programs which often parse this file)
|
||||
know what is your work about.
|
||||
|
||||
4.4.1 Old Descriptive Files
|
||||
|
||||
The formerly used descriptive files were named <rules>.lst Its structure is
|
||||
very simple and quite self descriptive but such simplicity had also some cav-
|
||||
ities, for example there was no way how to describe local variants of layouts
|
||||
and there were problems with the localization of descriptions. To preserve
|
||||
compatibility with some older programs, new XML descriptive files can be con-
|
||||
verted to old format '.lst'.
|
||||
|
||||
For each parameter of rules file should be described its meaning. For the
|
||||
rules file described above the .lst file could look like:
|
||||
|
||||
! model
|
||||
pc104 Generic 104-key PC
|
||||
microsoft Microsoft Natural
|
||||
pc98 PC-98xx Series
|
||||
macintosh Original Macintosh
|
||||
...
|
||||
|
||||
! layout
|
||||
us U.S. English
|
||||
cz Czech
|
||||
de German
|
||||
...
|
||||
|
||||
! option
|
||||
caps:internal uses internal capitalization. Shift cancels Caps
|
||||
caps:internal_nocancel uses internal capitalization. Shift doesn't cancel Caps
|
||||
|
||||
And that should be it. Enjoy creating your own xkb mapping.
|
||||
|
||||
|
||||
$XdotOrg: app/xkbcomp/README.enhancing,v 1.3 2004/09/03 23:41:22 kem Exp $
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,781 @@
|
|||
/* $Xorg: compat.c,v 1.3 2000/08/17 19:54:30 cpqbld Exp $ */
|
||||
/************************************************************
|
||||
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this
|
||||
software and its documentation for any purpose and without
|
||||
fee is hereby granted, provided that the above copyright
|
||||
notice appear in all copies and that both that copyright
|
||||
notice and this permission notice appear in supporting
|
||||
documentation, and that the name of Silicon Graphics not be
|
||||
used in advertising or publicity pertaining to distribution
|
||||
of the software without specific prior written permission.
|
||||
Silicon Graphics makes no representation about the suitability
|
||||
of this software for any purpose. It is provided "as is"
|
||||
without any express or implied warranty.
|
||||
|
||||
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
||||
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/xkbcomp/compat.c,v 3.3 2001/01/17 23:45:43 dawes Exp $ */
|
||||
|
||||
#include <X11/Xos.h>
|
||||
#include "xkbcomp.h"
|
||||
#include "tokens.h"
|
||||
#include "expr.h"
|
||||
#include "vmod.h"
|
||||
#include "misc.h"
|
||||
#include "indicators.h"
|
||||
#include "action.h"
|
||||
|
||||
typedef struct _SymInterpInfo {
|
||||
CommonInfo defs;
|
||||
XkbSymInterpretRec interp;
|
||||
} SymInterpInfo;
|
||||
|
||||
#define _SI_VirtualMod (1<<0)
|
||||
#define _SI_Action (1<<1)
|
||||
#define _SI_AutoRepeat (1<<2)
|
||||
#define _SI_LockingKey (1<<3)
|
||||
#define _SI_LevelOneOnly (1<<4)
|
||||
|
||||
typedef struct _GroupCompatInfo {
|
||||
unsigned char fileID;
|
||||
unsigned char merge;
|
||||
unsigned char real_mods;
|
||||
unsigned short vmods;
|
||||
} GroupCompatInfo;
|
||||
|
||||
typedef struct _CompatInfo {
|
||||
char * name;
|
||||
unsigned fileID;
|
||||
int errorCount;
|
||||
int nInterps;
|
||||
SymInterpInfo * interps;
|
||||
SymInterpInfo dflt;
|
||||
LEDInfo ledDflt;
|
||||
GroupCompatInfo groupCompat[XkbNumKbdGroups];
|
||||
LEDInfo * leds;
|
||||
VModInfo vmods;
|
||||
ActionInfo * act;
|
||||
XkbDescPtr xkb;
|
||||
} CompatInfo;
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
#define ReportSINotArray(si,f,i) \
|
||||
ReportNotArray("symbol interpretation",(f),siText((si),(i)))
|
||||
#define ReportSIBadType(si,f,w,i) \
|
||||
ReportBadType("symbol interpretation",(f),siText((si),(i)),(w))
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
static char *
|
||||
siText(SymInterpInfo * si,CompatInfo * info)
|
||||
{
|
||||
static char buf[128];
|
||||
|
||||
if (si==&info->dflt) {
|
||||
sprintf(buf,"default");
|
||||
}
|
||||
else {
|
||||
sprintf(buf,"%s+%s(%s)",XkbKeysymText(si->interp.sym,XkbMessage),
|
||||
XkbSIMatchText(si->interp.match,XkbMessage),
|
||||
XkbModMaskText(si->interp.mods,XkbMessage));
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
static void
|
||||
InitCompatInfo(CompatInfo *info,XkbDescPtr xkb)
|
||||
{
|
||||
register int i;
|
||||
|
||||
info->xkb= xkb;
|
||||
info->name= NULL;
|
||||
info->fileID= 0;
|
||||
info->errorCount= 0;
|
||||
info->nInterps= 0;
|
||||
info->interps= NULL;
|
||||
info->act= NULL;
|
||||
info->dflt.defs.fileID= info->fileID;
|
||||
info->dflt.defs.defined= 0;
|
||||
info->dflt.defs.merge= MergeOverride;
|
||||
info->dflt.interp.flags= 0;
|
||||
info->dflt.interp.virtual_mod= XkbNoModifier;
|
||||
info->dflt.interp.act.type= XkbSA_NoAction;
|
||||
for (i=0;i<XkbAnyActionDataSize;i++) {
|
||||
info->dflt.interp.act.data[i]= 0;
|
||||
}
|
||||
ClearIndicatorMapInfo(xkb->dpy,&info->ledDflt);
|
||||
info->ledDflt.defs.fileID= info->fileID;
|
||||
info->ledDflt.defs.defined= 0;
|
||||
info->ledDflt.defs.merge= MergeOverride;
|
||||
bzero((char *)&info->groupCompat[0],XkbNumKbdGroups*sizeof(GroupCompatInfo));
|
||||
info->leds= NULL;
|
||||
InitVModInfo(&info->vmods,xkb);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ClearCompatInfo(CompatInfo *info,XkbDescPtr xkb)
|
||||
{
|
||||
register int i;
|
||||
|
||||
if (info->name!=NULL)
|
||||
uFree(info->name);
|
||||
info->name= NULL;
|
||||
info->dflt.defs.defined= 0;
|
||||
info->dflt.defs.merge= MergeAugment;
|
||||
info->dflt.interp.flags= 0;
|
||||
info->dflt.interp.virtual_mod= XkbNoModifier;
|
||||
info->dflt.interp.act.type= XkbSA_NoAction;
|
||||
for (i=0;i<XkbAnyActionDataSize;i++) {
|
||||
info->dflt.interp.act.data[i]= 0;
|
||||
}
|
||||
ClearIndicatorMapInfo(xkb->dpy,&info->ledDflt);
|
||||
info->nInterps= 0;
|
||||
info->interps= (SymInterpInfo *)ClearCommonInfo(&info->interps->defs);
|
||||
bzero((char *)&info->groupCompat[0],XkbNumKbdGroups*sizeof(GroupCompatInfo));
|
||||
info->leds= (LEDInfo *)ClearCommonInfo(&info->leds->defs);
|
||||
/* 3/30/94 (ef) -- XXX! Should free action info here */
|
||||
ClearVModInfo(&info->vmods,xkb);
|
||||
return;
|
||||
}
|
||||
|
||||
static SymInterpInfo *
|
||||
NextInterp(CompatInfo *info)
|
||||
{
|
||||
SymInterpInfo * si;
|
||||
|
||||
si= uTypedAlloc(SymInterpInfo);
|
||||
if (si) {
|
||||
bzero((char *)si,sizeof(SymInterpInfo));
|
||||
info->interps= (SymInterpInfo *)AddCommonInfo(&info->interps->defs,
|
||||
(CommonInfo *)si);
|
||||
info->nInterps++;
|
||||
}
|
||||
return si;
|
||||
}
|
||||
|
||||
static SymInterpInfo *
|
||||
FindMatchingInterp(CompatInfo *info,SymInterpInfo *new)
|
||||
{
|
||||
SymInterpInfo * old;
|
||||
|
||||
for (old= info->interps;old!=NULL;old=(SymInterpInfo *)old->defs.next) {
|
||||
if ((old->interp.sym==new->interp.sym)&&
|
||||
(old->interp.mods==new->interp.mods)&&
|
||||
(old->interp.match==new->interp.match)) {
|
||||
return old;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Bool
|
||||
AddInterp(CompatInfo *info,SymInterpInfo *new)
|
||||
{
|
||||
unsigned collide;
|
||||
SymInterpInfo * old;
|
||||
|
||||
collide= 0;
|
||||
old= FindMatchingInterp(info,new);
|
||||
if (old!=NULL) {
|
||||
if (new->defs.merge==MergeReplace) {
|
||||
SymInterpInfo *next= (SymInterpInfo *)old->defs.next;
|
||||
if (((old->defs.fileID==new->defs.fileID)&&(warningLevel>0))||
|
||||
(warningLevel>9)) {
|
||||
WARN1("Multiple definitions for \"%s\"\n",siText(new,info));
|
||||
ACTION("Earlier interpretation ignored\n");
|
||||
}
|
||||
*old= *new;
|
||||
old->defs.next= &next->defs;
|
||||
return True;
|
||||
}
|
||||
if (UseNewField(_SI_VirtualMod,&old->defs,&new->defs,&collide)) {
|
||||
old->interp.virtual_mod= new->interp.virtual_mod;
|
||||
old->defs.defined|= _SI_VirtualMod;
|
||||
}
|
||||
if (UseNewField(_SI_Action,&old->defs,&new->defs,&collide)) {
|
||||
old->interp.act= new->interp.act;
|
||||
old->defs.defined|= _SI_Action;
|
||||
}
|
||||
if (UseNewField(_SI_AutoRepeat,&old->defs,&new->defs,&collide)) {
|
||||
old->interp.flags&= ~XkbSI_AutoRepeat;
|
||||
old->interp.flags|= (new->interp.flags&XkbSI_AutoRepeat);
|
||||
old->defs.defined|= _SI_AutoRepeat;
|
||||
}
|
||||
if (UseNewField(_SI_LockingKey,&old->defs,&new->defs,&collide)) {
|
||||
old->interp.flags&= ~XkbSI_LockingKey;
|
||||
old->interp.flags|= (new->interp.flags&XkbSI_LockingKey);
|
||||
old->defs.defined|= _SI_LockingKey;
|
||||
}
|
||||
if (UseNewField(_SI_LevelOneOnly,&old->defs,&new->defs,&collide)) {
|
||||
old->interp.match&= ~XkbSI_LevelOneOnly;
|
||||
old->interp.match|= (new->interp.match&XkbSI_LevelOneOnly);
|
||||
old->defs.defined|= _SI_LevelOneOnly;
|
||||
}
|
||||
if (collide) {
|
||||
WARN1("Multiple interpretations of \"%s\"\n",siText(new,info));
|
||||
ACTION1("Using %s definition for duplicate fields\n",
|
||||
(new->defs.merge!=MergeAugment?"last":"first"));
|
||||
}
|
||||
return True;
|
||||
}
|
||||
old= new;
|
||||
if ((new= NextInterp(info))==NULL)
|
||||
return False;
|
||||
*new= *old;
|
||||
new->defs.next= NULL;
|
||||
return True;
|
||||
}
|
||||
|
||||
static Bool
|
||||
AddGroupCompat(CompatInfo *info,unsigned group,GroupCompatInfo *newGC)
|
||||
{
|
||||
GroupCompatInfo * gc;
|
||||
unsigned merge;
|
||||
|
||||
merge= newGC->merge;
|
||||
gc= &info->groupCompat[group];
|
||||
if ((newGC->fileID<0)||
|
||||
((gc->real_mods==newGC->real_mods)&&(gc->vmods==newGC->vmods))) {
|
||||
return True;
|
||||
}
|
||||
if (((gc->fileID==newGC->fileID)&&(warningLevel>0))||(warningLevel>9)) {
|
||||
WARN1("Compat map for group %d redefined\n",group+1);
|
||||
ACTION1("Using %s definition\n",(merge==MergeAugment?"old":"new"));
|
||||
}
|
||||
if (merge!=MergeAugment)
|
||||
*gc= *newGC;
|
||||
return True;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
static Bool
|
||||
ResolveStateAndPredicate( ExprDef * expr,
|
||||
unsigned * pred_rtrn,
|
||||
unsigned * mods_rtrn,
|
||||
CompatInfo * info)
|
||||
{
|
||||
ExprResult result;
|
||||
|
||||
if (expr==NULL) {
|
||||
*pred_rtrn= XkbSI_AnyOfOrNone;
|
||||
*mods_rtrn= ~0;
|
||||
return True;
|
||||
}
|
||||
|
||||
*pred_rtrn= XkbSI_Exactly;
|
||||
if (expr->op==ExprActionDecl) {
|
||||
char *pred_txt= XkbAtomText(NULL,expr->value.action.name,XkbMessage);
|
||||
if (uStrCaseCmp(pred_txt,"noneof")==0)
|
||||
*pred_rtrn= XkbSI_NoneOf;
|
||||
else if (uStrCaseCmp(pred_txt,"anyofornone")==0)
|
||||
*pred_rtrn= XkbSI_AnyOfOrNone;
|
||||
else if (uStrCaseCmp(pred_txt,"anyof")==0)
|
||||
*pred_rtrn= XkbSI_AnyOf;
|
||||
else if (uStrCaseCmp(pred_txt,"allof")==0)
|
||||
*pred_rtrn= XkbSI_AllOf;
|
||||
else if (uStrCaseCmp(pred_txt,"exactly")==0)
|
||||
*pred_rtrn= XkbSI_Exactly;
|
||||
else {
|
||||
ERROR1("Illegal modifier predicate \"%s\"\n",pred_txt);
|
||||
ACTION("Ignored\n");
|
||||
return False;
|
||||
}
|
||||
expr= expr->value.action.args;
|
||||
}
|
||||
else if (expr->op==ExprIdent) {
|
||||
char *pred_txt= XkbAtomText(NULL,expr->value.str,XkbMessage);
|
||||
if ((pred_txt)&&(uStrCaseCmp(pred_txt,"any")==0)) {
|
||||
*pred_rtrn= XkbSI_AnyOf;
|
||||
*mods_rtrn= 0xff;
|
||||
return True;
|
||||
}
|
||||
}
|
||||
|
||||
if (ExprResolveModMask(expr,&result,NULL,NULL)) {
|
||||
*mods_rtrn= result.uval;
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
static void
|
||||
MergeIncludedCompatMaps( CompatInfo * into,
|
||||
CompatInfo * from,
|
||||
unsigned merge)
|
||||
{
|
||||
SymInterpInfo * si;
|
||||
LEDInfo * led,*rtrn,*next;
|
||||
GroupCompatInfo * gcm;
|
||||
register int i;
|
||||
|
||||
if (from->errorCount>0) {
|
||||
into->errorCount+= from->errorCount;
|
||||
return;
|
||||
}
|
||||
if (into->name==NULL) {
|
||||
into->name= from->name;
|
||||
from->name= NULL;
|
||||
}
|
||||
for (si=from->interps;si;si=(SymInterpInfo *)si->defs.next) {
|
||||
if (merge!=MergeDefault)
|
||||
si->defs.merge= merge;
|
||||
if (!AddInterp(into,si))
|
||||
into->errorCount++;
|
||||
}
|
||||
for (i=0,gcm=&from->groupCompat[0];i<XkbNumKbdGroups;i++,gcm++) {
|
||||
if (merge!=MergeDefault)
|
||||
gcm->merge= merge;
|
||||
if (!AddGroupCompat(into,i,gcm))
|
||||
into->errorCount++;
|
||||
}
|
||||
for (led=from->leds;led!=NULL;led=next) {
|
||||
next= (LEDInfo *)led->defs.next;
|
||||
if (merge!=MergeDefault)
|
||||
led->defs.merge= merge;
|
||||
rtrn= AddIndicatorMap(into->leds,led);
|
||||
if (rtrn!=NULL)
|
||||
into->leds= rtrn;
|
||||
else into->errorCount++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
typedef void (*FileHandler)(
|
||||
XkbFile * /* rtrn */,
|
||||
XkbDescPtr /* xkb */,
|
||||
unsigned /* merge */,
|
||||
CompatInfo * /* info */
|
||||
);
|
||||
|
||||
static Bool
|
||||
HandleIncludeCompatMap( IncludeStmt * stmt,
|
||||
XkbDescPtr xkb,
|
||||
CompatInfo * info,
|
||||
FileHandler hndlr)
|
||||
{
|
||||
unsigned newMerge;
|
||||
XkbFile * rtrn;
|
||||
CompatInfo included;
|
||||
Bool haveSelf;
|
||||
|
||||
haveSelf= False;
|
||||
if ((stmt->file==NULL)&&(stmt->map==NULL)) {
|
||||
haveSelf= True;
|
||||
included= *info;
|
||||
bzero(info,sizeof(CompatInfo));
|
||||
}
|
||||
else if (ProcessIncludeFile(stmt,XkmCompatMapIndex,&rtrn,&newMerge)) {
|
||||
InitCompatInfo(&included,xkb);
|
||||
included.fileID= rtrn->id;
|
||||
included.dflt= info->dflt;
|
||||
included.dflt.defs.fileID= rtrn->id;
|
||||
included.dflt.defs.merge= newMerge;
|
||||
included.ledDflt.defs.fileID= rtrn->id;
|
||||
included.ledDflt.defs.merge= newMerge;
|
||||
included.act= info->act;
|
||||
(*hndlr)(rtrn,xkb,MergeOverride,&included);
|
||||
if (stmt->stmt!=NULL) {
|
||||
if (included.name!=NULL)
|
||||
uFree(included.name);
|
||||
included.name= stmt->stmt;
|
||||
stmt->stmt= NULL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
info->errorCount+= 10;
|
||||
return False;
|
||||
}
|
||||
if ((stmt->next!=NULL)&&(included.errorCount<1)) {
|
||||
IncludeStmt * next;
|
||||
unsigned op;
|
||||
CompatInfo next_incl;
|
||||
|
||||
for (next=stmt->next;next!=NULL;next=next->next) {
|
||||
if ((next->file==NULL)&&(next->map==NULL)) {
|
||||
haveSelf= True;
|
||||
MergeIncludedCompatMaps(&included,info,next->merge);
|
||||
ClearCompatInfo(info,xkb);
|
||||
}
|
||||
else if (ProcessIncludeFile(next,XkmCompatMapIndex,&rtrn,&op)) {
|
||||
InitCompatInfo(&next_incl,xkb);
|
||||
next_incl.fileID= rtrn->id;
|
||||
next_incl.dflt= info->dflt;
|
||||
next_incl.dflt.defs.fileID= rtrn->id;
|
||||
next_incl.dflt.defs.merge= op;
|
||||
next_incl.ledDflt.defs.fileID= rtrn->id;
|
||||
next_incl.ledDflt.defs.merge= op;
|
||||
next_incl.act= info->act;
|
||||
(*hndlr)(rtrn,xkb,MergeOverride,&next_incl);
|
||||
MergeIncludedCompatMaps(&included,&next_incl,op);
|
||||
ClearCompatInfo(&next_incl,xkb);
|
||||
}
|
||||
else {
|
||||
info->errorCount+= 10;
|
||||
return False;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (haveSelf)
|
||||
*info= included;
|
||||
else {
|
||||
MergeIncludedCompatMaps(info,&included,newMerge);
|
||||
ClearCompatInfo(&included,xkb);
|
||||
}
|
||||
return (info->errorCount==0);
|
||||
}
|
||||
|
||||
static LookupEntry useModMapValues[] = {
|
||||
{ "levelone", 1 },
|
||||
{ "level1", 1 },
|
||||
{ "anylevel", 0 },
|
||||
{ "any", 0 },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static int
|
||||
SetInterpField( SymInterpInfo * si,
|
||||
XkbDescPtr xkb,
|
||||
char * field,
|
||||
ExprDef * arrayNdx,
|
||||
ExprDef * value,
|
||||
CompatInfo * info)
|
||||
{
|
||||
int ok= 1;
|
||||
ExprResult tmp;
|
||||
|
||||
if (uStrCaseCmp(field,"action")==0) {
|
||||
if (arrayNdx!=NULL)
|
||||
return ReportSINotArray(si,field,info);
|
||||
ok= HandleActionDef(value,xkb,&si->interp.act,si->defs.merge,info->act);
|
||||
if (ok)
|
||||
si->defs.defined|= _SI_Action;
|
||||
}
|
||||
else if ((uStrCaseCmp(field,"virtualmodifier")==0)||
|
||||
(uStrCaseCmp(field,"virtualmod")==0)) {
|
||||
if (arrayNdx!=NULL)
|
||||
return ReportSINotArray(si,field,info);
|
||||
ok= ResolveVirtualModifier(value,&tmp,&info->vmods);
|
||||
if (ok) {
|
||||
si->interp.virtual_mod= tmp.uval;
|
||||
si->defs.defined|= _SI_VirtualMod;
|
||||
}
|
||||
else return ReportSIBadType(si,field,"virtual modifier",info);
|
||||
}
|
||||
else if (uStrCaseCmp(field,"repeat")==0) {
|
||||
if (arrayNdx!=NULL)
|
||||
return ReportSINotArray(si,field,info);
|
||||
ok= ExprResolveBoolean(value,&tmp,NULL,NULL);
|
||||
if (ok) {
|
||||
if (tmp.uval) si->interp.flags|= XkbSI_AutoRepeat;
|
||||
else si->interp.flags&= ~XkbSI_AutoRepeat;
|
||||
si->defs.defined|= _SI_AutoRepeat;
|
||||
}
|
||||
else return ReportSIBadType(si,field,"boolean",info);
|
||||
}
|
||||
else if (uStrCaseCmp(field,"locking")==0) {
|
||||
if (arrayNdx!=NULL)
|
||||
return ReportSINotArray(si,field,info);
|
||||
ok= ExprResolveBoolean(value,&tmp,NULL,NULL);
|
||||
if (ok) {
|
||||
if (tmp.uval) si->interp.flags|= XkbSI_LockingKey;
|
||||
else si->interp.flags&= ~XkbSI_LockingKey;
|
||||
si->defs.defined|= _SI_LockingKey;
|
||||
}
|
||||
else return ReportSIBadType(si,field,"boolean",info);
|
||||
}
|
||||
else if ((uStrCaseCmp(field,"usemodmap")==0)||
|
||||
(uStrCaseCmp(field,"usemodmapmods")==0)) {
|
||||
if (arrayNdx!=NULL)
|
||||
return ReportSINotArray(si,field,info);
|
||||
ok= ExprResolveEnum(value,&tmp,useModMapValues);
|
||||
if (ok) {
|
||||
if (tmp.uval) si->interp.match|= XkbSI_LevelOneOnly;
|
||||
else si->interp.match&= ~XkbSI_LevelOneOnly;
|
||||
si->defs.defined|= _SI_LevelOneOnly;
|
||||
}
|
||||
else return ReportSIBadType(si,field,"level specification",info);
|
||||
}
|
||||
else {
|
||||
ok= ReportBadField("symbol interpretation",field,siText(si,info));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
LookupEntry groupNames[]= {
|
||||
{ "group1", 0x01 },
|
||||
{ "group2", 0x02 },
|
||||
{ "group3", 0x04 },
|
||||
{ "group4", 0x08 },
|
||||
{ "group5", 0x10 },
|
||||
{ "group6", 0x20 },
|
||||
{ "group7", 0x40 },
|
||||
{ "group8", 0x80 },
|
||||
{ "none", 0x00 },
|
||||
{ "all", 0xff },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static int
|
||||
HandleInterpVar(VarDef *stmt,XkbDescPtr xkb,CompatInfo *info)
|
||||
{
|
||||
ExprResult elem,field;
|
||||
ExprDef * ndx;
|
||||
|
||||
if (ExprResolveLhs(stmt->name,&elem,&field,&ndx)==0)
|
||||
return 0; /* internal error, already reported */
|
||||
if (elem.str&&(uStrCaseCmp(elem.str,"interpret")==0))
|
||||
return SetInterpField(&info->dflt,xkb,field.str,ndx,stmt->value,info);
|
||||
if (elem.str&&(uStrCaseCmp(elem.str,"indicator")==0)) {
|
||||
return SetIndicatorMapField(&info->ledDflt,xkb,field.str,ndx,
|
||||
stmt->value);
|
||||
}
|
||||
return SetActionField(xkb,elem.str,field.str,ndx,stmt->value,&info->act);
|
||||
}
|
||||
|
||||
static int
|
||||
HandleInterpBody(VarDef *def,XkbDescPtr xkb,SymInterpInfo *si,CompatInfo *info)
|
||||
{
|
||||
int ok= 1;
|
||||
ExprResult tmp,field;
|
||||
ExprDef * arrayNdx;
|
||||
|
||||
for (;def!=NULL;def= (VarDef *)def->common.next) {
|
||||
if ((def->name)&&(def->name->type==ExprFieldRef)) {
|
||||
ok= HandleInterpVar(def,xkb,info);
|
||||
continue;
|
||||
}
|
||||
ok= ExprResolveLhs(def->name,&tmp,&field,&arrayNdx);
|
||||
if (ok)
|
||||
ok= SetInterpField(si,xkb,field.str,arrayNdx,def->value,info);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
static int
|
||||
HandleInterpDef(InterpDef *def,XkbDescPtr xkb,unsigned merge,CompatInfo *info)
|
||||
{
|
||||
unsigned pred,mods;
|
||||
SymInterpInfo si;
|
||||
|
||||
if (!ResolveStateAndPredicate(def->match,&pred,&mods,info)) {
|
||||
ERROR("Couldn't determine matching modifiers\n");
|
||||
ACTION("Symbol interpretation ignored\n");
|
||||
return False;
|
||||
}
|
||||
if (def->merge!=MergeDefault)
|
||||
merge= def->merge;
|
||||
|
||||
si= info->dflt;
|
||||
si.defs.merge= merge;
|
||||
si.interp.sym= def->sym;
|
||||
si.interp.match= (si.interp.match&(~XkbSI_OpMask))|(pred&XkbSI_OpMask);
|
||||
si.interp.mods= mods;
|
||||
if (!HandleInterpBody(def->def,xkb,&si,info)) {
|
||||
info->errorCount++;
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!AddInterp(info,&si)) {
|
||||
info->errorCount++;
|
||||
return False;
|
||||
}
|
||||
return True;
|
||||
}
|
||||
|
||||
static int
|
||||
HandleGroupCompatDef( GroupCompatDef * def,
|
||||
XkbDescPtr xkb,
|
||||
unsigned merge,
|
||||
CompatInfo * info)
|
||||
{
|
||||
ExprResult val;
|
||||
GroupCompatInfo tmp;
|
||||
|
||||
if (def->merge!=MergeDefault)
|
||||
merge= def->merge;
|
||||
if (!XkbIsLegalGroup(def->group-1)) {
|
||||
ERROR1("Keyboard group must be in the range 1..%d\n",XkbNumKbdGroups+1);
|
||||
ACTION1("Compatibility map for illegal group %d ignored\n",def->group);
|
||||
return False;
|
||||
}
|
||||
tmp.fileID= info->fileID;
|
||||
tmp.merge= merge;
|
||||
if (!ExprResolveModMask(def->def,&val,LookupVModMask,(XPointer)xkb)) {
|
||||
ERROR("Expected a modifier mask in group compatibility definition\n");
|
||||
ACTION1("Ignoring illegal compatibility map for group %d\n",def->group);
|
||||
return False;
|
||||
}
|
||||
tmp.real_mods= val.uval&0xff;
|
||||
tmp.vmods= (val.uval>>8)&0xffff;
|
||||
return AddGroupCompat(info,def->group-1,&tmp);
|
||||
}
|
||||
|
||||
static void
|
||||
HandleCompatMapFile( XkbFile * file,
|
||||
XkbDescPtr xkb,
|
||||
unsigned merge,
|
||||
CompatInfo * info)
|
||||
{
|
||||
ParseCommon *stmt;
|
||||
|
||||
if (merge==MergeDefault)
|
||||
merge= MergeAugment;
|
||||
info->name= uStringDup(file->name);
|
||||
stmt= file->defs;
|
||||
while (stmt) {
|
||||
switch (stmt->stmtType) {
|
||||
case StmtInclude:
|
||||
if (!HandleIncludeCompatMap((IncludeStmt *)stmt,xkb,info,
|
||||
HandleCompatMapFile))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtInterpDef:
|
||||
if (!HandleInterpDef((InterpDef *)stmt,xkb,merge,info))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtGroupCompatDef:
|
||||
if (!HandleGroupCompatDef((GroupCompatDef*)stmt,xkb,merge,info))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtIndicatorMapDef:
|
||||
{
|
||||
LEDInfo *rtrn;
|
||||
rtrn= HandleIndicatorMapDef((IndicatorMapDef *)stmt,xkb,
|
||||
&info->ledDflt,info->leds,
|
||||
merge);
|
||||
if (rtrn!=NULL)
|
||||
info->leds= rtrn;
|
||||
else info->errorCount++;
|
||||
}
|
||||
break;
|
||||
case StmtVarDef:
|
||||
if (!HandleInterpVar((VarDef *)stmt,xkb,info))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtVModDef:
|
||||
if (!HandleVModDef((VModDef *)stmt,merge,&info->vmods))
|
||||
info->errorCount++;
|
||||
break;
|
||||
case StmtKeycodeDef:
|
||||
ERROR("Interpretation files may not include other types\n");
|
||||
ACTION("Ignoring definition of key name\n");
|
||||
info->errorCount++;
|
||||
break;
|
||||
default:
|
||||
WSGO1("Unexpected statement type %d in HandleCompatMapFile\n",
|
||||
stmt->stmtType);
|
||||
break;
|
||||
}
|
||||
stmt= stmt->next;
|
||||
if (info->errorCount>10) {
|
||||
#ifdef NOISY
|
||||
ERROR("Too many errors\n");
|
||||
#endif
|
||||
ACTION1("Abandoning compatibility map \"%s\"\n",file->topName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
CopyInterps( CompatInfo * info,
|
||||
XkbCompatMapPtr compat,
|
||||
Bool needSymbol,
|
||||
unsigned pred)
|
||||
{
|
||||
SymInterpInfo * si;
|
||||
|
||||
for (si=info->interps;si;si=(SymInterpInfo *)si->defs.next) {
|
||||
if (((si->interp.match&XkbSI_OpMask)!=pred)||
|
||||
(needSymbol&&(si->interp.sym==NoSymbol))||
|
||||
((!needSymbol)&&(si->interp.sym!=NoSymbol)))
|
||||
continue;
|
||||
if (compat->num_si>=compat->size_si) {
|
||||
WSGO("No room to merge symbol interpretations\n");
|
||||
ACTION("Symbol interpretations lost\n");
|
||||
return;
|
||||
}
|
||||
compat->sym_interpret[compat->num_si++]= si->interp;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Bool
|
||||
CompileCompatMap( XkbFile * file,
|
||||
XkbFileInfo * result,
|
||||
unsigned merge,
|
||||
LEDInfo ** unboundLEDs)
|
||||
{
|
||||
int i;
|
||||
CompatInfo info;
|
||||
XkbDescPtr xkb;
|
||||
GroupCompatInfo * gcm;
|
||||
|
||||
xkb= result->xkb;
|
||||
InitCompatInfo(&info,xkb);
|
||||
info.dflt.defs.merge= merge;
|
||||
info.ledDflt.defs.merge= merge;
|
||||
HandleCompatMapFile(file,xkb,merge,&info);
|
||||
|
||||
if (info.errorCount==0) {
|
||||
int size;
|
||||
if (XkbAllocCompatMap(xkb,XkbAllCompatMask,info.nInterps)!=Success) {
|
||||
WSGO("Couldn't allocate compatibility map\n");
|
||||
ACTION("Exiting\n");
|
||||
return False;
|
||||
}
|
||||
if (info.name!=NULL) {
|
||||
if (XkbAllocNames(xkb,XkbCompatNameMask,0,0)==Success)
|
||||
xkb->names->compat= XkbInternAtom(xkb->dpy,info.name,False);
|
||||
else {
|
||||
WSGO("Couldn't allocate space for compat name\n");
|
||||
ACTION2("Name \"%s\" (from %s) NOT assigned\n",scanFile,
|
||||
info.name);
|
||||
}
|
||||
}
|
||||
size= info.nInterps*sizeof(XkbSymInterpretRec);
|
||||
if (size>0) {
|
||||
CopyInterps(&info,xkb->compat,True,XkbSI_Exactly);
|
||||
CopyInterps(&info,xkb->compat,True,XkbSI_AllOf|XkbSI_NoneOf);
|
||||
CopyInterps(&info,xkb->compat,True,XkbSI_AnyOf);
|
||||
CopyInterps(&info,xkb->compat,True,XkbSI_AnyOfOrNone);
|
||||
CopyInterps(&info,xkb->compat,False,XkbSI_Exactly);
|
||||
CopyInterps(&info,xkb->compat,False,XkbSI_AllOf|XkbSI_NoneOf);
|
||||
CopyInterps(&info,xkb->compat,False,XkbSI_AnyOf);
|
||||
CopyInterps(&info,xkb->compat,False,XkbSI_AnyOfOrNone);
|
||||
}
|
||||
for (i=0,gcm=&info.groupCompat[0];i<XkbNumKbdGroups;i++,gcm++) {
|
||||
if ((gcm->fileID!=0)||(gcm->real_mods!=0)||(gcm->vmods!=0)) {
|
||||
xkb->compat->groups[i].mask= gcm->real_mods;
|
||||
xkb->compat->groups[i].real_mods= gcm->real_mods;
|
||||
xkb->compat->groups[i].vmods= gcm->vmods;
|
||||
}
|
||||
}
|
||||
if (info.leds!=NULL) {
|
||||
if (!CopyIndicatorMapDefs(result,info.leds,unboundLEDs))
|
||||
info.errorCount++;
|
||||
info.leds= NULL;
|
||||
}
|
||||
ClearCompatInfo(&info,xkb);
|
||||
return True;
|
||||
}
|
||||
if (info.interps!=NULL)
|
||||
uFree(info.interps);
|
||||
return False;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,43 @@
|
|||
|
||||
dnl Copyright 2005 Red Hat, Inc.
|
||||
dnl
|
||||
dnl Permission to use, copy, modify, distribute, and sell this software and its
|
||||
dnl documentation for any purpose is hereby granted without fee, provided that
|
||||
dnl the above copyright notice appear in all copies and that both that
|
||||
dnl copyright notice and this permission notice appear in supporting
|
||||
dnl documentation, and that the name of Red Hat not be used in
|
||||
dnl advertising or publicity pertaining to distribution of the software without
|
||||
dnl specific, written prior permission. Red Hat makes no
|
||||
dnl representations about the suitability of this software for any purpose. It
|
||||
dnl is provided "as is" without express or implied warranty.
|
||||
dnl
|
||||
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
dnl PERFORMANCE OF THIS SOFTWARE.
|
||||
dnl
|
||||
dnl Process this file with autoconf to create configure.
|
||||
|
||||
AC_PREREQ([2.57])
|
||||
AC_INIT(xkbcomp,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xkbcomp)
|
||||
AM_INIT_AUTOMAKE([dist-bzip2])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_YACC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
# Checks for pkg-config packages
|
||||
PKG_CHECK_MODULES(XKBCOMP, x11 xkbfile)
|
||||
AC_SUBST(XKBCOMP_CFLAGS)
|
||||
AC_SUBST(XKBCOMP_LIBS)
|
||||
|
||||
XORG_MANPAGE_SECTIONS
|
||||
XORG_RELEASE_VERSION
|
||||
|
||||
AC_OUTPUT([Makefile])
|
|
@ -0,0 +1,530 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2005-07-09.11
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mecanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,976 @@
|
|||
/* $XdotOrg: app/xkbcomp/expr.c,v 1.2 2004/04/23 19:54:50 eich Exp $ */
|
||||
/* $Xorg: expr.c,v 1.5 2000/08/17 19:54:30 cpqbld Exp $ */
|
||||
/************************************************************
|
||||
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this
|
||||
software and its documentation for any purpose and without
|
||||
fee is hereby granted, provided that the above copyright
|
||||
notice appear in all copies and that both that copyright
|
||||
notice and this permission notice appear in supporting
|
||||
documentation, and that the name of Silicon Graphics not be
|
||||
used in advertising or publicity pertaining to distribution
|
||||
of the software without specific prior written permission.
|
||||
Silicon Graphics makes no representation about the suitability
|
||||
of this software for any purpose. It is provided "as is"
|
||||
without any express or implied warranty.
|
||||
|
||||
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
||||
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
********************************************************/
|
||||
/* $XFree86: xc/programs/xkbcomp/expr.c,v 3.7 2003/08/06 14:04:05 eich Exp $ */
|
||||
|
||||
#include "xkbcomp.h"
|
||||
#include "tokens.h"
|
||||
#include "expr.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
char *
|
||||
exprOpText(unsigned type)
|
||||
{
|
||||
static char buf[32];
|
||||
|
||||
switch (type) {
|
||||
case ExprValue:
|
||||
strcpy(buf,"literal");
|
||||
break;
|
||||
case ExprIdent:
|
||||
strcpy(buf,"identifier");
|
||||
break;
|
||||
case ExprActionDecl:
|
||||
strcpy(buf,"action declaration");
|
||||
break;
|
||||
case ExprFieldRef:
|
||||
strcpy(buf,"field reference");
|
||||
break;
|
||||
case ExprArrayRef:
|
||||
strcpy(buf,"array reference");
|
||||
break;
|
||||
case ExprKeysymList:
|
||||
strcpy(buf,"list of keysyms");
|
||||
break;
|
||||
case ExprActionList:
|
||||
strcpy(buf,"list of actions");
|
||||
break;
|
||||
case OpAdd:
|
||||
strcpy(buf,"addition");
|
||||
break;
|
||||
case OpSubtract:
|
||||
strcpy(buf,"subtraction");
|
||||
break;
|
||||
case OpMultiply:
|
||||
strcpy(buf,"multiplication");
|
||||
break;
|
||||
case OpDivide:
|
||||
strcpy(buf,"division");
|
||||
break;
|
||||
case OpAssign:
|
||||
strcpy(buf,"assignment");
|
||||
break;
|
||||
case OpNot:
|
||||
strcpy(buf,"logical not");
|
||||
break;
|
||||
case OpNegate:
|
||||
strcpy(buf,"arithmetic negation");
|
||||
break;
|
||||
case OpInvert:
|
||||
strcpy(buf,"bitwise inversion");
|
||||
break;
|
||||
case OpUnaryPlus:
|
||||
strcpy(buf,"plus sign");
|
||||
break;
|
||||
default:
|
||||
sprintf(buf,"illegal(%d)",type);
|
||||
break;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *
|
||||
exprTypeText(unsigned type)
|
||||
{
|
||||
static char buf[20];
|
||||
|
||||
switch (type) {
|
||||
case TypeUnknown:
|
||||
strcpy(buf,"unknown");
|
||||
break;
|
||||
case TypeBoolean:
|
||||
strcpy(buf,"boolean");
|
||||
break;
|
||||
case TypeInt:
|
||||
strcpy(buf,"int");
|
||||
break;
|
||||
case TypeString:
|
||||
strcpy(buf,"string");
|
||||
break;
|
||||
case TypeAction:
|
||||
strcpy(buf,"action");
|
||||
break;
|
||||
case TypeKeyName:
|
||||
strcpy(buf,"keyname");
|
||||
break;
|
||||
default:
|
||||
sprintf(buf,"illegal(%d)",type);
|
||||
break;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveLhs( ExprDef * expr,
|
||||
ExprResult * elem_rtrn,
|
||||
ExprResult * field_rtrn,
|
||||
ExprDef ** index_rtrn)
|
||||
{
|
||||
switch (expr->op) {
|
||||
case ExprIdent:
|
||||
elem_rtrn->str= NULL;
|
||||
field_rtrn->str= XkbAtomGetString(NULL,expr->value.str);
|
||||
*index_rtrn= NULL;
|
||||
return True;
|
||||
case ExprFieldRef:
|
||||
elem_rtrn->str= XkbAtomGetString(NULL,expr->value.field.element);
|
||||
field_rtrn->str= XkbAtomGetString(NULL,expr->value.field.field);
|
||||
*index_rtrn= NULL;
|
||||
return True;
|
||||
case ExprArrayRef:
|
||||
elem_rtrn->str= XkbAtomGetString(NULL,expr->value.array.element);
|
||||
field_rtrn->str= XkbAtomGetString(NULL,expr->value.array.field);
|
||||
*index_rtrn= expr->value.array.entry;
|
||||
return True;
|
||||
}
|
||||
WSGO1("Unexpected operator %d in ResolveLhs\n",expr->op);
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool
|
||||
SimpleLookup( XPointer priv,
|
||||
Atom elem,
|
||||
Atom field,
|
||||
unsigned type,
|
||||
ExprResult * val_rtrn)
|
||||
{
|
||||
LookupEntry * entry;
|
||||
register char * str;
|
||||
|
||||
if ((priv==NULL)||
|
||||
(field==None)||(elem!=None)||
|
||||
((type!=TypeInt)&&(type!=TypeFloat))) {
|
||||
return False;
|
||||
}
|
||||
str= XkbAtomGetString(NULL,field);
|
||||
for (entry=(LookupEntry *)priv;(entry!=NULL)&&(entry->name!=NULL);entry++) {
|
||||
if (uStrCaseCmp(str,entry->name)==0) {
|
||||
val_rtrn->uval= entry->result;
|
||||
if (type==TypeFloat)
|
||||
val_rtrn->uval*= XkbGeomPtsPerMM;
|
||||
return True;
|
||||
}
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
Bool
|
||||
RadioLookup( XPointer priv,
|
||||
Atom elem,
|
||||
Atom field,
|
||||
unsigned type,
|
||||
ExprResult * val_rtrn)
|
||||
{
|
||||
register char * str;
|
||||
int rg;
|
||||
|
||||
if ((field==None)||(elem!=None)||(type!=TypeInt))
|
||||
return False;
|
||||
str= XkbAtomGetString(NULL,field);
|
||||
if (str) {
|
||||
if (uStrCasePrefix("group",str))
|
||||
str+= strlen("group");
|
||||
else if (uStrCasePrefix("radiogroup",str))
|
||||
str+= strlen("radiogroup");
|
||||
else if (uStrCasePrefix("rg",str))
|
||||
str+= strlen("rg");
|
||||
else if (!isdigit(str[0]))
|
||||
str= NULL;
|
||||
}
|
||||
if ((!str)||(sscanf(str,"%i",&rg)<1)||(rg<1)||(rg>XkbMaxRadioGroups))
|
||||
return False;
|
||||
val_rtrn->uval= rg;
|
||||
return True;
|
||||
}
|
||||
|
||||
int
|
||||
TableLookup( XPointer priv,
|
||||
Atom elem,
|
||||
Atom field,
|
||||
unsigned type,
|
||||
ExprResult * val_rtrn)
|
||||
{
|
||||
LookupTable * tbl= (LookupTable *)priv;
|
||||
register char * str;
|
||||
|
||||
if ((priv==NULL)||(field==None)||(type!=TypeInt))
|
||||
return False;
|
||||
str= XkbAtomGetString(NULL,elem);
|
||||
while (tbl) {
|
||||
if (((str==NULL)&&(tbl->element==NULL))||
|
||||
((str!=NULL)&&(tbl->element!=NULL)&&
|
||||
(uStrCaseCmp(str,tbl->element)==0))) {
|
||||
break;
|
||||
}
|
||||
tbl= tbl->nextElement;
|
||||
}
|
||||
if (tbl==NULL) /* didn't find a matching element */
|
||||
return False;
|
||||
priv= (XPointer)tbl->entries;
|
||||
return SimpleLookup(priv,(Atom)None,field,type,val_rtrn);
|
||||
}
|
||||
|
||||
static LookupEntry modIndexNames[] = {
|
||||
{ "shift", ShiftMapIndex },
|
||||
{ "control", ControlMapIndex },
|
||||
{ "lock", LockMapIndex },
|
||||
{ "mod1", Mod1MapIndex },
|
||||
{ "mod2", Mod2MapIndex },
|
||||
{ "mod3", Mod3MapIndex },
|
||||
{ "mod4", Mod4MapIndex },
|
||||
{ "mod5", Mod5MapIndex },
|
||||
{ "none", XkbNoModifier },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
int
|
||||
LookupModIndex( XPointer priv,
|
||||
Atom elem,
|
||||
Atom field,
|
||||
unsigned type,
|
||||
ExprResult * val_rtrn)
|
||||
{
|
||||
return SimpleLookup((XPointer)modIndexNames,elem,field,type,val_rtrn);
|
||||
}
|
||||
|
||||
int
|
||||
LookupModMask( XPointer priv,
|
||||
Atom elem,
|
||||
Atom field,
|
||||
unsigned type,
|
||||
ExprResult * val_rtrn)
|
||||
{
|
||||
char *str;
|
||||
|
||||
if ((elem!=None)||(type!=TypeInt))
|
||||
return False;
|
||||
str= XkbAtomGetString(NULL,field);
|
||||
if (str==NULL)
|
||||
return False;
|
||||
if (uStrCaseCmp(str,"all")==0)
|
||||
val_rtrn->uval= 0xff;
|
||||
else if (uStrCaseCmp(str,"none")==0)
|
||||
val_rtrn->uval= 0;
|
||||
else if (LookupModIndex(priv,elem,field,type,val_rtrn))
|
||||
val_rtrn->uval= (1<<val_rtrn->uval);
|
||||
else if (priv != NULL) {
|
||||
LookupPriv *lpriv= (LookupPriv *)priv;
|
||||
if ((lpriv->chain==NULL)||
|
||||
(!(*lpriv->chain)(lpriv->chainPriv,elem,field,type,val_rtrn)))
|
||||
return False;
|
||||
}
|
||||
else return False;
|
||||
return True;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveModIndex( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
char *bogus= NULL;
|
||||
|
||||
switch (expr->op) {
|
||||
case ExprValue:
|
||||
if (expr->type!=TypeInt) {
|
||||
ERROR1("Found constant of type %s where a modifier mask was expected\n",
|
||||
exprTypeText(expr->type));
|
||||
return False;
|
||||
}
|
||||
else if ((expr->value.ival>=XkbNumModifiers)||(expr->value.ival<0)){
|
||||
ERROR2("Illegal modifier index (%d, must be 0..%d)\n",
|
||||
expr->value.ival,XkbNumModifiers-1);
|
||||
return False;
|
||||
}
|
||||
val_rtrn->ival= expr->value.ival;
|
||||
return True;
|
||||
case ExprIdent:
|
||||
if (LookupModIndex(lookupPriv,(Atom)None,expr->value.str,
|
||||
(unsigned)TypeInt,val_rtrn)) {
|
||||
return True;
|
||||
}
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
None,expr->value.str,
|
||||
TypeInt,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR1("Cannot determine modifier index for \"%s\"\n",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
break;
|
||||
case ExprFieldRef:
|
||||
bogus= "field reference";
|
||||
break;
|
||||
case ExprArrayRef:
|
||||
bogus= "array reference";
|
||||
break;
|
||||
case ExprActionDecl:
|
||||
bogus= "function";
|
||||
break;
|
||||
case OpAdd:
|
||||
case OpSubtract:
|
||||
case OpMultiply:
|
||||
case OpDivide:
|
||||
case OpInvert:
|
||||
case OpNegate:
|
||||
case OpNot:
|
||||
case OpUnaryPlus:
|
||||
bogus= "arithmetic operations";
|
||||
break;
|
||||
case OpAssign:
|
||||
bogus= "assignment";
|
||||
break;
|
||||
default:
|
||||
WSGO1("Unknown operator %d in ResolveModIndex\n",expr->op);
|
||||
return False;
|
||||
}
|
||||
if (bogus) {
|
||||
ERROR1("Modifier index must be a name or number, %s ignored\n",bogus);
|
||||
return False;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveModMask( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
LookupPriv priv;
|
||||
|
||||
priv.priv= NULL;
|
||||
priv.chain= lookup;
|
||||
priv.chainPriv= lookupPriv;
|
||||
return ExprResolveMask(expr,val_rtrn,LookupModMask,(XPointer)&priv);
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveBoolean( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
char * bogus= NULL;
|
||||
|
||||
switch (expr->op) {
|
||||
case ExprValue:
|
||||
if (expr->type!=TypeBoolean) {
|
||||
ERROR1("Found constant of type %s where boolean was expected\n",
|
||||
exprTypeText(expr->type));
|
||||
return False;
|
||||
}
|
||||
val_rtrn->ival= expr->value.ival;
|
||||
return True;
|
||||
case ExprIdent:
|
||||
bogus= XkbAtomGetString(NULL,expr->value.str);
|
||||
if (bogus) {
|
||||
if ((uStrCaseCmp(bogus,"true")==0)||
|
||||
(uStrCaseCmp(bogus,"yes")==0)||
|
||||
(uStrCaseCmp(bogus,"on")==0)) {
|
||||
val_rtrn->uval= 1;
|
||||
return True;
|
||||
}
|
||||
else if ((uStrCaseCmp(bogus,"false")==0)||
|
||||
(uStrCaseCmp(bogus,"no")==0)||
|
||||
(uStrCaseCmp(bogus,"off")==0)) {
|
||||
val_rtrn->uval= 0;
|
||||
return True;
|
||||
}
|
||||
}
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
None,expr->value.str,
|
||||
TypeBoolean,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR1("Identifier \"%s\" of type int is unknown\n",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
return ok;
|
||||
case ExprFieldRef:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
expr->value.field.element,expr->value.field.field,
|
||||
TypeBoolean,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR2("Default \"%s.%s\" of type boolean is unknown\n",
|
||||
XkbAtomText(NULL,expr->value.field.element,XkbMessage),
|
||||
XkbAtomText(NULL,expr->value.field.field,XkbMessage));
|
||||
return ok;
|
||||
case OpInvert:
|
||||
case OpNot:
|
||||
ok= ExprResolveBoolean(expr,val_rtrn,lookup,lookupPriv);
|
||||
if (ok)
|
||||
val_rtrn->uval= !val_rtrn->uval;
|
||||
return ok;
|
||||
case OpAdd: if (bogus==NULL) bogus= "Addition";
|
||||
case OpSubtract: if (bogus==NULL) bogus= "Subtraction";
|
||||
case OpMultiply: if (bogus==NULL) bogus= "Multiplication";
|
||||
case OpDivide: if (bogus==NULL) bogus= "Division";
|
||||
case OpAssign: if (bogus==NULL) bogus= "Assignment";
|
||||
case OpNegate: if (bogus==NULL) bogus= "Negation";
|
||||
ERROR1("%s of boolean values not permitted\n",bogus);
|
||||
break;
|
||||
case OpUnaryPlus:
|
||||
ERROR("Unary \"+\" operator not permitted for boolean values\n");
|
||||
break;
|
||||
default:
|
||||
WSGO1("Unknown operator %d in ResolveBoolean\n",expr->op);
|
||||
break;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveFloat( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
ExprResult leftRtrn,rightRtrn;
|
||||
ExprDef *left,*right;
|
||||
|
||||
switch (expr->op) {
|
||||
case ExprValue:
|
||||
if (expr->type==TypeString) {
|
||||
register char *str;
|
||||
str= XkbAtomGetString(NULL,expr->value.str);
|
||||
if ((str!=None)&&(strlen(str)==1)) {
|
||||
val_rtrn->uval= str[0]*XkbGeomPtsPerMM;
|
||||
return True;
|
||||
}
|
||||
}
|
||||
if ((expr->type!=TypeInt)&&(expr->type!=TypeFloat)) {
|
||||
ERROR1("Found constant of type %s, expected a number\n",
|
||||
exprTypeText(expr->type));
|
||||
return False;
|
||||
}
|
||||
val_rtrn->ival= expr->value.ival;
|
||||
if (expr->type==TypeInt)
|
||||
val_rtrn->ival*= XkbGeomPtsPerMM;
|
||||
return True;
|
||||
case ExprIdent:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
None,expr->value.str,
|
||||
TypeFloat,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR1("Numeric identifier \"%s\" unknown\n",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
return ok;
|
||||
case ExprFieldRef:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
expr->value.field.element,expr->value.field.field,
|
||||
TypeFloat,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR2("Numeric default \"%s.%s\" unknown\n",
|
||||
XkbAtomText(NULL,expr->value.field.element,XkbMessage),
|
||||
XkbAtomText(NULL,expr->value.field.field,XkbMessage));
|
||||
return ok;
|
||||
case OpAdd:
|
||||
case OpSubtract:
|
||||
case OpMultiply:
|
||||
case OpDivide:
|
||||
left= expr->value.binary.left;
|
||||
right= expr->value.binary.right;
|
||||
if (ExprResolveFloat(left,&leftRtrn,lookup,lookupPriv)&&
|
||||
ExprResolveFloat(right,&rightRtrn,lookup,lookupPriv)) {
|
||||
switch (expr->op) {
|
||||
case OpAdd:
|
||||
val_rtrn->ival= leftRtrn.ival+rightRtrn.ival;
|
||||
break;
|
||||
case OpSubtract:
|
||||
val_rtrn->ival= leftRtrn.ival-rightRtrn.ival;
|
||||
break;
|
||||
case OpMultiply:
|
||||
val_rtrn->ival= leftRtrn.ival*rightRtrn.ival;
|
||||
break;
|
||||
case OpDivide:
|
||||
val_rtrn->ival= leftRtrn.ival/rightRtrn.ival;
|
||||
break;
|
||||
}
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
case OpAssign:
|
||||
WSGO("Assignment operator not implemented yet\n");
|
||||
break;
|
||||
case OpNot:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveFloat(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
ERROR("The ! operator cannot be applied to a number\n");
|
||||
}
|
||||
return False;
|
||||
case OpInvert:
|
||||
case OpNegate:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveFloat(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
if (expr->op==OpNegate)
|
||||
val_rtrn->ival= -leftRtrn.ival;
|
||||
else val_rtrn->ival= ~leftRtrn.ival;
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
case OpUnaryPlus:
|
||||
left= expr->value.child;
|
||||
return ExprResolveFloat(left,val_rtrn,lookup,lookupPriv);
|
||||
default:
|
||||
WSGO1("Unknown operator %d in ResolveFloat\n",expr->op);
|
||||
break;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveInteger( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
ExprResult leftRtrn,rightRtrn;
|
||||
ExprDef *left,*right;
|
||||
|
||||
switch (expr->op) {
|
||||
case ExprValue:
|
||||
if (expr->type==TypeString) {
|
||||
register char *str;
|
||||
str= XkbAtomGetString(NULL,expr->value.str);
|
||||
if (str!=None)
|
||||
switch (strlen(str)) {
|
||||
case 0:
|
||||
val_rtrn->uval= 0;
|
||||
return True;
|
||||
case 1:
|
||||
val_rtrn->uval= str[0];
|
||||
return True;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((expr->type!=TypeInt)&&(expr->type!=TypeFloat)) {
|
||||
ERROR1("Found constant of type %s where an int was expected\n",
|
||||
exprTypeText(expr->type));
|
||||
return False;
|
||||
}
|
||||
val_rtrn->ival= expr->value.ival;
|
||||
if (expr->type==TypeFloat)
|
||||
val_rtrn->ival/= XkbGeomPtsPerMM;
|
||||
return True;
|
||||
case ExprIdent:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
None,expr->value.str,
|
||||
TypeInt,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR1("Identifier \"%s\" of type int is unknown\n",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
return ok;
|
||||
case ExprFieldRef:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
expr->value.field.element,expr->value.field.field,
|
||||
TypeInt,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR2("Default \"%s.%s\" of type int is unknown\n",
|
||||
XkbAtomText(NULL,expr->value.field.element,XkbMessage),
|
||||
XkbAtomText(NULL,expr->value.field.field,XkbMessage));
|
||||
return ok;
|
||||
case OpAdd:
|
||||
case OpSubtract:
|
||||
case OpMultiply:
|
||||
case OpDivide:
|
||||
left= expr->value.binary.left;
|
||||
right= expr->value.binary.right;
|
||||
if (ExprResolveInteger(left,&leftRtrn,lookup,lookupPriv)&&
|
||||
ExprResolveInteger(right,&rightRtrn,lookup,lookupPriv)) {
|
||||
switch (expr->op) {
|
||||
case OpAdd:
|
||||
val_rtrn->ival= leftRtrn.ival+rightRtrn.ival;
|
||||
break;
|
||||
case OpSubtract:
|
||||
val_rtrn->ival= leftRtrn.ival-rightRtrn.ival;
|
||||
break;
|
||||
case OpMultiply:
|
||||
val_rtrn->ival= leftRtrn.ival*rightRtrn.ival;
|
||||
break;
|
||||
case OpDivide:
|
||||
val_rtrn->ival= leftRtrn.ival/rightRtrn.ival;
|
||||
break;
|
||||
}
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
case OpAssign:
|
||||
WSGO("Assignment operator not implemented yet\n");
|
||||
break;
|
||||
case OpNot:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveInteger(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
ERROR("The ! operator cannot be applied to an integer\n");
|
||||
}
|
||||
return False;
|
||||
case OpInvert:
|
||||
case OpNegate:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveInteger(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
if (expr->op==OpNegate)
|
||||
val_rtrn->ival= -leftRtrn.ival;
|
||||
else val_rtrn->ival= ~leftRtrn.ival;
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
case OpUnaryPlus:
|
||||
left= expr->value.child;
|
||||
return ExprResolveInteger(left,val_rtrn,lookup,lookupPriv);
|
||||
default:
|
||||
WSGO1("Unknown operator %d in ResolveInteger\n",expr->op);
|
||||
break;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveString( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
ExprResult leftRtrn,rightRtrn;
|
||||
ExprDef * left;
|
||||
ExprDef * right;
|
||||
char * bogus= NULL;
|
||||
|
||||
switch (expr->op) {
|
||||
case ExprValue:
|
||||
if (expr->type!=TypeString) {
|
||||
ERROR1("Found constant of type %s, expected a string\n",
|
||||
exprTypeText(expr->type));
|
||||
return False;
|
||||
}
|
||||
val_rtrn->str= XkbAtomGetString(NULL,expr->value.str);
|
||||
if (val_rtrn->str==NULL) {
|
||||
static char *empty= "";
|
||||
val_rtrn->str= empty;
|
||||
}
|
||||
return True;
|
||||
case ExprIdent:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
None,expr->value.str,
|
||||
TypeString,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR1("Identifier \"%s\" of type string not found\n",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
return ok;
|
||||
case ExprFieldRef:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
expr->value.field.element,expr->value.field.field,
|
||||
TypeString,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR2("Default \"%s.%s\" of type string not found\n",
|
||||
XkbAtomText(NULL,expr->value.field.element,XkbMessage),
|
||||
XkbAtomText(NULL,expr->value.field.field,XkbMessage));
|
||||
return ok;
|
||||
case OpAdd:
|
||||
left= expr->value.binary.left;
|
||||
right= expr->value.binary.right;
|
||||
if (ExprResolveString(left,&leftRtrn,lookup,lookupPriv)&&
|
||||
ExprResolveString(right,&rightRtrn,lookup,lookupPriv)) {
|
||||
int len;
|
||||
char *new;
|
||||
len= strlen(leftRtrn.str)+strlen(rightRtrn.str)+1;
|
||||
new= (char *)uAlloc(len);
|
||||
if (new) {
|
||||
sprintf(new,"%s%s",leftRtrn.str,rightRtrn.str);
|
||||
val_rtrn->str= new;
|
||||
return True;
|
||||
}
|
||||
}
|
||||
return False;
|
||||
case OpSubtract: if (bogus==NULL) bogus= "Subtraction";
|
||||
case OpMultiply: if (bogus==NULL) bogus= "Multiplication";
|
||||
case OpDivide: if (bogus==NULL) bogus= "Division";
|
||||
case OpAssign: if (bogus==NULL) bogus= "Assignment";
|
||||
case OpNegate: if (bogus==NULL) bogus= "Negation";
|
||||
case OpInvert: if (bogus==NULL) bogus= "Bitwise complement";
|
||||
ERROR1("%s of string values not permitted\n",bogus);
|
||||
return False;
|
||||
case OpNot:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveString(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
ERROR("The ! operator cannot be applied to a string\n");
|
||||
}
|
||||
return False;
|
||||
case OpUnaryPlus:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveString(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
ERROR("The + operator cannot be applied to a string\n");
|
||||
}
|
||||
return False;
|
||||
default:
|
||||
WSGO1("Unknown operator %d in ResolveString\n",expr->op);
|
||||
break;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveKeyName( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
ExprDef * left;
|
||||
ExprResult leftRtrn;
|
||||
char * bogus= NULL;
|
||||
|
||||
switch (expr->op) {
|
||||
case ExprValue:
|
||||
if (expr->type!=TypeKeyName) {
|
||||
ERROR1("Found constant of type %s, expected a key name\n",
|
||||
exprTypeText(expr->type));
|
||||
return False;
|
||||
}
|
||||
memcpy(val_rtrn->keyName.name,expr->value.keyName,XkbKeyNameLength);
|
||||
return True;
|
||||
case ExprIdent:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
None,expr->value.str,
|
||||
TypeString,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR1("Identifier \"%s\" of type string not found\n",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
return ok;
|
||||
case ExprFieldRef:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
expr->value.field.element,expr->value.field.field,
|
||||
TypeString,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR2("Default \"%s.%s\" of type key name not found\n",
|
||||
XkbAtomText(NULL,expr->value.field.element,XkbMessage),
|
||||
XkbAtomText(NULL,expr->value.field.field,XkbMessage));
|
||||
return ok;
|
||||
case OpAdd: if (bogus==NULL) bogus= "Addition";
|
||||
case OpSubtract: if (bogus==NULL) bogus= "Subtraction";
|
||||
case OpMultiply: if (bogus==NULL) bogus= "Multiplication";
|
||||
case OpDivide: if (bogus==NULL) bogus= "Division";
|
||||
case OpAssign: if (bogus==NULL) bogus= "Assignment";
|
||||
case OpNegate: if (bogus==NULL) bogus= "Negation";
|
||||
case OpInvert: if (bogus==NULL) bogus= "Bitwise complement";
|
||||
ERROR1("%s of key name values not permitted\n",bogus);
|
||||
return False;
|
||||
case OpNot:
|
||||
left= expr->value.binary.left;
|
||||
if (ExprResolveString(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
ERROR("The ! operator cannot be applied to a key name\n");
|
||||
}
|
||||
return False;
|
||||
case OpUnaryPlus:
|
||||
left= expr->value.binary.left;
|
||||
if (ExprResolveString(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
ERROR("The + operator cannot be applied to a key name\n");
|
||||
}
|
||||
return False;
|
||||
default:
|
||||
WSGO1("Unknown operator %d in ResolveKeyName\n",expr->op);
|
||||
break;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
/***====================================================================***/
|
||||
|
||||
int
|
||||
ExprResolveEnum(ExprDef *expr,ExprResult *val_rtrn,LookupEntry *values)
|
||||
{
|
||||
if (expr->op!=ExprIdent) {
|
||||
ERROR1("Found a %s where an enumerated value was expected\n",
|
||||
exprOpText(expr->op));
|
||||
return False;
|
||||
}
|
||||
if (!SimpleLookup((XPointer)values,(Atom)None,expr->value.str,
|
||||
(unsigned)TypeInt,val_rtrn)) {
|
||||
int nOut=0;
|
||||
ERROR1("Illegal identifier %s (expected one of: ",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
while (values && values->name) {
|
||||
if (nOut!=0) INFO1(", %s",values->name);
|
||||
else INFO1("%s",values->name);
|
||||
values++;
|
||||
nOut++;
|
||||
}
|
||||
INFO(")\n");
|
||||
return False;
|
||||
}
|
||||
return True;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveMask( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
ExprResult leftRtrn,rightRtrn;
|
||||
ExprDef *left,*right;
|
||||
char * bogus= NULL;
|
||||
|
||||
switch (expr->op) {
|
||||
case ExprValue:
|
||||
if (expr->type!=TypeInt) {
|
||||
ERROR1("Found constant of type %s where a mask was expected\n",
|
||||
exprTypeText(expr->type));
|
||||
return False;
|
||||
}
|
||||
val_rtrn->ival= expr->value.ival;
|
||||
return True;
|
||||
case ExprIdent:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
None,expr->value.str,
|
||||
TypeInt,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR1("Identifier \"%s\" of type int is unknown\n",
|
||||
XkbAtomText(NULL,expr->value.str,XkbMessage));
|
||||
return ok;
|
||||
case ExprFieldRef:
|
||||
if (lookup) {
|
||||
ok= (*lookup)(lookupPriv,
|
||||
expr->value.field.element,expr->value.field.field,
|
||||
TypeInt,val_rtrn);
|
||||
}
|
||||
if (!ok)
|
||||
ERROR2("Default \"%s.%s\" of type int is unknown\n",
|
||||
XkbAtomText(NULL,expr->value.field.element,XkbMessage),
|
||||
XkbAtomText(NULL,expr->value.field.field,XkbMessage));
|
||||
return ok;
|
||||
case ExprArrayRef:
|
||||
bogus= "array reference";
|
||||
case ExprActionDecl:
|
||||
if (bogus==NULL)
|
||||
bogus= "function use";
|
||||
ERROR1("Unexpected %s in mask expression\n",bogus);
|
||||
ACTION("Expression ignored\n");
|
||||
return False;
|
||||
case OpAdd:
|
||||
case OpSubtract:
|
||||
case OpMultiply:
|
||||
case OpDivide:
|
||||
left= expr->value.binary.left;
|
||||
right= expr->value.binary.right;
|
||||
if (ExprResolveMask(left,&leftRtrn,lookup,lookupPriv)&&
|
||||
ExprResolveMask(right,&rightRtrn,lookup,lookupPriv)) {
|
||||
switch (expr->op) {
|
||||
case OpAdd:
|
||||
val_rtrn->ival= leftRtrn.ival|rightRtrn.ival;
|
||||
break;
|
||||
case OpSubtract:
|
||||
val_rtrn->ival= leftRtrn.ival&(~rightRtrn.ival);
|
||||
break;
|
||||
case OpMultiply:
|
||||
case OpDivide:
|
||||
ERROR1("Cannot %s masks\n",
|
||||
expr->op==OpDivide?"divide":"multiply");
|
||||
ACTION("Illegal operation ignored\n");
|
||||
return False;
|
||||
}
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
case OpAssign:
|
||||
WSGO("Assignment operator not implemented yet\n");
|
||||
break;
|
||||
case OpInvert:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveInteger(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
val_rtrn->ival= ~leftRtrn.ival;
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
case OpUnaryPlus:
|
||||
case OpNegate:
|
||||
case OpNot:
|
||||
left= expr->value.child;
|
||||
if (ExprResolveInteger(left,&leftRtrn,lookup,lookupPriv)) {
|
||||
ERROR1("The %s operator cannot be used with a mask\n",
|
||||
(expr->op==OpNegate?"-":"!"));
|
||||
}
|
||||
return False;
|
||||
default:
|
||||
WSGO1("Unknown operator %d in ResolveMask\n",expr->op);
|
||||
break;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
int
|
||||
ExprResolveKeySym( ExprDef * expr,
|
||||
ExprResult * val_rtrn,
|
||||
IdentLookupFunc lookup,
|
||||
XPointer lookupPriv)
|
||||
{
|
||||
int ok= 0;
|
||||
KeySym sym;
|
||||
|
||||
if (expr->op==ExprIdent) {
|
||||
char *str;
|
||||
str= XkbAtomGetString(NULL,expr->value.str);
|
||||
if ((str!=NULL)&&((sym= XStringToKeysym(str))!=NoSymbol)) {
|
||||
val_rtrn->uval= sym;
|
||||
return True;
|
||||
}
|
||||
}
|
||||
ok= ExprResolveInteger(expr,val_rtrn,lookup,lookupPriv);
|
||||
if ((ok)&&(val_rtrn->uval<10))
|
||||
val_rtrn->uval+= '0';
|
||||
return ok;
|
||||
}
|
|
@ -0,0 +1,323 @@
|
|||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# 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
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test -n "$1"; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
*) # When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
test -n "$dir_arg$dstarg" && break
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test -z "$1"; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=
|
||||
|
||||
if test -d "$dst"; then
|
||||
mkdircmd=:
|
||||
chmodcmd=
|
||||
else
|
||||
mkdircmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst/`basename "$src"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# This sed command emulates the dirname command.
|
||||
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if test ! -d "$dstdir"; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=
|
||||
|
||||
while test $# -ne 0 ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
if test ! -d "$pathcomp"; then
|
||||
$mkdirprog "$pathcomp"
|
||||
# mkdir can fail with a `File exist' error in case several
|
||||
# install-sh are creating the directory concurrently. This
|
||||
# is OK.
|
||||
test -d "$pathcomp" || exit
|
||||
fi
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
$doit $mkdircmd "$dst" \
|
||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||
|
||||
else
|
||||
dstfile=`basename "$dst"`
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
$doit $cpprog "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dstdir/$dstfile"; then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
}
|
||||
}
|
||||
fi || { (exit 1); exit 1; }
|
||||
done
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
{
|
||||
(exit 0); exit 0
|
||||
}
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,360 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2005-06-08.21
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case "$1" in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue