├── AUTHORS ├── ChangeLog ├── INSTALL ├── LICENSE ├── Makefile.am ├── Makefile.in ├── README ├── TODO ├── acinclude.m4 ├── aclocal.m4 ├── autogen.sh ├── config.h.in ├── configure ├── configure.in ├── depcomp ├── install-sh ├── main.c ├── missing └── mkinstalldirs /AUTHORS: -------------------------------------------------------------------------------- 1 | Lubos Lunak 2 | XKB stuff by Oswald Buddenhagen 3 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2010-03-13 L.Lunak 2 | * 1.2 3 | * autotools upgrade 4 | 2005-10-03 L.Lunak 5 | * 1.1 6 | * toggle option from Chris Vanden Berghe 7 | * autotools upgrade from Martin-Eric Racine 8 | 2001-04-30 L.Lunak 9 | * 1.0 10 | * added XKB way of doing things from Oswald Buddenhagen 11 | * removed distro specific portions 12 | 2000-11-14 L.Lunak 13 | * 0.3 14 | 2000-08-30 L.Lunak 15 | * added more X11 cfg. paths 16 | * finally found out how to detect NumLock state without using XKB, 17 | i.e. replaced the test from KLeds by my own test 18 | 2000-06-28 L.Lunak 19 | * added /usr/X11R6/lib/X11/xdm/Xsetup_0 and 20 | /usr/X11R6/lib/X11/xinit/xinitrc as possible paths for X init files 21 | * added 'make user_xinitrc' 22 | 2000-06-14 L.Lunak 23 | * 0.2 - added another ugly hack, so it's now possible to detect 24 | NumLock state ( "borrowed" from KLeds 25 | by Hans Matzen ) 26 | * added configure & Co. 27 | 2000-02-18 ( or so ) L.Lunak 28 | * 0.1 - first version, ugly hack to change NumLock state in X 29 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------- 3 | Please see README for package specific installation details. 4 | -------------------------------------------------------------- 5 | 6 | Basic Installation 7 | ================== 8 | 9 | These are generic installation instructions. 10 | 11 | The `configure' shell script attempts to guess correct values for 12 | various system-dependent variables used during compilation. It uses 13 | those values to create a `Makefile' in each directory of the package. 14 | It may also create one or more `.h' files containing system-dependent 15 | definitions. Finally, it creates a shell script `config.status' that 16 | you can run in the future to recreate the current configuration, a file 17 | `config.cache' that saves the results of its tests to speed up 18 | reconfiguring, and a file `config.log' containing compiler output 19 | (useful mainly for debugging `configure'). 20 | 21 | If you need to do unusual things to compile the package, please try 22 | to figure out how `configure' could check whether to do them, and mail 23 | diffs or instructions to the address given in the `README' so they can 24 | be considered for the next release. If at some point `config.cache' 25 | contains results you don't want to keep, you may remove or edit it. 26 | 27 | The file `configure.in' is used to create `configure' by a program 28 | called `autoconf'. You only need `configure.in' if you want to change 29 | it or regenerate `configure' using a newer version of `autoconf'. 30 | 31 | The simplest way to compile this package is: 32 | 33 | 1. `cd' to the directory containing the package's source code and type 34 | `./configure' to configure the package for your system. If you're 35 | using `csh' on an old version of System V, you might need to type 36 | `sh ./configure' instead to prevent `csh' from trying to execute 37 | `configure' itself. 38 | 39 | Running `configure' takes a while. While running, it prints some 40 | messages telling which features it is checking for. 41 | 42 | 2. Type `make' to compile the package. 43 | 44 | 3. Type `make install' to install the programs and any data files and 45 | documentation. 46 | 47 | 4. You can remove the program binaries and object files from the 48 | source code directory by typing `make clean'. 49 | 50 | Compilers and Options 51 | ===================== 52 | 53 | Some systems require unusual options for compilation or linking that 54 | the `configure' script does not know about. You can give `configure' 55 | initial values for variables by setting them in the environment. Using 56 | a Bourne-compatible shell, you can do that on the command line like 57 | this: 58 | CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure 59 | 60 | Or on systems that have the `env' program, you can do it like this: 61 | env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure 62 | 63 | Compiling For Multiple Architectures 64 | ==================================== 65 | 66 | You can compile the package for more than one kind of computer at the 67 | same time, by placing the object files for each architecture in their 68 | own directory. To do this, you must use a version of `make' that 69 | supports the `VPATH' variable, such as GNU `make'. `cd' to the 70 | directory where you want the object files and executables to go and run 71 | the `configure' script. `configure' automatically checks for the 72 | source code in the directory that `configure' is in and in `..'. 73 | 74 | If you have to use a `make' that does not supports the `VPATH' 75 | variable, you have to compile the package for one architecture at a time 76 | in the source code directory. After you have installed the package for 77 | one architecture, use `make distclean' before reconfiguring for another 78 | architecture. 79 | 80 | Installation Names 81 | ================== 82 | 83 | By default, `make install' will install the package's files in 84 | `/usr/local/bin', `/usr/local/man', etc. You can specify an 85 | installation prefix other than `/usr/local' by giving `configure' the 86 | option `--prefix=PATH'. 87 | 88 | You can specify separate installation prefixes for 89 | architecture-specific files and architecture-independent files. If you 90 | give `configure' the option `--exec-prefix=PATH', the package will use 91 | PATH as the prefix for installing programs and libraries. 92 | Documentation and other data files will still use the regular prefix. 93 | 94 | If the package supports it, you can cause programs to be installed 95 | with an extra prefix or suffix on their names by giving `configure' the 96 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 97 | 98 | Optional Features 99 | ================= 100 | 101 | Some packages pay attention to `--enable-FEATURE' options to 102 | `configure', where FEATURE indicates an optional part of the package. 103 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 104 | is something like `gnu-as' or `x' (for the X Window System). The 105 | `README' should mention any `--enable-' and `--with-' options that the 106 | package recognizes. 107 | 108 | For packages that use the X Window System, `configure' can usually 109 | find the X include and library files automatically, but if it doesn't, 110 | you can use the `configure' options `--x-includes=DIR' and 111 | `--x-libraries=DIR' to specify their locations. 112 | 113 | Specifying the System Type 114 | ========================== 115 | 116 | There may be some features `configure' can not figure out 117 | automatically, but needs to determine by the type of host the package 118 | will run on. Usually `configure' can figure that out, but if it prints 119 | a message saying it can not guess the host type, give it the 120 | `--host=TYPE' option. TYPE can either be a short name for the system 121 | type, such as `sun4', or a canonical name with three fields: 122 | CPU-COMPANY-SYSTEM 123 | 124 | See the file `config.sub' for the possible values of each field. If 125 | `config.sub' isn't included in this package, then this package doesn't 126 | need to know the host type. 127 | 128 | If you are building compiler tools for cross-compiling, you can also 129 | use the `--target=TYPE' option to select the type of system they will 130 | produce code for and the `--build=TYPE' option to select the type of 131 | system on which you are compiling the package. 132 | 133 | Sharing Defaults 134 | ================ 135 | 136 | If you want to set default values for `configure' scripts to share, 137 | you can create a site shell script called `config.site' that gives 138 | default values for variables like `CC', `cache_file', and `prefix'. 139 | `configure' looks for `PREFIX/share/config.site' if it exists, then 140 | `PREFIX/etc/config.site' if it exists. Or, you can set the 141 | `CONFIG_SITE' environment variable to the location of the site script. 142 | A warning: not all `configure' scripts look for a site script. 143 | 144 | Operation Controls 145 | ================== 146 | 147 | `configure' recognizes the following options to control how it 148 | operates. 149 | 150 | `--cache-file=FILE' 151 | Use and save the results of the tests in FILE instead of 152 | `./config.cache'. Set FILE to `/dev/null' to disable caching, for 153 | debugging `configure'. 154 | 155 | `--help' 156 | Print a summary of the options to `configure', and exit. 157 | 158 | `--quiet' 159 | `--silent' 160 | `-q' 161 | Do not print messages saying which checks are being made. 162 | 163 | `--srcdir=DIR' 164 | Look for the package's source code in directory DIR. Usually 165 | `configure' can determine that directory automatically. 166 | 167 | `--version' 168 | Print the version of Autoconf used to generate the `configure' 169 | script, and exit. 170 | 171 | `configure' also accepts some other, not widely useful, options. 172 | 173 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2000-2001 Lubos Lunak 2 | Copyright (C) 2001 Oswald Buddenhagen 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.am,v 1.8 2001/04/30 19:34:10 seli Exp $ 2 | 3 | bin_PROGRAMS = numlockx 4 | 5 | numlockx_SOURCES = main.c 6 | numlockx_LDADD = @XTESTLIB@ -lXext -lX11 @X_PRE_LIBS@ 7 | numlockx_LDFLAGS = @X_LDFLAGS@ 8 | INCLUDES = @X_INCLUDES@ 9 | 10 | CFLAGS = @CFLAGS@ -Wall -pedantic 11 | 12 | EXTRA_DIST = AUTHORS LICENSE ChangeLog INSTALL README TODO 13 | 14 | AUTOMAKE_OPTIONS = foreign 15 | 16 | xsetup: 17 | @if test -n "@xsetup@"; then \ 18 | echo "Modifying @xsetup@"; \ 19 | rm -f @xsetup@.tmp ;\ 20 | cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\ 21 | echo "# Turn NumLock on ( numlockx ) ---------------" >> @xsetup@.tmp ;\ 22 | echo "${bindir}/numlockx " >> @xsetup@.tmp ;\ 23 | echo "# numlockx -----------------------------------" >> @xsetup@.tmp ;\ 24 | cp -f @xsetup@ ${srcdir}/xsetup.sav ;\ 25 | cat @xsetup@.tmp > @xsetup@ ;\ 26 | rm -f @xsetup@.tmp; \ 27 | else \ 28 | echo "Xsetup not found! - nothing to update";\ 29 | fi 30 | 31 | xsetup_uninstall: 32 | @if test -n "@xsetup@"; then \ 33 | echo "Restoring @xsetup@"; \ 34 | rm -f @xsetup@.tmp ;\ 35 | cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\ 36 | cat @xsetup@.tmp > @xsetup@ ;\ 37 | rm -f @xsetup@.tmp; \ 38 | else \ 39 | echo "Xsetup not found! - nothing to restore";\ 40 | fi 41 | 42 | xinitrc: 43 | @if test -n "@xinitrc@"; then \ 44 | echo "Modifying @xinitrc@"; \ 45 | rm -f @xinitrc@.tmp ;\ 46 | cat @xinitrc@ | grep -v "numlockx" \ 47 | | ( was_mod= ; \ 48 | ifs_sav=$IFS ;\ 49 | IFS= ;\ 50 | while read ln; do \ 51 | if test -n "$$ln"; then \ 52 | if test "$${ln#\#}" = "$$ln" ; then \ 53 | if test -z "$$was_mod"; then \ 54 | was_mod=1 ;\ 55 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 56 | echo "${bindir}/numlockx ";\ 57 | echo "# numlockx -----------------------------------" ;\ 58 | fi \ 59 | fi \ 60 | fi; \ 61 | echo "$$ln" ;\ 62 | done; \ 63 | IFS=$$ifs_sav ;\ 64 | if test -z "$$was_mod"; then \ 65 | was_mod=1 ;\ 66 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 67 | echo "${bindir}/numlockx ";\ 68 | echo "# numlockx -----------------------------------" ;\ 69 | fi \ 70 | ) \ 71 | > @xinitrc@.tmp ;\ 72 | cp -f @xinitrc@ ${srcdir}/xinitrc.sav ;\ 73 | cat @xinitrc@.tmp > @xinitrc@ ;\ 74 | rm -f @xinitrc@.tmp ;\ 75 | else \ 76 | echo "xinitrc not found! - nothing to update";\ 77 | fi 78 | 79 | xinitrc_uninstall: 80 | @if test -n "@xinitrc@"; then \ 81 | echo "Restoring @xinitrc@"; \ 82 | rm -f @xinitrc@.tmp ;\ 83 | cat @xinitrc@ | grep -v "numlockx" > @xinitrc@.tmp ;\ 84 | cat @xinitrc@.tmp > @xinitrc@ ;\ 85 | rm -f @xinitrc@.tmp ;\ 86 | else \ 87 | echo "xinitrc not found! - nothing to restore";\ 88 | fi 89 | 90 | user_xinitrc: 91 | @if test -f ~/.xinitrc; then \ 92 | echo "Modifying ~/.xinitrc"; \ 93 | rm -f xinitrc.tmp ;\ 94 | cat ~/.xinitrc | grep -v "numlockx" \ 95 | | ( was_mod= ; \ 96 | ifs_sav=$IFS ;\ 97 | IFS= ;\ 98 | while read ln; do \ 99 | if test -n "$$ln"; then \ 100 | if test "$${ln#\#}" = "$$ln" ; then \ 101 | if test -z "$$was_mod"; then \ 102 | was_mod=1 ;\ 103 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 104 | echo "${bindir}/numlockx ";\ 105 | echo "# numlockx -----------------------------------" ;\ 106 | fi \ 107 | fi \ 108 | fi; \ 109 | echo "$$ln" ;\ 110 | done; \ 111 | IFS=$$ifs_sav ;\ 112 | if test -z "$$was_mod"; then \ 113 | was_mod=1 ;\ 114 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 115 | echo "${bindir}/numlockx ";\ 116 | echo "# numlockx -----------------------------------" ;\ 117 | fi \ 118 | ) \ 119 | > xinitrc.tmp ;\ 120 | cp -f ~/.xinitrc ${srcdir}/xinitrc.sav ;\ 121 | cat xinitrc.tmp > ~/.xinitrc ;\ 122 | rm -f xinitrc.tmp ;\ 123 | else \ 124 | echo "# Turn NumLock on ( numlockx ) ---------------" >> ~/.xinitrc; \ 125 | echo "${bindir}/numlockx " >> ~/.xinitrc;\ 126 | echo "# numlockx -----------------------------------" >> ~/.xinitrc;\ 127 | chmod 700 ~/.xinitrc ; \ 128 | fi 129 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.11 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, 6 | # Inc. 7 | # This Makefile.in is free software; the Free Software Foundation 8 | # gives unlimited permission to copy and/or distribute it, 9 | # with or without modifications, as long as this notice is preserved. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 14 | # PARTICULAR PURPOSE. 15 | 16 | @SET_MAKE@ 17 | 18 | # $Id: Makefile.am,v 1.8 2001/04/30 19:34:10 seli Exp $ 19 | 20 | VPATH = @srcdir@ 21 | pkgdatadir = $(datadir)/@PACKAGE@ 22 | pkgincludedir = $(includedir)/@PACKAGE@ 23 | pkglibdir = $(libdir)/@PACKAGE@ 24 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 25 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 26 | install_sh_DATA = $(install_sh) -c -m 644 27 | install_sh_PROGRAM = $(install_sh) -c 28 | install_sh_SCRIPT = $(install_sh) -c 29 | INSTALL_HEADER = $(INSTALL_DATA) 30 | transform = $(program_transform_name) 31 | NORMAL_INSTALL = : 32 | PRE_INSTALL = : 33 | POST_INSTALL = : 34 | NORMAL_UNINSTALL = : 35 | PRE_UNINSTALL = : 36 | POST_UNINSTALL = : 37 | bin_PROGRAMS = numlockx$(EXEEXT) 38 | subdir = . 39 | DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ 40 | $(srcdir)/Makefile.in $(srcdir)/config.h.in \ 41 | $(top_srcdir)/configure AUTHORS ChangeLog INSTALL TODO depcomp \ 42 | install-sh missing mkinstalldirs 43 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 44 | am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ 45 | $(top_srcdir)/configure.in 46 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 47 | $(ACLOCAL_M4) 48 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 49 | configure.lineno config.status.lineno 50 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 51 | CONFIG_HEADER = config.h 52 | CONFIG_CLEAN_FILES = 53 | CONFIG_CLEAN_VPATH_FILES = 54 | am__installdirs = "$(DESTDIR)$(bindir)" 55 | PROGRAMS = $(bin_PROGRAMS) 56 | am_numlockx_OBJECTS = main.$(OBJEXT) 57 | numlockx_OBJECTS = $(am_numlockx_OBJECTS) 58 | numlockx_DEPENDENCIES = 59 | numlockx_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(numlockx_LDFLAGS) \ 60 | $(LDFLAGS) -o $@ 61 | DEFAULT_INCLUDES = -I.@am__isrc@ 62 | depcomp = $(SHELL) $(top_srcdir)/depcomp 63 | am__depfiles_maybe = depfiles 64 | am__mv = mv -f 65 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 66 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 67 | CCLD = $(CC) 68 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 69 | SOURCES = $(numlockx_SOURCES) 70 | DIST_SOURCES = $(numlockx_SOURCES) 71 | ETAGS = etags 72 | CTAGS = ctags 73 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 74 | distdir = $(PACKAGE)-$(VERSION) 75 | top_distdir = $(distdir) 76 | am__remove_distdir = \ 77 | { test ! -d "$(distdir)" \ 78 | || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 79 | && rm -fr "$(distdir)"; }; } 80 | DIST_ARCHIVES = $(distdir).tar.gz 81 | GZIP_ENV = --best 82 | distuninstallcheck_listfiles = find . -type f -print 83 | distcleancheck_listfiles = find . -type f -print 84 | ACLOCAL = @ACLOCAL@ 85 | AMTAR = @AMTAR@ 86 | AUTOCONF = @AUTOCONF@ 87 | AUTOHEADER = @AUTOHEADER@ 88 | AUTOMAKE = @AUTOMAKE@ 89 | AWK = @AWK@ 90 | CC = @CC@ 91 | CCDEPMODE = @CCDEPMODE@ 92 | CFLAGS = @CFLAGS@ -Wall -pedantic 93 | CPP = @CPP@ 94 | CPPFLAGS = @CPPFLAGS@ 95 | CYGPATH_W = @CYGPATH_W@ 96 | DEFS = @DEFS@ 97 | DEPDIR = @DEPDIR@ 98 | ECHO_C = @ECHO_C@ 99 | ECHO_N = @ECHO_N@ 100 | ECHO_T = @ECHO_T@ 101 | EGREP = @EGREP@ 102 | EXEEXT = @EXEEXT@ 103 | GREP = @GREP@ 104 | INSTALL = @INSTALL@ 105 | INSTALL_DATA = @INSTALL_DATA@ 106 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 107 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 108 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 109 | LDFLAGS = @LDFLAGS@ 110 | LIBOBJS = @LIBOBJS@ 111 | LIBS = @LIBS@ 112 | LIBSM = @LIBSM@ 113 | LIB_X11 = @LIB_X11@ 114 | LTLIBOBJS = @LTLIBOBJS@ 115 | MAKEINFO = @MAKEINFO@ 116 | MKDIR_P = @MKDIR_P@ 117 | OBJEXT = @OBJEXT@ 118 | PACKAGE = @PACKAGE@ 119 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 120 | PACKAGE_NAME = @PACKAGE_NAME@ 121 | PACKAGE_STRING = @PACKAGE_STRING@ 122 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 123 | PACKAGE_VERSION = @PACKAGE_VERSION@ 124 | PATH_SEPARATOR = @PATH_SEPARATOR@ 125 | RANLIB = @RANLIB@ 126 | SET_MAKE = @SET_MAKE@ 127 | SHELL = @SHELL@ 128 | STRIP = @STRIP@ 129 | VERSION = @VERSION@ 130 | XMKMF = @XMKMF@ 131 | XTESTLIB = @XTESTLIB@ 132 | X_INCLUDES = @X_INCLUDES@ 133 | X_LDFLAGS = @X_LDFLAGS@ 134 | X_PRE_LIBS = @X_PRE_LIBS@ 135 | abs_builddir = @abs_builddir@ 136 | abs_srcdir = @abs_srcdir@ 137 | abs_top_builddir = @abs_top_builddir@ 138 | abs_top_srcdir = @abs_top_srcdir@ 139 | ac_ct_CC = @ac_ct_CC@ 140 | ac_prefix_program = @ac_prefix_program@ 141 | am__include = @am__include@ 142 | am__leading_dot = @am__leading_dot@ 143 | am__quote = @am__quote@ 144 | am__tar = @am__tar@ 145 | am__untar = @am__untar@ 146 | bindir = @bindir@ 147 | build_alias = @build_alias@ 148 | builddir = @builddir@ 149 | datadir = @datadir@ 150 | datarootdir = @datarootdir@ 151 | docdir = @docdir@ 152 | dvidir = @dvidir@ 153 | exec_prefix = @exec_prefix@ 154 | host_alias = @host_alias@ 155 | htmldir = @htmldir@ 156 | includedir = @includedir@ 157 | infodir = @infodir@ 158 | install_sh = @install_sh@ 159 | libdir = @libdir@ 160 | libexecdir = @libexecdir@ 161 | localedir = @localedir@ 162 | localstatedir = @localstatedir@ 163 | mandir = @mandir@ 164 | mkdir_p = @mkdir_p@ 165 | oldincludedir = @oldincludedir@ 166 | pdfdir = @pdfdir@ 167 | prefix = @prefix@ 168 | program_transform_name = @program_transform_name@ 169 | psdir = @psdir@ 170 | sbindir = @sbindir@ 171 | sharedstatedir = @sharedstatedir@ 172 | srcdir = @srcdir@ 173 | sysconfdir = @sysconfdir@ 174 | target_alias = @target_alias@ 175 | top_build_prefix = @top_build_prefix@ 176 | top_builddir = @top_builddir@ 177 | top_srcdir = @top_srcdir@ 178 | x_includes = @x_includes@ 179 | x_libraries = @x_libraries@ 180 | xinitrc = @xinitrc@ 181 | xsetup = @xsetup@ 182 | numlockx_SOURCES = main.c 183 | numlockx_LDADD = @XTESTLIB@ -lXext -lX11 @X_PRE_LIBS@ 184 | numlockx_LDFLAGS = @X_LDFLAGS@ 185 | INCLUDES = @X_INCLUDES@ 186 | EXTRA_DIST = AUTHORS LICENSE ChangeLog INSTALL README TODO 187 | AUTOMAKE_OPTIONS = foreign 188 | all: config.h 189 | $(MAKE) $(AM_MAKEFLAGS) all-am 190 | 191 | .SUFFIXES: 192 | .SUFFIXES: .c .o .obj 193 | am--refresh: 194 | @: 195 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 196 | @for dep in $?; do \ 197 | case '$(am__configure_deps)' in \ 198 | *$$dep*) \ 199 | echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ 200 | $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ 201 | && exit 0; \ 202 | exit 1;; \ 203 | esac; \ 204 | done; \ 205 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ 206 | $(am__cd) $(top_srcdir) && \ 207 | $(AUTOMAKE) --foreign Makefile 208 | .PRECIOUS: Makefile 209 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 210 | @case '$?' in \ 211 | *config.status*) \ 212 | echo ' $(SHELL) ./config.status'; \ 213 | $(SHELL) ./config.status;; \ 214 | *) \ 215 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 216 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 217 | esac; 218 | 219 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 220 | $(SHELL) ./config.status --recheck 221 | 222 | $(top_srcdir)/configure: $(am__configure_deps) 223 | $(am__cd) $(srcdir) && $(AUTOCONF) 224 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 225 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 226 | $(am__aclocal_m4_deps): 227 | 228 | config.h: stamp-h1 229 | @if test ! -f $@; then \ 230 | rm -f stamp-h1; \ 231 | $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ 232 | else :; fi 233 | 234 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status 235 | @rm -f stamp-h1 236 | cd $(top_builddir) && $(SHELL) ./config.status config.h 237 | $(srcdir)/config.h.in: $(am__configure_deps) 238 | ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) 239 | rm -f stamp-h1 240 | touch $@ 241 | 242 | distclean-hdr: 243 | -rm -f config.h stamp-h1 244 | install-binPROGRAMS: $(bin_PROGRAMS) 245 | @$(NORMAL_INSTALL) 246 | test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" 247 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 248 | for p in $$list; do echo "$$p $$p"; done | \ 249 | sed 's/$(EXEEXT)$$//' | \ 250 | while read p p1; do if test -f $$p; \ 251 | then echo "$$p"; echo "$$p"; else :; fi; \ 252 | done | \ 253 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ 254 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 255 | sed 'N;N;N;s,\n, ,g' | \ 256 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 257 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 258 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 259 | else { print "f", $$3 "/" $$4, $$1; } } \ 260 | END { for (d in files) print "f", d, files[d] }' | \ 261 | while read type dir files; do \ 262 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 263 | test -z "$$files" || { \ 264 | echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 265 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 266 | } \ 267 | ; done 268 | 269 | uninstall-binPROGRAMS: 270 | @$(NORMAL_UNINSTALL) 271 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 272 | files=`for p in $$list; do echo "$$p"; done | \ 273 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 274 | -e 's/$$/$(EXEEXT)/' `; \ 275 | test -n "$$list" || exit 0; \ 276 | echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ 277 | cd "$(DESTDIR)$(bindir)" && rm -f $$files 278 | 279 | clean-binPROGRAMS: 280 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 281 | numlockx$(EXEEXT): $(numlockx_OBJECTS) $(numlockx_DEPENDENCIES) 282 | @rm -f numlockx$(EXEEXT) 283 | $(numlockx_LINK) $(numlockx_OBJECTS) $(numlockx_LDADD) $(LIBS) 284 | 285 | mostlyclean-compile: 286 | -rm -f *.$(OBJEXT) 287 | 288 | distclean-compile: 289 | -rm -f *.tab.c 290 | 291 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ 292 | 293 | .c.o: 294 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 295 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 296 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 297 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 298 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< 299 | 300 | .c.obj: 301 | @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 302 | @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 303 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 304 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 305 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` 306 | 307 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) 308 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ 309 | unique=`for i in $$list; do \ 310 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 311 | done | \ 312 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 313 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 314 | mkid -fID $$unique 315 | tags: TAGS 316 | 317 | TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 318 | $(TAGS_FILES) $(LISP) 319 | set x; \ 320 | here=`pwd`; \ 321 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 322 | unique=`for i in $$list; do \ 323 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 324 | done | \ 325 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 326 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 327 | shift; \ 328 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 329 | test -n "$$unique" || unique=$$empty_fix; \ 330 | if test $$# -gt 0; then \ 331 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 332 | "$$@" $$unique; \ 333 | else \ 334 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 335 | $$unique; \ 336 | fi; \ 337 | fi 338 | ctags: CTAGS 339 | CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ 340 | $(TAGS_FILES) $(LISP) 341 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ 342 | unique=`for i in $$list; do \ 343 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 344 | done | \ 345 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ 346 | END { if (nonempty) { for (i in files) print i; }; }'`; \ 347 | test -z "$(CTAGS_ARGS)$$unique" \ 348 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 349 | $$unique 350 | 351 | GTAGS: 352 | here=`$(am__cd) $(top_builddir) && pwd` \ 353 | && $(am__cd) $(top_srcdir) \ 354 | && gtags -i $(GTAGS_ARGS) "$$here" 355 | 356 | distclean-tags: 357 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 358 | 359 | distdir: $(DISTFILES) 360 | $(am__remove_distdir) 361 | test -d "$(distdir)" || mkdir "$(distdir)" 362 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 363 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 364 | list='$(DISTFILES)'; \ 365 | dist_files=`for file in $$list; do echo $$file; done | \ 366 | sed -e "s|^$$srcdirstrip/||;t" \ 367 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 368 | case $$dist_files in \ 369 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 370 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 371 | sort -u` ;; \ 372 | esac; \ 373 | for file in $$dist_files; do \ 374 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 375 | if test -d $$d/$$file; then \ 376 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 377 | if test -d "$(distdir)/$$file"; then \ 378 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 379 | fi; \ 380 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 381 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 382 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 383 | fi; \ 384 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 385 | else \ 386 | test -f "$(distdir)/$$file" \ 387 | || cp -p $$d/$$file "$(distdir)/$$file" \ 388 | || exit 1; \ 389 | fi; \ 390 | done 391 | -test -n "$(am__skip_mode_fix)" \ 392 | || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ 393 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 394 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 395 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 396 | || chmod -R a+r "$(distdir)" 397 | dist-gzip: distdir 398 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 399 | $(am__remove_distdir) 400 | 401 | dist-bzip2: distdir 402 | tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 403 | $(am__remove_distdir) 404 | 405 | dist-lzma: distdir 406 | tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma 407 | $(am__remove_distdir) 408 | 409 | dist-xz: distdir 410 | tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz 411 | $(am__remove_distdir) 412 | 413 | dist-tarZ: distdir 414 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 415 | $(am__remove_distdir) 416 | 417 | dist-shar: distdir 418 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 419 | $(am__remove_distdir) 420 | 421 | dist-zip: distdir 422 | -rm -f $(distdir).zip 423 | zip -rq $(distdir).zip $(distdir) 424 | $(am__remove_distdir) 425 | 426 | dist dist-all: distdir 427 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 428 | $(am__remove_distdir) 429 | 430 | # This target untars the dist file and tries a VPATH configuration. Then 431 | # it guarantees that the distribution is self-contained by making another 432 | # tarfile. 433 | distcheck: dist 434 | case '$(DIST_ARCHIVES)' in \ 435 | *.tar.gz*) \ 436 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ 437 | *.tar.bz2*) \ 438 | bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ 439 | *.tar.lzma*) \ 440 | unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ 441 | *.tar.xz*) \ 442 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 443 | *.tar.Z*) \ 444 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 445 | *.shar.gz*) \ 446 | GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ 447 | *.zip*) \ 448 | unzip $(distdir).zip ;;\ 449 | esac 450 | chmod -R a-w $(distdir); chmod a+w $(distdir) 451 | mkdir $(distdir)/_build 452 | mkdir $(distdir)/_inst 453 | chmod a-w $(distdir) 454 | test -d $(distdir)/_build || exit 0; \ 455 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 456 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 457 | && am__cwd=`pwd` \ 458 | && $(am__cd) $(distdir)/_build \ 459 | && ../configure --srcdir=.. --prefix="$$dc_install_base" \ 460 | $(DISTCHECK_CONFIGURE_FLAGS) \ 461 | && $(MAKE) $(AM_MAKEFLAGS) \ 462 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 463 | && $(MAKE) $(AM_MAKEFLAGS) check \ 464 | && $(MAKE) $(AM_MAKEFLAGS) install \ 465 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 466 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 467 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 468 | distuninstallcheck \ 469 | && chmod -R a-w "$$dc_install_base" \ 470 | && ({ \ 471 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 472 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 473 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 474 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 475 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 476 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 477 | && rm -rf "$$dc_destdir" \ 478 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 479 | && rm -rf $(DIST_ARCHIVES) \ 480 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 481 | && cd "$$am__cwd" \ 482 | || exit 1 483 | $(am__remove_distdir) 484 | @(echo "$(distdir) archives ready for distribution: "; \ 485 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 486 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 487 | distuninstallcheck: 488 | @$(am__cd) '$(distuninstallcheck_dir)' \ 489 | && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ 490 | || { echo "ERROR: files left after uninstall:" ; \ 491 | if test -n "$(DESTDIR)"; then \ 492 | echo " (check DESTDIR support)"; \ 493 | fi ; \ 494 | $(distuninstallcheck_listfiles) ; \ 495 | exit 1; } >&2 496 | distcleancheck: distclean 497 | @if test '$(srcdir)' = . ; then \ 498 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 499 | exit 1 ; \ 500 | fi 501 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 502 | || { echo "ERROR: files left in build directory after distclean:" ; \ 503 | $(distcleancheck_listfiles) ; \ 504 | exit 1; } >&2 505 | check-am: all-am 506 | check: check-am 507 | all-am: Makefile $(PROGRAMS) config.h 508 | installdirs: 509 | for dir in "$(DESTDIR)$(bindir)"; do \ 510 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 511 | done 512 | install: install-am 513 | install-exec: install-exec-am 514 | install-data: install-data-am 515 | uninstall: uninstall-am 516 | 517 | install-am: all-am 518 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 519 | 520 | installcheck: installcheck-am 521 | install-strip: 522 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 523 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 524 | `test -z '$(STRIP)' || \ 525 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install 526 | mostlyclean-generic: 527 | 528 | clean-generic: 529 | 530 | distclean-generic: 531 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 532 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 533 | 534 | maintainer-clean-generic: 535 | @echo "This command is intended for maintainers to use" 536 | @echo "it deletes files that may require special tools to rebuild." 537 | clean: clean-am 538 | 539 | clean-am: clean-binPROGRAMS clean-generic mostlyclean-am 540 | 541 | distclean: distclean-am 542 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 543 | -rm -rf ./$(DEPDIR) 544 | -rm -f Makefile 545 | distclean-am: clean-am distclean-compile distclean-generic \ 546 | distclean-hdr distclean-tags 547 | 548 | dvi: dvi-am 549 | 550 | dvi-am: 551 | 552 | html: html-am 553 | 554 | html-am: 555 | 556 | info: info-am 557 | 558 | info-am: 559 | 560 | install-data-am: 561 | 562 | install-dvi: install-dvi-am 563 | 564 | install-dvi-am: 565 | 566 | install-exec-am: install-binPROGRAMS 567 | 568 | install-html: install-html-am 569 | 570 | install-html-am: 571 | 572 | install-info: install-info-am 573 | 574 | install-info-am: 575 | 576 | install-man: 577 | 578 | install-pdf: install-pdf-am 579 | 580 | install-pdf-am: 581 | 582 | install-ps: install-ps-am 583 | 584 | install-ps-am: 585 | 586 | installcheck-am: 587 | 588 | maintainer-clean: maintainer-clean-am 589 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 590 | -rm -rf $(top_srcdir)/autom4te.cache 591 | -rm -rf ./$(DEPDIR) 592 | -rm -f Makefile 593 | maintainer-clean-am: distclean-am maintainer-clean-generic 594 | 595 | mostlyclean: mostlyclean-am 596 | 597 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 598 | 599 | pdf: pdf-am 600 | 601 | pdf-am: 602 | 603 | ps: ps-am 604 | 605 | ps-am: 606 | 607 | uninstall-am: uninstall-binPROGRAMS 608 | 609 | .MAKE: all install-am install-strip 610 | 611 | .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ 612 | clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ 613 | dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ 614 | distcheck distclean distclean-compile distclean-generic \ 615 | distclean-hdr distclean-tags distcleancheck distdir \ 616 | distuninstallcheck dvi dvi-am html html-am info info-am \ 617 | install install-am install-binPROGRAMS install-data \ 618 | install-data-am install-dvi install-dvi-am install-exec \ 619 | install-exec-am install-html install-html-am install-info \ 620 | install-info-am install-man install-pdf install-pdf-am \ 621 | install-ps install-ps-am install-strip installcheck \ 622 | installcheck-am installdirs maintainer-clean \ 623 | maintainer-clean-generic mostlyclean mostlyclean-compile \ 624 | mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ 625 | uninstall-am uninstall-binPROGRAMS 626 | 627 | 628 | xsetup: 629 | @if test -n "@xsetup@"; then \ 630 | echo "Modifying @xsetup@"; \ 631 | rm -f @xsetup@.tmp ;\ 632 | cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\ 633 | echo "# Turn NumLock on ( numlockx ) ---------------" >> @xsetup@.tmp ;\ 634 | echo "${bindir}/numlockx " >> @xsetup@.tmp ;\ 635 | echo "# numlockx -----------------------------------" >> @xsetup@.tmp ;\ 636 | cp -f @xsetup@ ${srcdir}/xsetup.sav ;\ 637 | cat @xsetup@.tmp > @xsetup@ ;\ 638 | rm -f @xsetup@.tmp; \ 639 | else \ 640 | echo "Xsetup not found! - nothing to update";\ 641 | fi 642 | 643 | xsetup_uninstall: 644 | @if test -n "@xsetup@"; then \ 645 | echo "Restoring @xsetup@"; \ 646 | rm -f @xsetup@.tmp ;\ 647 | cat @xsetup@ | grep -v "numlockx" > @xsetup@.tmp ;\ 648 | cat @xsetup@.tmp > @xsetup@ ;\ 649 | rm -f @xsetup@.tmp; \ 650 | else \ 651 | echo "Xsetup not found! - nothing to restore";\ 652 | fi 653 | 654 | xinitrc: 655 | @if test -n "@xinitrc@"; then \ 656 | echo "Modifying @xinitrc@"; \ 657 | rm -f @xinitrc@.tmp ;\ 658 | cat @xinitrc@ | grep -v "numlockx" \ 659 | | ( was_mod= ; \ 660 | ifs_sav=$IFS ;\ 661 | IFS= ;\ 662 | while read ln; do \ 663 | if test -n "$$ln"; then \ 664 | if test "$${ln#\#}" = "$$ln" ; then \ 665 | if test -z "$$was_mod"; then \ 666 | was_mod=1 ;\ 667 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 668 | echo "${bindir}/numlockx ";\ 669 | echo "# numlockx -----------------------------------" ;\ 670 | fi \ 671 | fi \ 672 | fi; \ 673 | echo "$$ln" ;\ 674 | done; \ 675 | IFS=$$ifs_sav ;\ 676 | if test -z "$$was_mod"; then \ 677 | was_mod=1 ;\ 678 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 679 | echo "${bindir}/numlockx ";\ 680 | echo "# numlockx -----------------------------------" ;\ 681 | fi \ 682 | ) \ 683 | > @xinitrc@.tmp ;\ 684 | cp -f @xinitrc@ ${srcdir}/xinitrc.sav ;\ 685 | cat @xinitrc@.tmp > @xinitrc@ ;\ 686 | rm -f @xinitrc@.tmp ;\ 687 | else \ 688 | echo "xinitrc not found! - nothing to update";\ 689 | fi 690 | 691 | xinitrc_uninstall: 692 | @if test -n "@xinitrc@"; then \ 693 | echo "Restoring @xinitrc@"; \ 694 | rm -f @xinitrc@.tmp ;\ 695 | cat @xinitrc@ | grep -v "numlockx" > @xinitrc@.tmp ;\ 696 | cat @xinitrc@.tmp > @xinitrc@ ;\ 697 | rm -f @xinitrc@.tmp ;\ 698 | else \ 699 | echo "xinitrc not found! - nothing to restore";\ 700 | fi 701 | 702 | user_xinitrc: 703 | @if test -f ~/.xinitrc; then \ 704 | echo "Modifying ~/.xinitrc"; \ 705 | rm -f xinitrc.tmp ;\ 706 | cat ~/.xinitrc | grep -v "numlockx" \ 707 | | ( was_mod= ; \ 708 | ifs_sav=$IFS ;\ 709 | IFS= ;\ 710 | while read ln; do \ 711 | if test -n "$$ln"; then \ 712 | if test "$${ln#\#}" = "$$ln" ; then \ 713 | if test -z "$$was_mod"; then \ 714 | was_mod=1 ;\ 715 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 716 | echo "${bindir}/numlockx ";\ 717 | echo "# numlockx -----------------------------------" ;\ 718 | fi \ 719 | fi \ 720 | fi; \ 721 | echo "$$ln" ;\ 722 | done; \ 723 | IFS=$$ifs_sav ;\ 724 | if test -z "$$was_mod"; then \ 725 | was_mod=1 ;\ 726 | echo "# Turn NumLock on ( numlockx ) ---------------";\ 727 | echo "${bindir}/numlockx ";\ 728 | echo "# numlockx -----------------------------------" ;\ 729 | fi \ 730 | ) \ 731 | > xinitrc.tmp ;\ 732 | cp -f ~/.xinitrc ${srcdir}/xinitrc.sav ;\ 733 | cat xinitrc.tmp > ~/.xinitrc ;\ 734 | rm -f xinitrc.tmp ;\ 735 | else \ 736 | echo "# Turn NumLock on ( numlockx ) ---------------" >> ~/.xinitrc; \ 737 | echo "${bindir}/numlockx " >> ~/.xinitrc;\ 738 | echo "# numlockx -----------------------------------" >> ~/.xinitrc;\ 739 | chmod 700 ~/.xinitrc ; \ 740 | fi 741 | 742 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 743 | # Otherwise a system limit (for SysV at least) may be exceeded. 744 | .NOEXPORT: 745 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | NUMLOCKX 1.2 3 | 4 | This little thingy allows you to start X with NumLock turned on ( which is 5 | a feature that a lot of people seem to miss and nobody really knew how to 6 | achieve this ). 7 | This code relies on X extensions called XTest and XKB, so you need to have 8 | at least one of these X extensions installed ( you most probably do ). 9 | 10 | Please note that I'm not interested in problems caused by your distribution 11 | being different from mine. NumLockX is written so it should work on plain X, 12 | and I don't have the time to play with all distros there are, sorry. 13 | If it doesn't work with your distro because they changed something 14 | in the configuration files, bother them to include this package with their 15 | next release ( with the necessary modifications ). It's much better that way, 16 | since NumLockX requires modifications of several files and it's better if 17 | they do the changes themselves. This is supposed to be the last version 18 | of NumLockX anyway ( hopefully ). 19 | The same way, please don't send me any binary packages. Such packages simply 20 | can't be good because they need to modify files that don't belong to them. 21 | Please bother your favourite distribution instead. 22 | 23 | QUICK INSTALL : 24 | 25 | First of all, make sure this package isn't already included in your 26 | distribution ( e.g. Mandrake includes it ). If you distribution already 27 | includes NumLockX, use their package instead ( it needn't be necessarily 28 | called NumLockX, it may be e.g. part of some other package ). 29 | 30 | Otherwise, do : 31 | ./configure 32 | make 33 | make install 34 | make xsetup 35 | make xinitrc 36 | 37 | If everything compiles, installs and works fine, you're done. Great :) . 38 | 39 | DETAILED INSTALL : 40 | 41 | First of all, make sure this package isn't already included in your 42 | distribution ( e.g. Mandrake includes it ). If you distribution already 43 | includes NumLockX, use it instead. To find out if your distribution includes 44 | NumLockX, read the docs, or see if there's a package called 'numlock' 45 | or similar. 46 | 47 | Otherwise, do : 48 | ./configure 49 | make 50 | make install 51 | 52 | 'make install' will put the executable in your /bin directory. 53 | Do 'numlockx ?' for usage. 54 | Now you need to call it somewhere while starting X and it will always 55 | make X start with NumLock turned on. 56 | 57 | If you use kdm ( xdm, whatever ... simply if X starts automatically ), add 58 | a line containing '/usr/X11R6/bin/numlockx on' ( assuming that the compiled 59 | binary is in /usr/X11R6/bin ) somewhere in file /etc/X11/xdm/Xsetup_0 60 | ( make xsetup will do this ). For people using startx, put that line somewhere 61 | at the beginning of file /etc/X11/xinit/xinitrc ( make xinitrc will do this ). 62 | In case you don't know if you use kdm/xdm/... or startx, simply modify both 63 | files. 64 | Both 'make xsetup' and 'make xinitrc' copy your original Xsetup_0 and xinitrc 65 | to Xsetup_0.sav and xinitrc.sav respectively in numlockx build directory 66 | in case something goes wrong. 67 | 'make xsetup_uninstall' and 'make xinitrc_uninstall' remove changes made 68 | in Xsetup_0 and xinitrc. 69 | 70 | PROBLEMS : 71 | 72 | First of all, let me repeat that I'm not interested in your distribution 73 | specific problems. It works fine here, and I don't time to bother with your 74 | distro, sorry. Try to bother your distribution to include this package 75 | with their next release with the necessary changes. 76 | 77 | If it doesn't compile, there are two possibilities : 78 | - You have XTest or XKB, but configure failed to find it. Do 'xdpyinfo' and 79 | look for 'XTEST' or 'XKB' in the list of extensions. 80 | - You have neither XTest nor XKB ... bad luck :(. 81 | If the executable doesn't work ... bad luck :( . 82 | If configure fails to find Xsetup_0 or xinitrc, because you have them elsewhere 83 | than in the directories where configure script looks for them, do the change 84 | manually. 85 | If you're not root and therefore you can modify neither Xsetup_0 nor xinitrc, 86 | you can use your ~/.xinitrc ( in your home directory ). NumLock won't be 87 | turned on in kdm/xdm/... but it will be turned on after starting your X 88 | session ( you may use 'make user_xinitrc' to do this ). 89 | 90 | 91 | Thanks to 92 | Oswald Buddenhagen for the XKB way of doing things. 93 | Chris Vanden Berghe for toggle option. 94 | 95 | 96 | Lubos Lunak 97 | l.lunak@kde.org 98 | 99 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | nothing, nothing and nothing 2 | -------------------------------------------------------------------------------- /acinclude.m4: -------------------------------------------------------------------------------- 1 | ## -*- autoconf -*- 2 | # $Id: acinclude.m4,v 1.9 2001/04/30 19:34:11 seli Exp $ 3 | 4 | dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu) 5 | dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org) 6 | dnl (C) 2005 Martin-Eric Racine (q-funk@iki.fi) 7 | 8 | dnl This file is free software; you can redistribute it and/or 9 | dnl modify it under the terms of the GNU Library General Public 10 | dnl License as published by the Free Software Foundation; either 11 | dnl version 2 of the License, or (at your option) any later version. 12 | 13 | dnl This library is distributed in the hope that it will be useful, 14 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | dnl Library General Public License for more details. 17 | 18 | dnl You should have received a copy of the GNU Library General Public License 19 | dnl along with this library; see the file COPYING.LIB. If not, write to 20 | dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 | dnl Boston, MA 02111-1307, USA. 22 | 23 | dnl ------------------------------------------------------------------------ 24 | dnl Find the header files and libraries for X-Windows. Extended the 25 | dnl macro AC_PATH_X 26 | dnl ------------------------------------------------------------------------ 27 | dnl 28 | AC_DEFUN([K_PATH_X], 29 | [ 30 | AC_REQUIRE([AC_PROG_CPP]) 31 | AC_MSG_CHECKING(for X) 32 | AC_LANG_SAVE 33 | AC_LANG_C 34 | AC_CACHE_VAL(ac_cv_have_x, 35 | [# One or both of the vars are not set, and there is no cached value. 36 | if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then 37 | kde_x_includes=NO 38 | else 39 | kde_x_includes=$x_includes 40 | fi 41 | if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then 42 | kde_x_libraries=NO 43 | else 44 | kde_x_libraries=$x_libraries 45 | fi 46 | 47 | # below we use the standard autoconf calls 48 | ac_x_libraries=$kde_x_libraries 49 | ac_x_includes=$kde_x_includes 50 | 51 | _AC_PATH_X_DIRECT 52 | _AC_PATH_X_XMKMF 53 | if test -z "$ac_x_includes"; then 54 | ac_x_includes="." 55 | fi 56 | if test -z "$ac_x_libraries"; then 57 | ac_x_libraries="/usr/lib" 58 | fi 59 | #from now on we use our own again 60 | 61 | # when the user already gave --x-includes, we ignore 62 | # what the standard autoconf macros told us. 63 | if test "$kde_x_includes" = NO; then 64 | kde_x_includes=$ac_x_includes 65 | fi 66 | 67 | if test "$kde_x_includes" = NO; then 68 | AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!]) 69 | fi 70 | 71 | if test "$ac_x_libraries" = NO; then 72 | AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!]) 73 | fi 74 | 75 | # Record where we found X for the cache. 76 | ac_cv_have_x="have_x=yes \ 77 | kde_x_includes=$kde_x_includes ac_x_libraries=$ac_x_libraries" 78 | ])dnl 79 | eval "$ac_cv_have_x" 80 | 81 | if test "$have_x" != yes; then 82 | AC_MSG_RESULT($have_x) 83 | no_x=yes 84 | else 85 | AC_MSG_RESULT([libraries $ac_x_libraries, headers $kde_x_includes]) 86 | fi 87 | 88 | if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then 89 | X_INCLUDES="" 90 | x_includes="."; dnl better than nothing :- 91 | else 92 | x_includes=$kde_x_includes 93 | X_INCLUDES="-I$x_includes" 94 | fi 95 | 96 | if test -z "$ac_x_libraries" || test "x$ac_x_libraries" = xNONE; then 97 | X_LDFLAGS="" 98 | x_libraries="/usr/lib"; dnl better than nothing :- 99 | else 100 | x_libraries=$ac_x_libraries 101 | X_LDFLAGS="-L$x_libraries" 102 | fi 103 | all_includes="$X_INCLUDES" 104 | all_libraries="$X_LDFLAGS" 105 | 106 | AC_SUBST(X_INCLUDES) 107 | AC_SUBST(X_LDFLAGS) 108 | AC_SUBST(x_libraries) 109 | AC_SUBST(x_includes) 110 | 111 | # Check for libraries that X11R6 Xt/Xaw programs need. 112 | ac_save_LDFLAGS="$LDFLAGS" 113 | test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" 114 | # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to 115 | # check for ICE first), but we must link in the order -lSM -lICE or 116 | # we get undefined symbols. So assume we have SM if we have ICE. 117 | # These have to be linked with before -lX11, unlike the other 118 | # libraries we check for below, so use a different variable. 119 | # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. 120 | AC_CHECK_LIB(ICE, IceConnectionNumber, 121 | [LIBSM="$X_PRELIBS -lSM"], , $X_EXTRA_LIBS) 122 | AC_SUBST(LIBSM) 123 | LDFLAGS="$ac_save_LDFLAGS" 124 | 125 | AC_SUBST(X_PRE_LIBS) 126 | 127 | LIB_X11='-lX11 $(LIBSOCKET)' 128 | AC_SUBST(LIB_X11) 129 | 130 | AC_MSG_CHECKING(for libXext) 131 | AC_CACHE_VAL(kde_cv_have_libXext, 132 | [ 133 | kde_ldflags_safe="$LDFLAGS" 134 | kde_libs_safe="$LIBS" 135 | 136 | LDFLAGS="$X_LDFLAGS $USER_LDFLAGS" 137 | LIBS="-lXext -lX11 $LIBSOCKET" 138 | 139 | AC_TRY_LINK([ 140 | #include 141 | ], 142 | [ 143 | printf("hello Xext\n"); 144 | ], 145 | kde_cv_have_libXext=yes, 146 | kde_cv_have_libXext=no 147 | ) 148 | 149 | LDFLAGS=$kde_ldflags_safe 150 | LIBS=$kde_libs_safe 151 | ]) 152 | 153 | AC_MSG_RESULT($kde_cv_have_libXext) 154 | 155 | if test "kde_cv_have_libXext" = "no"; then 156 | AC_MSG_ERROR([We need a working libXext to proceed. Since configure 157 | can't find it itself, we stop here assuming that make wouldn't find 158 | them either.]) 159 | fi 160 | 161 | ]) 162 | 163 | dnl ----- Check for the XKB extension ----- 164 | AC_DEFUN([NM_CHECK_XKB], 165 | [ 166 | ac_save_ldflags="$LDFLAGS" 167 | LDFLAGS="$X_LDFLAGS" 168 | AC_CHECK_HEADER(X11/XKBlib.h, 169 | [AC_CHECK_LIB( Xext, XkbLockModifiers, 170 | [AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension])], 171 | , -lX11 [ $X_PRE_LIBS ]) 172 | ]) 173 | LDFLAGS="$ac_save_ldflags" 174 | ]) 175 | dnl ---------- 176 | 177 | dnl ----- Check for the XTEST extension ----- 178 | AC_DEFUN([NM_CHECK_XTEST], 179 | [ 180 | ac_save_ldflags="$LDFLAGS" 181 | LDFLAGS="$X_LDFLAGS" 182 | XTESTLIB= 183 | AC_CHECK_HEADER(X11/extensions/XTest.h, 184 | [AC_CHECK_LIB( Xtst, XTestFakeKeyEvent, 185 | [AC_DEFINE(HAVE_XTEST, 1, [Define if you have the XTest extension]) 186 | XTESTLIB=-lXtst], 187 | , [ -lXext -lX11 $X_PRE_LIBS ]) 188 | ]) 189 | AC_SUBST(XTESTLIB) 190 | LDFLAGS="$ac_save_ldflags" 191 | ]) 192 | dnl ---------- 193 | 194 | ## ------------------------------------------------------------------------ 195 | ## Find a file (or one of more files in a list of dirs) 196 | ## ------------------------------------------------------------------------ 197 | ## 198 | AC_DEFUN([AC_FIND_FILE], 199 | [ 200 | $3=NO 201 | for i in $2; 202 | do 203 | for j in $1; 204 | do 205 | if test -r "$i/$j"; then 206 | $3=$i 207 | break 2 208 | fi 209 | done 210 | done 211 | ]) 212 | 213 | dnl ----------------------------------------------------------- 214 | dnl Check for the Xsetup file ( for xdm ) 215 | dnl ----------------------------------------------------------- 216 | AC_DEFUN([NM_CHECK_XSETUP], 217 | [ 218 | AC_MSG_CHECKING([for Xsetup file]) 219 | AC_FIND_FILE( Xsetup, /etc/X11/xdm /usr/X11R6/lib/X11/xdm /var/X11/xdm /usr/openwin/xdm,xsetup) 220 | if test ! "$xsetup" = "NO" ; then 221 | xsetup="$xsetup/Xsetup" 222 | else 223 | AC_FIND_FILE( Xsetup_0, /etc/X11/xdm /usr/X11R6/lib/X11/xdm /var/X11/xdm /usr/openwin/xdm,xsetup) 224 | if test ! "$xsetup" = "NO" ; then 225 | xsetup="$xsetup/Xsetup_0" 226 | fi 227 | fi 228 | if test "$xsetup" = "NO" ; then 229 | xsetup= 230 | AC_MSG_RESULT(no) 231 | else 232 | AC_MSG_RESULT($xsetup) 233 | fi 234 | AC_SUBST(xsetup) 235 | ]) 236 | 237 | dnl ----------------------------------------------------------- 238 | dnl Check for the xinitrc file ( for startx ) 239 | dnl ----------------------------------------------------------- 240 | 241 | AC_DEFUN([NM_CHECK_XINITRC], 242 | [ 243 | AC_MSG_CHECKING([for xinitrc file]) 244 | AC_FIND_FILE( xinitrc, /etc/X11/xinit /usr/X11R6/lib/X11/xinit /var/X11/xinit /usr/openwin/xinit,xinitrc) 245 | if test ! "$xinitrc" = "NO" ; then 246 | xinitrc="$xinitrc/xinitrc" 247 | fi 248 | if test "$xinitrc" = "NO" ; then 249 | xinitrc= 250 | AC_MSG_RESULT(no) 251 | else 252 | AC_MSG_RESULT($xinitrc) 253 | fi 254 | AC_SUBST(xinitrc) 255 | ]) 256 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.11 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 | # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_AUTOCONF_VERSION], 15 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, 17 | [m4_warning([this file was generated for autoconf 2.63. 18 | You have another version of autoconf. It may work, but is not guaranteed to. 19 | If you have problems, you may need to regenerate the build system entirely. 20 | To do so, use the procedure documented by the package, typically `autoreconf'.])]) 21 | 22 | # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 23 | # 24 | # This file is free software; the Free Software Foundation 25 | # gives unlimited permission to copy and/or distribute it, 26 | # with or without modifications, as long as this notice is preserved. 27 | 28 | # AM_AUTOMAKE_VERSION(VERSION) 29 | # ---------------------------- 30 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 31 | # generated from the m4 files accompanying Automake X.Y. 32 | # (This private macro should not be called outside this file.) 33 | AC_DEFUN([AM_AUTOMAKE_VERSION], 34 | [am__api_version='1.11' 35 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 36 | dnl require some minimum version. Point them to the right macro. 37 | m4_if([$1], [1.11], [], 38 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 39 | ]) 40 | 41 | # _AM_AUTOCONF_VERSION(VERSION) 42 | # ----------------------------- 43 | # aclocal traces this macro to find the Autoconf version. 44 | # This is a private macro too. Using m4_define simplifies 45 | # the logic in aclocal, which can simply ignore this definition. 46 | m4_define([_AM_AUTOCONF_VERSION], []) 47 | 48 | # AM_SET_CURRENT_AUTOMAKE_VERSION 49 | # ------------------------------- 50 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 51 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 52 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 53 | [AM_AUTOMAKE_VERSION([1.11])dnl 54 | m4_ifndef([AC_AUTOCONF_VERSION], 55 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 56 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 57 | 58 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- 59 | 60 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 61 | # 62 | # This file is free software; the Free Software Foundation 63 | # gives unlimited permission to copy and/or distribute it, 64 | # with or without modifications, as long as this notice is preserved. 65 | 66 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 67 | # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 68 | # `$srcdir', `$srcdir/..', or `$srcdir/../..'. 69 | # 70 | # Of course, Automake must honor this variable whenever it calls a 71 | # tool from the auxiliary directory. The problem is that $srcdir (and 72 | # therefore $ac_aux_dir as well) can be either absolute or relative, 73 | # depending on how configure is run. This is pretty annoying, since 74 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 75 | # source directory, any form will work fine, but in subdirectories a 76 | # relative path needs to be adjusted first. 77 | # 78 | # $ac_aux_dir/missing 79 | # fails when called from a subdirectory if $ac_aux_dir is relative 80 | # $top_srcdir/$ac_aux_dir/missing 81 | # fails if $ac_aux_dir is absolute, 82 | # fails when called from a subdirectory in a VPATH build with 83 | # a relative $ac_aux_dir 84 | # 85 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 86 | # are both prefixed by $srcdir. In an in-source build this is usually 87 | # harmless because $srcdir is `.', but things will broke when you 88 | # start a VPATH build or use an absolute $srcdir. 89 | # 90 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 91 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 92 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 93 | # and then we would define $MISSING as 94 | # MISSING="\${SHELL} $am_aux_dir/missing" 95 | # This will work as long as MISSING is not called from configure, because 96 | # unfortunately $(top_srcdir) has no meaning in configure. 97 | # However there are other variables, like CC, which are often used in 98 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 99 | # 100 | # Another solution, used here, is to always expand $ac_aux_dir to an 101 | # absolute PATH. The drawback is that using absolute paths prevent a 102 | # configured tree to be moved without reconfiguration. 103 | 104 | AC_DEFUN([AM_AUX_DIR_EXPAND], 105 | [dnl Rely on autoconf to set up CDPATH properly. 106 | AC_PREREQ([2.50])dnl 107 | # expand $ac_aux_dir to an absolute path 108 | am_aux_dir=`cd $ac_aux_dir && pwd` 109 | ]) 110 | 111 | # AM_CONDITIONAL -*- Autoconf -*- 112 | 113 | # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 114 | # Free Software Foundation, Inc. 115 | # 116 | # This file is free software; the Free Software Foundation 117 | # gives unlimited permission to copy and/or distribute it, 118 | # with or without modifications, as long as this notice is preserved. 119 | 120 | # serial 9 121 | 122 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) 123 | # ------------------------------------- 124 | # Define a conditional. 125 | AC_DEFUN([AM_CONDITIONAL], 126 | [AC_PREREQ(2.52)dnl 127 | ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 128 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 129 | AC_SUBST([$1_TRUE])dnl 130 | AC_SUBST([$1_FALSE])dnl 131 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl 132 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl 133 | m4_define([_AM_COND_VALUE_$1], [$2])dnl 134 | if $2; then 135 | $1_TRUE= 136 | $1_FALSE='#' 137 | else 138 | $1_TRUE='#' 139 | $1_FALSE= 140 | fi 141 | AC_CONFIG_COMMANDS_PRE( 142 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 143 | AC_MSG_ERROR([[conditional "$1" was never defined. 144 | Usually this means the macro was only invoked conditionally.]]) 145 | fi])]) 146 | 147 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 148 | # Free Software Foundation, Inc. 149 | # 150 | # This file is free software; the Free Software Foundation 151 | # gives unlimited permission to copy and/or distribute it, 152 | # with or without modifications, as long as this notice is preserved. 153 | 154 | # serial 10 155 | 156 | # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 157 | # written in clear, in which case automake, when reading aclocal.m4, 158 | # will think it sees a *use*, and therefore will trigger all it's 159 | # C support machinery. Also note that it means that autoscan, seeing 160 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 161 | 162 | 163 | # _AM_DEPENDENCIES(NAME) 164 | # ---------------------- 165 | # See how the compiler implements dependency checking. 166 | # NAME is "CC", "CXX", "GCJ", or "OBJC". 167 | # We try a few techniques and use that to set a single cache variable. 168 | # 169 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 170 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 171 | # dependency, and given that the user is not expected to run this macro, 172 | # just rely on AC_PROG_CC. 173 | AC_DEFUN([_AM_DEPENDENCIES], 174 | [AC_REQUIRE([AM_SET_DEPDIR])dnl 175 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 176 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl 177 | AC_REQUIRE([AM_DEP_TRACK])dnl 178 | 179 | ifelse([$1], CC, [depcc="$CC" am_compiler_list=], 180 | [$1], CXX, [depcc="$CXX" am_compiler_list=], 181 | [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 182 | [$1], UPC, [depcc="$UPC" am_compiler_list=], 183 | [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 184 | [depcc="$$1" am_compiler_list=]) 185 | 186 | AC_CACHE_CHECK([dependency style of $depcc], 187 | [am_cv_$1_dependencies_compiler_type], 188 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 189 | # We make a subdir and do the tests there. Otherwise we can end up 190 | # making bogus files that we don't know about and never remove. For 191 | # instance it was reported that on HP-UX the gcc test will end up 192 | # making a dummy file named `D' -- because `-MD' means `put the output 193 | # in D'. 194 | mkdir conftest.dir 195 | # Copy depcomp to subdir because otherwise we won't find it if we're 196 | # using a relative directory. 197 | cp "$am_depcomp" conftest.dir 198 | cd conftest.dir 199 | # We will build objects and dependencies in a subdirectory because 200 | # it helps to detect inapplicable dependency modes. For instance 201 | # both Tru64's cc and ICC support -MD to output dependencies as a 202 | # side effect of compilation, but ICC will put the dependencies in 203 | # the current directory while Tru64 will put them in the object 204 | # directory. 205 | mkdir sub 206 | 207 | am_cv_$1_dependencies_compiler_type=none 208 | if test "$am_compiler_list" = ""; then 209 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 210 | fi 211 | am__universal=false 212 | m4_case([$1], [CC], 213 | [case " $depcc " in #( 214 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 215 | esac], 216 | [CXX], 217 | [case " $depcc " in #( 218 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 219 | esac]) 220 | 221 | for depmode in $am_compiler_list; do 222 | # Setup a source with many dependencies, because some compilers 223 | # like to wrap large dependency lists on column 80 (with \), and 224 | # we should not choose a depcomp mode which is confused by this. 225 | # 226 | # We need to recreate these files for each test, as the compiler may 227 | # overwrite some of them when testing with obscure command lines. 228 | # This happens at least with the AIX C compiler. 229 | : > sub/conftest.c 230 | for i in 1 2 3 4 5 6; do 231 | echo '#include "conftst'$i'.h"' >> sub/conftest.c 232 | # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 233 | # Solaris 8's {/usr,}/bin/sh. 234 | touch sub/conftst$i.h 235 | done 236 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 237 | 238 | # We check with `-c' and `-o' for the sake of the "dashmstdout" 239 | # mode. It turns out that the SunPro C++ compiler does not properly 240 | # handle `-M -o', and we need to detect this. Also, some Intel 241 | # versions had trouble with output in subdirs 242 | am__obj=sub/conftest.${OBJEXT-o} 243 | am__minus_obj="-o $am__obj" 244 | case $depmode in 245 | gcc) 246 | # This depmode causes a compiler race in universal mode. 247 | test "$am__universal" = false || continue 248 | ;; 249 | nosideeffect) 250 | # after this tag, mechanisms are not by side-effect, so they'll 251 | # only be used when explicitly requested 252 | if test "x$enable_dependency_tracking" = xyes; then 253 | continue 254 | else 255 | break 256 | fi 257 | ;; 258 | msvisualcpp | msvcmsys) 259 | # This compiler won't grok `-c -o', but also, the minuso test has 260 | # not run yet. These depmodes are late enough in the game, and 261 | # so weak that their functioning should not be impacted. 262 | am__obj=conftest.${OBJEXT-o} 263 | am__minus_obj= 264 | ;; 265 | none) break ;; 266 | esac 267 | if depmode=$depmode \ 268 | source=sub/conftest.c object=$am__obj \ 269 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 270 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 271 | >/dev/null 2>conftest.err && 272 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 273 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 274 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 275 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 276 | # icc doesn't choke on unknown options, it will just issue warnings 277 | # or remarks (even with -Werror). So we grep stderr for any message 278 | # that says an option was ignored or not supported. 279 | # When given -MP, icc 7.0 and 7.1 complain thusly: 280 | # icc: Command line warning: ignoring option '-M'; no argument required 281 | # The diagnosis changed in icc 8.0: 282 | # icc: Command line remark: option '-MP' not supported 283 | if (grep 'ignoring option' conftest.err || 284 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 285 | am_cv_$1_dependencies_compiler_type=$depmode 286 | break 287 | fi 288 | fi 289 | done 290 | 291 | cd .. 292 | rm -rf conftest.dir 293 | else 294 | am_cv_$1_dependencies_compiler_type=none 295 | fi 296 | ]) 297 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 298 | AM_CONDITIONAL([am__fastdep$1], [ 299 | test "x$enable_dependency_tracking" != xno \ 300 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 301 | ]) 302 | 303 | 304 | # AM_SET_DEPDIR 305 | # ------------- 306 | # Choose a directory name for dependency files. 307 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES 308 | AC_DEFUN([AM_SET_DEPDIR], 309 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl 310 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 311 | ]) 312 | 313 | 314 | # AM_DEP_TRACK 315 | # ------------ 316 | AC_DEFUN([AM_DEP_TRACK], 317 | [AC_ARG_ENABLE(dependency-tracking, 318 | [ --disable-dependency-tracking speeds up one-time build 319 | --enable-dependency-tracking do not reject slow dependency extractors]) 320 | if test "x$enable_dependency_tracking" != xno; then 321 | am_depcomp="$ac_aux_dir/depcomp" 322 | AMDEPBACKSLASH='\' 323 | fi 324 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 325 | AC_SUBST([AMDEPBACKSLASH])dnl 326 | _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 327 | ]) 328 | 329 | # Generate code to set up dependency tracking. -*- Autoconf -*- 330 | 331 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 332 | # Free Software Foundation, Inc. 333 | # 334 | # This file is free software; the Free Software Foundation 335 | # gives unlimited permission to copy and/or distribute it, 336 | # with or without modifications, as long as this notice is preserved. 337 | 338 | #serial 5 339 | 340 | # _AM_OUTPUT_DEPENDENCY_COMMANDS 341 | # ------------------------------ 342 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 343 | [{ 344 | # Autoconf 2.62 quotes --file arguments for eval, but not when files 345 | # are listed without --file. Let's play safe and only enable the eval 346 | # if we detect the quoting. 347 | case $CONFIG_FILES in 348 | *\'*) eval set x "$CONFIG_FILES" ;; 349 | *) set x $CONFIG_FILES ;; 350 | esac 351 | shift 352 | for mf 353 | do 354 | # Strip MF so we end up with the name of the file. 355 | mf=`echo "$mf" | sed -e 's/:.*$//'` 356 | # Check whether this is an Automake generated Makefile or not. 357 | # We used to match only the files named `Makefile.in', but 358 | # some people rename them; so instead we look at the file content. 359 | # Grep'ing the first line is not enough: some people post-process 360 | # each Makefile.in and add a new line on top of each file to say so. 361 | # Grep'ing the whole file is not good either: AIX grep has a line 362 | # limit of 2048, but all sed's we know have understand at least 4000. 363 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 364 | dirpart=`AS_DIRNAME("$mf")` 365 | else 366 | continue 367 | fi 368 | # Extract the definition of DEPDIR, am__include, and am__quote 369 | # from the Makefile without running `make'. 370 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 371 | test -z "$DEPDIR" && continue 372 | am__include=`sed -n 's/^am__include = //p' < "$mf"` 373 | test -z "am__include" && continue 374 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 375 | # When using ansi2knr, U may be empty or an underscore; expand it 376 | U=`sed -n 's/^U = //p' < "$mf"` 377 | # Find all dependency output files, they are included files with 378 | # $(DEPDIR) in their names. We invoke sed twice because it is the 379 | # simplest approach to changing $(DEPDIR) to its actual value in the 380 | # expansion. 381 | for file in `sed -n " 382 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 383 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 384 | # Make sure the directory exists. 385 | test -f "$dirpart/$file" && continue 386 | fdir=`AS_DIRNAME(["$file"])` 387 | AS_MKDIR_P([$dirpart/$fdir]) 388 | # echo "creating $dirpart/$file" 389 | echo '# dummy' > "$dirpart/$file" 390 | done 391 | done 392 | } 393 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS 394 | 395 | 396 | # AM_OUTPUT_DEPENDENCY_COMMANDS 397 | # ----------------------------- 398 | # This macro should only be invoked once -- use via AC_REQUIRE. 399 | # 400 | # This code is only required when automatic dependency tracking 401 | # is enabled. FIXME. This creates each `.P' file that we will 402 | # need in order to bootstrap the dependency handling code. 403 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 404 | [AC_CONFIG_COMMANDS([depfiles], 405 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 406 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 407 | ]) 408 | 409 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 410 | # Free Software Foundation, Inc. 411 | # 412 | # This file is free software; the Free Software Foundation 413 | # gives unlimited permission to copy and/or distribute it, 414 | # with or without modifications, as long as this notice is preserved. 415 | 416 | # serial 8 417 | 418 | # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 419 | AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 420 | 421 | # Do all the work for Automake. -*- Autoconf -*- 422 | 423 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 424 | # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 425 | # 426 | # This file is free software; the Free Software Foundation 427 | # gives unlimited permission to copy and/or distribute it, 428 | # with or without modifications, as long as this notice is preserved. 429 | 430 | # serial 16 431 | 432 | # This macro actually does too much. Some checks are only needed if 433 | # your package does certain things. But this isn't really a big deal. 434 | 435 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 436 | # AM_INIT_AUTOMAKE([OPTIONS]) 437 | # ----------------------------------------------- 438 | # The call with PACKAGE and VERSION arguments is the old style 439 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 440 | # and VERSION should now be passed to AC_INIT and removed from 441 | # the call to AM_INIT_AUTOMAKE. 442 | # We support both call styles for the transition. After 443 | # the next Automake release, Autoconf can make the AC_INIT 444 | # arguments mandatory, and then we can depend on a new Autoconf 445 | # release and drop the old call support. 446 | AC_DEFUN([AM_INIT_AUTOMAKE], 447 | [AC_PREREQ([2.62])dnl 448 | dnl Autoconf wants to disallow AM_ names. We explicitly allow 449 | dnl the ones we care about. 450 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 451 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 452 | AC_REQUIRE([AC_PROG_INSTALL])dnl 453 | if test "`cd $srcdir && pwd`" != "`pwd`"; then 454 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 455 | # is not polluted with repeated "-I." 456 | AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 457 | # test to see if srcdir already configured 458 | if test -f $srcdir/config.status; then 459 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 460 | fi 461 | fi 462 | 463 | # test whether we have cygpath 464 | if test -z "$CYGPATH_W"; then 465 | if (cygpath --version) >/dev/null 2>/dev/null; then 466 | CYGPATH_W='cygpath -w' 467 | else 468 | CYGPATH_W=echo 469 | fi 470 | fi 471 | AC_SUBST([CYGPATH_W]) 472 | 473 | # Define the identity of the package. 474 | dnl Distinguish between old-style and new-style calls. 475 | m4_ifval([$2], 476 | [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 477 | AC_SUBST([PACKAGE], [$1])dnl 478 | AC_SUBST([VERSION], [$2])], 479 | [_AM_SET_OPTIONS([$1])dnl 480 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 481 | m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 482 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 483 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 484 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 485 | 486 | _AM_IF_OPTION([no-define],, 487 | [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 488 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 489 | 490 | # Some tools Automake needs. 491 | AC_REQUIRE([AM_SANITY_CHECK])dnl 492 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 493 | AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 494 | AM_MISSING_PROG(AUTOCONF, autoconf) 495 | AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 496 | AM_MISSING_PROG(AUTOHEADER, autoheader) 497 | AM_MISSING_PROG(MAKEINFO, makeinfo) 498 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 499 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 500 | AC_REQUIRE([AM_PROG_MKDIR_P])dnl 501 | # We need awk for the "check" target. The system "awk" is bad on 502 | # some platforms. 503 | AC_REQUIRE([AC_PROG_AWK])dnl 504 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 505 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl 506 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 507 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 508 | [_AM_PROG_TAR([v7])])]) 509 | _AM_IF_OPTION([no-dependencies],, 510 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 511 | [_AM_DEPENDENCIES(CC)], 512 | [define([AC_PROG_CC], 513 | defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 514 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 515 | [_AM_DEPENDENCIES(CXX)], 516 | [define([AC_PROG_CXX], 517 | defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 518 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], 519 | [_AM_DEPENDENCIES(OBJC)], 520 | [define([AC_PROG_OBJC], 521 | defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 522 | ]) 523 | _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 524 | dnl The `parallel-tests' driver may need to know about EXEEXT, so add the 525 | dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 526 | dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 527 | AC_CONFIG_COMMANDS_PRE(dnl 528 | [m4_provide_if([_AM_COMPILER_EXEEXT], 529 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 530 | ]) 531 | 532 | dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 533 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 534 | dnl mangled by Autoconf and run in a shell conditional statement. 535 | m4_define([_AC_COMPILER_EXEEXT], 536 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 537 | 538 | 539 | # When config.status generates a header, we must update the stamp-h file. 540 | # This file resides in the same directory as the config header 541 | # that is generated. The stamp files are numbered to have different names. 542 | 543 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 544 | # loop where config.status creates the headers, so we can generate 545 | # our stamp files there. 546 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 547 | [# Compute $1's index in $config_headers. 548 | _am_arg=$1 549 | _am_stamp_count=1 550 | for _am_header in $config_headers :; do 551 | case $_am_header in 552 | $_am_arg | $_am_arg:* ) 553 | break ;; 554 | * ) 555 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; 556 | esac 557 | done 558 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 559 | 560 | # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 561 | # 562 | # This file is free software; the Free Software Foundation 563 | # gives unlimited permission to copy and/or distribute it, 564 | # with or without modifications, as long as this notice is preserved. 565 | 566 | # AM_PROG_INSTALL_SH 567 | # ------------------ 568 | # Define $install_sh. 569 | AC_DEFUN([AM_PROG_INSTALL_SH], 570 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 571 | if test x"${install_sh}" != xset; then 572 | case $am_aux_dir in 573 | *\ * | *\ *) 574 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 575 | *) 576 | install_sh="\${SHELL} $am_aux_dir/install-sh" 577 | esac 578 | fi 579 | AC_SUBST(install_sh)]) 580 | 581 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. 582 | # 583 | # This file is free software; the Free Software Foundation 584 | # gives unlimited permission to copy and/or distribute it, 585 | # with or without modifications, as long as this notice is preserved. 586 | 587 | # serial 2 588 | 589 | # Check whether the underlying file-system supports filenames 590 | # with a leading dot. For instance MS-DOS doesn't. 591 | AC_DEFUN([AM_SET_LEADING_DOT], 592 | [rm -rf .tst 2>/dev/null 593 | mkdir .tst 2>/dev/null 594 | if test -d .tst; then 595 | am__leading_dot=. 596 | else 597 | am__leading_dot=_ 598 | fi 599 | rmdir .tst 2>/dev/null 600 | AC_SUBST([am__leading_dot])]) 601 | 602 | # Check to see how 'make' treats includes. -*- Autoconf -*- 603 | 604 | # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 605 | # 606 | # This file is free software; the Free Software Foundation 607 | # gives unlimited permission to copy and/or distribute it, 608 | # with or without modifications, as long as this notice is preserved. 609 | 610 | # serial 4 611 | 612 | # AM_MAKE_INCLUDE() 613 | # ----------------- 614 | # Check to see how make treats includes. 615 | AC_DEFUN([AM_MAKE_INCLUDE], 616 | [am_make=${MAKE-make} 617 | cat > confinc << 'END' 618 | am__doit: 619 | @echo this is the am__doit target 620 | .PHONY: am__doit 621 | END 622 | # If we don't find an include directive, just comment out the code. 623 | AC_MSG_CHECKING([for style of include used by $am_make]) 624 | am__include="#" 625 | am__quote= 626 | _am_result=none 627 | # First try GNU make style include. 628 | echo "include confinc" > confmf 629 | # Ignore all kinds of additional output from `make'. 630 | case `$am_make -s -f confmf 2> /dev/null` in #( 631 | *the\ am__doit\ target*) 632 | am__include=include 633 | am__quote= 634 | _am_result=GNU 635 | ;; 636 | esac 637 | # Now try BSD make style include. 638 | if test "$am__include" = "#"; then 639 | echo '.include "confinc"' > confmf 640 | case `$am_make -s -f confmf 2> /dev/null` in #( 641 | *the\ am__doit\ target*) 642 | am__include=.include 643 | am__quote="\"" 644 | _am_result=BSD 645 | ;; 646 | esac 647 | fi 648 | AC_SUBST([am__include]) 649 | AC_SUBST([am__quote]) 650 | AC_MSG_RESULT([$_am_result]) 651 | rm -f confinc confmf 652 | ]) 653 | 654 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 655 | 656 | # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 657 | # Free Software Foundation, Inc. 658 | # 659 | # This file is free software; the Free Software Foundation 660 | # gives unlimited permission to copy and/or distribute it, 661 | # with or without modifications, as long as this notice is preserved. 662 | 663 | # serial 6 664 | 665 | # AM_MISSING_PROG(NAME, PROGRAM) 666 | # ------------------------------ 667 | AC_DEFUN([AM_MISSING_PROG], 668 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 669 | $1=${$1-"${am_missing_run}$2"} 670 | AC_SUBST($1)]) 671 | 672 | 673 | # AM_MISSING_HAS_RUN 674 | # ------------------ 675 | # Define MISSING if not defined so far and test if it supports --run. 676 | # If it does, set am_missing_run to use it, otherwise, to nothing. 677 | AC_DEFUN([AM_MISSING_HAS_RUN], 678 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 679 | AC_REQUIRE_AUX_FILE([missing])dnl 680 | if test x"${MISSING+set}" != xset; then 681 | case $am_aux_dir in 682 | *\ * | *\ *) 683 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 684 | *) 685 | MISSING="\${SHELL} $am_aux_dir/missing" ;; 686 | esac 687 | fi 688 | # Use eval to expand $SHELL 689 | if eval "$MISSING --run true"; then 690 | am_missing_run="$MISSING --run " 691 | else 692 | am_missing_run= 693 | AC_MSG_WARN([`missing' script is too old or missing]) 694 | fi 695 | ]) 696 | 697 | # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 698 | # 699 | # This file is free software; the Free Software Foundation 700 | # gives unlimited permission to copy and/or distribute it, 701 | # with or without modifications, as long as this notice is preserved. 702 | 703 | # AM_PROG_MKDIR_P 704 | # --------------- 705 | # Check for `mkdir -p'. 706 | AC_DEFUN([AM_PROG_MKDIR_P], 707 | [AC_PREREQ([2.60])dnl 708 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl 709 | dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 710 | dnl while keeping a definition of mkdir_p for backward compatibility. 711 | dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 712 | dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 713 | dnl Makefile.ins that do not define MKDIR_P, so we do our own 714 | dnl adjustment using top_builddir (which is defined more often than 715 | dnl MKDIR_P). 716 | AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 717 | case $mkdir_p in 718 | [[\\/$]]* | ?:[[\\/]]*) ;; 719 | */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 720 | esac 721 | ]) 722 | 723 | # Helper functions for option handling. -*- Autoconf -*- 724 | 725 | # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 726 | # 727 | # This file is free software; the Free Software Foundation 728 | # gives unlimited permission to copy and/or distribute it, 729 | # with or without modifications, as long as this notice is preserved. 730 | 731 | # serial 4 732 | 733 | # _AM_MANGLE_OPTION(NAME) 734 | # ----------------------- 735 | AC_DEFUN([_AM_MANGLE_OPTION], 736 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 737 | 738 | # _AM_SET_OPTION(NAME) 739 | # ------------------------------ 740 | # Set option NAME. Presently that only means defining a flag for this option. 741 | AC_DEFUN([_AM_SET_OPTION], 742 | [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 743 | 744 | # _AM_SET_OPTIONS(OPTIONS) 745 | # ---------------------------------- 746 | # OPTIONS is a space-separated list of Automake options. 747 | AC_DEFUN([_AM_SET_OPTIONS], 748 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 749 | 750 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 751 | # ------------------------------------------- 752 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 753 | AC_DEFUN([_AM_IF_OPTION], 754 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 755 | 756 | # Check to make sure that the build environment is sane. -*- Autoconf -*- 757 | 758 | # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 759 | # Free Software Foundation, Inc. 760 | # 761 | # This file is free software; the Free Software Foundation 762 | # gives unlimited permission to copy and/or distribute it, 763 | # with or without modifications, as long as this notice is preserved. 764 | 765 | # serial 5 766 | 767 | # AM_SANITY_CHECK 768 | # --------------- 769 | AC_DEFUN([AM_SANITY_CHECK], 770 | [AC_MSG_CHECKING([whether build environment is sane]) 771 | # Just in case 772 | sleep 1 773 | echo timestamp > conftest.file 774 | # Reject unsafe characters in $srcdir or the absolute working directory 775 | # name. Accept space and tab only in the latter. 776 | am_lf=' 777 | ' 778 | case `pwd` in 779 | *[[\\\"\#\$\&\'\`$am_lf]]*) 780 | AC_MSG_ERROR([unsafe absolute working directory name]);; 781 | esac 782 | case $srcdir in 783 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 784 | AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 785 | esac 786 | 787 | # Do `set' in a subshell so we don't clobber the current shell's 788 | # arguments. Must try -L first in case configure is actually a 789 | # symlink; some systems play weird games with the mod time of symlinks 790 | # (eg FreeBSD returns the mod time of the symlink's containing 791 | # directory). 792 | if ( 793 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 794 | if test "$[*]" = "X"; then 795 | # -L didn't work. 796 | set X `ls -t "$srcdir/configure" conftest.file` 797 | fi 798 | rm -f conftest.file 799 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 800 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 801 | 802 | # If neither matched, then we have a broken ls. This can happen 803 | # if, for instance, CONFIG_SHELL is bash and it inherits a 804 | # broken ls alias from the environment. This has actually 805 | # happened. Such a system could not be considered "sane". 806 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 807 | alias in your environment]) 808 | fi 809 | 810 | test "$[2]" = conftest.file 811 | ) 812 | then 813 | # Ok. 814 | : 815 | else 816 | AC_MSG_ERROR([newly created file is older than distributed files! 817 | Check your system clock]) 818 | fi 819 | AC_MSG_RESULT(yes)]) 820 | 821 | # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 822 | # 823 | # This file is free software; the Free Software Foundation 824 | # gives unlimited permission to copy and/or distribute it, 825 | # with or without modifications, as long as this notice is preserved. 826 | 827 | # AM_PROG_INSTALL_STRIP 828 | # --------------------- 829 | # One issue with vendor `install' (even GNU) is that you can't 830 | # specify the program used to strip binaries. This is especially 831 | # annoying in cross-compiling environments, where the build's strip 832 | # is unlikely to handle the host's binaries. 833 | # Fortunately install-sh will honor a STRIPPROG variable, so we 834 | # always use install-sh in `make install-strip', and initialize 835 | # STRIPPROG with the value of the STRIP variable (set by the user). 836 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 837 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 838 | # Installed binaries are usually stripped using `strip' when the user 839 | # run `make install-strip'. However `strip' might not be the right 840 | # tool to use in cross-compilation environments, therefore Automake 841 | # will honor the `STRIP' environment variable to overrule this program. 842 | dnl Don't test for $cross_compiling = yes, because it might be `maybe'. 843 | if test "$cross_compiling" != no; then 844 | AC_CHECK_TOOL([STRIP], [strip], :) 845 | fi 846 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 847 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 848 | 849 | # Copyright (C) 2006, 2008 Free Software Foundation, Inc. 850 | # 851 | # This file is free software; the Free Software Foundation 852 | # gives unlimited permission to copy and/or distribute it, 853 | # with or without modifications, as long as this notice is preserved. 854 | 855 | # serial 2 856 | 857 | # _AM_SUBST_NOTMAKE(VARIABLE) 858 | # --------------------------- 859 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 860 | # This macro is traced by Automake. 861 | AC_DEFUN([_AM_SUBST_NOTMAKE]) 862 | 863 | # AM_SUBST_NOTMAKE(VARIABLE) 864 | # --------------------------- 865 | # Public sister of _AM_SUBST_NOTMAKE. 866 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 867 | 868 | # Check how to create a tarball. -*- Autoconf -*- 869 | 870 | # Copyright (C) 2004, 2005 Free Software Foundation, Inc. 871 | # 872 | # This file is free software; the Free Software Foundation 873 | # gives unlimited permission to copy and/or distribute it, 874 | # with or without modifications, as long as this notice is preserved. 875 | 876 | # serial 2 877 | 878 | # _AM_PROG_TAR(FORMAT) 879 | # -------------------- 880 | # Check how to create a tarball in format FORMAT. 881 | # FORMAT should be one of `v7', `ustar', or `pax'. 882 | # 883 | # Substitute a variable $(am__tar) that is a command 884 | # writing to stdout a FORMAT-tarball containing the directory 885 | # $tardir. 886 | # tardir=directory && $(am__tar) > result.tar 887 | # 888 | # Substitute a variable $(am__untar) that extract such 889 | # a tarball read from stdin. 890 | # $(am__untar) < result.tar 891 | AC_DEFUN([_AM_PROG_TAR], 892 | [# Always define AMTAR for backward compatibility. 893 | AM_MISSING_PROG([AMTAR], [tar]) 894 | m4_if([$1], [v7], 895 | [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 896 | [m4_case([$1], [ustar],, [pax],, 897 | [m4_fatal([Unknown tar format])]) 898 | AC_MSG_CHECKING([how to create a $1 tar archive]) 899 | # Loop over all known methods to create a tar archive until one works. 900 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 901 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} 902 | # Do not fold the above two line into one, because Tru64 sh and 903 | # Solaris sh will not grok spaces in the rhs of `-'. 904 | for _am_tool in $_am_tools 905 | do 906 | case $_am_tool in 907 | gnutar) 908 | for _am_tar in tar gnutar gtar; 909 | do 910 | AM_RUN_LOG([$_am_tar --version]) && break 911 | done 912 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 913 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 914 | am__untar="$_am_tar -xf -" 915 | ;; 916 | plaintar) 917 | # Must skip GNU tar: if it does not support --format= it doesn't create 918 | # ustar tarball either. 919 | (tar --version) >/dev/null 2>&1 && continue 920 | am__tar='tar chf - "$$tardir"' 921 | am__tar_='tar chf - "$tardir"' 922 | am__untar='tar xf -' 923 | ;; 924 | pax) 925 | am__tar='pax -L -x $1 -w "$$tardir"' 926 | am__tar_='pax -L -x $1 -w "$tardir"' 927 | am__untar='pax -r' 928 | ;; 929 | cpio) 930 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 931 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 932 | am__untar='cpio -i -H $1 -d' 933 | ;; 934 | none) 935 | am__tar=false 936 | am__tar_=false 937 | am__untar=false 938 | ;; 939 | esac 940 | 941 | # If the value was cached, stop now. We just wanted to have am__tar 942 | # and am__untar set. 943 | test -n "${am_cv_prog_tar_$1}" && break 944 | 945 | # tar/untar a dummy directory, and stop if the command works 946 | rm -rf conftest.dir 947 | mkdir conftest.dir 948 | echo GrepMe > conftest.dir/file 949 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 950 | rm -rf conftest.dir 951 | if test -s conftest.tar; then 952 | AM_RUN_LOG([$am__untar /dev/null 2>&1 && break 954 | fi 955 | done 956 | rm -rf conftest.dir 957 | 958 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 959 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 960 | AC_SUBST([am__tar]) 961 | AC_SUBST([am__untar]) 962 | ]) # _AM_PROG_TAR 963 | 964 | m4_include([acinclude.m4]) 965 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | aclocal \ 4 | && automake -acf \ 5 | && autoconf \ 6 | && autoheader \ 7 | && rm -r autom4te.cache 8 | if [ -f config.h.in~ ] 9 | then 10 | rm config.h.in~ 11 | fi 12 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.in by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_INTTYPES_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_MEMORY_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_STDINT_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_STDLIB_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STRINGS_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STRING_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_SYS_STAT_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_SYS_TYPES_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_UNISTD_H 29 | 30 | /* Define if you have the XKB extension */ 31 | #undef HAVE_XKB 32 | 33 | /* Define if you have the XTest extension */ 34 | #undef HAVE_XTEST 35 | 36 | /* Name of package */ 37 | #undef PACKAGE 38 | 39 | /* Define to the address where bug reports for this package should be sent. */ 40 | #undef PACKAGE_BUGREPORT 41 | 42 | /* Define to the full name of this package. */ 43 | #undef PACKAGE_NAME 44 | 45 | /* Define to the full name and version of this package. */ 46 | #undef PACKAGE_STRING 47 | 48 | /* Define to the one symbol short name of this package. */ 49 | #undef PACKAGE_TARNAME 50 | 51 | /* Define to the version of this package. */ 52 | #undef PACKAGE_VERSION 53 | 54 | /* Define to 1 if you have the ANSI C header files. */ 55 | #undef STDC_HEADERS 56 | 57 | /* Version number of package */ 58 | #undef VERSION 59 | -------------------------------------------------------------------------------- /configure.in: -------------------------------------------------------------------------------- 1 | dnl $Id: configure.in,v 1.5 2001/04/10 08:45:11 seli Exp $ 2 | dnl Process this file with autoconf to produce a configure script. 3 | AC_INIT(Makefile.am) 4 | 5 | AM_CONFIG_HEADER(config.h) 6 | 7 | AM_INIT_AUTOMAKE(numlockx,1.2) 8 | 9 | dnl Checks for programs. 10 | AC_PROG_CC 11 | AC_PROG_RANLIB 12 | AC_PATH_X 13 | AC_PREFIX_PROGRAM(X) 14 | K_PATH_X 15 | NM_CHECK_XKB 16 | NM_CHECK_XTEST 17 | NM_CHECK_XSETUP 18 | NM_CHECK_XINITRC 19 | 20 | dnl Checks for libraries. 21 | 22 | dnl Checks for header files. 23 | 24 | dnl Checks for typedefs, structures, and compiler characteristics. 25 | 26 | dnl Checks for library functions. 27 | 28 | AC_OUTPUT(Makefile) 29 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # depcomp - compile a program generating dependencies as side-effects 3 | 4 | scriptversion=2005-07-09.11 5 | 6 | # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. 7 | 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2, or (at your option) 11 | # any later version. 12 | 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 21 | # 02110-1301, USA. 22 | 23 | # As a special exception to the GNU General Public License, if you 24 | # distribute this file as part of a program that contains a 25 | # configuration script generated by Autoconf, you may include it under 26 | # the same distribution terms that you use for the rest of that program. 27 | 28 | # Originally written by Alexandre Oliva . 29 | 30 | case $1 in 31 | '') 32 | echo "$0: No command. Try \`$0 --help' for more information." 1>&2 33 | exit 1; 34 | ;; 35 | -h | --h*) 36 | cat <<\EOF 37 | Usage: depcomp [--help] [--version] PROGRAM [ARGS] 38 | 39 | Run PROGRAMS ARGS to compile a file, generating dependencies 40 | as side-effects. 41 | 42 | Environment variables: 43 | depmode Dependency tracking mode. 44 | source Source file read by `PROGRAMS ARGS'. 45 | object Object file output by `PROGRAMS ARGS'. 46 | DEPDIR directory where to store dependencies. 47 | depfile Dependency file to output. 48 | tmpdepfile Temporary file to use when outputing dependencies. 49 | libtool Whether libtool is used (yes/no). 50 | 51 | Report bugs to . 52 | EOF 53 | exit $? 54 | ;; 55 | -v | --v*) 56 | echo "depcomp $scriptversion" 57 | exit $? 58 | ;; 59 | esac 60 | 61 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 62 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 63 | exit 1 64 | fi 65 | 66 | # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. 67 | depfile=${depfile-`echo "$object" | 68 | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} 69 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 70 | 71 | rm -f "$tmpdepfile" 72 | 73 | # Some modes work just like other modes, but use different flags. We 74 | # parameterize here, but still list the modes in the big case below, 75 | # to make depend.m4 easier to write. Note that we *cannot* use a case 76 | # here, because this file can only contain one case statement. 77 | if test "$depmode" = hp; then 78 | # HP compiler uses -M and no extra arg. 79 | gccflag=-M 80 | depmode=gcc 81 | fi 82 | 83 | if test "$depmode" = dashXmstdout; then 84 | # This is just like dashmstdout with a different argument. 85 | dashmflag=-xM 86 | depmode=dashmstdout 87 | fi 88 | 89 | case "$depmode" in 90 | gcc3) 91 | ## gcc 3 implements dependency tracking that does exactly what 92 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 93 | ## it if -MD -MP comes after the -MF stuff. Hmm. 94 | "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 95 | stat=$? 96 | if test $stat -eq 0; then : 97 | else 98 | rm -f "$tmpdepfile" 99 | exit $stat 100 | fi 101 | mv "$tmpdepfile" "$depfile" 102 | ;; 103 | 104 | gcc) 105 | ## There are various ways to get dependency output from gcc. Here's 106 | ## why we pick this rather obscure method: 107 | ## - Don't want to use -MD because we'd like the dependencies to end 108 | ## up in a subdir. Having to rename by hand is ugly. 109 | ## (We might end up doing this anyway to support other compilers.) 110 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 111 | ## -MM, not -M (despite what the docs say). 112 | ## - Using -M directly means running the compiler twice (even worse 113 | ## than renaming). 114 | if test -z "$gccflag"; then 115 | gccflag=-MD, 116 | fi 117 | "$@" -Wp,"$gccflag$tmpdepfile" 118 | stat=$? 119 | if test $stat -eq 0; then : 120 | else 121 | rm -f "$tmpdepfile" 122 | exit $stat 123 | fi 124 | rm -f "$depfile" 125 | echo "$object : \\" > "$depfile" 126 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 127 | ## The second -e expression handles DOS-style file names with drive letters. 128 | sed -e 's/^[^:]*: / /' \ 129 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 130 | ## This next piece of magic avoids the `deleted header file' problem. 131 | ## The problem is that when a header file which appears in a .P file 132 | ## is deleted, the dependency causes make to die (because there is 133 | ## typically no way to rebuild the header). We avoid this by adding 134 | ## dummy dependencies for each header file. Too bad gcc doesn't do 135 | ## this for us directly. 136 | tr ' ' ' 137 | ' < "$tmpdepfile" | 138 | ## Some versions of gcc put a space before the `:'. On the theory 139 | ## that the space means something, we add a space to the output as 140 | ## well. 141 | ## Some versions of the HPUX 10.20 sed can't process this invocation 142 | ## correctly. Breaking it into two sed invocations is a workaround. 143 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 144 | rm -f "$tmpdepfile" 145 | ;; 146 | 147 | hp) 148 | # This case exists only to let depend.m4 do its work. It works by 149 | # looking at the text of this script. This case will never be run, 150 | # since it is checked for above. 151 | exit 1 152 | ;; 153 | 154 | sgi) 155 | if test "$libtool" = yes; then 156 | "$@" "-Wp,-MDupdate,$tmpdepfile" 157 | else 158 | "$@" -MDupdate "$tmpdepfile" 159 | fi 160 | stat=$? 161 | if test $stat -eq 0; then : 162 | else 163 | rm -f "$tmpdepfile" 164 | exit $stat 165 | fi 166 | rm -f "$depfile" 167 | 168 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 169 | echo "$object : \\" > "$depfile" 170 | 171 | # Clip off the initial element (the dependent). Don't try to be 172 | # clever and replace this with sed code, as IRIX sed won't handle 173 | # lines with more than a fixed number of characters (4096 in 174 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 175 | # the IRIX cc adds comments like `#:fec' to the end of the 176 | # dependency line. 177 | tr ' ' ' 178 | ' < "$tmpdepfile" \ 179 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 180 | tr ' 181 | ' ' ' >> $depfile 182 | echo >> $depfile 183 | 184 | # The second pass generates a dummy entry for each header file. 185 | tr ' ' ' 186 | ' < "$tmpdepfile" \ 187 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 188 | >> $depfile 189 | else 190 | # The sourcefile does not contain any dependencies, so just 191 | # store a dummy comment line, to avoid errors with the Makefile 192 | # "include basename.Plo" scheme. 193 | echo "#dummy" > "$depfile" 194 | fi 195 | rm -f "$tmpdepfile" 196 | ;; 197 | 198 | aix) 199 | # The C for AIX Compiler uses -M and outputs the dependencies 200 | # in a .u file. In older versions, this file always lives in the 201 | # current directory. Also, the AIX compiler puts `$object:' at the 202 | # start of each line; $object doesn't have directory information. 203 | # Version 6 uses the directory in both cases. 204 | stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` 205 | tmpdepfile="$stripped.u" 206 | if test "$libtool" = yes; then 207 | "$@" -Wc,-M 208 | else 209 | "$@" -M 210 | fi 211 | stat=$? 212 | 213 | if test -f "$tmpdepfile"; then : 214 | else 215 | stripped=`echo "$stripped" | sed 's,^.*/,,'` 216 | tmpdepfile="$stripped.u" 217 | fi 218 | 219 | if test $stat -eq 0; then : 220 | else 221 | rm -f "$tmpdepfile" 222 | exit $stat 223 | fi 224 | 225 | if test -f "$tmpdepfile"; then 226 | outname="$stripped.o" 227 | # Each line is of the form `foo.o: dependent.h'. 228 | # Do two passes, one to just change these to 229 | # `$object: dependent.h' and one to simply `dependent.h:'. 230 | sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" 231 | sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" 232 | else 233 | # The sourcefile does not contain any dependencies, so just 234 | # store a dummy comment line, to avoid errors with the Makefile 235 | # "include basename.Plo" scheme. 236 | echo "#dummy" > "$depfile" 237 | fi 238 | rm -f "$tmpdepfile" 239 | ;; 240 | 241 | icc) 242 | # Intel's C compiler understands `-MD -MF file'. However on 243 | # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c 244 | # ICC 7.0 will fill foo.d with something like 245 | # foo.o: sub/foo.c 246 | # foo.o: sub/foo.h 247 | # which is wrong. We want: 248 | # sub/foo.o: sub/foo.c 249 | # sub/foo.o: sub/foo.h 250 | # sub/foo.c: 251 | # sub/foo.h: 252 | # ICC 7.1 will output 253 | # foo.o: sub/foo.c sub/foo.h 254 | # and will wrap long lines using \ : 255 | # foo.o: sub/foo.c ... \ 256 | # sub/foo.h ... \ 257 | # ... 258 | 259 | "$@" -MD -MF "$tmpdepfile" 260 | stat=$? 261 | if test $stat -eq 0; then : 262 | else 263 | rm -f "$tmpdepfile" 264 | exit $stat 265 | fi 266 | rm -f "$depfile" 267 | # Each line is of the form `foo.o: dependent.h', 268 | # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. 269 | # Do two passes, one to just change these to 270 | # `$object: dependent.h' and one to simply `dependent.h:'. 271 | sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" 272 | # Some versions of the HPUX 10.20 sed can't process this invocation 273 | # correctly. Breaking it into two sed invocations is a workaround. 274 | sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | 275 | sed -e 's/$/ :/' >> "$depfile" 276 | rm -f "$tmpdepfile" 277 | ;; 278 | 279 | tru64) 280 | # The Tru64 compiler uses -MD to generate dependencies as a side 281 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 282 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 283 | # dependencies in `foo.d' instead, so we check for that too. 284 | # Subdirectories are respected. 285 | dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` 286 | test "x$dir" = "x$object" && dir= 287 | base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` 288 | 289 | if test "$libtool" = yes; then 290 | # With Tru64 cc, shared objects can also be used to make a 291 | # static library. This mecanism is used in libtool 1.4 series to 292 | # handle both shared and static libraries in a single compilation. 293 | # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. 294 | # 295 | # With libtool 1.5 this exception was removed, and libtool now 296 | # generates 2 separate objects for the 2 libraries. These two 297 | # compilations output dependencies in in $dir.libs/$base.o.d and 298 | # in $dir$base.o.d. We have to check for both files, because 299 | # one of the two compilations can be disabled. We should prefer 300 | # $dir$base.o.d over $dir.libs/$base.o.d because the latter is 301 | # automatically cleaned when .libs/ is deleted, while ignoring 302 | # the former would cause a distcleancheck panic. 303 | tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 304 | tmpdepfile2=$dir$base.o.d # libtool 1.5 305 | tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 306 | tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 307 | "$@" -Wc,-MD 308 | else 309 | tmpdepfile1=$dir$base.o.d 310 | tmpdepfile2=$dir$base.d 311 | tmpdepfile3=$dir$base.d 312 | tmpdepfile4=$dir$base.d 313 | "$@" -MD 314 | fi 315 | 316 | stat=$? 317 | if test $stat -eq 0; then : 318 | else 319 | rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 320 | exit $stat 321 | fi 322 | 323 | for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 324 | do 325 | test -f "$tmpdepfile" && break 326 | done 327 | if test -f "$tmpdepfile"; then 328 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 329 | # That's a tab and a space in the []. 330 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 331 | else 332 | echo "#dummy" > "$depfile" 333 | fi 334 | rm -f "$tmpdepfile" 335 | ;; 336 | 337 | #nosideeffect) 338 | # This comment above is used by automake to tell side-effect 339 | # dependency tracking mechanisms from slower ones. 340 | 341 | dashmstdout) 342 | # Important note: in order to support this mode, a compiler *must* 343 | # always write the preprocessed file to stdout, regardless of -o. 344 | "$@" || exit $? 345 | 346 | # Remove the call to Libtool. 347 | if test "$libtool" = yes; then 348 | while test $1 != '--mode=compile'; do 349 | shift 350 | done 351 | shift 352 | fi 353 | 354 | # Remove `-o $object'. 355 | IFS=" " 356 | for arg 357 | do 358 | case $arg in 359 | -o) 360 | shift 361 | ;; 362 | $object) 363 | shift 364 | ;; 365 | *) 366 | set fnord "$@" "$arg" 367 | shift # fnord 368 | shift # $arg 369 | ;; 370 | esac 371 | done 372 | 373 | test -z "$dashmflag" && dashmflag=-M 374 | # Require at least two characters before searching for `:' 375 | # in the target name. This is to cope with DOS-style filenames: 376 | # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. 377 | "$@" $dashmflag | 378 | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 379 | rm -f "$depfile" 380 | cat < "$tmpdepfile" > "$depfile" 381 | tr ' ' ' 382 | ' < "$tmpdepfile" | \ 383 | ## Some versions of the HPUX 10.20 sed can't process this invocation 384 | ## correctly. Breaking it into two sed invocations is a workaround. 385 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 386 | rm -f "$tmpdepfile" 387 | ;; 388 | 389 | dashXmstdout) 390 | # This case only exists to satisfy depend.m4. It is never actually 391 | # run, as this mode is specially recognized in the preamble. 392 | exit 1 393 | ;; 394 | 395 | makedepend) 396 | "$@" || exit $? 397 | # Remove any Libtool call 398 | if test "$libtool" = yes; then 399 | while test $1 != '--mode=compile'; do 400 | shift 401 | done 402 | shift 403 | fi 404 | # X makedepend 405 | shift 406 | cleared=no 407 | for arg in "$@"; do 408 | case $cleared in 409 | no) 410 | set ""; shift 411 | cleared=yes ;; 412 | esac 413 | case "$arg" in 414 | -D*|-I*) 415 | set fnord "$@" "$arg"; shift ;; 416 | # Strip any option that makedepend may not understand. Remove 417 | # the object too, otherwise makedepend will parse it as a source file. 418 | -*|$object) 419 | ;; 420 | *) 421 | set fnord "$@" "$arg"; shift ;; 422 | esac 423 | done 424 | obj_suffix="`echo $object | sed 's/^.*\././'`" 425 | touch "$tmpdepfile" 426 | ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" 427 | rm -f "$depfile" 428 | cat < "$tmpdepfile" > "$depfile" 429 | sed '1,2d' "$tmpdepfile" | tr ' ' ' 430 | ' | \ 431 | ## Some versions of the HPUX 10.20 sed can't process this invocation 432 | ## correctly. Breaking it into two sed invocations is a workaround. 433 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 434 | rm -f "$tmpdepfile" "$tmpdepfile".bak 435 | ;; 436 | 437 | cpp) 438 | # Important note: in order to support this mode, a compiler *must* 439 | # always write the preprocessed file to stdout. 440 | "$@" || exit $? 441 | 442 | # Remove the call to Libtool. 443 | if test "$libtool" = yes; then 444 | while test $1 != '--mode=compile'; do 445 | shift 446 | done 447 | shift 448 | fi 449 | 450 | # Remove `-o $object'. 451 | IFS=" " 452 | for arg 453 | do 454 | case $arg in 455 | -o) 456 | shift 457 | ;; 458 | $object) 459 | shift 460 | ;; 461 | *) 462 | set fnord "$@" "$arg" 463 | shift # fnord 464 | shift # $arg 465 | ;; 466 | esac 467 | done 468 | 469 | "$@" -E | 470 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ 471 | -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 472 | sed '$ s: \\$::' > "$tmpdepfile" 473 | rm -f "$depfile" 474 | echo "$object : \\" > "$depfile" 475 | cat < "$tmpdepfile" >> "$depfile" 476 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 477 | rm -f "$tmpdepfile" 478 | ;; 479 | 480 | msvisualcpp) 481 | # Important note: in order to support this mode, a compiler *must* 482 | # always write the preprocessed file to stdout, regardless of -o, 483 | # because we must use -o when running libtool. 484 | "$@" || exit $? 485 | IFS=" " 486 | for arg 487 | do 488 | case "$arg" in 489 | "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") 490 | set fnord "$@" 491 | shift 492 | shift 493 | ;; 494 | *) 495 | set fnord "$@" "$arg" 496 | shift 497 | shift 498 | ;; 499 | esac 500 | done 501 | "$@" -E | 502 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" 503 | rm -f "$depfile" 504 | echo "$object : \\" > "$depfile" 505 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 506 | echo " " >> "$depfile" 507 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" 508 | rm -f "$tmpdepfile" 509 | ;; 510 | 511 | none) 512 | exec "$@" 513 | ;; 514 | 515 | *) 516 | echo "Unknown depmode $depmode" 1>&2 517 | exit 1 518 | ;; 519 | esac 520 | 521 | exit 0 522 | 523 | # Local Variables: 524 | # mode: shell-script 525 | # sh-indentation: 2 526 | # eval: (add-hook 'write-file-hooks 'time-stamp) 527 | # time-stamp-start: "scriptversion=" 528 | # time-stamp-format: "%:y-%02m-%02d.%02H" 529 | # time-stamp-end: "$" 530 | # End: 531 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # install - install a program, script, or datafile 3 | 4 | scriptversion=2005-05-14.22 5 | 6 | # This originates from X11R5 (mit/util/scripts/install.sh), which was 7 | # later released in X11R6 (xc/config/util/install.sh) with the 8 | # following copyright and license. 9 | # 10 | # Copyright (C) 1994 X Consortium 11 | # 12 | # Permission is hereby granted, free of charge, to any person obtaining a copy 13 | # of this software and associated documentation files (the "Software"), to 14 | # deal in the Software without restriction, including without limitation the 15 | # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 16 | # sell copies of the Software, and to permit persons to whom the Software is 17 | # furnished to do so, subject to the following conditions: 18 | # 19 | # The above copyright notice and this permission notice shall be included in 20 | # all copies or substantial portions of the Software. 21 | # 22 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- 27 | # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name of the X Consortium shall not 30 | # be used in advertising or otherwise to promote the sale, use or other deal- 31 | # ings in this Software without prior written authorization from the X Consor- 32 | # tium. 33 | # 34 | # 35 | # FSF changes to this file are in the public domain. 36 | # 37 | # Calling this script install-sh is preferred over install.sh, to prevent 38 | # `make' implicit rules from creating a file called install from it 39 | # when there is no Makefile. 40 | # 41 | # This script is compatible with the BSD install script, but was written 42 | # from scratch. It can only install one file at a time, a restriction 43 | # shared with many OS's install programs. 44 | 45 | # set DOITPROG to echo to test this script 46 | 47 | # Don't use :- since 4.3BSD and earlier shells don't like it. 48 | doit="${DOITPROG-}" 49 | 50 | # put in absolute paths if you don't have them in your path; or use env. vars. 51 | 52 | mvprog="${MVPROG-mv}" 53 | cpprog="${CPPROG-cp}" 54 | chmodprog="${CHMODPROG-chmod}" 55 | chownprog="${CHOWNPROG-chown}" 56 | chgrpprog="${CHGRPPROG-chgrp}" 57 | stripprog="${STRIPPROG-strip}" 58 | rmprog="${RMPROG-rm}" 59 | mkdirprog="${MKDIRPROG-mkdir}" 60 | 61 | chmodcmd="$chmodprog 0755" 62 | chowncmd= 63 | chgrpcmd= 64 | stripcmd= 65 | rmcmd="$rmprog -f" 66 | mvcmd="$mvprog" 67 | src= 68 | dst= 69 | dir_arg= 70 | dstarg= 71 | no_target_directory= 72 | 73 | usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE 74 | or: $0 [OPTION]... SRCFILES... DIRECTORY 75 | or: $0 [OPTION]... -t DIRECTORY SRCFILES... 76 | or: $0 [OPTION]... -d DIRECTORIES... 77 | 78 | In the 1st form, copy SRCFILE to DSTFILE. 79 | In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. 80 | In the 4th, create DIRECTORIES. 81 | 82 | Options: 83 | -c (ignored) 84 | -d create directories instead of installing files. 85 | -g GROUP $chgrpprog installed files to GROUP. 86 | -m MODE $chmodprog installed files to MODE. 87 | -o USER $chownprog installed files to USER. 88 | -s $stripprog installed files. 89 | -t DIRECTORY install into DIRECTORY. 90 | -T report an error if DSTFILE is a directory. 91 | --help display this help and exit. 92 | --version display version info and exit. 93 | 94 | Environment variables override the default commands: 95 | CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG 96 | " 97 | 98 | while test -n "$1"; do 99 | case $1 in 100 | -c) shift 101 | continue;; 102 | 103 | -d) dir_arg=true 104 | shift 105 | continue;; 106 | 107 | -g) chgrpcmd="$chgrpprog $2" 108 | shift 109 | shift 110 | continue;; 111 | 112 | --help) echo "$usage"; exit $?;; 113 | 114 | -m) chmodcmd="$chmodprog $2" 115 | shift 116 | shift 117 | continue;; 118 | 119 | -o) chowncmd="$chownprog $2" 120 | shift 121 | shift 122 | continue;; 123 | 124 | -s) stripcmd=$stripprog 125 | shift 126 | continue;; 127 | 128 | -t) dstarg=$2 129 | shift 130 | shift 131 | continue;; 132 | 133 | -T) no_target_directory=true 134 | shift 135 | continue;; 136 | 137 | --version) echo "$0 $scriptversion"; exit $?;; 138 | 139 | *) # When -d is used, all remaining arguments are directories to create. 140 | # When -t is used, the destination is already specified. 141 | test -n "$dir_arg$dstarg" && break 142 | # Otherwise, the last argument is the destination. Remove it from $@. 143 | for arg 144 | do 145 | if test -n "$dstarg"; then 146 | # $@ is not empty: it contains at least $arg. 147 | set fnord "$@" "$dstarg" 148 | shift # fnord 149 | fi 150 | shift # arg 151 | dstarg=$arg 152 | done 153 | break;; 154 | esac 155 | done 156 | 157 | if test -z "$1"; then 158 | if test -z "$dir_arg"; then 159 | echo "$0: no input file specified." >&2 160 | exit 1 161 | fi 162 | # It's OK to call `install-sh -d' without argument. 163 | # This can happen when creating conditional directories. 164 | exit 0 165 | fi 166 | 167 | for src 168 | do 169 | # Protect names starting with `-'. 170 | case $src in 171 | -*) src=./$src ;; 172 | esac 173 | 174 | if test -n "$dir_arg"; then 175 | dst=$src 176 | src= 177 | 178 | if test -d "$dst"; then 179 | mkdircmd=: 180 | chmodcmd= 181 | else 182 | mkdircmd=$mkdirprog 183 | fi 184 | else 185 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command 186 | # might cause directories to be created, which would be especially bad 187 | # if $src (and thus $dsttmp) contains '*'. 188 | if test ! -f "$src" && test ! -d "$src"; then 189 | echo "$0: $src does not exist." >&2 190 | exit 1 191 | fi 192 | 193 | if test -z "$dstarg"; then 194 | echo "$0: no destination specified." >&2 195 | exit 1 196 | fi 197 | 198 | dst=$dstarg 199 | # Protect names starting with `-'. 200 | case $dst in 201 | -*) dst=./$dst ;; 202 | esac 203 | 204 | # If destination is a directory, append the input filename; won't work 205 | # if double slashes aren't ignored. 206 | if test -d "$dst"; then 207 | if test -n "$no_target_directory"; then 208 | echo "$0: $dstarg: Is a directory" >&2 209 | exit 1 210 | fi 211 | dst=$dst/`basename "$src"` 212 | fi 213 | fi 214 | 215 | # This sed command emulates the dirname command. 216 | dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` 217 | 218 | # Make sure that the destination directory exists. 219 | 220 | # Skip lots of stat calls in the usual case. 221 | if test ! -d "$dstdir"; then 222 | defaultIFS=' 223 | ' 224 | IFS="${IFS-$defaultIFS}" 225 | 226 | oIFS=$IFS 227 | # Some sh's can't handle IFS=/ for some reason. 228 | IFS='%' 229 | set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` 230 | shift 231 | IFS=$oIFS 232 | 233 | pathcomp= 234 | 235 | while test $# -ne 0 ; do 236 | pathcomp=$pathcomp$1 237 | shift 238 | if test ! -d "$pathcomp"; then 239 | $mkdirprog "$pathcomp" 240 | # mkdir can fail with a `File exist' error in case several 241 | # install-sh are creating the directory concurrently. This 242 | # is OK. 243 | test -d "$pathcomp" || exit 244 | fi 245 | pathcomp=$pathcomp/ 246 | done 247 | fi 248 | 249 | if test -n "$dir_arg"; then 250 | $doit $mkdircmd "$dst" \ 251 | && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ 252 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ 253 | && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ 254 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } 255 | 256 | else 257 | dstfile=`basename "$dst"` 258 | 259 | # Make a couple of temp file names in the proper directory. 260 | dsttmp=$dstdir/_inst.$$_ 261 | rmtmp=$dstdir/_rm.$$_ 262 | 263 | # Trap to clean up those temp files at exit. 264 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 265 | trap '(exit $?); exit' 1 2 13 15 266 | 267 | # Copy the file name to the temp name. 268 | $doit $cpprog "$src" "$dsttmp" && 269 | 270 | # and set any options; do chmod last to preserve setuid bits. 271 | # 272 | # If any of these fail, we abort the whole thing. If we want to 273 | # ignore errors from any of these, just make sure not to ignore 274 | # errors from the above "$doit $cpprog $src $dsttmp" command. 275 | # 276 | { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ 277 | && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ 278 | && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ 279 | && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && 280 | 281 | # Now rename the file to the real destination. 282 | { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ 283 | || { 284 | # The rename failed, perhaps because mv can't rename something else 285 | # to itself, or perhaps because mv is so ancient that it does not 286 | # support -f. 287 | 288 | # Now remove or move aside any old file at destination location. 289 | # We try this two ways since rm can't unlink itself on some 290 | # systems and the destination file might be busy for other 291 | # reasons. In this case, the final cleanup might fail but the new 292 | # file should still install successfully. 293 | { 294 | if test -f "$dstdir/$dstfile"; then 295 | $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ 296 | || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ 297 | || { 298 | echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 299 | (exit 1); exit 1 300 | } 301 | else 302 | : 303 | fi 304 | } && 305 | 306 | # Now rename the file to the real destination. 307 | $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" 308 | } 309 | } 310 | fi || { (exit 1); exit 1; } 311 | done 312 | 313 | # The final little trick to "correctly" pass the exit status to the exit trap. 314 | { 315 | (exit 0); exit 0 316 | } 317 | 318 | # Local variables: 319 | # eval: (add-hook 'write-file-hooks 'time-stamp) 320 | # time-stamp-start: "scriptversion=" 321 | # time-stamp-format: "%:y-%02m-%02d.%02H" 322 | # time-stamp-end: "$" 323 | # End: 324 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | NumLockX 4 | 5 | $Id: main.c,v 1.10 2001/04/30 20:55:20 seli Exp $ 6 | 7 | Copyright (C) 2000-2001 Lubos Lunak 8 | Copyright (C) 2001 Oswald Buddenhagen 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a 11 | copy of this software and associated documentation files (the "Software"), 12 | to deal in the Software without restriction, including without limitation 13 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 14 | and/or sell copies of the Software, and to permit persons to whom the 15 | Software is furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 23 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 26 | DEALINGS IN THE SOFTWARE. 27 | 28 | ****************************************************************************/ 29 | 30 | #define __main_C 31 | 32 | #ifdef HAVE_CONFIG_H 33 | #include 34 | #endif 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | 42 | #ifdef HAVE_XTEST 43 | #include 44 | #endif 45 | 46 | #ifdef HAVE_XKB 47 | #include 48 | #endif 49 | 50 | #include 51 | 52 | void usage( const char* argv0 ) 53 | { 54 | printf( "NumLockX " VERSION "\n" 55 | "(C) 2000-2001 Lubos Lunak \n" 56 | "(C) 2001 Oswald Buddenhagen \n\n" 57 | "Usage : %s [on|off]\n" 58 | "on - turns NumLock on in X ( default )\n" 59 | "off - turns NumLock off in X\n" 60 | "toggle - toggles the NumLock on and off in X\n" 61 | "\n" 62 | , argv0 ); 63 | } 64 | 65 | Display* dpy; 66 | 67 | /* the XKB stuff is based on code created by Oswald Buddenhagen */ 68 | #ifdef HAVE_XKB 69 | int xkb_init() 70 | { 71 | int xkb_opcode, xkb_event, xkb_error; 72 | int xkb_lmaj = XkbMajorVersion; 73 | int xkb_lmin = XkbMinorVersion; 74 | return XkbLibraryVersion( &xkb_lmaj, &xkb_lmin ) 75 | && XkbQueryExtension( dpy, &xkb_opcode, &xkb_event, &xkb_error, 76 | &xkb_lmaj, &xkb_lmin ); 77 | } 78 | 79 | unsigned int xkb_mask_modifier( XkbDescPtr xkb, const char *name ) 80 | { 81 | int i; 82 | if( !xkb || !xkb->names ) 83 | return 0; 84 | for( i = 0; 85 | i < XkbNumVirtualMods; 86 | i++ ) 87 | { 88 | char* modStr = XGetAtomName( xkb->dpy, xkb->names->vmods[i] ); 89 | if( modStr != NULL && strcmp(name, modStr) == 0 ) 90 | { 91 | unsigned int mask; 92 | XkbVirtualModsToReal( xkb, 1 << i, &mask ); 93 | return mask; 94 | } 95 | } 96 | return 0; 97 | } 98 | 99 | unsigned int xkb_numlock_mask() 100 | { 101 | XkbDescPtr xkb; 102 | if(( xkb = XkbGetKeyboard( dpy, XkbAllComponentsMask, XkbUseCoreKbd )) != NULL ) 103 | { 104 | unsigned int mask = xkb_mask_modifier( xkb, "NumLock" ); 105 | XkbFreeKeyboard( xkb, 0, True ); 106 | return mask; 107 | } 108 | return 0; 109 | } 110 | 111 | int xkb_set_on() 112 | { 113 | unsigned int mask; 114 | if( !xkb_init()) 115 | return 0; 116 | mask = xkb_numlock_mask(); 117 | if( mask == 0 ) 118 | return 0; 119 | XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, mask); 120 | return 1; 121 | } 122 | 123 | int xkb_set_off() 124 | { 125 | unsigned int mask; 126 | if( !xkb_init()) 127 | return 0; 128 | mask = xkb_numlock_mask(); 129 | if( mask == 0 ) 130 | return 0; 131 | XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, 0); 132 | return 1; 133 | } 134 | 135 | int xkb_toggle() 136 | { 137 | unsigned int mask; 138 | unsigned int numlockState; 139 | XkbStateRec xkbState; 140 | if( !xkb_init()) 141 | return 0; 142 | mask = xkb_numlock_mask(); 143 | if( mask == 0 ) 144 | return 0; 145 | XkbGetState( dpy, XkbUseCoreKbd, &xkbState); 146 | numlockState = xkbState.locked_mods & mask; 147 | if (numlockState) 148 | XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, 0); 149 | else 150 | XkbLockModifiers ( dpy, XkbUseCoreKbd, mask, mask); 151 | return 1; 152 | } 153 | 154 | #endif 155 | 156 | #ifdef HAVE_XTEST 157 | int xtest_get_numlock_state() 158 | { 159 | int i; 160 | int numlock_mask = 0; 161 | Window dummy1, dummy2; 162 | int dummy3, dummy4, dummy5, dummy6; 163 | unsigned int mask; 164 | XModifierKeymap* map = XGetModifierMapping( dpy ); 165 | KeyCode numlock_keycode = XKeysymToKeycode( dpy, XK_Num_Lock ); 166 | if( numlock_keycode == NoSymbol ) 167 | return 0; 168 | for( i = 0; 169 | i < 8; 170 | ++i ) 171 | { 172 | if( map->modifiermap[ map->max_keypermod * i ] == numlock_keycode ) 173 | numlock_mask = 1 << i; 174 | } 175 | XQueryPointer( dpy, DefaultRootWindow( dpy ), &dummy1, &dummy2, 176 | &dummy3, &dummy4, &dummy5, &dummy6, &mask ); 177 | XFreeModifiermap( map ); 178 | return mask & numlock_mask; 179 | } 180 | 181 | void xtest_change_numlock() 182 | { 183 | XTestFakeKeyEvent( dpy, XKeysymToKeycode( dpy, XK_Num_Lock ), True, CurrentTime ); 184 | XTestFakeKeyEvent( dpy, XKeysymToKeycode( dpy, XK_Num_Lock ), False, CurrentTime ); 185 | } 186 | 187 | void xtest_set_on() 188 | { 189 | if( !xtest_get_numlock_state()) 190 | xtest_change_numlock(); 191 | } 192 | 193 | void xtest_set_off() 194 | { 195 | if( xtest_get_numlock_state()) 196 | xtest_change_numlock(); 197 | } 198 | 199 | void xtest_toggle() 200 | { 201 | xtest_change_numlock(); 202 | } 203 | #endif 204 | 205 | void numlock_set_on() 206 | { 207 | #ifdef HAVE_XKB 208 | if( xkb_set_on()) 209 | return; 210 | #endif 211 | #ifdef HAVE_XTEST 212 | xtest_set_on(); 213 | #endif 214 | } 215 | 216 | void numlock_set_off() 217 | { 218 | #ifdef HAVE_XKB 219 | if( xkb_set_off()) 220 | return; 221 | #endif 222 | #ifdef HAVE_XTEST 223 | xtest_set_off(); 224 | #endif 225 | } 226 | 227 | void numlock_toggle() 228 | { 229 | #ifdef HAVE_XKB 230 | if( xkb_toggle()) 231 | return; 232 | #endif 233 | #ifdef HAVE_XTEST 234 | xtest_toggle(); 235 | #endif 236 | } 237 | 238 | int main( int argc, char* argv[] ) 239 | { 240 | if( argc > 2 ) 241 | { 242 | usage( argv[ 0 ] ); 243 | return 1; 244 | } 245 | dpy = XOpenDisplay( NULL ); 246 | if( dpy == NULL ) 247 | { 248 | fprintf( stderr, "Error opening display!\n" ); 249 | return 1; 250 | } 251 | if( argc == 1 ) 252 | numlock_set_on(); 253 | else if( strcmp( argv[ 1 ], "on" ) == 0 ) 254 | numlock_set_on(); 255 | else if( strcmp( argv[ 1 ], "off" ) == 0 ) 256 | numlock_set_off(); 257 | else if( strcmp( argv[ 1 ], "toggle" ) == 0 ) 258 | numlock_toggle(); 259 | else 260 | { 261 | usage( argv[ 0 ] ); 262 | XCloseDisplay( dpy ); 263 | return 2; 264 | } 265 | XCloseDisplay( dpy ); 266 | return 0; 267 | } 268 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | 4 | scriptversion=2005-06-08.21 5 | 6 | # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 7 | # Free Software Foundation, Inc. 8 | # Originally by Fran,cois Pinard , 1996. 9 | 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 2, or (at your option) 13 | # any later version. 14 | 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 23 | # 02110-1301, USA. 24 | 25 | # As a special exception to the GNU General Public License, if you 26 | # distribute this file as part of a program that contains a 27 | # configuration script generated by Autoconf, you may include it under 28 | # the same distribution terms that you use for the rest of that program. 29 | 30 | if test $# -eq 0; then 31 | echo 1>&2 "Try \`$0 --help' for more information" 32 | exit 1 33 | fi 34 | 35 | run=: 36 | 37 | # In the cases where this matters, `missing' is being run in the 38 | # srcdir already. 39 | if test -f configure.ac; then 40 | configure_ac=configure.ac 41 | else 42 | configure_ac=configure.in 43 | fi 44 | 45 | msg="missing on your system" 46 | 47 | case "$1" in 48 | --run) 49 | # Try to run requested program, and just exit if it succeeds. 50 | run= 51 | shift 52 | "$@" && exit 0 53 | # Exit code 63 means version mismatch. This often happens 54 | # when the user try to use an ancient version of a tool on 55 | # a file that requires a minimum version. In this case we 56 | # we should proceed has if the program had been absent, or 57 | # if --run hadn't been passed. 58 | if test $? = 63; then 59 | run=: 60 | msg="probably too old" 61 | fi 62 | ;; 63 | 64 | -h|--h|--he|--hel|--help) 65 | echo "\ 66 | $0 [OPTION]... PROGRAM [ARGUMENT]... 67 | 68 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69 | error status if there is no known handling for PROGRAM. 70 | 71 | Options: 72 | -h, --help display this help and exit 73 | -v, --version output version information and exit 74 | --run try to run the given command, and emulate it if it fails 75 | 76 | Supported PROGRAM values: 77 | aclocal touch file \`aclocal.m4' 78 | autoconf touch file \`configure' 79 | autoheader touch file \`config.h.in' 80 | automake touch all \`Makefile.in' files 81 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 82 | flex create \`lex.yy.c', if possible, from existing .c 83 | help2man touch the output file 84 | lex create \`lex.yy.c', if possible, from existing .c 85 | makeinfo touch the output file 86 | tar try tar, gnutar, gtar, then tar without non-portable flags 87 | yacc create \`y.tab.[ch]', if possible, from existing .[ch] 88 | 89 | Send bug reports to ." 90 | exit $? 91 | ;; 92 | 93 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 94 | echo "missing $scriptversion (GNU Automake)" 95 | exit $? 96 | ;; 97 | 98 | -*) 99 | echo 1>&2 "$0: Unknown \`$1' option" 100 | echo 1>&2 "Try \`$0 --help' for more information" 101 | exit 1 102 | ;; 103 | 104 | esac 105 | 106 | # Now exit if we have it, but it failed. Also exit now if we 107 | # don't have it and --version was passed (most likely to detect 108 | # the program). 109 | case "$1" in 110 | lex|yacc) 111 | # Not GNU programs, they don't have --version. 112 | ;; 113 | 114 | tar) 115 | if test -n "$run"; then 116 | echo 1>&2 "ERROR: \`tar' requires --run" 117 | exit 1 118 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 119 | exit 1 120 | fi 121 | ;; 122 | 123 | *) 124 | if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 125 | # We have it, but it failed. 126 | exit 1 127 | elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 128 | # Could not run --version or --help. This is probably someone 129 | # running `$TOOL --version' or `$TOOL --help' to check whether 130 | # $TOOL exists and not knowing $TOOL uses missing. 131 | exit 1 132 | fi 133 | ;; 134 | esac 135 | 136 | # If it does not exist, or fails to run (possibly an outdated version), 137 | # try to emulate it. 138 | case "$1" in 139 | aclocal*) 140 | echo 1>&2 "\ 141 | WARNING: \`$1' is $msg. You should only need it if 142 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 143 | to install the \`Automake' and \`Perl' packages. Grab them from 144 | any GNU archive site." 145 | touch aclocal.m4 146 | ;; 147 | 148 | autoconf) 149 | echo 1>&2 "\ 150 | WARNING: \`$1' is $msg. You should only need it if 151 | you modified \`${configure_ac}'. You might want to install the 152 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 153 | archive site." 154 | touch configure 155 | ;; 156 | 157 | autoheader) 158 | echo 1>&2 "\ 159 | WARNING: \`$1' is $msg. You should only need it if 160 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 161 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 162 | from any GNU archive site." 163 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 164 | test -z "$files" && files="config.h" 165 | touch_files= 166 | for f in $files; do 167 | case "$f" in 168 | *:*) touch_files="$touch_files "`echo "$f" | 169 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 170 | *) touch_files="$touch_files $f.in";; 171 | esac 172 | done 173 | touch $touch_files 174 | ;; 175 | 176 | automake*) 177 | echo 1>&2 "\ 178 | WARNING: \`$1' is $msg. You should only need it if 179 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 180 | You might want to install the \`Automake' and \`Perl' packages. 181 | Grab them from any GNU archive site." 182 | find . -type f -name Makefile.am -print | 183 | sed 's/\.am$/.in/' | 184 | while read f; do touch "$f"; done 185 | ;; 186 | 187 | autom4te) 188 | echo 1>&2 "\ 189 | WARNING: \`$1' is needed, but is $msg. 190 | You might have modified some files without having the 191 | proper tools for further handling them. 192 | You can get \`$1' as part of \`Autoconf' from any GNU 193 | archive site." 194 | 195 | file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` 196 | test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 197 | if test -f "$file"; then 198 | touch $file 199 | else 200 | test -z "$file" || exec >$file 201 | echo "#! /bin/sh" 202 | echo "# Created by GNU Automake missing as a replacement of" 203 | echo "# $ $@" 204 | echo "exit 0" 205 | chmod +x $file 206 | exit 1 207 | fi 208 | ;; 209 | 210 | bison|yacc) 211 | echo 1>&2 "\ 212 | WARNING: \`$1' $msg. You should only need it if 213 | you modified a \`.y' file. You may need the \`Bison' package 214 | in order for those modifications to take effect. You can get 215 | \`Bison' from any GNU archive site." 216 | rm -f y.tab.c y.tab.h 217 | if [ $# -ne 1 ]; then 218 | eval LASTARG="\${$#}" 219 | case "$LASTARG" in 220 | *.y) 221 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 222 | if [ -f "$SRCFILE" ]; then 223 | cp "$SRCFILE" y.tab.c 224 | fi 225 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 226 | if [ -f "$SRCFILE" ]; then 227 | cp "$SRCFILE" y.tab.h 228 | fi 229 | ;; 230 | esac 231 | fi 232 | if [ ! -f y.tab.h ]; then 233 | echo >y.tab.h 234 | fi 235 | if [ ! -f y.tab.c ]; then 236 | echo 'main() { return 0; }' >y.tab.c 237 | fi 238 | ;; 239 | 240 | lex|flex) 241 | echo 1>&2 "\ 242 | WARNING: \`$1' is $msg. You should only need it if 243 | you modified a \`.l' file. You may need the \`Flex' package 244 | in order for those modifications to take effect. You can get 245 | \`Flex' from any GNU archive site." 246 | rm -f lex.yy.c 247 | if [ $# -ne 1 ]; then 248 | eval LASTARG="\${$#}" 249 | case "$LASTARG" in 250 | *.l) 251 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 252 | if [ -f "$SRCFILE" ]; then 253 | cp "$SRCFILE" lex.yy.c 254 | fi 255 | ;; 256 | esac 257 | fi 258 | if [ ! -f lex.yy.c ]; then 259 | echo 'main() { return 0; }' >lex.yy.c 260 | fi 261 | ;; 262 | 263 | help2man) 264 | echo 1>&2 "\ 265 | WARNING: \`$1' is $msg. You should only need it if 266 | you modified a dependency of a manual page. You may need the 267 | \`Help2man' package in order for those modifications to take 268 | effect. You can get \`Help2man' from any GNU archive site." 269 | 270 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 271 | if test -z "$file"; then 272 | file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` 273 | fi 274 | if [ -f "$file" ]; then 275 | touch $file 276 | else 277 | test -z "$file" || exec >$file 278 | echo ".ab help2man is required to generate this page" 279 | exit 1 280 | fi 281 | ;; 282 | 283 | makeinfo) 284 | echo 1>&2 "\ 285 | WARNING: \`$1' is $msg. You should only need it if 286 | you modified a \`.texi' or \`.texinfo' file, or any other file 287 | indirectly affecting the aspect of the manual. The spurious 288 | call might also be the consequence of using a buggy \`make' (AIX, 289 | DU, IRIX). You might want to install the \`Texinfo' package or 290 | the \`GNU make' package. Grab either from any GNU archive site." 291 | # The file to touch is that specified with -o ... 292 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 293 | if test -z "$file"; then 294 | # ... or it is the one specified with @setfilename ... 295 | infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 296 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` 297 | # ... or it is derived from the source name (dir/f.texi becomes f.info) 298 | test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 299 | fi 300 | # If the file does not exist, the user really needs makeinfo; 301 | # let's fail without touching anything. 302 | test -f $file || exit 1 303 | touch $file 304 | ;; 305 | 306 | tar) 307 | shift 308 | 309 | # We have already tried tar in the generic part. 310 | # Look for gnutar/gtar before invocation to avoid ugly error 311 | # messages. 312 | if (gnutar --version > /dev/null 2>&1); then 313 | gnutar "$@" && exit 0 314 | fi 315 | if (gtar --version > /dev/null 2>&1); then 316 | gtar "$@" && exit 0 317 | fi 318 | firstarg="$1" 319 | if shift; then 320 | case "$firstarg" in 321 | *o*) 322 | firstarg=`echo "$firstarg" | sed s/o//` 323 | tar "$firstarg" "$@" && exit 0 324 | ;; 325 | esac 326 | case "$firstarg" in 327 | *h*) 328 | firstarg=`echo "$firstarg" | sed s/h//` 329 | tar "$firstarg" "$@" && exit 0 330 | ;; 331 | esac 332 | fi 333 | 334 | echo 1>&2 "\ 335 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 336 | You may want to install GNU tar or Free paxutils, or check the 337 | command line arguments." 338 | exit 1 339 | ;; 340 | 341 | *) 342 | echo 1>&2 "\ 343 | WARNING: \`$1' is needed, and is $msg. 344 | You might have modified some files without having the 345 | proper tools for further handling them. Check the \`README' file, 346 | it often tells you about the needed prerequisites for installing 347 | this package. You may also peek at any GNU archive site, in case 348 | some other package would contain this missing \`$1' program." 349 | exit 1 350 | ;; 351 | esac 352 | 353 | exit 0 354 | 355 | # Local variables: 356 | # eval: (add-hook 'write-file-hooks 'time-stamp) 357 | # time-stamp-start: "scriptversion=" 358 | # time-stamp-format: "%:y-%02m-%02d.%02H" 359 | # time-stamp-end: "$" 360 | # End: 361 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | 4 | scriptversion=2005-06-29.22 5 | 6 | # Original author: Noah Friedman 7 | # Created: 1993-05-16 8 | # Public domain. 9 | # 10 | # This file is maintained in Automake, please report 11 | # bugs to or send patches to 12 | # . 13 | 14 | errstatus=0 15 | dirmode= 16 | 17 | usage="\ 18 | Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... 19 | 20 | Create each directory DIR (with mode MODE, if specified), including all 21 | leading file name components. 22 | 23 | Report bugs to ." 24 | 25 | # process command line arguments 26 | while test $# -gt 0 ; do 27 | case $1 in 28 | -h | --help | --h*) # -h for help 29 | echo "$usage" 30 | exit $? 31 | ;; 32 | -m) # -m PERM arg 33 | shift 34 | test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } 35 | dirmode=$1 36 | shift 37 | ;; 38 | --version) 39 | echo "$0 $scriptversion" 40 | exit $? 41 | ;; 42 | --) # stop option processing 43 | shift 44 | break 45 | ;; 46 | -*) # unknown option 47 | echo "$usage" 1>&2 48 | exit 1 49 | ;; 50 | *) # first non-opt arg 51 | break 52 | ;; 53 | esac 54 | done 55 | 56 | for file 57 | do 58 | if test -d "$file"; then 59 | shift 60 | else 61 | break 62 | fi 63 | done 64 | 65 | case $# in 66 | 0) exit 0 ;; 67 | esac 68 | 69 | # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and 70 | # mkdir -p a/c at the same time, both will detect that a is missing, 71 | # one will create a, then the other will try to create a and die with 72 | # a "File exists" error. This is a problem when calling mkinstalldirs 73 | # from a parallel make. We use --version in the probe to restrict 74 | # ourselves to GNU mkdir, which is thread-safe. 75 | case $dirmode in 76 | '') 77 | if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then 78 | echo "mkdir -p -- $*" 79 | exec mkdir -p -- "$@" 80 | else 81 | # On NextStep and OpenStep, the `mkdir' command does not 82 | # recognize any option. It will interpret all options as 83 | # directories to create, and then abort because `.' already 84 | # exists. 85 | test -d ./-p && rmdir ./-p 86 | test -d ./--version && rmdir ./--version 87 | fi 88 | ;; 89 | *) 90 | if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && 91 | test ! -d ./--version; then 92 | echo "mkdir -m $dirmode -p -- $*" 93 | exec mkdir -m "$dirmode" -p -- "$@" 94 | else 95 | # Clean up after NextStep and OpenStep mkdir. 96 | for d in ./-m ./-p ./--version "./$dirmode"; 97 | do 98 | test -d $d && rmdir $d 99 | done 100 | fi 101 | ;; 102 | esac 103 | 104 | for file 105 | do 106 | case $file in 107 | /*) pathcomp=/ ;; 108 | *) pathcomp= ;; 109 | esac 110 | oIFS=$IFS 111 | IFS=/ 112 | set fnord $file 113 | shift 114 | IFS=$oIFS 115 | 116 | for d 117 | do 118 | test "x$d" = x && continue 119 | 120 | pathcomp=$pathcomp$d 121 | case $pathcomp in 122 | -*) pathcomp=./$pathcomp ;; 123 | esac 124 | 125 | if test ! -d "$pathcomp"; then 126 | echo "mkdir $pathcomp" 127 | 128 | mkdir "$pathcomp" || lasterr=$? 129 | 130 | if test ! -d "$pathcomp"; then 131 | errstatus=$lasterr 132 | else 133 | if test ! -z "$dirmode"; then 134 | echo "chmod $dirmode $pathcomp" 135 | lasterr= 136 | chmod "$dirmode" "$pathcomp" || lasterr=$? 137 | 138 | if test ! -z "$lasterr"; then 139 | errstatus=$lasterr 140 | fi 141 | fi 142 | fi 143 | fi 144 | 145 | pathcomp=$pathcomp/ 146 | done 147 | done 148 | 149 | exit $errstatus 150 | 151 | # Local Variables: 152 | # mode: shell-script 153 | # sh-indentation: 2 154 | # eval: (add-hook 'write-file-hooks 'time-stamp) 155 | # time-stamp-start: "scriptversion=" 156 | # time-stamp-format: "%:y-%02m-%02d.%02H" 157 | # time-stamp-end: "$" 158 | # End: 159 | --------------------------------------------------------------------------------