From a7dc94904b2393dcf4069de3d847614407f6adb6 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 7 Mar 2008 20:29:03 +0100 Subject: [PATCH] * xset 1.0.4 --- debian/changelog | 1 + xset/ChangeLog | 45 + xset/INSTALL | 236 ----- xset/Makefile.in | 140 +-- xset/aclocal.m4 | 220 ++--- xset/autogen.sh | 13 + xset/compile | 142 --- xset/config.guess | 28 +- xset/config.sub | 44 +- xset/configure | 385 ++++---- xset/configure.ac | 2 +- xset/depcomp | 93 +- xset/install-sh | 508 +++++++---- xset/missing | 61 +- xset/mkinstalldirs | 158 ---- xset/xset.c | 2135 ++++++++++++++++++++++---------------------- xset/xset.man | 7 + 17 files changed, 2045 insertions(+), 2173 deletions(-) create mode 100755 xset/autogen.sh delete mode 100755 xset/compile delete mode 100755 xset/mkinstalldirs diff --git a/debian/changelog b/debian/changelog index 35a983f..7a46e77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ x11-xserver-utils (7.3+3) UNRELEASED; urgency=low * xrdb 1.0.5 + * xset 1.0.4 -- Julien Cristau Fri, 07 Mar 2008 20:27:02 +0100 diff --git a/xset/ChangeLog b/xset/ChangeLog index 3855654..43366f3 100644 --- a/xset/ChangeLog +++ b/xset/ChangeLog @@ -1,3 +1,48 @@ +commit b6343fa846eeadb6736f383577b91dbb46d46971 +Author: Alan Coopersmith +Date: Tue Jan 15 18:11:25 2008 -0800 + + Delete duplicated #include statements + +commit e92294748383b0eaca6cb7f3883cf909077963a1 +Author: Alan Coopersmith +Date: Tue Jan 15 18:10:37 2008 -0800 + + Convert function declarations from K&R to ANSI C + +commit 685fe4692583d383ffec8e0db52ea055fca0ed11 +Author: Alan Coopersmith +Date: Tue Jan 15 17:54:14 2008 -0800 + + Make code formatting consistent + + Too many different indent styles/levels made code hard to read + +commit 5dfbc61487623448c82d043c4f4f29d5e047d498 +Author: gsr.bugs +Date: Thu Nov 15 00:04:34 2007 +0200 + + Manpage: Add mention of mouse acceleration with zero threshold + + xset m A/B 0 gives a different behaviour, smooth acceleration, than typical + A/B C (C not zero) which is two speed. This behaviour is, for some people, + nice. But the point is that it is not documented in man page, so nobody + can just test it except if discovered due some reason more complex than read + the docs. + +commit 6d56c1f8d25ce84c797c3b72070073bc44d1a7ac +Merge: c4f7c40... 3decc85... +Author: James Cloos +Date: Mon Sep 3 06:02:50 2007 -0400 + + Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/app/xset + +commit c4f7c402ad52c784c01655b5d3a9d4d33c6598d6 +Author: James Cloos +Date: Mon Sep 3 05:51:47 2007 -0400 + + Add *~ to .gitignore to skip patch/emacs droppings + commit 3decc85623f023a31b8c19526b29092a9f2d0357 Author: Alan Coopersmith Date: Mon Aug 27 16:37:20 2007 -0700 diff --git a/xset/INSTALL b/xset/INSTALL index 23e5f25..e69de29 100644 --- a/xset/INSTALL +++ b/xset/INSTALL @@ -1,236 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free -Software Foundation, Inc. - -This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -Basic Installation -================== - -These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' if you want to change it or regenerate `configure' using -a newer version of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. If you're - using `csh' on an old version of System V, you might need to type - `sh ./configure' instead to prevent `csh' from trying to execute - `configure' itself. - - Running `configure' takes awhile. While running, it prints some - messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package. - - 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - -Compilers and Options -===================== - -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - -You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you must use a version of `make' that -supports the `VPATH' variable, such as GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. - - If you have to use a `make' that does not support the `VPATH' -variable, you have to compile the package for one architecture at a -time in the source code directory. After you have installed the -package for one architecture, use `make distclean' before reconfiguring -for another architecture. - -Installation Names -================== - -By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - -Optional Features -================= - -Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - -Specifying the System Type -========================== - -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - -Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). Here is a another example: - - /bin/bash ./configure CONFIG_SHELL=/bin/bash - -Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent -configuration-related scripts to be executed by `/bin/bash'. - -`configure' Invocation -====================== - -`configure' recognizes the following options to control how it operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/xset/Makefile.in b/xset/Makefile.in index eb9f665..1b6db4d 100644 --- a/xset/Makefile.in +++ b/xset/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.6 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 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. @@ -36,15 +36,11 @@ # 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 @@ -59,19 +55,18 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = xset$(EXEEXT) +subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - compile config.guess config.sub depcomp install-sh missing \ - mkinstalldirs -subdir = . + config.guess config.sub depcomp install-sh missing 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 = $(SHELL) $(top_srcdir)/mkinstalldirs + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" @@ -81,7 +76,7 @@ am_xset_OBJECTS = xset.$(OBJEXT) xset_OBJECTS = $(am_xset_OBJECTS) am__DEPENDENCIES_1 = xset_DEPENDENCIES = $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -114,8 +109,6 @@ 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@ @@ -138,6 +131,7 @@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -149,11 +143,10 @@ 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@ +MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -181,9 +174,11 @@ STRIP = @STRIP@ VERSION = @VERSION@ XSET_CFLAGS = @XSET_CFLAGS@ XSET_LIBS = @XSET_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ -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@ @@ -195,6 +190,7 @@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ +builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ @@ -222,8 +218,11 @@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ AM_CFLAGS = $(XSET_CFLAGS) -D_BSD_SOURCE xset_LDADD = $(XSET_LIBS) xset_SOURCES = \ @@ -298,7 +297,7 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ - $(MAKE) stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @@ -313,7 +312,7 @@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + 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 \ @@ -336,7 +335,7 @@ clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) xset$(EXEEXT): $(xset_OBJECTS) $(xset_DEPENDENCIES) @rm -f xset$(EXEEXT) - $(LINK) $(xset_LDFLAGS) $(xset_OBJECTS) $(xset_LDADD) $(LIBS) + $(LINK) $(xset_OBJECTS) $(xset_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -347,22 +346,21 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xset.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 +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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 +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` -uninstall-info-am: install-appmanDATA: $(appman_DATA) @$(NORMAL_INSTALL) - test -z "$(appmandir)" || $(mkdir_p) "$(DESTDIR)$(appmandir)" + 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) \ @@ -383,8 +381,8 @@ ID: $(HEADERS) $(SOURCES) $(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; }'`; \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS @@ -396,8 +394,8 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 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; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { 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) \ @@ -407,13 +405,12 @@ 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; }'`; \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique @@ -428,23 +425,22 @@ distclean-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; \ + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ 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 \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -461,7 +457,7 @@ distdir: $(DISTFILES) -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 {} {} \; \ + ! -type d ! -perm -444 -exec $(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 @@ -470,6 +466,10 @@ dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -497,6 +497,8 @@ distcheck: dist GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -536,7 +538,7 @@ distcheck: dist $(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;}' + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -560,7 +562,7 @@ check: check-am all-am: Makefile $(PROGRAMS) $(DATA) config.h installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am @@ -611,12 +613,20 @@ info-am: install-data-am: install-appmanDATA +install-dvi: install-dvi-am + install-exec-am: install-binPROGRAMS +install-html: install-html-am + install-info: install-info-am install-man: +install-pdf: install-pdf-am + +install-ps: install-ps-am + installcheck-am: maintainer-clean: maintainer-clean-am @@ -638,23 +648,25 @@ ps: ps-am ps-am: -uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \ - uninstall-info-am +uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS + +.MAKE: install-am install-strip .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-hook 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 \ + dist-gzip dist-hook dist-lzma 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-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am 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 + uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS .PHONY: ChangeLog diff --git a/xset/aclocal.m4 b/xset/aclocal.m4 index 2d86b12..e5b3eb6 100644 --- a/xset/aclocal.m4 +++ b/xset/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.6 -*- Autoconf -*- +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file 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. @@ -11,6 +11,14 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . @@ -79,16 +87,14 @@ fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried fi[]dnl ])# _PKG_CONFIG @@ -132,9 +138,9 @@ See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD @@ -216,7 +222,7 @@ AC_DEFUN([XORG_MACROS_VERSION],[ XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) - [XORG_MACROS_version=1.1.5 + [XORG_MACROS_version=1.1.6 XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then @@ -365,7 +371,11 @@ AC_DEFUN([XORG_CHECK_LINUXDOC],[ XORG_SGML_PATH=$prefix/share/sgml HAVE_DEFS_ENT= -AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) +if test x"$cross_compiling" = x"yes" ; then + HAVE_DEFS_ENT=no +else + AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) +fi AC_PATH_PROG(LINUXDOC, linuxdoc) AC_PATH_PROG(PS2PDF, ps2pdf) @@ -637,14 +647,14 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], [Major version of this package]) - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2` + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], [$PVM], [Minor version of this package]) - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3` + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi @@ -653,7 +663,7 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ [Patch version of this package]) ]) -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -663,14 +673,31 @@ AC_DEFUN([XORG_RELEASE_VERSION],[ # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- -# Call AM_AUTOMAKE_VERSION so it can be traced. +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.6])]) +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- @@ -727,14 +754,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. -# serial 7 +# serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- @@ -743,8 +770,10 @@ AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' @@ -758,15 +787,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. -# serial 8 +# serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -794,6 +822,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) @@ -859,6 +888,7 @@ AC_CACHE_CHECK([dependency style of $depcc], depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -911,7 +941,8 @@ if test "x$enable_dependency_tracking" != xno; then AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -936,8 +967,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue @@ -996,14 +1028,14 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. # # This file 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. -# serial 12 +# serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. @@ -1020,16 +1052,20 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl +[AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi fi # test whether we have cygpath @@ -1049,6 +1085,9 @@ m4_ifval([$2], AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl @@ -1084,6 +1123,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) @@ -1097,16 +1140,17 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX], # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $1 | $1:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # @@ -1119,7 +1163,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. @@ -1226,14 +1270,14 @@ rm -f confinc confmf # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. -# serial 4 +# serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ @@ -1249,6 +1293,7 @@ AC_SUBST($1)]) # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then @@ -1259,7 +1304,7 @@ else fi ]) -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1267,60 +1312,23 @@ fi # AM_PROG_MKDIR_P # --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) +# Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) # Helper functions for option handling. -*- Autoconf -*- @@ -1432,9 +1440,21 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file 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. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. diff --git a/xset/autogen.sh b/xset/autogen.sh new file mode 100755 index 0000000..e81f989 --- /dev/null +++ b/xset/autogen.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-maintainer-mode "$@" + diff --git a/xset/compile b/xset/compile deleted file mode 100755 index 1b1d232..0000000 --- a/xset/compile +++ /dev/null @@ -1,142 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2005-05-14.22 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# 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. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; -esac - -ofile= -cfile= -eat= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we strip `-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` - -# Create the lock directory. -# Note: use `[/.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# 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: diff --git a/xset/config.guess b/xset/config.guess index 278f9e9..ca2a03c 100755 --- a/xset/config.guess +++ b/xset/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-07-22' +timestamp='2008-01-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -56,8 +56,8 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -532,7 +532,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[45]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -799,6 +799,9 @@ EOF EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks @@ -833,7 +836,14 @@ EOF echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -954,8 +964,8 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so diff --git a/xset/config.sub b/xset/config.sub index 1761d8b..6759825 100755 --- a/xset/config.sub +++ b/xset/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-06-28' +timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -72,8 +72,8 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -369,10 +369,14 @@ case $basic_machine in | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -443,6 +447,14 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; c90) basic_machine=c90-cray os=-unicos @@ -668,6 +680,14 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; m88k-omron*) basic_machine=m88k-omron ;; @@ -813,6 +833,14 @@ case $basic_machine in basic_machine=i860-intel os=-osf ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; pbd) basic_machine=sparc-tti ;; @@ -1021,6 +1049,10 @@ case $basic_machine in basic_machine=tic6x-unknown os=-coff ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown ;; diff --git a/xset/configure b/xset/configure index a8237b4..1bd4ea9 100755 --- a/xset/configure +++ b/xset/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for xset 1.0.3. +# Generated by GNU Autoconf 2.61 for xset 1.0.4. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='xset' PACKAGE_TARNAME='xset' -PACKAGE_VERSION='1.0.3' -PACKAGE_STRING='xset 1.0.3' +PACKAGE_VERSION='1.0.4' +PACKAGE_STRING='xset 1.0.4' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' ac_subst_vars='SHELL @@ -618,6 +618,7 @@ target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA +am__isrc CYGPATH_W PACKAGE VERSION @@ -1218,7 +1219,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xset 1.0.3 to adapt to many kinds of systems. +\`configure' configures xset 1.0.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1288,7 +1289,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xset 1.0.3:";; + short | recursive ) echo "Configuration of xset 1.0.4:";; esac cat <<\_ACEOF @@ -1406,7 +1407,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xset configure 1.0.3 +xset configure 1.0.4 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1420,7 +1421,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xset $as_me 1.0.3, which was +It was created by xset $as_me 1.0.4, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1773,7 +1774,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version="1.9" +am__api_version='1.10' + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then @@ -1956,38 +1958,53 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" else - mkdir_p='$(install_sh) -d' + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" fi fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac for ac_prog in gawk mawk nawk awk do @@ -2070,12 +2087,16 @@ else fi rmdir .tst 2>/dev/null -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } + fi fi # test whether we have cygpath @@ -2090,7 +2111,7 @@ fi # Define the identity of the package. PACKAGE='xset' - VERSION='1.0.3' + VERSION='1.0.4' cat >>confdefs.h <<_ACEOF @@ -2118,7 +2139,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} -install_sh=${install_sh-"$am_aux_dir/install-sh"} +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right @@ -2222,7 +2243,7 @@ else fi fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. @@ -2247,9 +2268,7 @@ fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } - - -if test $USE_MAINTAINER_MODE = yes; then + if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else @@ -3235,9 +3254,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi - - -if test "x$enable_dependency_tracking" != xno; then + if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else @@ -3247,7 +3264,6 @@ fi - depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 @@ -3315,6 +3331,7 @@ else depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then @@ -3344,9 +3361,7 @@ fi echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - -if + if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= @@ -3661,11 +3676,10 @@ pkg_failed=no { echo "$as_me:$LINENO: checking for XSET" >&5 echo $ECHO_N "checking for XSET... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$XSET_CFLAGS"; then - pkg_cv_XSET_CFLAGS="$XSET_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$XSET_CFLAGS"; then + pkg_cv_XSET_CFLAGS="$XSET_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xmuu\"") >&5 ($PKG_CONFIG --exists --print-errors "xmuu") 2>&5 ac_status=$? @@ -3675,15 +3689,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$XSET_LIBS"; then - pkg_cv_XSET_LIBS="$XSET_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$XSET_LIBS"; then + pkg_cv_XSET_LIBS="$XSET_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xmuu\"") >&5 ($PKG_CONFIG --exists --print-errors "xmuu") 2>&5 ac_status=$? @@ -3693,9 +3705,8 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi @@ -3708,9 +3719,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XSET_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xmuu"` + XSET_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xmuu" 2>&1` else - XSET_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xmuu"` + XSET_PKG_ERRORS=`$PKG_CONFIG --print-errors "xmuu" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XSET_PKG_ERRORS" >&5 @@ -3774,11 +3785,10 @@ pkg_failed=no { echo "$as_me:$LINENO: checking for SET_X11" >&5 echo $ECHO_N "checking for SET_X11... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$SET_X11_CFLAGS"; then - pkg_cv_SET_X11_CFLAGS="$SET_X11_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_X11_CFLAGS"; then + pkg_cv_SET_X11_CFLAGS="$SET_X11_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11\"") >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? @@ -3788,15 +3798,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$SET_X11_LIBS"; then - pkg_cv_SET_X11_LIBS="$SET_X11_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_X11_LIBS"; then + pkg_cv_SET_X11_LIBS="$SET_X11_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11\"") >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? @@ -3806,9 +3814,8 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi @@ -3821,9 +3828,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SET_X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "x11"` + SET_X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11" 2>&1` else - SET_X11_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x11"` + SET_X11_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SET_X11_PKG_ERRORS" >&5 @@ -3886,11 +3893,10 @@ pkg_failed=no { echo "$as_me:$LINENO: checking for SET_XEXT" >&5 echo $ECHO_N "checking for SET_XEXT... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XEXT_CFLAGS"; then - pkg_cv_SET_XEXT_CFLAGS="$SET_XEXT_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XEXT_CFLAGS"; then + pkg_cv_SET_XEXT_CFLAGS="$SET_XEXT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xext\"") >&5 ($PKG_CONFIG --exists --print-errors "xext") 2>&5 ac_status=$? @@ -3900,15 +3906,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XEXT_LIBS"; then - pkg_cv_SET_XEXT_LIBS="$SET_XEXT_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XEXT_LIBS"; then + pkg_cv_SET_XEXT_LIBS="$SET_XEXT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xext\"") >&5 ($PKG_CONFIG --exists --print-errors "xext") 2>&5 ac_status=$? @@ -3918,9 +3922,8 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi @@ -3933,9 +3936,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SET_XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xext"` + SET_XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xext" 2>&1` else - SET_XEXT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xext"` + SET_XEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xext" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SET_XEXT_PKG_ERRORS" >&5 @@ -4019,11 +4022,10 @@ pkg_failed=no { echo "$as_me:$LINENO: checking for SET_XKB" >&5 echo $ECHO_N "checking for SET_XKB... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XKB_CFLAGS"; then - pkg_cv_SET_XKB_CFLAGS="$SET_XKB_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XKB_CFLAGS"; then + pkg_cv_SET_XKB_CFLAGS="$SET_XKB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11\"") >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? @@ -4033,15 +4035,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XKB_LIBS"; then - pkg_cv_SET_XKB_LIBS="$SET_XKB_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XKB_LIBS"; then + pkg_cv_SET_XKB_LIBS="$SET_XKB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11\"") >&5 ($PKG_CONFIG --exists --print-errors "x11") 2>&5 ac_status=$? @@ -4051,9 +4051,8 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi @@ -4066,9 +4065,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SET_XKB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "x11"` + SET_XKB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11" 2>&1` else - SET_XKB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x11"` + SET_XKB_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SET_XKB_PKG_ERRORS" >&5 @@ -4151,11 +4150,10 @@ pkg_failed=no { echo "$as_me:$LINENO: checking for SET_XF86MISC" >&5 echo $ECHO_N "checking for SET_XF86MISC... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XF86MISC_CFLAGS"; then - pkg_cv_SET_XF86MISC_CFLAGS="$SET_XF86MISC_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XF86MISC_CFLAGS"; then + pkg_cv_SET_XF86MISC_CFLAGS="$SET_XF86MISC_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xxf86misc\"") >&5 ($PKG_CONFIG --exists --print-errors "xxf86misc") 2>&5 ac_status=$? @@ -4165,15 +4163,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XF86MISC_LIBS"; then - pkg_cv_SET_XF86MISC_LIBS="$SET_XF86MISC_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XF86MISC_LIBS"; then + pkg_cv_SET_XF86MISC_LIBS="$SET_XF86MISC_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xxf86misc\"") >&5 ($PKG_CONFIG --exists --print-errors "xxf86misc") 2>&5 ac_status=$? @@ -4183,9 +4179,8 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi @@ -4198,9 +4193,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SET_XF86MISC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xxf86misc"` + SET_XF86MISC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xxf86misc" 2>&1` else - SET_XF86MISC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xxf86misc"` + SET_XF86MISC_PKG_ERRORS=`$PKG_CONFIG --print-errors "xxf86misc" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SET_XF86MISC_PKG_ERRORS" >&5 @@ -4285,11 +4280,10 @@ pkg_failed=no { echo "$as_me:$LINENO: checking for SET_FONTCACHE" >&5 echo $ECHO_N "checking for SET_FONTCACHE... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$SET_FONTCACHE_CFLAGS"; then - pkg_cv_SET_FONTCACHE_CFLAGS="$SET_FONTCACHE_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_FONTCACHE_CFLAGS"; then + pkg_cv_SET_FONTCACHE_CFLAGS="$SET_FONTCACHE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xfontcache\"") >&5 ($PKG_CONFIG --exists --print-errors "xfontcache") 2>&5 ac_status=$? @@ -4299,15 +4293,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$SET_FONTCACHE_LIBS"; then - pkg_cv_SET_FONTCACHE_LIBS="$SET_FONTCACHE_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_FONTCACHE_LIBS"; then + pkg_cv_SET_FONTCACHE_LIBS="$SET_FONTCACHE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xfontcache\"") >&5 ($PKG_CONFIG --exists --print-errors "xfontcache") 2>&5 ac_status=$? @@ -4317,9 +4309,8 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi @@ -4332,9 +4323,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SET_FONTCACHE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xfontcache"` + SET_FONTCACHE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xfontcache" 2>&1` else - SET_FONTCACHE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xfontcache"` + SET_FONTCACHE_PKG_ERRORS=`$PKG_CONFIG --print-errors "xfontcache" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SET_FONTCACHE_PKG_ERRORS" >&5 @@ -4418,11 +4409,10 @@ pkg_failed=no { echo "$as_me:$LINENO: checking for SET_XPRINT" >&5 echo $ECHO_N "checking for SET_XPRINT... $ECHO_C" >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XPRINT_CFLAGS"; then - pkg_cv_SET_XPRINT_CFLAGS="$SET_XPRINT_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XPRINT_CFLAGS"; then + pkg_cv_SET_XPRINT_CFLAGS="$SET_XPRINT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xp\"") >&5 ($PKG_CONFIG --exists --print-errors "xp") 2>&5 ac_status=$? @@ -4432,15 +4422,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$SET_XPRINT_LIBS"; then - pkg_cv_SET_XPRINT_LIBS="$SET_XPRINT_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SET_XPRINT_LIBS"; then + pkg_cv_SET_XPRINT_LIBS="$SET_XPRINT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xp\"") >&5 ($PKG_CONFIG --exists --print-errors "xp") 2>&5 ac_status=$? @@ -4450,9 +4438,8 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi @@ -4465,9 +4452,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SET_XPRINT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xp"` + SET_XPRINT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "xp" 2>&1` else - SET_XPRINT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xp"` + SET_XPRINT_PKG_ERRORS=`$PKG_CONFIG --print-errors "xp" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SET_XPRINT_PKG_ERRORS" >&5 @@ -4725,7 +4712,7 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF - PVM=`echo $PACKAGE_VERSION | cut -d . -f 2` + PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi @@ -4734,7 +4721,7 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PVM _ACEOF - PVP=`echo $PACKAGE_VERSION | cut -d . -f 3` + PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi @@ -5164,7 +5151,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xset $as_me 1.0.3, which was +This file was extended by xset $as_me 1.0.4, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5217,7 +5204,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -xset config.status 1.0.3 +xset config.status 1.0.4 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -5228,6 +5215,7 @@ gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -5435,6 +5423,7 @@ target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim @@ -5491,7 +5480,6 @@ build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim -host!$host$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -5533,6 +5521,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim @@ -5552,7 +5541,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 17; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -5779,6 +5768,11 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -5832,6 +5826,7 @@ s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out @@ -5947,21 +5942,22 @@ echo "$as_me: $ac_file is unchanged" >&6;} fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. +_am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in - $ac_file | $ac_file:* ) + $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || -$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X$ac_file : 'X\(//\)[^/]' \| \ - X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| . 2>/dev/null || -echo X$ac_file | +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -5996,8 +5992,9 @@ echo "$as_me: executing $ac_file commands" >&6;} # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. - # So let's grep whole file. - if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ diff --git a/xset/configure.ac b/xset/configure.ac index 815fd75..4522853 100644 --- a/xset/configure.ac +++ b/xset/configure.ac @@ -21,7 +21,7 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) -AC_INIT(xset,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xset) +AC_INIT(xset,[1.0.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xset) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE diff --git a/xset/depcomp b/xset/depcomp index 04701da..e5f9736 100755 --- a/xset/depcomp +++ b/xset/depcomp @@ -1,9 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2005-07-09.11 +scriptversion=2007-03-29.01 -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 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 @@ -91,7 +92,20 @@ 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" +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" stat=$? if test $stat -eq 0; then : else @@ -201,34 +215,39 @@ aix) # 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" + 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 + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u "$@" -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" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done 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" + 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 # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -276,6 +295,46 @@ icc) rm -f "$tmpdepfile" ;; +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + 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 + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + 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'. @@ -288,13 +347,13 @@ tru64) 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 + # static library. This mechanism 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 + # compilations output dependencies 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 diff --git a/xset/install-sh b/xset/install-sh index 4d4a951..a5897de 100755 --- a/xset/install-sh +++ b/xset/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2005-05-14.22 +scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -39,38 +39,68 @@ scriptversion=2005-05-14.22 # 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. +# from scratch. + +nl=' +' +IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi -# put in absolute paths if you don't have them in your path; or use env. vars. +# Put in absolute file names if you don't have them in your path; +# or use environment 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}" +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 -chmodcmd="$chmodprog 0755" -chowncmd= chgrpcmd= -stripcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog rmcmd="$rmprog -f" -mvcmd="$mvprog" +stripcmd= + src= dst= dir_arg= -dstarg= +dst_arg= + +copy_on_change=false no_target_directory= -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... @@ -80,81 +110,86 @@ 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. + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -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. Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG " -while test -n "$1"; do +while test $# -ne 0; do case $1 in - -c) shift - continue;; + -c) ;; - -d) dir_arg=true - shift - continue;; + -C) copy_on_change=true;; + + -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; + shift;; --help) echo "$usage"; exit $?;; - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift - shift - continue;; + shift;; - -s) stripcmd=$stripprog - shift - continue;; + -s) stripcmd=$stripprog;; - -t) dstarg=$2 - shift - shift - continue;; + -t) dst_arg=$2 + shift;; - -T) no_target_directory=true - shift - continue;; + -T) no_target_directory=true;; --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 + --) shift break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; esac + shift done -if test -z "$1"; then +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 @@ -164,24 +199,47 @@ if test -z "$1"; then exit 0 fi +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + for src do # Protect names starting with `-'. case $src in - -*) src=./$src ;; + -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src - src= - - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? 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 '*'. @@ -190,71 +248,199 @@ do exit 1 fi - if test -z "$dstarg"; then + if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi - dst=$dstarg + dst=$dst_arg # Protect names starting with `-'. case $dst in - -*) dst=./$dst ;; + -*) 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 + echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi - dst=$dst/`basename "$src"` + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? fi fi - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + obsolete_mkdir_used=false - # Make sure that the destination directory exists. + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac - 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 + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi - pathcomp= + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir 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 + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi - pathcomp=$pathcomp/ - done + fi 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"; } - + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else - dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ @@ -262,10 +448,9 @@ do # 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" && + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -273,48 +458,59 @@ do # 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"; } && + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$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. + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - # 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 - } && + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit 1; } + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 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. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi 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=" diff --git a/xset/missing b/xset/missing index 894e786..1c8ff70 100755 --- a/xset/missing +++ b/xset/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2005-06-08.21 +scriptversion=2006-05-10.23 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. @@ -33,6 +33,8 @@ if test $# -eq 0; then fi run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. @@ -44,7 +46,7 @@ fi msg="missing on your system" -case "$1" in +case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= @@ -77,6 +79,7 @@ Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one 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 @@ -106,7 +109,7 @@ 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 +case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; @@ -135,7 +138,7 @@ esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case "$1" in +case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if test -z "$files" && files="config.h" touch_files= for f in $files; do - case "$f" in + case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; @@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg. 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'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else @@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if 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 + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi - if [ ! -f y.tab.h ]; then + if test ! -f y.tab.h; then echo >y.tab.h fi - if [ ! -f y.tab.c ]; then + if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; @@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if 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 + if test $# -ne 1; then eval LASTARG="\${$#}" - case "$LASTARG" in + case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if [ -f "$SRCFILE" ]; then + if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi - if [ ! -f lex.yy.c ]; then + if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; @@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if \`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 + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then touch $file else test -z "$file" || exec >$file @@ -289,11 +290,17 @@ WARNING: \`$1' is $msg. You should only need it if 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'` + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 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` + 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 @@ -317,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if fi firstarg="$1" if shift; then - case "$firstarg" in + case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac - case "$firstarg" in + case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 diff --git a/xset/mkinstalldirs b/xset/mkinstalldirs deleted file mode 100755 index 259dbfc..0000000 --- a/xset/mkinstalldirs +++ /dev/null @@ -1,158 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy - -scriptversion=2005-06-29.22 - -# Original author: Noah Friedman -# Created: 1993-05-16 -# Public domain. -# -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -errstatus=0 -dirmode= - -usage="\ -Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... - -Create each directory DIR (with mode MODE, if specified), including all -leading file name components. - -Report bugs to ." - -# process command line arguments -while test $# -gt 0 ; do - case $1 in - -h | --help | --h*) # -h for help - echo "$usage" - exit $? - ;; - -m) # -m PERM arg - shift - test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } - dirmode=$1 - shift - ;; - --version) - echo "$0 $scriptversion" - exit $? - ;; - --) # stop option processing - shift - break - ;; - -*) # unknown option - echo "$usage" 1>&2 - exit 1 - ;; - *) # first non-opt arg - break - ;; - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in - 0) exit 0 ;; -esac - -# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and -# mkdir -p a/c at the same time, both will detect that a is missing, -# one will create a, then the other will try to create a and die with -# a "File exists" error. This is a problem when calling mkinstalldirs -# from a parallel make. We use --version in the probe to restrict -# ourselves to GNU mkdir, which is thread-safe. -case $dirmode in - '') - if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - test -d ./-p && rmdir ./-p - test -d ./--version && rmdir ./--version - fi - ;; - *) - if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && - test ! -d ./--version; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - else - # Clean up after NextStep and OpenStep mkdir. - for d in ./-m ./-p ./--version "./$dirmode"; - do - test -d $d && rmdir $d - done - fi - ;; -esac - -for file -do - case $file in - /*) pathcomp=/ ;; - *) pathcomp= ;; - esac - oIFS=$IFS - IFS=/ - set fnord $file - shift - IFS=$oIFS - - for d - do - test "x$d" = x && continue - - pathcomp=$pathcomp$d - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - lasterr= - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp=$pathcomp/ - done -done - -exit $errstatus - -# 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: diff --git a/xset/xset.c b/xset/xset.c index c2676e0..0b0243e 100644 --- a/xset/xset.c +++ b/xset/xset.c @@ -31,31 +31,31 @@ in this Software without prior written authorization from The Open Group. /* Modified by Stephen so keyboard rate is set using XKB extensions */ #ifdef HAVE_CONFIG_H -#include +# include #endif #ifdef HAVE_X11_EXTENSIONS_DPMS_H -#define DPMSExtension +# define DPMSExtension #endif #ifdef HAVE_X11_EXTENSIONS_MITMISC_H -#define MITMISC +# define MITMISC #endif #ifdef HAVE_X11_XKBLIB_H -#define XKB +# define XKB #endif #if defined(HAVE_X11_EXTENSIONS_XF86MISC_H) && defined(HAVE_X11_EXTENSIONS_XF86MSCSTR_H) -#define XF86MISC +# define XF86MISC #endif #if defined(HAVE_X11_EXTENSIONS_PRINT_H) -#define BUILD_PRINTSUPPORT +# define BUILD_PRINTSUPPORT #endif #if defined(HAVE_X11_EXTENSIONS_FONTCACHE_H) && defined(HAVE_X11_EXTENSIONS_FONTCACHEP_H) -#define FONTCACHE +# define FONTCACHE #endif #include @@ -70,56 +70,46 @@ in this Software without prior written authorization from The Open Group. #include #include #ifdef MITMISC -#include +# include #endif #ifdef DPMSExtension -#include -#ifdef WIN32 -#define BOOL wBOOL -#ifdef Status -#undef Status -#define Status wStatus -#endif -#include -#ifdef Status -#undef Status -#define Status int -#endif -#undef BOOL -#endif -#ifndef HAVE_USLEEP -# if defined(SVR4) && defined(sun) -# include +# include +# ifdef WIN32 +# define BOOL wBOOL +# ifdef Status +# undef Status +# define Status wStatus +# endif +# include +# ifdef Status +# undef Status +# define Status int +# endif +# undef BOOL +# endif +# ifndef HAVE_USLEEP +# if defined(SVR4) && defined(sun) +# include +# endif # endif -#endif #endif /* DPMSExtension */ -#include -#include -#include -#include -#include -#include -#include -#ifdef MITMISC -#include -#endif #ifdef XF86MISC -#include -#include +# include +# include #endif #ifdef XKB -#include +# include #endif #ifdef FONTCACHE -#include -#include +# include +# include static Status set_font_cache(Display *, long, long, long); static void query_cache_status(Display *dpy); #endif #ifdef BUILD_PRINTSUPPORT -#include +# include #endif #define ON 1 @@ -138,12 +128,12 @@ static void query_cache_status(Display *dpy); #define ALLOW_EXP 4 #ifdef XF86MISC -#define KBDDELAY_DEFAULT 500 -#define KBDRATE_DEFAULT 30 +# define KBDDELAY_DEFAULT 500 +# define KBDRATE_DEFAULT 30 #endif #ifdef XKB -#define XKBDDELAY_DEFAULT 660 -#define XKBDRATE_DEFAULT (1000/40) +# define XKBDDELAY_DEFAULT 660 +# define XKBDRATE_DEFAULT (1000/40) #endif #define nextarg(i, argv) \ @@ -160,21 +150,22 @@ static void set_click(Display *dpy, int percent); static void set_bell_vol(Display *dpy, int percent); static void set_bell_pitch(Display *dpy, int pitch); static void set_bell_dur(Display *dpy, int duration); -static void set_font_path(Display *dpy, char *path, int special, +static void set_font_path(Display *dpy, char *path, int special, int before, int after); static void set_led(Display *dpy, int led, int led_mode); static void set_mouse(Display *dpy, int acc_num, int acc_denom, int threshold); static void set_saver(Display *dpy, int mask, int value); static void set_repeat(Display *dpy, int key, int auto_repeat_mode); -static void set_pixels(Display *dpy, unsigned long *pixels, caddr_t *colors, +static void set_pixels(Display *dpy, unsigned long *pixels, caddr_t *colors, int numpixels); static void set_lock(Display *dpy, Bool onoff); -static char * on_or_off(int val, int onval, char *onstr, - int offval, char *offstr, char buf[]); +static char *on_or_off(int val, int onval, char *onstr, + int offval, char *offstr, char buf[]); static void query(Display *dpy); static void usage(char *fmt, ...); static void error(char *message); static int local_xerror(Display *dpy, XErrorEvent *rep); + #ifdef XF86MISC static void set_repeatrate(Display *dpy, int delay, int rate); #endif @@ -185,398 +176,410 @@ static void xkbset_repeatrate(Display *dpy, int delay, int rate); int main(int argc, char *argv[]) { -register char *arg; -register int i; -int percent; -int acc_num, acc_denom, threshold; + register char *arg; + register int i; + int percent; + int acc_num, acc_denom, threshold; + #ifdef DPMSExtension -CARD16 standby_timeout, suspend_timeout, off_timeout; + CARD16 standby_timeout, suspend_timeout, off_timeout; #endif -int key, auto_repeat_mode; -XKeyboardControl values; + int key, auto_repeat_mode; + XKeyboardControl values; + #define MAX_PIXEL_COUNT 512 -unsigned long pixels[MAX_PIXEL_COUNT]; -caddr_t colors[MAX_PIXEL_COUNT]; -int numpixels = 0; -char *disp = NULL; -Display *dpy; -Bool hasargs = False; + unsigned long pixels[MAX_PIXEL_COUNT]; + caddr_t colors[MAX_PIXEL_COUNT]; + int numpixels = 0; + char *disp = NULL; + Display *dpy; + Bool hasargs = False; + #ifdef XF86MISC -int miscpresent = 1; -int major, minor; + int miscpresent = 1; + int major, minor; #else -int miscpresent = 0; + int miscpresent = 0; #endif #ifdef XKB -int xkbpresent = 1; -int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion; -int xkbopcode, xkbevent, xkberror; + int xkbpresent = 1; + int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion; + int xkbopcode, xkbevent, xkberror; #else -int xkbpresent = 0; + int xkbpresent = 0; #endif #ifdef FONTCACHE -long himark, lowmark, balance; + long himark, lowmark, balance; #endif -progName = argv[0]; -for (i = 1; i < argc; i++) { - arg = argv[i]; - if (strcmp (arg, "-display") == 0 || strcmp (arg, "-d") == 0) { - if (++i >= argc) usage ("missing argument to -display", NULL); - disp = argv[i]; - } else { - hasargs = True; - } -} -if (!hasargs) { - usage (NULL, NULL); /* replace with window interface */ -} - -dpy = XOpenDisplay(disp); /* Open display and check for success */ -if (dpy == NULL) { - fprintf(stderr, "%s: unable to open display \"%s\"\n", - argv[0], XDisplayName (disp)); - exit(EXIT_FAILURE); -} -XSetErrorHandler (local_xerror); -for (i = 1; i < argc; ) { - arg = argv[i++]; - if (strcmp (arg, "-display") == 0 || strcmp (arg, "-d") == 0) { - ++i; /* already dealt with */ - continue; - } else if (*arg == '-' && *(arg + 1) == 'c'){ /* Does arg start with "-c"? */ - set_click(dpy, 0); /* If so, turn click off and */ - } - else if (*arg == 'c') { /* Well, does it start with "c", then? */ - percent = SERVER_DEFAULT; /* Default click volume. */ - if (i >= argc) { - set_click (dpy, percent); /* set click to default */ - break; - } - arg = nextarg(i, argv); - if (strcmp(arg, "on") == 0) { /* Let click be default. */ - percent = DEFAULT_ON; - i++; - } - else if (strcmp(arg, "off") == 0) { - percent = 0; /* Turn it off. */ - i++; - } - else if (is_number(arg, 100)) { - percent = atoi(arg); /* Set to spec. volume */ - i++; - } - set_click(dpy, percent); - } - else if (strcmp(arg, "-b") == 0) { - set_bell_vol(dpy, 0); /* Then turn off bell. */ - } - else if (strcmp(arg, "b") == 0) { - percent = SERVER_DEFAULT; /* Set bell to default. */ - if (i >= argc) { - set_bell_vol (dpy, percent); /* set bell to default */ - set_bell_pitch(dpy,percent); /* set pitch to default */ - set_bell_dur(dpy,percent); /* set duration to default */ - break; - } - arg = nextarg(i, argv); - if (strcmp(arg, "on") == 0) { /* Let it stay that way. */ - set_bell_vol(dpy, DEFAULT_ON); /* set bell on */ - set_bell_pitch(dpy,percent); /* set pitch to default */ - set_bell_dur(dpy,percent); /* set duration to default */ - i++; - } - else if (strcmp(arg, "off") == 0) { - percent = 0; /* Turn the bell off. */ - set_bell_vol(dpy, percent); - i++; - } - else if (is_number(arg, 100)) { /* If volume is given: */ - percent = atoi(arg); /* set bell appropriately.*/ - set_bell_vol(dpy, percent); - i++; - arg = nextarg(i, argv); - - if (is_number(arg, 32767)) { /* If pitch is given: */ - set_bell_pitch(dpy, atoi(arg)); /* set the bell. */ - i++; - - arg = nextarg(i, argv); - if (is_number(arg, 32767)) { /* If duration is given: */ - set_bell_dur(dpy, atoi(arg)); /* set the bell. */ - i++; + progName = argv[0]; + for (i = 1; i < argc; i++) { + arg = argv[i]; + if (strcmp(arg, "-display") == 0 || strcmp(arg, "-d") == 0) { + if (++i >= argc) + usage("missing argument to -display", NULL); + disp = argv[i]; + } else { + hasargs = True; } - } } - else - set_bell_vol (dpy, percent); /* set bell to default */ - } + if (!hasargs) { + usage(NULL, NULL); /* replace with window interface */ + } + + dpy = XOpenDisplay(disp); /* Open display and check for success */ + if (dpy == NULL) { + fprintf(stderr, "%s: unable to open display \"%s\"\n", + argv[0], XDisplayName(disp)); + exit(EXIT_FAILURE); + } + XSetErrorHandler(local_xerror); + for (i = 1; i < argc;) { + arg = argv[i++]; + if (strcmp(arg, "-display") == 0 || strcmp(arg, "-d") == 0) { + ++i; /* already dealt with */ + continue; + } else if (*arg == '-' && *(arg + 1) == 'c') { /* Does arg start + with "-c"? */ + set_click(dpy, 0); /* If so, turn click off */ + } else if (*arg == 'c') { /* Well, does it start + with "c", then? */ + percent = SERVER_DEFAULT; /* Default click volume. */ + if (i >= argc) { + set_click(dpy, percent); /* set click to default */ + break; + } + arg = nextarg(i, argv); + if (strcmp(arg, "on") == 0) { /* Let click be default. */ + percent = DEFAULT_ON; + i++; + } else if (strcmp(arg, "off") == 0) { + percent = 0; /* Turn it off. */ + i++; + } else if (is_number(arg, 100)) { + percent = atoi(arg); /* Set to spec. volume */ + i++; + } + set_click(dpy, percent); + } else if (strcmp(arg, "-b") == 0) { + set_bell_vol(dpy, 0); /* Then turn off bell. */ + } else if (strcmp(arg, "b") == 0) { + percent = SERVER_DEFAULT; /* Set bell to default. */ + if (i >= argc) { + set_bell_vol(dpy, percent); /* set bell to default */ + set_bell_pitch(dpy, percent); /* set pitch to default */ + set_bell_dur(dpy, percent); /* set duration to default */ + break; + } + arg = nextarg(i, argv); + if (strcmp(arg, "on") == 0) { /* Let it stay that way. */ + set_bell_vol(dpy, DEFAULT_ON); /* set bell on */ + set_bell_pitch(dpy, percent); /* set pitch to default */ + set_bell_dur(dpy, percent); /* set duration to default */ + i++; + } else if (strcmp(arg, "off") == 0) { + percent = 0; /* Turn the bell off. */ + set_bell_vol(dpy, percent); + i++; + } else if (is_number(arg, 100)) { /* If volume is given: */ + percent = atoi(arg); /* set bell appropriately. */ + set_bell_vol(dpy, percent); + i++; + arg = nextarg(i, argv); + + if (is_number(arg, 32767)) { /* If pitch is given: */ + set_bell_pitch(dpy, atoi(arg)); /* set the bell. */ + i++; + + arg = nextarg(i, argv); + if (is_number(arg, 32767)) { /* If duration is given: */ + set_bell_dur(dpy, atoi(arg)); /* set the bell. */ + i++; + } + } + } else + set_bell_vol(dpy, percent); /* set bell to default */ + } #ifdef MITMISC - else if (strcmp(arg, "bc") == 0) { - int dummy; - if (XMITMiscQueryExtension(dpy, &dummy, &dummy)) - XMITMiscSetBugMode(dpy, True); - else - fprintf(stderr, "server does not have extension for bc option\n"); - } - else if (strcmp(arg, "-bc") == 0) { - int dummy; - if (XMITMiscQueryExtension(dpy, &dummy, &dummy)) - XMITMiscSetBugMode(dpy, False); - else - fprintf(stderr, "server does not have extension for -bc option\n"); - } + else if (strcmp(arg, "bc") == 0) { + int dummy; + + if (XMITMiscQueryExtension(dpy, &dummy, &dummy)) + XMITMiscSetBugMode(dpy, True); + else + fprintf(stderr, + "server does not have extension for bc option\n"); + } else if (strcmp(arg, "-bc") == 0) { + int dummy; + + if (XMITMiscQueryExtension(dpy, &dummy, &dummy)) + XMITMiscSetBugMode(dpy, False); + else + fprintf(stderr, + "server does not have extension for -bc option\n"); + } #endif #ifdef FONTCACHE - else if (strcmp(arg, "fc") == 0) { - int dummy; - FontCacheSettings cs; - if (FontCacheQueryExtension(dpy, &dummy, &dummy)) { - FontCacheGetCacheSettings(dpy, &cs); - himark = cs.himark / 1024; - lowmark = cs.lowmark / 1024; - balance = cs.balance; - if (i >= argc) { - /* Set to server's values, and clear all cache in side effect */ - set_font_cache(dpy, himark, lowmark, balance); - break; - } - arg = nextarg(i, argv); - if (is_number(arg, 32767)) { /* If hi-mark is given: */ - himark = atoi(arg); - i++; - if (himark <= 0) { - usage("hi-mark must be greater than 0", NULL); - } - if (i >= argc) { - lowmark = (himark * 70) / 100; - set_font_cache(dpy, himark, lowmark, balance); - break; - } - arg = nextarg(i, argv); - if (is_number(arg, 32767)) { /* If low-mark is given: */ - lowmark = atoi(arg); - i++; - if (lowmark <= 0) { - usage("low-mark must be greater than 0", NULL); - } - if (himark <= lowmark) { - usage("hi-mark must be greater than low-mark", NULL); - } - if (i >= argc) { - set_font_cache(dpy, himark, lowmark, balance); - break; - } - arg = nextarg(i, argv); - if (is_number(arg, 90)) { - balance = atoi(arg); - i++; - if (!(10 <= balance && balance <= 90)) { - usage("balance must be 10 to 90\n"); - } - set_font_cache(dpy, himark, lowmark, balance); - } - } - } else if (strcmp(arg, "s") == 0 || strcmp(arg, "status") == 0) { - /* display cache status */ - query_cache_status(dpy); - } - } else { - fprintf(stderr, "server does not have extension for fc option\n"); - } - } + else if (strcmp(arg, "fc") == 0) { + int dummy; + FontCacheSettings cs; + + if (FontCacheQueryExtension(dpy, &dummy, &dummy)) { + FontCacheGetCacheSettings(dpy, &cs); + himark = cs.himark / 1024; + lowmark = cs.lowmark / 1024; + balance = cs.balance; + if (i >= argc) { + /* Set to server's values, and clear all cache + in side effect */ + set_font_cache(dpy, himark, lowmark, balance); + break; + } + arg = nextarg(i, argv); + if (is_number(arg, 32767)) { /* If hi-mark is given: */ + himark = atoi(arg); + i++; + if (himark <= 0) { + usage("hi-mark must be greater than 0", NULL); + } + if (i >= argc) { + lowmark = (himark * 70) / 100; + set_font_cache(dpy, himark, lowmark, balance); + break; + } + arg = nextarg(i, argv); + if (is_number(arg, 32767)) { /* If low-mark is given: */ + lowmark = atoi(arg); + i++; + if (lowmark <= 0) { + usage("low-mark must be greater than 0", NULL); + } + if (himark <= lowmark) { + usage("hi-mark must be greater than low-mark", + NULL); + } + if (i >= argc) { + set_font_cache(dpy, himark, lowmark, balance); + break; + } + arg = nextarg(i, argv); + if (is_number(arg, 90)) { + balance = atoi(arg); + i++; + if (!(10 <= balance && balance <= 90)) { + usage("balance must be 10 to 90\n"); + } + set_font_cache(dpy, himark, lowmark, balance); + } + } + } else if (strcmp(arg, "s") == 0 + || strcmp(arg, "status") == 0) { + /* display cache status */ + query_cache_status(dpy); + } + } else { + fprintf(stderr, + "server does not have extension for fc option\n"); + } + } #endif #ifdef BUILD_PRINTSUPPORT - else if (strcmp(arg, "rehashprinterlist") == 0) { /* rehash list of printers */ - short dummy; - if (XpQueryVersion(dpy, &dummy, &dummy)) { - XpRehashPrinterList(dpy); - } else { - fprintf(stderr, "server does not have extension for rehashprinterlist option\n"); - } - } -#endif - else if (strcmp(arg, "fp") == 0) { /* set font path */ - if (i >= argc) { - arg = "default"; - } else { - arg = nextarg(i, argv); - } - set_font_path(dpy, arg, 1, 0, 0); /* special argument */ - i++; - } - else if (strcmp(arg, "fp=") == 0) { /* unconditionally set */ - if (i >= argc) { - usage ("missing fp= argument", NULL); - } else { - arg = nextarg(i, argv); - } - set_font_path(dpy, arg, 0, 0, 0); /* not special, set */ - i++; - } - else if (strcmp(arg, "+fp") == 0) { /* set font path */ - if (i >= argc) usage ("missing +fp argument", NULL); - arg = nextarg(i, argv); - set_font_path(dpy, arg, 0, 1, 0); /* not special, prepend */ - i++; - } - else if (strcmp(arg, "fp+") == 0) { /* set font path */ - if (i >= argc) usage ("missing fp+ argument", NULL); - arg = nextarg(i, argv); - set_font_path(dpy, arg, 0, 0, 1); /* not special, append */ - i++; - } - else if (strcmp(arg, "-fp") == 0) { /* set font path */ - if (i >= argc) usage ("missing -fp argument", NULL); - arg = nextarg(i, argv); - set_font_path(dpy, arg, 0, -1, 0); /* not special, preremove */ - i++; - } - else if (strcmp(arg, "fp-") == 0) { /* set font path */ - if (i >= argc) usage ("missing fp- argument", NULL); - arg = nextarg(i, argv); - set_font_path(dpy, arg, 0, 0, -1); /* not special, postremove */ - i++; - } - else if (strcmp(arg, "-led") == 0) { /* Turn off one or all LEDs */ - values.led_mode = OFF; - values.led = ALL; /* None specified */ - if (i >= argc) { - set_led(dpy, values.led, values.led_mode); - break; - } - arg = nextarg(i, argv); - if (is_number(arg, 32) && atoi(arg) > 0) { - values.led = atoi(arg); - i++; - } - set_led(dpy, values.led, values.led_mode); - } - else if (strcmp(arg, "led") == 0) { /* Turn on one or all LEDs */ - values.led_mode = ON; - values.led = ALL; - if (i >= argc) { - set_led (dpy, values.led, values.led_mode); /* set led to def */ - break; - } - arg = nextarg(i, argv); - if (strcmp(arg, "on") == 0) { - i++; - } - else if (strcmp(arg, "off") == 0) { /* ...except in this case. */ - values.led_mode = OFF; - i++; - } - else if (is_number(arg, 32) && atoi(arg) > 0) { - values.led = atoi(arg); - i++; - } - set_led(dpy, values.led, values.led_mode); - } -/* Set pointer (mouse) settings: Acceleration and Threshold. */ - else if (strcmp(arg, "m") == 0 || strcmp(arg, "mouse") == 0) { - acc_num = SERVER_DEFAULT; /* restore server defaults */ - acc_denom = SERVER_DEFAULT; - threshold = SERVER_DEFAULT; - if (i >= argc){ - set_mouse(dpy, acc_num, acc_denom, threshold); - break; - } - arg = argv[i]; - if (strcmp(arg, "default") == 0) { - i++; - } - else if (*arg >= '0' && *arg <= '9') { - acc_denom = 1; - sscanf(arg, "%d/%d", &acc_num, &acc_denom); - i++; - if (i >= argc) { - set_mouse(dpy, acc_num, acc_denom, threshold); - break; - } - arg = argv[i]; - if (*arg >= '0' && *arg <= '9') { - threshold = atoi(arg); /* Set threshold as user specified. */ - i++; - } - } - set_mouse(dpy, acc_num, acc_denom, threshold); - } -#ifdef DPMSExtension - else if (strcmp(arg, "+dpms") == 0) { /* turn on DPMS */ - int dummy; - if (DPMSQueryExtension(dpy, &dummy, &dummy)) - DPMSEnable(dpy); - else - fprintf(stderr, "server does not have extension for +dpms option\n"); - } - else if (strcmp(arg, "-dpms") == 0) { /* shut off DPMS */ - int dummy; - if (DPMSQueryExtension(dpy, &dummy, &dummy)) - DPMSDisable(dpy); - else - fprintf(stderr, "server does not have extension for -dpms option\n"); + else if (strcmp(arg, "rehashprinterlist") == 0) { + /* rehash list of printers */ + short dummy; - } - else if (strcmp(arg, "dpms") == 0) { /* tune DPMS */ - int dummy; - if (DPMSQueryExtension(dpy, &dummy, &dummy)) - { - DPMSGetTimeouts(dpy, &standby_timeout, &suspend_timeout, - &off_timeout); - if (i >= argc) { - DPMSEnable(dpy); - break; - } - arg = argv[i]; - if (*arg >= '0' && *arg <= '9') { - sscanf(arg, "%hu", &standby_timeout); - i++; - arg = argv[i]; - if ((arg)&&(*arg >= '0' && *arg <= '9')) { - sscanf(arg, "%hu", &suspend_timeout); - i++; - arg = argv[i]; - if ((arg)&&(*arg >= '0' && *arg <= '9')) { - sscanf(arg, "%hu", &off_timeout); - i++; - arg = argv[i]; - } - } - if ((suspend_timeout != 0)&&(standby_timeout > suspend_timeout)) - { - fprintf(stderr, "illegal combination of values\n"); - fprintf(stderr, " standby time of %d is greater than suspend time of %d\n", standby_timeout, suspend_timeout); - exit(EXIT_FAILURE); - } - if ((off_timeout != 0)&&(suspend_timeout > off_timeout)) - { - fprintf(stderr, "illegal combination of values\n"); - fprintf(stderr, " suspend time of %d is greater than off time of %d\n", suspend_timeout, off_timeout); - exit(EXIT_FAILURE); - } - if ((suspend_timeout == 0)&&(off_timeout != 0)&& - (standby_timeout > off_timeout)) - { - fprintf(stderr, "illegal combination of values\n"); - fprintf(stderr, " standby time of %d is greater than off time of %d\n", standby_timeout, off_timeout); - exit(EXIT_FAILURE); - } - DPMSEnable(dpy); - DPMSSetTimeouts(dpy, standby_timeout, suspend_timeout, off_timeout); - } - else if (i+1 < argc && strcmp(arg, "force") == 0) { - i++; - arg = argv[i]; - /* - * The calls to usleep below are necessary to delay the actual - * DPMS mode setting briefly. Without them, it's likely that the - * mode will be set between the Down and Up key transitions, in - * which case the Up transition may immediately turn the display - * back on. - * - * On OS/2, use _sleep2() - */ + if (XpQueryVersion(dpy, &dummy, &dummy)) { + XpRehashPrinterList(dpy); + } else { + fprintf(stderr, + "server does not have extension for rehashprinterlist option\n"); + } + } +#endif + else if (strcmp(arg, "fp") == 0) { /* set font path */ + if (i >= argc) { + arg = "default"; + } else { + arg = nextarg(i, argv); + } + set_font_path(dpy, arg, 1, 0, 0); /* special argument */ + i++; + } else if (strcmp(arg, "fp=") == 0) { /* unconditionally set */ + if (i >= argc) { + usage("missing fp= argument", NULL); + } else { + arg = nextarg(i, argv); + } + set_font_path(dpy, arg, 0, 0, 0); /* not special, set */ + i++; + } else if (strcmp(arg, "+fp") == 0) { /* set font path */ + if (i >= argc) + usage("missing +fp argument", NULL); + arg = nextarg(i, argv); + set_font_path(dpy, arg, 0, 1, 0); /* not special, prepend */ + i++; + } else if (strcmp(arg, "fp+") == 0) { /* set font path */ + if (i >= argc) + usage("missing fp+ argument", NULL); + arg = nextarg(i, argv); + set_font_path(dpy, arg, 0, 0, 1); /* not special, append */ + i++; + } else if (strcmp(arg, "-fp") == 0) { /* set font path */ + if (i >= argc) + usage("missing -fp argument", NULL); + arg = nextarg(i, argv); + set_font_path(dpy, arg, 0, -1, 0); /* not special, preremove */ + i++; + } else if (strcmp(arg, "fp-") == 0) { /* set font path */ + if (i >= argc) + usage("missing fp- argument", NULL); + arg = nextarg(i, argv); + set_font_path(dpy, arg, 0, 0, -1); /* not special, postremove */ + i++; + } else if (strcmp(arg, "-led") == 0) { /* Turn off one or all LEDs */ + values.led_mode = OFF; + values.led = ALL; /* None specified */ + if (i >= argc) { + set_led(dpy, values.led, values.led_mode); + break; + } + arg = nextarg(i, argv); + if (is_number(arg, 32) && atoi(arg) > 0) { + values.led = atoi(arg); + i++; + } + set_led(dpy, values.led, values.led_mode); + } else if (strcmp(arg, "led") == 0) { /* Turn on one or all LEDs */ + values.led_mode = ON; + values.led = ALL; + if (i >= argc) { + set_led(dpy, values.led, + values.led_mode); /* set led to def */ + break; + } + arg = nextarg(i, argv); + if (strcmp(arg, "on") == 0) { + i++; + } else if (strcmp(arg, "off") == 0) { /* ...except in this case. */ + values.led_mode = OFF; + i++; + } else if (is_number(arg, 32) && atoi(arg) > 0) { + values.led = atoi(arg); + i++; + } + set_led(dpy, values.led, values.led_mode); + } +/* Set pointer (mouse) settings: Acceleration and Threshold. */ + else if (strcmp(arg, "m") == 0 || strcmp(arg, "mouse") == 0) { + acc_num = SERVER_DEFAULT; /* restore server defaults */ + acc_denom = SERVER_DEFAULT; + threshold = SERVER_DEFAULT; + if (i >= argc) { + set_mouse(dpy, acc_num, acc_denom, threshold); + break; + } + arg = argv[i]; + if (strcmp(arg, "default") == 0) { + i++; + } else if (*arg >= '0' && *arg <= '9') { + acc_denom = 1; + sscanf(arg, "%d/%d", &acc_num, &acc_denom); + i++; + if (i >= argc) { + set_mouse(dpy, acc_num, acc_denom, threshold); + break; + } + arg = argv[i]; + if (*arg >= '0' && *arg <= '9') { + threshold = atoi(arg); /* Set threshold as user specified. */ + i++; + } + } + set_mouse(dpy, acc_num, acc_denom, threshold); + } +#ifdef DPMSExtension + else if (strcmp(arg, "+dpms") == 0) { /* turn on DPMS */ + int dummy; + + if (DPMSQueryExtension(dpy, &dummy, &dummy)) + DPMSEnable(dpy); + else + fprintf(stderr, + "server does not have extension for +dpms option\n"); + } else if (strcmp(arg, "-dpms") == 0) { /* shut off DPMS */ + int dummy; + + if (DPMSQueryExtension(dpy, &dummy, &dummy)) + DPMSDisable(dpy); + else + fprintf(stderr, + "server does not have extension for -dpms option\n"); + + } else if (strcmp(arg, "dpms") == 0) { /* tune DPMS */ + int dummy; + + if (DPMSQueryExtension(dpy, &dummy, &dummy)) { + DPMSGetTimeouts(dpy, &standby_timeout, &suspend_timeout, + &off_timeout); + if (i >= argc) { + DPMSEnable(dpy); + break; + } + arg = argv[i]; + if (*arg >= '0' && *arg <= '9') { + sscanf(arg, "%hu", &standby_timeout); + i++; + arg = argv[i]; + if ((arg) && (*arg >= '0' && *arg <= '9')) { + sscanf(arg, "%hu", &suspend_timeout); + i++; + arg = argv[i]; + if ((arg) && (*arg >= '0' && *arg <= '9')) { + sscanf(arg, "%hu", &off_timeout); + i++; + arg = argv[i]; + } + } + if ((suspend_timeout != 0) + && (standby_timeout > suspend_timeout)) { + fprintf(stderr, "illegal combination of values\n"); + fprintf(stderr, + " standby time of %d is greater than suspend time of %d\n", + standby_timeout, suspend_timeout); + exit(EXIT_FAILURE); + } + if ((off_timeout != 0) && (suspend_timeout > off_timeout)) { + fprintf(stderr, "illegal combination of values\n"); + fprintf(stderr, + " suspend time of %d is greater than off time of %d\n", + suspend_timeout, off_timeout); + exit(EXIT_FAILURE); + } + if ((suspend_timeout == 0) && (off_timeout != 0) && + (standby_timeout > off_timeout)) { + fprintf(stderr, "illegal combination of values\n"); + fprintf(stderr, + " standby time of %d is greater than off time of %d\n", + standby_timeout, off_timeout); + exit(EXIT_FAILURE); + } + DPMSEnable(dpy); + DPMSSetTimeouts(dpy, standby_timeout, suspend_timeout, + off_timeout); + } else if (i + 1 < argc && strcmp(arg, "force") == 0) { + i++; + arg = argv[i]; + /* + * The calls to usleep below are necessary to + * delay the actual DPMS mode setting briefly. + * Without them, it's likely that the mode will be + * set between the Down and Up key transitions, in + * which case the Up transition may immediately + * turn the display back on. + * + * On OS/2, use _sleep2() + */ + #ifdef HAVE_USLEEP # define Usleep(us) usleep((us)) #else @@ -617,230 +620,214 @@ for (i = 1; i < argc; ) { #endif #endif /* HAVE_USLEEP */ - if (strcmp(arg, "on") == 0) { - DPMSEnable(dpy); - DPMSForceLevel(dpy, DPMSModeOn); - i++; - } - else if (strcmp(arg, "standby") == 0) { - DPMSEnable(dpy); - Usleep(100000); - DPMSForceLevel(dpy, DPMSModeStandby); - i++; - } - else if (strcmp(arg, "suspend") == 0) { - DPMSEnable(dpy); - Usleep(100000); - DPMSForceLevel(dpy, DPMSModeSuspend); - i++; - } - else if (strcmp(arg, "off") == 0) { - DPMSEnable(dpy); - Usleep(100000); - DPMSForceLevel(dpy, DPMSModeOff); - i++; - } - else { - fprintf(stderr, "bad parameter %s\n", arg); - i++; - } - } - } - else { - fprintf(stderr, "server does not have extension for dpms option\n"); - } -} + if (strcmp(arg, "on") == 0) { + DPMSEnable(dpy); + DPMSForceLevel(dpy, DPMSModeOn); + i++; + } else if (strcmp(arg, "standby") == 0) { + DPMSEnable(dpy); + Usleep(100000); + DPMSForceLevel(dpy, DPMSModeStandby); + i++; + } else if (strcmp(arg, "suspend") == 0) { + DPMSEnable(dpy); + Usleep(100000); + DPMSForceLevel(dpy, DPMSModeSuspend); + i++; + } else if (strcmp(arg, "off") == 0) { + DPMSEnable(dpy); + Usleep(100000); + DPMSForceLevel(dpy, DPMSModeOff); + i++; + } else { + fprintf(stderr, "bad parameter %s\n", arg); + i++; + } + } + } else { + fprintf(stderr, + "server does not have extension for dpms option\n"); + } + } #endif /* DPMSExtension */ - else if (strcmp(arg, "s") == 0) { - if (i >= argc) { - set_saver(dpy, ALL, 0); /* Set everything to default */ - break; - } - arg = argv[i]; - if (strcmp(arg, "blank") == 0) { /* Alter blanking preference. */ - set_saver(dpy, PREFER_BLANK, PreferBlanking); - i++; - } - else if (strcmp(arg, "noblank") == 0) { /* Ditto. */ - set_saver(dpy, PREFER_BLANK, DontPreferBlanking); - i++; - } - else if (strcmp(arg, "expose") == 0) { /* Alter exposure preference. */ - set_saver(dpy, ALLOW_EXP, AllowExposures); - i++; - } - else if (strcmp(arg, "noexpose") == 0) { /* Ditto. */ - set_saver(dpy, ALLOW_EXP, DontAllowExposures); - i++; - } - else if (strcmp(arg, "off") == 0) { - set_saver(dpy, TIMEOUT, 0); /* Turn off screen saver. */ - i++; - if (i >= argc) - break; - arg = argv[i]; - if (strcmp(arg, "off") == 0) { - set_saver(dpy, INTERVAL, 0); - i++; - } - } - else if (strcmp(arg, "default") == 0) { /* Leave as default. */ - set_saver(dpy, ALL, SERVER_DEFAULT); - i++; - } - else if (strcmp(arg, "on") == 0) { /* Turn on. */ - set_saver(dpy, ALL, DEFAULT_TIMEOUT); - i++; - } - else if (strcmp(arg, "activate") == 0) { /* force it active */ - XActivateScreenSaver(dpy); - i++; - } - else if (strcmp(arg, "reset") == 0) { /* force it inactive */ - XResetScreenSaver(dpy); - i++; - } - else if (*arg >= '0' && *arg <= '9') { /* Set as user wishes. */ - set_saver(dpy, TIMEOUT, atoi(arg)); - i++; - if (i >= argc) - break; - arg = argv[i]; - if (*arg >= '0' && *arg <= '9') { - set_saver(dpy, INTERVAL, atoi(arg)); - i++; - } - } - } - else if (strcmp(arg, "-r") == 0) { /* Turn off one or all autorepeats */ - auto_repeat_mode = OFF; - key = ALL; /* None specified */ - arg = argv[i]; - if (i < argc) - if (is_number(arg, 255)) { - key = atoi(arg); - i++; - } - set_repeat(dpy, key, auto_repeat_mode); - } - else if (strcmp(arg, "r") == 0) { /* Turn on one or all autorepeats */ - auto_repeat_mode = ON; - key = ALL; /* None specified */ - arg = argv[i]; - if (i < argc) { - if (strcmp(arg, "on") == 0) { - i++; - } - else if (strcmp(arg, "off") == 0) { /* ...except in this case */ - auto_repeat_mode = OFF; - i++; - } + else if (strcmp(arg, "s") == 0) { + if (i >= argc) { + set_saver(dpy, ALL, 0); /* Set everything to default */ + break; + } + arg = argv[i]; + if (strcmp(arg, "blank") == 0) { /* Alter blanking preference. */ + set_saver(dpy, PREFER_BLANK, PreferBlanking); + i++; + } else if (strcmp(arg, "noblank") == 0) { /* Ditto. */ + set_saver(dpy, PREFER_BLANK, DontPreferBlanking); + i++; + } else if (strcmp(arg, "expose") == 0) { /* Alter exposure preference. */ + set_saver(dpy, ALLOW_EXP, AllowExposures); + i++; + } else if (strcmp(arg, "noexpose") == 0) { /* Ditto. */ + set_saver(dpy, ALLOW_EXP, DontAllowExposures); + i++; + } else if (strcmp(arg, "off") == 0) { + set_saver(dpy, TIMEOUT, 0); /* Turn off screen saver. */ + i++; + if (i >= argc) + break; + arg = argv[i]; + if (strcmp(arg, "off") == 0) { + set_saver(dpy, INTERVAL, 0); + i++; + } + } else if (strcmp(arg, "default") == 0) { /* Leave as default. */ + set_saver(dpy, ALL, SERVER_DEFAULT); + i++; + } else if (strcmp(arg, "on") == 0) { /* Turn on. */ + set_saver(dpy, ALL, DEFAULT_TIMEOUT); + i++; + } else if (strcmp(arg, "activate") == 0) { /* force it active */ + XActivateScreenSaver(dpy); + i++; + } else if (strcmp(arg, "reset") == 0) { /* force it inactive */ + XResetScreenSaver(dpy); + i++; + } else if (*arg >= '0' && *arg <= '9') { /* Set as user wishes. */ + set_saver(dpy, TIMEOUT, atoi(arg)); + i++; + if (i >= argc) + break; + arg = argv[i]; + if (*arg >= '0' && *arg <= '9') { + set_saver(dpy, INTERVAL, atoi(arg)); + i++; + } + } + } else if (strcmp(arg, "-r") == 0) { /* Turn off one or + all autorepeats */ + auto_repeat_mode = OFF; + key = ALL; /* None specified */ + arg = argv[i]; + if (i < argc) + if (is_number(arg, 255)) { + key = atoi(arg); + i++; + } + set_repeat(dpy, key, auto_repeat_mode); + } else if (strcmp(arg, "r") == 0) { /* Turn on one or + all autorepeats */ + auto_repeat_mode = ON; + key = ALL; /* None specified */ + arg = argv[i]; + if (i < argc) { + if (strcmp(arg, "on") == 0) { + i++; + } else if (strcmp(arg, "off") == 0) { /* ...except in + this case */ + auto_repeat_mode = OFF; + i++; + } #if defined(XF86MISC) || defined(XKB) - else if (strcmp(arg, "rate") == 0) { /* ...or this one. */ - int delay = 0, rate = 0; + else if (strcmp(arg, "rate") == 0) { /* ...or this one. */ + int delay = 0, rate = 0; + #ifdef XF86MISC - int rate_set = 0; - if (XF86MiscQueryVersion(dpy, &major, &minor)) { - delay=KBDDELAY_DEFAULT, rate=KBDRATE_DEFAULT; - } else { - miscpresent = 0; - } + int rate_set = 0; + + if (XF86MiscQueryVersion(dpy, &major, &minor)) { + delay = KBDDELAY_DEFAULT, rate = KBDRATE_DEFAULT; + } else { + miscpresent = 0; + } #endif #ifdef XKB - if (XkbQueryExtension(dpy, &xkbopcode, &xkbevent, &xkberror, &xkbmajor, - &xkbminor)) { - delay=XKBDDELAY_DEFAULT, rate=XKBDRATE_DEFAULT; - } else { - xkbpresent = 0; - } + if (XkbQueryExtension(dpy, &xkbopcode, &xkbevent, + &xkberror, &xkbmajor, &xkbminor)) { + delay = XKBDDELAY_DEFAULT, rate = XKBDRATE_DEFAULT; + } else { + xkbpresent = 0; + } #endif - if (!miscpresent && !xkbpresent) - fprintf(stderr, - "server does not have extension for \"r rate\" option\n"); - i++; - arg = argv[i]; - if (i < argc) { - if (is_number(arg, 10000) && atoi(arg)>0) { - delay = atoi(arg); - i++; - arg = argv[i]; - if (i < argc) { - if (is_number(arg, 255) && atoi(arg)>0) { - rate = atoi(arg); - i++; - } - } - } - } + if (!miscpresent && !xkbpresent) + fprintf(stderr, + "server does not have extension for \"r rate\" option\n"); + i++; + arg = argv[i]; + if (i < argc) { + if (is_number(arg, 10000) && atoi(arg) > 0) { + delay = atoi(arg); + i++; + arg = argv[i]; + if (i < argc) { + if (is_number(arg, 255) && atoi(arg) > 0) { + rate = atoi(arg); + i++; + } + } + } + } #ifdef XKB - if (xkbpresent) { - xkbset_repeatrate(dpy, delay, 1000/rate); + if (xkbpresent) { + xkbset_repeatrate(dpy, delay, 1000 / rate); #ifdef XF86MISC - rate_set = 1; + rate_set = 1; #endif - } + } #endif #ifdef XF86MISC - if (miscpresent && !rate_set) { - set_repeatrate(dpy, delay, rate); - } + if (miscpresent && !rate_set) { + set_repeatrate(dpy, delay, rate); + } #endif - } + } #endif - else if (is_number(arg, 255)) { - key = atoi(arg); - i++; + else if (is_number(arg, 255)) { + key = atoi(arg); + i++; + } + } + set_repeat(dpy, key, auto_repeat_mode); + } else if (strcmp(arg, "p") == 0) { + if (i + 1 >= argc) + usage("missing argument to p", NULL); + arg = argv[i]; + if (numpixels >= MAX_PIXEL_COUNT) + usage("more than %d pixels specified", MAX_PIXEL_COUNT); + if (*arg >= '0' && *arg <= '9') + pixels[numpixels] = atoi(arg); + else + usage("invalid pixel number %s", arg); + i++; + colors[numpixels] = argv[i]; + i++; + numpixels++; + } else if (strcmp(arg, "-k") == 0) { + set_lock(dpy, OFF); + } else if (strcmp(arg, "k") == 0) { + set_lock(dpy, ON); + } else if (strcmp(arg, "q") == 0 || strcmp(arg, "-q") == 0) { + query(dpy); + } else + usage("unknown option %s", arg); } - } - set_repeat(dpy, key, auto_repeat_mode); - } - else if (strcmp(arg, "p") == 0) { - if (i + 1 >= argc) - usage ("missing argument to p", NULL); - arg = argv[i]; - if (numpixels >= MAX_PIXEL_COUNT) - usage ("more than %d pixels specified", MAX_PIXEL_COUNT); - if (*arg >= '0' && *arg <= '9') - pixels[numpixels] = atoi(arg); - else - usage ("invalid pixel number %s", arg); - i++; - colors[numpixels] = argv[i]; - i++; - numpixels++; - } - else if (strcmp(arg, "-k") == 0) { - set_lock(dpy, OFF); - } - else if (strcmp(arg, "k") == 0) { - set_lock(dpy, ON); - } - else if (strcmp(arg, "q") == 0 || strcmp(arg, "-q") == 0) { - query(dpy); - } - else - usage ("unknown option %s", arg); -} -if (numpixels) - set_pixels(dpy, pixels, colors, numpixels); + if (numpixels) + set_pixels(dpy, pixels, colors, numpixels); -XCloseDisplay (dpy); + XCloseDisplay(dpy); -exit(error_status); /* Done. We can go home now. */ + exit(error_status); /* Done. We can go home now. */ } static int is_number(char *arg, int maximum) { - register char *p; + register char *p; - if (arg[0] == '-' && arg[1] == '1' && arg[2] == '\0') - return(1); - for (p=arg; isdigit(*p); p++); - if (*p || atoi(arg) > maximum) - return(0); - return(1); + if (arg[0] == '-' && arg[1] == '1' && arg[2] == '\0') + return (1); + for (p = arg; isdigit(*p); p++) ; + if (*p || atoi(arg) > maximum) + return (0); + return (1); } /* These next few functions do the real work (xsetting things). @@ -848,57 +835,61 @@ is_number(char *arg, int maximum) static void set_click(Display *dpy, int percent) { -XKeyboardControl values; -XKeyboardState kbstate; -values.key_click_percent = percent; -if (percent == DEFAULT_ON) - values.key_click_percent = SERVER_DEFAULT; -XChangeKeyboardControl(dpy, KBKeyClickPercent, &values); -if (percent == DEFAULT_ON) { - XGetKeyboardControl(dpy, &kbstate); - if (!kbstate.key_click_percent) { - values.key_click_percent = -percent; + XKeyboardControl values; + XKeyboardState kbstate; + + values.key_click_percent = percent; + if (percent == DEFAULT_ON) + values.key_click_percent = SERVER_DEFAULT; XChangeKeyboardControl(dpy, KBKeyClickPercent, &values); - } -} -return; + if (percent == DEFAULT_ON) { + XGetKeyboardControl(dpy, &kbstate); + if (!kbstate.key_click_percent) { + values.key_click_percent = -percent; + XChangeKeyboardControl(dpy, KBKeyClickPercent, &values); + } + } + return; } static void set_bell_vol(Display *dpy, int percent) { -XKeyboardControl values; -XKeyboardState kbstate; -values.bell_percent = percent; -if (percent == DEFAULT_ON) - values.bell_percent = SERVER_DEFAULT; -XChangeKeyboardControl(dpy, KBBellPercent, &values); -if (percent == DEFAULT_ON) { - XGetKeyboardControl(dpy, &kbstate); - if (!kbstate.bell_percent) { - values.bell_percent = -percent; + XKeyboardControl values; + XKeyboardState kbstate; + + values.bell_percent = percent; + if (percent == DEFAULT_ON) + values.bell_percent = SERVER_DEFAULT; XChangeKeyboardControl(dpy, KBBellPercent, &values); - } -} -return; + if (percent == DEFAULT_ON) { + XGetKeyboardControl(dpy, &kbstate); + if (!kbstate.bell_percent) { + values.bell_percent = -percent; + XChangeKeyboardControl(dpy, KBBellPercent, &values); + } + } + return; } static void set_bell_pitch(Display *dpy, int pitch) { -XKeyboardControl values; -values.bell_pitch = pitch; -XChangeKeyboardControl(dpy, KBBellPitch, &values); -return; + XKeyboardControl values; + + values.bell_pitch = pitch; + XChangeKeyboardControl(dpy, KBBellPitch, &values); + return; } static void set_bell_dur(Display *dpy, int duration) { -XKeyboardControl values; -values.bell_duration = duration; -XChangeKeyboardControl(dpy, KBBellDuration, &values); -return; + XKeyboardControl values; + + values.bell_duration = duration; + XChangeKeyboardControl(dpy, KBBellDuration, &values); + return; } /* @@ -915,25 +906,27 @@ return; static void set_font_path(Display *dpy, char *path, int special, int before, int after) { - char **directoryList = NULL; int ndirs = 0; - char **currentList = NULL; int ncurrent = 0; + char **directoryList = NULL; + int ndirs = 0; + char **currentList = NULL; + int ncurrent = 0; if (special) { - if (strcmp (path, "default") == 0) { - XSetFontPath (dpy, NULL, 0); + if (strcmp(path, "default") == 0) { + XSetFontPath(dpy, NULL, 0); return; } - if (strcmp (path, "rehash") == 0) { - currentList = XGetFontPath (dpy, &ncurrent); + if (strcmp(path, "rehash") == 0) { + currentList = XGetFontPath(dpy, &ncurrent); if (!currentList) { - fprintf (stderr, "%s: unable to get current font path.\n", - progName); + fprintf(stderr, "%s: unable to get current font path.\n", + progName); return; } - XSetFontPath (dpy, currentList, ncurrent); - XFreeFontPath (currentList); + XSetFontPath(dpy, currentList, ncurrent); + XFreeFontPath(currentList); return; - } + } /* * for now, fall though and process keyword and directory list for * compatibility with previous versions. @@ -946,10 +939,9 @@ set_font_path(Display *dpy, char *path, int special, int before, int after) */ if (before != 0 || after != 0) { - currentList = XGetFontPath (dpy, &ncurrent); + currentList = XGetFontPath(dpy, &ncurrent); if (!currentList) { - fprintf (stderr, "%s: unable to get old font path.\n", - progName); + fprintf(stderr, "%s: unable to get old font path.\n", progName); before = after = 0; } } @@ -965,8 +957,9 @@ set_font_path(Display *dpy, char *path, int special, int before, int after) } } - directoryList = (char **) malloc (ndirs*sizeof (char *)); - if (!directoryList) error ("out of memory for font path directory list"); + directoryList = (char **)malloc(ndirs * sizeof(char *)); + if (!directoryList) + error("out of memory for font path directory list"); { /* mung the path and set directoryList pointers */ @@ -979,69 +972,74 @@ set_font_path(Display *dpy, char *path, int special, int before, int after) *cp++ = '\0'; } if (i != ndirs) { - fprintf (stderr, - "%s: internal error, only parsed %d of %d directories.\n", - progName, i, ndirs); - exit (EXIT_FAILURE); + fprintf(stderr, + "%s: internal error, only parsed %d of %d directories.\n", + progName, i, ndirs); + exit(EXIT_FAILURE); } } - + /* * now we have have parsed the input path, so we can set it */ if (before == 0 && after == 0) { - XSetFontPath (dpy, directoryList, ndirs); + XSetFontPath(dpy, directoryList, ndirs); } /* if adding to list, build a superset */ if (before > 0 || after > 0) { int nnew = ndirs + ncurrent; - char **newList = (char **) malloc (nnew * sizeof (char *)); - - if (!newList) error ("out of memory"); - if (before > 0) { /* new + current */ - memmove( (char *) newList, (char *) directoryList, - (unsigned) (ndirs*sizeof (char *))); - memmove( (char *) (newList + ndirs), (char *) currentList, - (unsigned) (ncurrent*sizeof (char *))); - XSetFontPath (dpy, newList, nnew); + char **newList = (char **)malloc(nnew * sizeof(char *)); + + if (!newList) + error("out of memory"); + if (before > 0) { /* new + current */ + memmove((char *)newList, (char *)directoryList, + (unsigned)(ndirs * sizeof(char *))); + memmove((char *)(newList + ndirs), (char *)currentList, + (unsigned)(ncurrent * sizeof(char *))); + XSetFontPath(dpy, newList, nnew); } else if (after > 0) { - memmove( (char *) newList, (char *) currentList, - (unsigned) (ncurrent*sizeof (char *))); - memmove( (char *) (newList + ncurrent), (char *) directoryList, - (unsigned) (ndirs*sizeof (char *))); - XSetFontPath (dpy, newList, nnew); - } - free ((char *) newList); + memmove((char *)newList, (char *)currentList, + (unsigned)(ncurrent * sizeof(char *))); + memmove((char *)(newList + ncurrent), (char *)directoryList, + (unsigned)(ndirs * sizeof(char *))); + XSetFontPath(dpy, newList, nnew); + } + free((char *)newList); } /* if deleting from list, build one the same size */ if (before < 0 || after < 0) { int i, j; int nnew = 0; - char **newList = (char **) malloc (ncurrent * sizeof (char *)); - - if (!newList) error ("out of memory"); + char **newList = (char **)malloc(ncurrent * sizeof(char *)); + + if (!newList) + error("out of memory"); for (i = 0; i < ncurrent; i++) { for (j = 0; j < ndirs; j++) { - if (strcmp (currentList[i], directoryList[j]) == 0) - break; + if (strcmp(currentList[i], directoryList[j]) == 0) + break; } /* if we ran out, then insert into new list */ - if (j == ndirs) newList[nnew++] = currentList[i]; + if (j == ndirs) + newList[nnew++] = currentList[i]; } if (nnew == ncurrent) { - fprintf (stderr, - "%s: warning, no entries deleted from font path.\n", - progName); + fprintf(stderr, + "%s: warning, no entries deleted from font path.\n", + progName); } - XSetFontPath (dpy, newList, nnew); - free ((char *) newList); + XSetFontPath(dpy, newList, nnew); + free((char *)newList); } - if (directoryList) free ((char *) directoryList); - if (currentList) XFreeFontPath (currentList); + if (directoryList) + free((char *)directoryList); + if (currentList) + XFreeFontPath(currentList); return; } @@ -1049,197 +1047,206 @@ set_font_path(Display *dpy, char *path, int special, int before, int after) static void set_led(Display *dpy, int led, int led_mode) { - XKeyboardControl values; - values.led_mode = led_mode; - if (led != ALL) { - values.led = led; - XChangeKeyboardControl(dpy, KBLed | KBLedMode, &values); - } - else { - XChangeKeyboardControl(dpy, KBLedMode, &values); - } - return; + XKeyboardControl values; + + values.led_mode = led_mode; + if (led != ALL) { + values.led = led; + XChangeKeyboardControl(dpy, KBLed | KBLedMode, &values); + } else { + XChangeKeyboardControl(dpy, KBLedMode, &values); + } + return; } static void set_mouse(Display *dpy, int acc_num, int acc_denom, int threshold) { -int do_accel = True, do_threshold = True; + int do_accel = True, do_threshold = True; -if (acc_num == DONT_CHANGE) /* what an incredible crock... */ - do_accel = False; -if (threshold == DONT_CHANGE) - do_threshold = False; -if (acc_num < 0) /* shouldn't happen */ - acc_num = SERVER_DEFAULT; -if (acc_denom <= 0) /* prevent divide by zero */ - acc_denom = SERVER_DEFAULT; -if (threshold < 0) threshold = SERVER_DEFAULT; -XChangePointerControl(dpy, do_accel, do_threshold, acc_num, - acc_denom, threshold); -return; + if (acc_num == DONT_CHANGE) /* what an incredible crock... */ + do_accel = False; + if (threshold == DONT_CHANGE) + do_threshold = False; + if (acc_num < 0) /* shouldn't happen */ + acc_num = SERVER_DEFAULT; + if (acc_denom <= 0) /* prevent divide by zero */ + acc_denom = SERVER_DEFAULT; + if (threshold < 0) + threshold = SERVER_DEFAULT; + XChangePointerControl(dpy, do_accel, do_threshold, acc_num, + acc_denom, threshold); + return; } static void set_saver(Display *dpy, int mask, int value) { - int timeout, interval, prefer_blank, allow_exp; - XGetScreenSaver(dpy, &timeout, &interval, &prefer_blank, - &allow_exp); - if (mask == TIMEOUT) timeout = value; - if (mask == INTERVAL) interval = value; - if (mask == PREFER_BLANK) prefer_blank = value; - if (mask == ALLOW_EXP) allow_exp = value; - if (mask == ALL) { - timeout = SERVER_DEFAULT; - interval = SERVER_DEFAULT; - prefer_blank = DefaultBlanking; - allow_exp = DefaultExposures; - } - XSetScreenSaver(dpy, timeout, interval, prefer_blank, - allow_exp); - if (mask == ALL && value == DEFAULT_TIMEOUT) { + int timeout, interval, prefer_blank, allow_exp; + XGetScreenSaver(dpy, &timeout, &interval, &prefer_blank, &allow_exp); - if (!timeout) - XSetScreenSaver(dpy, -DEFAULT_TIMEOUT, interval, prefer_blank, - allow_exp); - } - return; + if (mask == TIMEOUT) + timeout = value; + if (mask == INTERVAL) + interval = value; + if (mask == PREFER_BLANK) + prefer_blank = value; + if (mask == ALLOW_EXP) + allow_exp = value; + if (mask == ALL) { + timeout = SERVER_DEFAULT; + interval = SERVER_DEFAULT; + prefer_blank = DefaultBlanking; + allow_exp = DefaultExposures; + } + XSetScreenSaver(dpy, timeout, interval, prefer_blank, allow_exp); + if (mask == ALL && value == DEFAULT_TIMEOUT) { + XGetScreenSaver(dpy, &timeout, &interval, &prefer_blank, &allow_exp); + if (!timeout) + XSetScreenSaver(dpy, -DEFAULT_TIMEOUT, interval, prefer_blank, + allow_exp); + } + return; } static void set_repeat(Display *dpy, int key, int auto_repeat_mode) { - XKeyboardControl values; - values.auto_repeat_mode = auto_repeat_mode; - if (key != ALL) { - values.key = key; - XChangeKeyboardControl(dpy, KBKey | KBAutoRepeatMode, &values); - } - else { - XChangeKeyboardControl(dpy, KBAutoRepeatMode, &values); - } - return; + XKeyboardControl values; + + values.auto_repeat_mode = auto_repeat_mode; + if (key != ALL) { + values.key = key; + XChangeKeyboardControl(dpy, KBKey | KBAutoRepeatMode, &values); + } else { + XChangeKeyboardControl(dpy, KBAutoRepeatMode, &values); + } + return; } #ifdef XF86MISC -static void +static void set_repeatrate(Display *dpy, int delay, int rate) { - XF86MiscKbdSettings values; + XF86MiscKbdSettings values; - XF86MiscGetKbdSettings(dpy, &values); - values.delay = delay; - values.rate = rate; - XF86MiscSetKbdSettings(dpy, &values); - return; + XF86MiscGetKbdSettings(dpy, &values); + values.delay = delay; + values.rate = rate; + XF86MiscSetKbdSettings(dpy, &values); + return; } #endif #ifdef XKB -static void +static void xkbset_repeatrate(Display *dpy, int delay, int interval) { - XkbDescPtr xkb = XkbAllocKeyboard(); - if (!xkb) - return; - XkbGetControls(dpy, XkbRepeatKeysMask, xkb); - xkb->ctrls->repeat_delay = delay; - xkb->ctrls->repeat_interval = interval; - XkbSetControls(dpy, XkbRepeatKeysMask, xkb); - XkbFreeKeyboard(xkb, 0, True); + XkbDescPtr xkb = XkbAllocKeyboard(); + + if (!xkb) + return; + XkbGetControls(dpy, XkbRepeatKeysMask, xkb); + xkb->ctrls->repeat_delay = delay; + xkb->ctrls->repeat_interval = interval; + XkbSetControls(dpy, XkbRepeatKeysMask, xkb); + XkbFreeKeyboard(xkb, 0, True); } #endif static void -set_pixels(Display *dpy, unsigned long *pixels, caddr_t *colors, int numpixels) +set_pixels(Display *dpy, unsigned long *pixels, caddr_t * colors, + int numpixels) { - XColor def; - int scr = DefaultScreen (dpy); - Visual *visual = DefaultVisual (dpy, scr); - Colormap cmap = DefaultColormap (dpy, scr); - unsigned long max_cells = DisplayCells(dpy, scr); - XVisualInfo viproto, *vip; - int nvisuals = 0; - char *visual_type = NULL; - int i; + XColor def; + int scr = DefaultScreen(dpy); + Visual *visual = DefaultVisual(dpy, scr); + Colormap cmap = DefaultColormap(dpy, scr); + unsigned long max_cells = DisplayCells(dpy, scr); + XVisualInfo viproto, *vip; + int nvisuals = 0; + char *visual_type = NULL; + int i; - viproto.visualid = XVisualIDFromVisual (visual); - vip = XGetVisualInfo (dpy, VisualIDMask, &viproto, &nvisuals); - if (!vip) { - fprintf (stderr, "%s: Can't get visual for visualID 0x%x\n", - progName, (unsigned int)viproto.visualid); - return; - } + viproto.visualid = XVisualIDFromVisual(visual); + vip = XGetVisualInfo(dpy, VisualIDMask, &viproto, &nvisuals); + if (!vip) { + fprintf(stderr, "%s: Can't get visual for visualID 0x%x\n", + progName, (unsigned int)viproto.visualid); + return; + } - switch (vip->class) { - case GrayScale: - case PseudoColor: + switch (vip->class) { + case GrayScale: + case PseudoColor: break; - case TrueColor: + case TrueColor: visual_type = "TrueColor"; /* fall through */ - case DirectColor: + case DirectColor: max_cells *= max_cells * max_cells; break; - case StaticGray: + case StaticGray: visual_type = "StaticGray"; break; - case StaticColor: + case StaticColor: visual_type = "StaticColor"; break; - default: - fprintf (stderr, "%s: unknown visual class type %d\n", - progName, vip->class); + default: + fprintf(stderr, "%s: unknown visual class type %d\n", + progName, vip->class); numpixels = 0; - } - - if (visual_type) { - fprintf (stderr, "%s: cannot set pixel values in read-only %s visuals\n", - progName, visual_type); - } else { - for (i = 0; i < numpixels; i++) { - def.pixel = pixels[i]; - if (def.pixel >= max_cells) - fprintf(stderr, - "%s: pixel value %ld out of colormap range 0 through %ld\n", - progName, def.pixel, max_cells - 1); - else { - if (XParseColor (dpy, cmap, colors[i], &def)) - XStoreColor(dpy, cmap, &def); - else - fprintf (stderr, "%s: invalid color \"%s\"\n", progName, colors[i]); - } } - } - XFree ((char *) vip); + if (visual_type) { + fprintf(stderr, + "%s: cannot set pixel values in read-only %s visuals\n", + progName, visual_type); + } else { + for (i = 0; i < numpixels; i++) { + def.pixel = pixels[i]; + if (def.pixel >= max_cells) + fprintf(stderr, + "%s: pixel value %ld out of colormap range 0 through %ld\n", + progName, def.pixel, max_cells - 1); + else { + if (XParseColor(dpy, cmap, colors[i], &def)) + XStoreColor(dpy, cmap, &def); + else + fprintf(stderr, "%s: invalid color \"%s\"\n", progName, + colors[i]); + } + } + } - return; + XFree((char *)vip); + + return; } static void set_lock(Display *dpy, Bool onoff) { - XModifierKeymap *mods; - mods = XGetModifierMapping(dpy); + XModifierKeymap *mods; - if (onoff) - mods = XInsertModifiermapEntry(mods, (KeyCode) XK_Caps_Lock, LockMapIndex); - else - mods = XDeleteModifiermapEntry(mods, (KeyCode) XK_Caps_Lock, LockMapIndex); - XSetModifierMapping(dpy, mods); - XFreeModifiermap(mods); - return; + mods = XGetModifierMapping(dpy); + + if (onoff) + mods = + XInsertModifiermapEntry(mods, (KeyCode) XK_Caps_Lock, + LockMapIndex); + else + mods = + XDeleteModifiermapEntry(mods, (KeyCode) XK_Caps_Lock, + LockMapIndex); + XSetModifierMapping(dpy, mods); + XFreeModifiermap(mods); + return; } #ifdef FONTCACHE static Status -set_font_cache(dpy, himark, lowmark, balance) - Display *dpy; - long himark; - long lowmark; - long balance; +set_font_cache(Display *dpy, long himark, long lowmark, long balance) { FontCacheSettings cs; Status status; @@ -1254,203 +1261,205 @@ set_font_cache(dpy, himark, lowmark, balance) #endif static char * -on_or_off(int val, int onval, char *onstr, - int offval, char *offstr, char buf[]) +on_or_off(int val, int onval, char *onstr, + int offval, char *offstr, char buf[]) { - if (val == onval) - return onstr; + if (val == onval) + return onstr; else if (val == offval) - return offstr; + return offstr; buf[0] = '\0'; - sprintf (buf, "<%d>", val); + sprintf(buf, "<%d>", val); return buf; } - /* This is the information-getting function for telling the user what the * current "xsettings" are. */ static void query(Display *dpy) { -int scr = DefaultScreen (dpy); -XKeyboardState values; -int acc_num, acc_denom, threshold; -int timeout, interval, prefer_blank, allow_exp; -int dummy; + int scr = DefaultScreen(dpy); + XKeyboardState values; + int acc_num, acc_denom, threshold; + int timeout, interval, prefer_blank, allow_exp; + int dummy; + #ifdef XF86MISC -XF86MiscKbdSettings kbdinfo; + XF86MiscKbdSettings kbdinfo; #endif #ifdef XKB -XkbDescPtr xkb; -int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion; -int xkbopcode, xkbevent, xkberror; + XkbDescPtr xkb; + int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion; + int xkbopcode, xkbevent, xkberror; #endif -char **font_path; int npaths; -int i, j; -char buf[20]; /* big enough for 16 bit number */ + char **font_path; + int npaths; + int i, j; + char buf[20]; /* big enough for 16 bit number */ -XGetKeyboardControl(dpy, &values); -XGetPointerControl(dpy, &acc_num, &acc_denom, &threshold); -XGetScreenSaver(dpy, &timeout, &interval, &prefer_blank, &allow_exp); -font_path = XGetFontPath(dpy, &npaths); + XGetKeyboardControl(dpy, &values); + XGetPointerControl(dpy, &acc_num, &acc_denom, &threshold); + XGetScreenSaver(dpy, &timeout, &interval, &prefer_blank, &allow_exp); + font_path = XGetFontPath(dpy, &npaths); -printf ("Keyboard Control:\n"); -printf (" auto repeat: %s key click percent: %d LED mask: %08lx\n", - on_or_off (values.global_auto_repeat, - AutoRepeatModeOn, "on", AutoRepeatModeOff, "off", buf), - values.key_click_percent, values.led_mask); + printf("Keyboard Control:\n"); + printf + (" auto repeat: %s key click percent: %d LED mask: %08lx\n", + on_or_off(values.global_auto_repeat, AutoRepeatModeOn, "on", + AutoRepeatModeOff, "off", buf), values.key_click_percent, + values.led_mask); #ifdef XKB -if (XkbQueryExtension(dpy, &xkbopcode, &xkbevent, &xkberror, &xkbmajor, &xkbminor) - && (xkb = XkbAllocKeyboard()) != NULL - && XkbGetControls(dpy, XkbRepeatKeysMask, xkb) == Success) - printf (" auto repeat delay: %d repeat rate: %d\n", - xkb->ctrls->repeat_delay, 1000/xkb->ctrls->repeat_interval); + if (XkbQueryExtension(dpy, &xkbopcode, &xkbevent, &xkberror, &xkbmajor, + &xkbminor) + && (xkb = XkbAllocKeyboard()) != NULL + && XkbGetControls(dpy, XkbRepeatKeysMask, xkb) == Success) + printf(" auto repeat delay: %d repeat rate: %d\n", + xkb->ctrls->repeat_delay, 1000 / xkb->ctrls->repeat_interval); #ifdef XF86MISC -else + else #endif #endif #ifdef XF86MISC -if (XF86MiscQueryExtension(dpy, &dummy, &dummy) && - XF86MiscGetKbdSettings(dpy, &kbdinfo)) - printf (" auto repeat delay: %d repeat rate: %d\n", - kbdinfo.delay, kbdinfo.rate); + if (XF86MiscQueryExtension(dpy, &dummy, &dummy) && + XF86MiscGetKbdSettings(dpy, &kbdinfo)) + printf(" auto repeat delay: %d repeat rate: %d\n", + kbdinfo.delay, kbdinfo.rate); #endif -printf (" auto repeating keys: "); -for (i = 0; i < 4; i++) { - if (i) printf (" "); - for (j = 0; j < 8; j++) { - printf ("%02x", (unsigned char)values.auto_repeats[i*8 + j]); + printf(" auto repeating keys: "); + for (i = 0; i < 4; i++) { + if (i) + printf(" "); + for (j = 0; j < 8; j++) { + printf("%02x", (unsigned char)values.auto_repeats[i * 8 + j]); + } + printf("\n"); } - printf ("\n"); -} -printf (" bell percent: %d bell pitch: %d bell duration: %d\n", - values.bell_percent, values.bell_pitch, values.bell_duration); + printf(" bell percent: %d bell pitch: %d bell duration: %d\n", + values.bell_percent, values.bell_pitch, values.bell_duration); -printf ("Pointer Control:\n"); -printf (" acceleration: %d/%d threshold: %d\n", - acc_num, acc_denom, threshold); + printf("Pointer Control:\n"); + printf(" acceleration: %d/%d threshold: %d\n", + acc_num, acc_denom, threshold); -printf ("Screen Saver:\n"); -printf (" prefer blanking: %s ", - on_or_off (prefer_blank, PreferBlanking, "yes", - DontPreferBlanking, "no", buf)); -printf ("allow exposures: %s\n", - on_or_off (allow_exp, AllowExposures, "yes", - DontAllowExposures, "no", buf)); -printf (" timeout: %d cycle: %d\n", timeout, interval); + printf("Screen Saver:\n"); + printf(" prefer blanking: %s ", + on_or_off(prefer_blank, PreferBlanking, "yes", + DontPreferBlanking, "no", buf)); + printf("allow exposures: %s\n", + on_or_off(allow_exp, AllowExposures, "yes", + DontAllowExposures, "no", buf)); + printf(" timeout: %d cycle: %d\n", timeout, interval); -printf ("Colors:\n"); -printf (" default colormap: 0x%lx BlackPixel: %ld WhitePixel: %ld\n", - DefaultColormap (dpy, scr), - BlackPixel (dpy, scr), WhitePixel (dpy, scr)); + printf("Colors:\n"); + printf(" default colormap: 0x%lx BlackPixel: %ld WhitePixel: %ld\n", + DefaultColormap(dpy, scr), BlackPixel(dpy, scr), WhitePixel(dpy, + scr)); -printf ("Font Path:\n"); -if (npaths) { - printf( " %s", *font_path++ ); - for( --npaths; npaths; npaths-- ) - printf( ",%s", *font_path++ ); - printf( "\n" ); -} else { - printf (" (empty)\n"); -} + printf("Font Path:\n"); + if (npaths) { + printf(" %s", *font_path++); + for (--npaths; npaths; npaths--) + printf(",%s", *font_path++); + printf("\n"); + } else { + printf(" (empty)\n"); + } #ifdef MITMISC -{ - int dummy; - if (XMITMiscQueryExtension(dpy, &dummy, &dummy)) { - if (XMITMiscGetBugMode(dpy)) - printf ("Bug Mode: compatibility mode is enabled\n"); - else - printf ("Bug Mode: compatibility mode is disabled\n"); + { + int dummy; + + if (XMITMiscQueryExtension(dpy, &dummy, &dummy)) { + if (XMITMiscGetBugMode(dpy)) + printf("Bug Mode: compatibility mode is enabled\n"); + else + printf("Bug Mode: compatibility mode is disabled\n"); + } } -} #endif #ifdef DPMSExtension -{ - - int dummy; - CARD16 standby, suspend, off; - BOOL onoff; - CARD16 state; + { - printf("DPMS (Energy Star):\n"); - if (DPMSQueryExtension(dpy, &dummy, &dummy)) { - if (DPMSCapable(dpy)) { - DPMSGetTimeouts(dpy, &standby, &suspend, &off); - printf (" Standby: %d Suspend: %d Off: %d\n", - standby, suspend, off); - DPMSInfo(dpy, &state, &onoff); - if (onoff) { - printf(" DPMS is Enabled\n"); - switch (state) { - case DPMSModeOn: - printf(" Monitor is On\n"); - break; - case DPMSModeStandby: - printf(" Monitor is in Standby\n"); - break; - case DPMSModeSuspend: - printf(" Monitor is in Suspend\n"); - break; - case DPMSModeOff: - printf(" Monitor is Off\n"); - break; - default: - printf(" Unrecognized response from server\n"); - } - } - else - printf(" DPMS is Disabled\n"); - } - else - printf (" Display is not capable of DPMS\n"); - } - else { - printf (" Server does not have the DPMS Extension\n"); - } -} + int dummy; + CARD16 standby, suspend, off; + BOOL onoff; + CARD16 state; + + printf("DPMS (Energy Star):\n"); + if (DPMSQueryExtension(dpy, &dummy, &dummy)) { + if (DPMSCapable(dpy)) { + DPMSGetTimeouts(dpy, &standby, &suspend, &off); + printf(" Standby: %d Suspend: %d Off: %d\n", + standby, suspend, off); + DPMSInfo(dpy, &state, &onoff); + if (onoff) { + printf(" DPMS is Enabled\n"); + switch (state) { + case DPMSModeOn: + printf(" Monitor is On\n"); + break; + case DPMSModeStandby: + printf(" Monitor is in Standby\n"); + break; + case DPMSModeSuspend: + printf(" Monitor is in Suspend\n"); + break; + case DPMSModeOff: + printf(" Monitor is Off\n"); + break; + default: + printf(" Unrecognized response from server\n"); + } + } else + printf(" DPMS is Disabled\n"); + } else + printf(" Display is not capable of DPMS\n"); + } else { + printf(" Server does not have the DPMS Extension\n"); + } + } #endif #ifdef FONTCACHE -{ - int dummy; - FontCacheSettings cs; - int himark, lowmark, balance; + { + int dummy; + FontCacheSettings cs; + int himark, lowmark, balance; - printf("Font cache:\n"); - if (FontCacheQueryExtension(dpy, &dummy, &dummy)) { - if (FontCacheGetCacheSettings(dpy, &cs)) { - himark = cs.himark / 1024; - lowmark = cs.lowmark / 1024; - balance = cs.balance; - printf(" hi-mark (KB): %d low-mark (KB): %d balance (%%): %d\n", - himark, lowmark, balance); + printf("Font cache:\n"); + if (FontCacheQueryExtension(dpy, &dummy, &dummy)) { + if (FontCacheGetCacheSettings(dpy, &cs)) { + himark = cs.himark / 1024; + lowmark = cs.lowmark / 1024; + balance = cs.balance; + printf(" hi-mark (KB): %d low-mark (KB): %d balance (%%): %d\n", + himark, lowmark, balance); + } + } else { + printf(" Server does not have the FontCache Extension\n"); } - } else { - printf(" Server does not have the FontCache Extension\n"); } -} #endif #ifdef XF86MISC -{ - int dummy; - int maj, min; - XF86MiscFilePaths paths; + { + int dummy; + int maj, min; + XF86MiscFilePaths paths; - if (XF86MiscQueryExtension(dpy, &dummy, &dummy) && - XF86MiscQueryVersion(dpy, &maj, &min) && - ((maj > 0) || (maj == 0 && min >= 7)) && - XF86MiscGetFilePaths(dpy, &paths)) { - printf("File paths:\n"); - printf(" Config file: %s\n", paths.configfile); - printf(" Modules path: %s\n", paths.modulepath); - printf(" Log file: %s\n", paths.logfile); + if (XF86MiscQueryExtension(dpy, &dummy, &dummy) && + XF86MiscQueryVersion(dpy, &maj, &min) && + ((maj > 0) || (maj == 0 && min >= 7)) && + XF86MiscGetFilePaths(dpy, &paths)) { + printf("File paths:\n"); + printf(" Config file: %s\n", paths.configfile); + printf(" Modules path: %s\n", paths.modulepath); + printf(" Log file: %s\n", paths.logfile); + } } -} #endif -return; + return; } #ifdef FONTCACHE @@ -1461,8 +1470,7 @@ return; * current settings and statistics are. */ static void -query_cache_status(dpy) - Display *dpy; +query_cache_status(Display *dpy) { int dummy; FontCacheSettings cs; @@ -1508,103 +1516,104 @@ usage(char *fmt, ...) va_list ap; if (fmt) { - fprintf (stderr, "%s: ", progName); + fprintf(stderr, "%s: ", progName); va_start(ap, fmt); - vfprintf (stderr, fmt, ap); + vfprintf(stderr, fmt, ap); va_end(ap); - fprintf (stderr, "\n\n"); - + fprintf(stderr, "\n\n"); + } - fprintf (stderr, "usage: %s [-display host:dpy] option ...\n", progName); - fprintf (stderr, " To turn bell off:\n"); - fprintf (stderr, "\t-b b off b 0\n"); - fprintf (stderr, " To set bell volume, pitch and duration:\n"); - fprintf (stderr, "\t b [vol [pitch [dur]]] b on\n"); + fprintf(stderr, "usage: %s [-display host:dpy] option ...\n", progName); + fprintf(stderr, " To turn bell off:\n"); + fprintf(stderr, "\t-b b off b 0\n"); + fprintf(stderr, " To set bell volume, pitch and duration:\n"); + fprintf(stderr, "\t b [vol [pitch [dur]]] b on\n"); #ifdef MITMISC - fprintf (stderr, " To disable bug compatibility mode:\n"); - fprintf (stderr, "\t-bc\n"); - fprintf (stderr, " To enable bug compatibility mode:\n"); - fprintf (stderr, "\tbc\n"); + fprintf(stderr, " To disable bug compatibility mode:\n"); + fprintf(stderr, "\t-bc\n"); + fprintf(stderr, " To enable bug compatibility mode:\n"); + fprintf(stderr, "\tbc\n"); #endif - fprintf (stderr, " To turn keyclick off:\n"); - fprintf (stderr, "\t-c c off c 0\n"); - fprintf (stderr, " To set keyclick volume:\n"); - fprintf (stderr, "\t c [0-100] c on\n"); + fprintf(stderr, " To turn keyclick off:\n"); + fprintf(stderr, "\t-c c off c 0\n"); + fprintf(stderr, " To set keyclick volume:\n"); + fprintf(stderr, "\t c [0-100] c on\n"); #ifdef DPMSExtension - fprintf (stderr, " To control Energy Star (DPMS) features:\n"); - fprintf (stderr, "\t-dpms Energy Star features off\n"); - fprintf (stderr, "\t+dpms Energy Star features on\n"); - fprintf (stderr, "\t dpms [standby [suspend [off]]] \n"); - fprintf (stderr, "\t force standby \n"); - fprintf (stderr, "\t force suspend \n"); - fprintf (stderr, "\t force off \n"); - fprintf (stderr, "\t force on \n"); - fprintf (stderr, "\t (also implicitly enables DPMS features) \n"); - fprintf (stderr, "\t a timeout value of zero disables the mode \n"); + fprintf(stderr, " To control Energy Star (DPMS) features:\n"); + fprintf(stderr, "\t-dpms Energy Star features off\n"); + fprintf(stderr, "\t+dpms Energy Star features on\n"); + fprintf(stderr, "\t dpms [standby [suspend [off]]] \n"); + fprintf(stderr, "\t force standby \n"); + fprintf(stderr, "\t force suspend \n"); + fprintf(stderr, "\t force off \n"); + fprintf(stderr, "\t force on \n"); + fprintf(stderr, "\t (also implicitly enables DPMS features) \n"); + fprintf(stderr, "\t a timeout value of zero disables the mode \n"); #endif #ifdef FONTCACHE - fprintf (stderr, " To control font cache:\n"); - fprintf (stderr, "\t fc [hi-mark [low-mark [balance]]]\n"); - fprintf (stderr, "\t both mark values spcecified in KB\n"); - fprintf (stderr, "\t balance value spcecified in percent (10 - 90)\n"); - fprintf (stderr, " Show font cache statistics:\n"); - fprintf (stderr, "\t fc s\n"); + fprintf(stderr, " To control font cache:\n"); + fprintf(stderr, "\t fc [hi-mark [low-mark [balance]]]\n"); + fprintf(stderr, "\t both mark values spcecified in KB\n"); + fprintf(stderr, "\t balance value spcecified in percent (10 - 90)\n"); + fprintf(stderr, " Show font cache statistics:\n"); + fprintf(stderr, "\t fc s\n"); #endif #ifdef BUILD_PRINTSUPPORT - fprintf (stderr, " To control Xprint features:\n"); - fprintf (stderr, "\t rehashprinterlist Recomputes the list of available printers\n"); + fprintf(stderr, " To control Xprint features:\n"); + fprintf(stderr, + "\t rehashprinterlist Recomputes the list of available printers\n"); #endif - fprintf (stderr, " To set the font path:\n" ); - fprintf (stderr, "\t fp= path[,path...]\n" ); - fprintf (stderr, " To restore the default font path:\n"); - fprintf (stderr, "\t fp default\n"); - fprintf (stderr, " To have the server reread font databases:\n"); - fprintf (stderr, "\t fp rehash\n"); - fprintf (stderr, " To remove elements from font path:\n"); - fprintf (stderr, "\t-fp path[,path...] fp- path[,path...]\n"); - fprintf (stderr, " To prepend or append elements to font path:\n"); - fprintf (stderr, "\t+fp path[,path...] fp+ path[,path...]\n"); - fprintf (stderr, " To set LED states off or on:\n"); - fprintf (stderr, "\t-led [1-32] led off\n"); - fprintf (stderr, "\t led [1-32] led on\n"); - fprintf (stderr, " To set mouse acceleration and threshold:\n"); - fprintf (stderr, "\t m [acc_mult[/acc_div] [thr]] m default\n"); - fprintf (stderr, " To set pixel colors:\n"); - fprintf (stderr, "\t p pixel_value color_name\n"); - fprintf (stderr, " To turn auto-repeat off or on:\n"); - fprintf (stderr, "\t-r [keycode] r off\n"); - fprintf (stderr, "\t r [keycode] r on\n"); + fprintf(stderr, " To set the font path:\n"); + fprintf(stderr, "\t fp= path[,path...]\n"); + fprintf(stderr, " To restore the default font path:\n"); + fprintf(stderr, "\t fp default\n"); + fprintf(stderr, " To have the server reread font databases:\n"); + fprintf(stderr, "\t fp rehash\n"); + fprintf(stderr, " To remove elements from font path:\n"); + fprintf(stderr, "\t-fp path[,path...] fp- path[,path...]\n"); + fprintf(stderr, " To prepend or append elements to font path:\n"); + fprintf(stderr, "\t+fp path[,path...] fp+ path[,path...]\n"); + fprintf(stderr, " To set LED states off or on:\n"); + fprintf(stderr, "\t-led [1-32] led off\n"); + fprintf(stderr, "\t led [1-32] led on\n"); + fprintf(stderr, " To set mouse acceleration and threshold:\n"); + fprintf(stderr, "\t m [acc_mult[/acc_div] [thr]] m default\n"); + fprintf(stderr, " To set pixel colors:\n"); + fprintf(stderr, "\t p pixel_value color_name\n"); + fprintf(stderr, " To turn auto-repeat off or on:\n"); + fprintf(stderr, "\t-r [keycode] r off\n"); + fprintf(stderr, "\t r [keycode] r on\n"); #if defined(XF86MISC) || defined(XKB) - fprintf (stderr, "\t r rate [delay [rate]]\n"); + fprintf(stderr, "\t r rate [delay [rate]]\n"); #endif - fprintf (stderr, " For screen-saver control:\n"); - fprintf (stderr, "\t s [timeout [cycle]] s default s on\n"); - fprintf (stderr, "\t s blank s noblank s off\n"); - fprintf (stderr, "\t s expose s noexpose\n"); - fprintf (stderr, "\t s activate s reset\n"); - fprintf (stderr, " For status information: q\n"); + fprintf(stderr, " For screen-saver control:\n"); + fprintf(stderr, "\t s [timeout [cycle]] s default s on\n"); + fprintf(stderr, "\t s blank s noblank s off\n"); + fprintf(stderr, "\t s expose s noexpose\n"); + fprintf(stderr, "\t s activate s reset\n"); + fprintf(stderr, " For status information: q\n"); exit(EXIT_SUCCESS); } static void error(char *message) { - fprintf( stderr, "%s: %s\n", progName, message ); + fprintf(stderr, "%s: %s\n", progName, message); exit(EXIT_FAILURE); } - -static int +static int local_xerror(Display *dpy, XErrorEvent *rep) { if (rep->request_code == X_SetFontPath && rep->error_code == BadValue) { fprintf(stderr, "%s: bad font path element (#%ld), possible causes are:\n", progName, rep->resourceid); - fprintf(stderr," Directory does not exist or has wrong permissions\n"); - fprintf(stderr," Directory missing fonts.dir\n"); - fprintf(stderr," Incorrect font server address or syntax\n"); + fprintf(stderr, + " Directory does not exist or has wrong permissions\n"); + fprintf(stderr, " Directory missing fonts.dir\n"); + fprintf(stderr, " Incorrect font server address or syntax\n"); } else if (rep->request_code == X_StoreColors) { switch (rep->error_code) { case BadAccess: @@ -1616,11 +1625,11 @@ local_xerror(Display *dpy, XErrorEvent *rep) "%s: cannot store in pixel 0x%lx, invalid pixel number\n", progName, rep->resourceid); break; - default: - XmuPrintDefaultErrorMessage (dpy, rep, stderr); + default: + XmuPrintDefaultErrorMessage(dpy, rep, stderr); } } else - XmuPrintDefaultErrorMessage (dpy, rep, stderr); + XmuPrintDefaultErrorMessage(dpy, rep, stderr); error_status = -1; diff --git a/xset/xset.man b/xset/xset.man index 02a73e4..7d38d9e 100644 --- a/xset/xset.man +++ b/xset/xset.man @@ -199,6 +199,13 @@ option can be omitted, but if only one is given, it will be interpreted as the acceleration. If no parameters or the flag 'default' is used, the system defaults will be set. + +If the `threshold' parameter is provided and 0, the `acceleration' +parameter will be used in the exponent of a more natural and continous +formula, giving precise control for slow motion but big reach for fast +motion, and a progresive transition for motions in between. +Recommended `acceleration' value in this case is 3/2 to 2, but not +limited to that range. .PP .TP 8 .B p